Răsfoiți Sursa

Updated builds.

Mr.doob 10 ani în urmă
părinte
comite
7fbcb457a9
2 a modificat fișierele cu 275 adăugiri și 292 ștergeri
  1. 36 53
      build/three.js
  2. 239 239
      build/three.min.js

+ 36 - 53
build/three.js

@@ -21330,7 +21330,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	function setMaterialFaces( material ) {
 
-		state.setDoubleSided( material.side === THREE.DoubleSide );
+		material.side !== THREE.DoubleSide ? state.enable( _gl.CULL_FACE ) : state.disable( _gl.CULL_FACE );
 		state.setFlipSided( material.side === THREE.BackSide );
 
 	}
@@ -22394,7 +22394,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		if ( cullFace === THREE.CullFaceNone ) {
 
-			_gl.disable( _gl.CULL_FACE );
+			state.disable( _gl.CULL_FACE );
 
 		} else {
 
@@ -22422,7 +22422,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			}
 
-			_gl.enable( _gl.CULL_FACE );
+			state.enable( _gl.CULL_FACE );
 
 		}
 
@@ -24445,7 +24445,6 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 	this.enabled = false;
 	this.type = THREE.PCFShadowMap;
 	this.cullFace = THREE.CullFaceFront;
-	this.debug = false;
 	this.cascade = false;
 
 	this.render = function ( scene, camera ) {
@@ -24465,9 +24464,9 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 		// set GL state for depth map
 
 		_gl.clearColor( 1, 1, 1, 1 );
-		_state.setBlend( false );
+		_state.disable( _gl.BLEND );
 
-		_gl.enable( _gl.CULL_FACE );
+		_state.enable( _gl.CULL_FACE );
 		_gl.frontFace( _gl.CCW );
 
 		if ( scope.cullFace === THREE.CullFaceFront ) {
@@ -24717,7 +24716,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 		clearAlpha = _renderer.getClearAlpha();
 
 		_gl.clearColor( clearColor.r, clearColor.g, clearColor.b, clearAlpha );
-		_state.setBlend( true );
+		_state.enable( _gl.BLEND );
 
 		if ( scope.cullFace === THREE.CullFaceFront ) {
 
@@ -24909,7 +24908,8 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 	var newAttributes = new Uint8Array( 16 );
 	var enabledAttributes = new Uint8Array( 16 );
 
-	var currentBlend = null;
+	var switches = {};
+
 	var currentBlending = null;
 	var currentBlendEquation = null;
 	var currentBlendSrc = null;
@@ -24924,7 +24924,6 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 	var currentColorWrite = null;
 
-	var currentDoubleSided = null;
 	var currentFlipSided = null;
 
 	var currentLineWidth = null;
@@ -24949,9 +24948,9 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 		gl.frontFace( gl.CCW );
 		gl.cullFace( gl.BACK );
-		gl.enable( gl.CULL_FACE );
+		this.enable( gl.CULL_FACE );
 
-		gl.enable( gl.BLEND );
+		this.enable( gl.BLEND );
 		gl.blendEquation( gl.FUNC_ADD );
 		gl.blendFunc( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA );
 
@@ -24995,21 +24994,23 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 	};
 
-	this.setBlend = function ( blend ) {
+	this.enable = function ( id ) {
 
-		if ( blend !== currentBlend ) {
+		if ( switches[ id ] !== true ) {
 
-			if ( blend ) {
+			gl.enable( id );
+			switches[ id ] = true;
 
-				gl.enable( gl.BLEND );
+		}
 
-			} else {
+	};
 
-				gl.disable( gl.BLEND );
+	this.disable = function ( id ) {
 
-			}
+		if ( switches[ id ] !== false ) {
 
-			currentBlend = blend;
+			gl.disable( id );
+			switches[ id ] = false;
 
 		}
 
@@ -25021,11 +25022,11 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 			if ( blending === THREE.NoBlending ) {
 
-				this.setBlend( false );
+				this.disable( gl.BLEND );
 
 			} else if ( blending === THREE.AdditiveBlending ) {
 
-				this.setBlend( true );
+				this.enable( gl.BLEND );
 				gl.blendEquation( gl.FUNC_ADD );
 				gl.blendFunc( gl.SRC_ALPHA, gl.ONE );
 
@@ -25033,7 +25034,7 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 				// TODO: Find blendFuncSeparate() combination
 
-				this.setBlend( true );
+				this.enable( gl.BLEND );
 				gl.blendEquation( gl.FUNC_ADD );
 				gl.blendFunc( gl.ZERO, gl.ONE_MINUS_SRC_COLOR );
 
@@ -25041,17 +25042,17 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 				// TODO: Find blendFuncSeparate() combination
 
-				this.setBlend( true );
+				this.enable( gl.BLEND );
 				gl.blendEquation( gl.FUNC_ADD );
 				gl.blendFunc( gl.ZERO, gl.SRC_COLOR );
 
 			} else if ( blending === THREE.CustomBlending ) {
 
-				this.setBlend( true );
+				this.enable( gl.BLEND );
 
 			} else {
 
-				this.setBlend( true );
+				this.enable( gl.BLEND );
 				gl.blendEquationSeparate( gl.FUNC_ADD, gl.FUNC_ADD );
 				gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );
 
@@ -25208,26 +25209,6 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 	};
 
-	this.setDoubleSided = function ( doubleSided ) {
-
-		if ( currentDoubleSided !== doubleSided ) {
-
-			if ( doubleSided ) {
-
-				gl.disable( gl.CULL_FACE );
-
-			} else {
-
-				gl.enable( gl.CULL_FACE );
-
-			}
-
-			currentDoubleSided = doubleSided;
-
-		}
-
-	};
-
 	this.setFlipSided = function ( flipSided ) {
 
 		if ( currentFlipSided !== flipSided ) {
@@ -25375,11 +25356,13 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
 
 		}
 
+		switches = {};
+
 		currentBlending = null;
 		currentDepthTest = null;
 		currentDepthWrite = null;
 		currentColorWrite = null;
-		currentDoubleSided = null;
+
 		currentFlipSided = null;
 
 	};
@@ -25703,7 +25686,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
 
 		gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, elementBuffer );
 
-		gl.disable( gl.CULL_FACE );
+		state.disable( gl.CULL_FACE );
 		gl.depthMask( false );
 
 		for ( var i = 0, l = flares.length; i < l; i ++ ) {
@@ -25750,7 +25733,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
 				gl.uniform2f( uniforms.scale, scale.x, scale.y );
 				gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z );
 
-				state.setBlend( false );
+				state.disable( gl.BLEND );
 				gl.enable( gl.DEPTH_TEST );
 
 				gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );
@@ -25790,7 +25773,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
 				// render flares
 
 				gl.uniform1i( uniforms.renderType, 2 );
-				state.setBlend( true );
+				state.enable( gl.BLEND );
 
 				for ( var j = 0, jl = flare.lensFlares.length; j < jl; j ++ ) {
 
@@ -25829,7 +25812,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
 
 		// restore gl
 
-		gl.enable( gl.CULL_FACE );
+		state.enable( gl.CULL_FACE );
 		gl.enable( gl.DEPTH_TEST );
 		gl.depthMask( true );
 
@@ -25971,8 +25954,8 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
 		state.enableAttribute( attributes.uv );
 		state.disableUnusedAttributes();
 
-		gl.disable( gl.CULL_FACE );
-		state.setBlend( true );
+		state.disable( gl.CULL_FACE );
+		state.enable( gl.BLEND );
 
 		gl.bindBuffer( gl.ARRAY_BUFFER, vertexBuffer );
 		gl.vertexAttribPointer( attributes.position, 2, gl.FLOAT, false, 2 * 8, 0 );
@@ -26104,7 +26087,7 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
 
 		// restore gl
 
-		gl.enable( gl.CULL_FACE );
+		state.enable( gl.CULL_FACE );
 
 		renderer.resetGLState();
 

+ 239 - 239
build/three.min.js

@@ -67,9 +67,9 @@ Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return
 fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];this.w=a.array[b+3];return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};
 THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ";
 THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x=
-a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],l=e[9],m=e[2],p=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,
-k)):(this._y=Math.atan2(-m,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-m,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=
-Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(p,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-l,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeRotationFromQuaternion(b);this.setFromRotationMatrix(a,c,d);return this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,
+a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],l=e[9],m=e[2],r=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(r,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,
+k)):(this._y=Math.atan2(-m,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(r,-1,1)),.99999>Math.abs(r)?(this._y=Math.atan2(-m,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._x=Math.atan2(r,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=
+Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(r,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-l,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeRotationFromQuaternion(b);this.setFromRotationMatrix(a,c,d);return this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,
 b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?
 a.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3};
 THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,
@@ -94,22 +94,22 @@ void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.
 this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},
 transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];
 a[8]=b[8];return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}};THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,m,p,n,r,t,q){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=f;u[9]=g;u[13]=h;u[2]=k;u[6]=l;u[10]=m;u[14]=p;u[3]=n;u[7]=r;u[11]=t;u[15]=q;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,m,r,n,q,t,p){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=f;u[9]=g;u[13]=h;u[2]=k;u[6]=l;u[10]=m;u[14]=r;u[3]=n;u[7]=q;u[11]=t;u[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
 copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){var d=this.elements;a.set(d[0],d[1],d[2]);b.set(d[4],d[5],d[6]);c.set(d[8],d[9],d[10]);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],
 b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=
 f*h;var k=f*e,l=c*h,m=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-m*d;b[9]=-c*g;b[2]=m-a*d;b[6]=l+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,l=d*h,m=d*e,b[0]=a+m*c,b[4]=l*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=m+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,m=d*e,b[0]=a-m*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=m-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,l=c*h,m=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+m,b[1]=g*e,b[5]=m*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*
 g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,l=c*g,m=c*d,b[0]=g*h,b[4]=m-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-m*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,m=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,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("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
 makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,m=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(m+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+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,b,c;return function(d,e,f){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var g=this.elements;c.subVectors(d,
 e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,
-d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],m=c[5],p=c[9],n=c[13],r=c[2],t=c[6],q=c[10],u=c[14],w=c[3],x=c[7],z=c[11],c=c[15],v=d[0],I=d[4],K=d[8],A=d[12],y=d[1],F=d[5],G=d[9],C=d[13],J=d[2],O=d[6],E=d[10],D=d[14],B=d[3],N=d[7],R=d[11],d=d[15];e[0]=f*v+g*y+h*J+k*B;e[4]=f*I+g*F+h*O+k*N;e[8]=f*K+g*G+h*E+k*R;e[12]=f*A+g*C+h*D+k*d;e[1]=l*v+m*y+p*J+n*B;e[5]=l*I+m*F+p*O+n*N;e[9]=l*K+m*G+p*E+n*R;e[13]=l*A+m*C+p*D+n*d;e[2]=r*v+t*y+q*J+u*B;e[6]=r*I+t*F+q*O+u*N;e[10]=r*K+t*G+q*E+u*R;e[14]=
-r*A+t*C+q*D+u*d;e[3]=w*v+x*y+z*J+c*B;e[7]=w*I+x*F+z*O+c*N;e[11]=w*K+x*G+z*E+c*R;e[15]=w*A+x*C+z*D+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]*=
+d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],m=c[5],r=c[9],n=c[13],q=c[2],t=c[6],p=c[10],u=c[14],w=c[3],x=c[7],z=c[11],c=c[15],v=d[0],H=d[4],K=d[8],A=d[12],y=d[1],G=d[5],F=d[9],C=d[13],L=d[2],O=d[6],E=d[10],D=d[14],B=d[3],N=d[7],R=d[11],d=d[15];e[0]=f*v+g*y+h*L+k*B;e[4]=f*H+g*G+h*O+k*N;e[8]=f*K+g*F+h*E+k*R;e[12]=f*A+g*C+h*D+k*d;e[1]=l*v+m*y+r*L+n*B;e[5]=l*H+m*G+r*O+n*N;e[9]=l*K+m*F+r*E+n*R;e[13]=l*A+m*C+r*D+n*d;e[2]=q*v+t*y+p*L+u*B;e[6]=q*H+t*G+p*O+u*N;e[10]=q*K+t*F+p*E+u*R;e[14]=
+q*A+t*C+p*D+u*d;e[3]=w*v+x*y+z*L+c*B;e[7]=w*H+x*G+z*O+c*N;e[11]=w*K+x*F+z*E+c*R;e[15]=w*A+x*C+z*D+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
 a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
-a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],m=a[6],p=a[10],n=a[14];return a[3]*(+e*h*m-d*k*
-m-e*g*p+c*k*p+d*g*n-c*h*n)+a[7]*(+b*h*n-b*k*p+e*f*p-d*f*n+d*k*l-e*h*l)+a[11]*(+b*k*m-b*g*n-e*f*m+c*f*n+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*m+b*g*p+d*f*m-c*f*p+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=
+a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],m=a[6],r=a[10],n=a[14];return a[3]*(+e*h*m-d*k*
+m-e*g*r+c*k*r+d*g*n-c*h*n)+a[7]*(+b*h*n-b*k*r+e*f*r-d*f*n+d*k*l-e*h*l)+a[11]*(+b*k*m-b*g*n-e*f*m+c*f*n+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*m+b*g*r+d*f*m-c*f*r+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=
 c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a;return function(){void 0===a&&(a=new THREE.Vector3);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=
-this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],m=d[9],p=d[13],n=d[2],r=d[6],t=d[10],q=d[14],u=d[3],w=d[7],x=d[11],d=d[15];c[0]=m*q*w-p*t*w+p*r*x-l*q*x-m*r*d+l*t*d;c[4]=h*t*w-g*q*w-h*r*x+f*q*x+g*r*d-f*t*d;c[8]=g*p*w-h*m*w+h*l*x-f*p*x-g*l*d+f*m*d;c[12]=h*m*r-g*p*r-h*l*t+f*p*t+g*l*q-f*m*q;c[1]=p*t*u-m*q*u-p*n*x+k*q*x+m*n*d-k*t*d;c[5]=g*q*u-h*t*u+h*n*x-e*q*x-g*n*d+e*t*d;c[9]=h*m*u-g*p*u-h*k*x+e*p*x+g*k*d-e*m*d;c[13]=g*p*n-h*m*n+h*k*t-e*p*t-g*k*q+e*m*q;c[2]=l*q*u-p*r*u+p*n*w-k*q*
-w-l*n*d+k*r*d;c[6]=h*r*u-f*q*u-h*n*w+e*q*w+f*n*d-e*r*d;c[10]=f*p*u-h*l*u+h*k*w-e*p*w-f*k*d+e*l*d;c[14]=h*l*n-f*p*n-h*k*r+e*p*r+f*k*q-e*l*q;c[3]=m*r*u-l*t*u-m*n*w+k*t*w+l*n*x-k*r*x;c[7]=f*t*u-g*r*u+g*n*w-e*t*w-f*n*x+e*r*x;c[11]=g*l*u-f*m*u-g*k*w+e*m*w+f*k*x-e*l*x;c[15]=f*m*n-g*l*n+g*k*r-e*m*r-f*k*t+e*l*t;c=e*c[0]+k*c[4]+n*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
+this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],m=d[9],r=d[13],n=d[2],q=d[6],t=d[10],p=d[14],u=d[3],w=d[7],x=d[11],d=d[15];c[0]=m*p*w-r*t*w+r*q*x-l*p*x-m*q*d+l*t*d;c[4]=h*t*w-g*p*w-h*q*x+f*p*x+g*q*d-f*t*d;c[8]=g*r*w-h*m*w+h*l*x-f*r*x-g*l*d+f*m*d;c[12]=h*m*q-g*r*q-h*l*t+f*r*t+g*l*p-f*m*p;c[1]=r*t*u-m*p*u-r*n*x+k*p*x+m*n*d-k*t*d;c[5]=g*p*u-h*t*u+h*n*x-e*p*x-g*n*d+e*t*d;c[9]=h*m*u-g*r*u-h*k*x+e*r*x+g*k*d-e*m*d;c[13]=g*r*n-h*m*n+h*k*t-e*r*t-g*k*p+e*m*p;c[2]=l*p*u-r*q*u+r*n*w-k*p*
+w-l*n*d+k*q*d;c[6]=h*q*u-f*p*u-h*n*w+e*p*w+f*n*d-e*q*d;c[10]=f*r*u-h*l*u+h*k*w-e*r*w-f*k*d+e*l*d;c[14]=h*l*n-f*r*n-h*k*q+e*r*q+f*k*p-e*l*p;c[3]=m*q*u-l*t*u-m*n*w+k*t*w+l*n*x-k*q*x;c[7]=f*t*u-g*q*u+g*n*w-e*t*w-f*n*x+e*q*x;c[11]=g*l*u-f*m*u-g*k*w+e*m*w+f*k*x-e*l*x;c[15]=f*m*n-g*l*n+g*k*q-e*m*q-f*k*t+e*l*t;c=e*c[0]+k*c[4]+n*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
 this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=
 this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,
 0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,k=e*f,l=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+d*h,l*g+c,l*h-d*f,0,k*h-d*g,l*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,
@@ -119,8 +119,8 @@ a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function
 THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);
 var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,
-b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),l=c.dot(this.direction),m=-c.dot(b),p=c.lengthSq(),n=Math.abs(1-k*k),r;0<n?(d=k*m-l,e=k*l-m,r=h*n,0<=d?e>=-r?e<=r?(h=1/n,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*m)+p):(e=h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+p):(e=-h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+p):e<=-r?(d=Math.max(0,-(-k*h+l)),e=
-0<d?-h:Math.min(Math.max(-h,-m),h),k=-d*d+e*(e+2*m)+p):e<=r?(d=0,e=Math.min(Math.max(-h,-m),h),k=e*(e+2*m)+p):(d=Math.max(0,-(k*h+l)),e=0<d?h:Math.min(Math.max(-h,-m),h),k=-d*d+e*(e+2*m)+p)):(e=0<k?-h:h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+p);f&&f.copy(this.direction).multiplyScalar(d).add(this.origin);g&&g.copy(b).multiplyScalar(e).add(a);return k}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,
+b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),l=c.dot(this.direction),m=-c.dot(b),r=c.lengthSq(),n=Math.abs(1-k*k),q;0<n?(d=k*m-l,e=k*l-m,q=h*n,0<=d?e>=-q?e<=q?(h=1/n,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*m)+r):(e=h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+r):(e=-h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+r):e<=-q?(d=Math.max(0,-(-k*h+l)),e=
+0<d?-h:Math.min(Math.max(-h,-m),h),k=-d*d+e*(e+2*m)+r):e<=q?(d=0,e=Math.min(Math.max(-h,-m),h),k=e*(e+2*m)+r):(d=Math.max(0,-(k*h+l)),e=0<d?h:Math.min(Math.max(-h,-m),h),k=-d*d+e*(e+2*m)+r)):(e=0<k?-h:h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+r);f&&f.copy(this.direction).multiplyScalar(d).add(this.origin);g&&g.copy(b).multiplyScalar(e).add(a);return k}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,
 c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;if(e>f)return null;f=Math.sqrt(f-e);e=d-f;d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=
 a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;
 if(e>c||c!==c)c=e;if(f<d||d!==d)d=f;0<=g?(e=(a.min.z-h.z)*g,g*=a.max.z-h.z):(e=(a.max.z-h.z)*g,g*=a.min.z-h.z);if(c>g||e>d)return null;if(e>c||c!==c)c=e;if(g<d||d!==d)d=g;return 0>d?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0<f){if(h)return null;h=1}else if(0>f)h=-1,f=-f;else return null;a.subVectors(this.origin,
@@ -130,8 +130,8 @@ THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.c
 this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);
 return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};
 THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],m=c[8],p=c[9],n=c[10],r=c[11],t=c[12],q=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,l-g,r-m,c-t).normalize();b[1].setComponents(f+
-a,l+g,r+m,c+t).normalize();b[2].setComponents(f+d,l+h,r+p,c+q).normalize();b[3].setComponents(f-d,l-h,r-p,c-q).normalize();b[4].setComponents(f-e,l-k,r-n,c-u).normalize();b[5].setComponents(f+e,l+k,r+n,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],m=c[8],r=c[9],n=c[10],q=c[11],t=c[12],p=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,l-g,q-m,c-t).normalize();b[1].setComponents(f+
+a,l+g,q+m,c+t).normalize();b[2].setComponents(f+d,l+h,q+r,c+p).normalize();b[3].setComponents(f-d,l-h,q-r,c-p).normalize();b[4].setComponents(f-e,l-k,q-n,c-u).normalize();b[5].setComponents(f+e,l+k,q+n,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
 c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var g=f.distanceToPoint(a),f=f.distanceToPoint(b);if(0>g&&0>f)return!1}return!0}}(),
 containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
@@ -142,8 +142,8 @@ a.constant===this.constant},clone:function(){return(new THREE.Plane).copy(this)}
 THREE.Math={generateUUID:function(){var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8===e||13===e||18===e||23===e?b[e]="-":14===e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19===e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+
 (a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/
 180;return function(b){return b*a}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nextPowerOfTwo:function(a){a--;a|=a>>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a}};
-THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,m,p,n;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+
-2;l=this.points[c[0]];m=this.points[c[1]];p=this.points[c[2]];n=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,m.x,p.x,n.x,g,h,k);d.y=b(l.y,m.y,p.y,n.y,g,h,k);d.z=b(l.z,m.z,p.z,n.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
+THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,m,r,n;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+
+2;l=this.points[c[0]];m=this.points[c[1]];r=this.points[c[2]];n=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,m.x,r.x,n.x,g,h,k);d.y=b(l.y,m.y,r.y,n.y,g,h,k);d.z=b(l.z,m.z,r.z,n.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
 a/c,d=this.getPoint(b),g.copy(d),k+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!==e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],k=new THREE.Vector3,l=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];g=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),
 h.push(k.copy(d).clone());h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
 THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e);b.subVectors(f,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);f=a.dot(c);var k=b.dot(b);g=b.dot(c);var l=d*k-e*e;h=h||new THREE.Vector3;if(0===l)return h.set(-2,-1,-1);l=1/l;k=(k*f-e*g)*l;d=(d*g-e*f)*l;return h.set(1-k-d,d,k)}}();
@@ -194,32 +194,32 @@ setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data.array[a+0]=b
 THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Geometry";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.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
 this.elementsNeedUpdate=this.verticesNeedUpdate=this.hasTangents=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=
-this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=void 0!==c.uv2?c.uv2.array:void 0,l=void 0!==c.tangent?c.tangent.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);void 0!==l&&(this.hasTangents=!0);for(var m=[],p=[],n=[],r=[],t=c=0,q=0;c<d.length;c+=3,t+=2,q+=4)b.vertices.push(new THREE.Vector3(d[c],
-d[c+1],d[c+2])),void 0!==f&&m.push(new THREE.Vector3(f[c],f[c+1],f[c+2])),void 0!==g&&b.colors.push(new THREE.Color(g[c],g[c+1],g[c+2])),void 0!==h&&p.push(new THREE.Vector2(h[t],h[t+1])),void 0!==k&&n.push(new THREE.Vector2(k[t],k[t+1])),void 0!==l&&r.push(new THREE.Vector4(l[q],l[q+1],l[q+2],l[q+3]));q=function(a,c,d){var e=void 0!==f?[m[a].clone(),m[c].clone(),m[d].clone()]:[],q=void 0!==g?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[],e=new THREE.Face3(a,c,d,e,q);b.faces.push(e);
-void 0!==h&&b.faceVertexUvs[0].push([p[a].clone(),p[c].clone(),p[d].clone()]);void 0!==k&&b.faceVertexUvs[1].push([n[a].clone(),n[c].clone(),n[d].clone()]);void 0!==l&&e.vertexTangents.push(r[a].clone(),r[c].clone(),r[d].clone())};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var t=d[c],u=t.start,w=t.count,x=t.index,t=u,u=u+w;t<u;t+=3)q(x+e[t],x+e[t+1],x+e[t+2]);else for(c=0;c<e.length;c+=3)q(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)q(c,c+1,c+2);this.computeFaceNormals();
+this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=void 0!==c.uv2?c.uv2.array:void 0,l=void 0!==c.tangent?c.tangent.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);void 0!==l&&(this.hasTangents=!0);for(var m=[],r=[],n=[],q=[],t=c=0,p=0;c<d.length;c+=3,t+=2,p+=4)b.vertices.push(new THREE.Vector3(d[c],
+d[c+1],d[c+2])),void 0!==f&&m.push(new THREE.Vector3(f[c],f[c+1],f[c+2])),void 0!==g&&b.colors.push(new THREE.Color(g[c],g[c+1],g[c+2])),void 0!==h&&r.push(new THREE.Vector2(h[t],h[t+1])),void 0!==k&&n.push(new THREE.Vector2(k[t],k[t+1])),void 0!==l&&q.push(new THREE.Vector4(l[p],l[p+1],l[p+2],l[p+3]));p=function(a,c,d){var e=void 0!==f?[m[a].clone(),m[c].clone(),m[d].clone()]:[],p=void 0!==g?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[],e=new THREE.Face3(a,c,d,e,p);b.faces.push(e);
+void 0!==h&&b.faceVertexUvs[0].push([r[a].clone(),r[c].clone(),r[d].clone()]);void 0!==k&&b.faceVertexUvs[1].push([n[a].clone(),n[c].clone(),n[d].clone()]);void 0!==l&&e.vertexTangents.push(q[a].clone(),q[c].clone(),q[d].clone())};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var t=d[c],u=t.start,w=t.count,x=t.index,t=u,u=u+w;t<u;t+=3)p(x+e[t],x+e[t+1],x+e[t+2]);else for(c=0;c<e.length;c+=3)p(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)p(c,c+1,c+2);this.computeFaceNormals();
 null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},normalize:function(){this.computeBoundingSphere();var a=this.boundingSphere.center,b=this.boundingSphere.radius,b=0===b?1:1/b,c=new THREE.Matrix4;c.set(b,0,0,-b*a.x,0,b,0,-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);
 return this},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,k=new THREE.Vector3;a=0;for(b=this.faces.length;a<
 b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=c.vertexNormals,3===e.length?(e[0].copy(d[c.a]),e[1].copy(d[c.b]),e[2].copy(d[c.c])):(e[0]=d[c.a].clone(),
 e[1]=d[c.b].clone(),e[2]=d[c.c].clone())},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;
 f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();
-c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,m,p,n,r,t,q,u,w=[],x=[];c=new THREE.Vector3;var z=new THREE.Vector3,v=new THREE.Vector3,I=new THREE.Vector3,K=new THREE.Vector3;
-a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,x[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=f[0],m=f[1],p=f[2],f=h.x-g.x,n=k.x-g.x,r=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=m.x-l.x,q=p.x-l.x,m=m.y-l.y,l=p.y-l.y,p=1/(k*l-q*m),c.set((l*f-m*n)*p,(l*r-m*t)*p,(l*h-m*g)*p),z.set((k*n-q*f)*p,(k*t-q*r)*p,(k*g-q*h)*p),w[d].add(c),w[u].add(c),w[e].add(c),x[d].add(z),
-x[u].add(z),x[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)K.copy(e.vertexNormals[c]),d=e[z[c]],u=w[d],v.copy(u),v.sub(K.multiplyScalar(K.dot(u))).normalize(),I.crossVectors(e.vertexNormals[c],u),d=I.dot(x[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(v.x,v.y,v.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]=
+c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,m,r,n,q,t,p,u,w=[],x=[];c=new THREE.Vector3;var z=new THREE.Vector3,v=new THREE.Vector3,H=new THREE.Vector3,K=new THREE.Vector3;
+a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,x[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=f[0],m=f[1],r=f[2],f=h.x-g.x,n=k.x-g.x,q=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=m.x-l.x,p=r.x-l.x,m=m.y-l.y,l=r.y-l.y,r=1/(k*l-p*m),c.set((l*f-m*n)*r,(l*q-m*t)*r,(l*h-m*g)*r),z.set((k*n-p*f)*r,(k*t-p*q)*r,(k*g-p*h)*r),w[d].add(c),w[u].add(c),w[e].add(c),x[d].add(z),
+x[u].add(z),x[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)K.copy(e.vertexNormals[c]),d=e[z[c]],u=w[d],v.copy(u),v.sub(K.multiplyScalar(K.dot(u))).normalize(),H.crossVectors(e.vertexNormals[c],u),d=H.dot(x[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(v.x,v.y,v.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=
 a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var c,d=this.vertices.length,e=this.vertices,f=a.vertices,g=this.faces,
-h=a.faces,k=this.faceVertexUvs[0],l=a.faceVertexUvs[0];void 0!==b&&(c=(new THREE.Matrix3).getNormalMatrix(b));for(var m=0,p=f.length;m<p;m++){var n=f[m].clone();void 0!==b&&n.applyMatrix4(b);e.push(n)}m=0;for(p=h.length;m<p;m++){var r=h[m],t,q=r.vertexNormals,u=r.vertexColors,n=new THREE.Face3(r.a+d,r.b+d,r.c+d);n.normal.copy(r.normal);void 0!==c&&n.normal.applyMatrix3(c).normalize();e=0;for(f=q.length;e<f;e++)t=q[e].clone(),void 0!==c&&t.applyMatrix3(c).normalize(),n.vertexNormals.push(t);n.color.copy(r.color);
-e=0;for(f=u.length;e<f;e++)r=u[e],n.vertexColors.push(r.clone());g.push(n)}m=0;for(p=l.length;m<p;m++)if(c=l[m],d=[],void 0!==c){e=0;for(f=c.length;e<f;e++)d.push(c[e].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=
+h=a.faces,k=this.faceVertexUvs[0],l=a.faceVertexUvs[0];void 0!==b&&(c=(new THREE.Matrix3).getNormalMatrix(b));for(var m=0,r=f.length;m<r;m++){var n=f[m].clone();void 0!==b&&n.applyMatrix4(b);e.push(n)}m=0;for(r=h.length;m<r;m++){var q=h[m],t,p=q.vertexNormals,u=q.vertexColors,n=new THREE.Face3(q.a+d,q.b+d,q.c+d);n.normal.copy(q.normal);void 0!==c&&n.normal.applyMatrix3(c).normalize();e=0;for(f=p.length;e<f;e++)t=p[e].clone(),void 0!==c&&t.applyMatrix3(c).normalize(),n.vertexNormals.push(t);n.color.copy(q.color);
+e=0;for(f=u.length;e<f;e++)q=u[e],n.vertexColors.push(q.clone());g.push(n)}m=0;for(r=l.length;m<r;m++)if(c=l[m],d=[],void 0!==c){e=0;for(f=c.length;e<f;e++)d.push(c[e].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=
 this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]===e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},
-toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=m.length;m.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==r[b])return r[b];r[b]=n.length/2;n.push(a.x,a.y);return r[b]}var e={metadata:{version:4.4,type:"Geometry",
-generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],l={},m=[],p={},n=[],r={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],q=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),w=0<t.vertexNormals.length,x=1!==t.color.r||1!==t.color.g||1!==t.color.b,
-z=0<t.vertexColors.length,v=0,v=a(v,0,0),v=a(v,1,!1),v=a(v,2,!1),v=a(v,3,q),v=a(v,4,u),v=a(v,5,w),v=a(v,6,x),v=a(v,7,z);h.push(v);h.push(t.a,t.b,t.c);q&&(q=this.faceVertexUvs[0][g],h.push(d(q[0]),d(q[1]),d(q[2])));u&&h.push(b(t.normal));w&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));x&&h.push(c(t.color));z&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<m.length&&(e.data.colors=m);0<n.length&&(e.data.uvs=[n]);e.data.faces=h;return e},clone:function(){for(var a=
+toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==r[b])return r[b];r[b]=m.length;m.push(a.getHex());return r[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=n.length/2;n.push(a.x,a.y);return q[b]}var e={metadata:{version:4.4,type:"Geometry",
+generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],l={},m=[],r={},n=[],q={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],p=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),w=0<t.vertexNormals.length,x=1!==t.color.r||1!==t.color.g||1!==t.color.b,
+z=0<t.vertexColors.length,v=0,v=a(v,0,0),v=a(v,1,!1),v=a(v,2,!1),v=a(v,3,p),v=a(v,4,u),v=a(v,5,w),v=a(v,6,x),v=a(v,7,z);h.push(v);h.push(t.a,t.b,t.c);p&&(p=this.faceVertexUvs[0][g],h.push(d(p[0]),d(p[1]),d(p[2])));u&&h.push(b(t.normal));w&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));x&&h.push(c(t.color));z&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<m.length&&(e.data.colors=m);0<n.length&&(e.data.uvs=[n]);e.data.faces=h;return e},clone:function(){for(var a=
 new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());c=0;for(d=this.faceVertexUvs.length;c<d;c++){b=this.faceVertexUvs[c];void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],h=[],k=0,l=g.length;k<l;k++)h.push(g[k].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})},set groupsNeedUpdate(a){!0===a&&this.dispose()}};
 THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
 THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DirectGeometry";this.indices=[];this.vertices=[];this.colors=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.tangents=[];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.tangentsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=
 this.normalsNeedUpdate=this.verticesNeedUpdate=!1};
 THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.");return this},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.");return this},computeTangents:function(){console.warn("THREE.DirectGeometry: computeTangents() is not a method of this type of geometry.");
-return this},fromGeometry:function(a){for(var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.hasTangents,h=a.morphTargets,k=h.length,l=0;l<k;l++)this.morphTargets[l]=[];for(var m=a.morphNormals.length,l=0;l<m;l++)this.morphNormals[l]=[];m=a.morphColors.length;for(l=0;l<m;l++)this.morphColors[l]=[];for(var m=a.skinIndices,p=a.skinWeights,n=m.length===c.length,r=p.length===c.length,l=0;l<b.length;l++){var t=b[l];this.vertices.push(c[t.a],c[t.b],c[t.c]);var q=
-t.vertexNormals;3===q.length?this.normals.push(q[0],q[1],q[2]):(q=t.normal,this.normals.push(q,q,q));q=t.vertexColors;3===q.length?this.colors.push(q[0],q[1],q[2]):(q=t.color,this.colors.push(q,q,q));!0===e&&(q=d[0][l],void 0!==q?this.uvs.push(q[0],q[1],q[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(q=d[1][l],void 0!==q?this.uvs2.push(q[0],q[1],q[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
-l),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(q=t.vertexTangents,3===q.length?this.tangents.push(q[0],q[1],q[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",l),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(q=0;q<k;q++){var u=h[q].vertices;this.morphTargets[q].push(u[t.a],u[t.b],u[t.c])}n&&this.skinIndices.push(m[t.a],m[t.b],m[t.c]);r&&this.skinWeights.push(p[t.a],p[t.b],p[t.c])}this.verticesNeedUpdate=
+return this},fromGeometry:function(a){for(var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.hasTangents,h=a.morphTargets,k=h.length,l=0;l<k;l++)this.morphTargets[l]=[];for(var m=a.morphNormals.length,l=0;l<m;l++)this.morphNormals[l]=[];m=a.morphColors.length;for(l=0;l<m;l++)this.morphColors[l]=[];for(var m=a.skinIndices,r=a.skinWeights,n=m.length===c.length,q=r.length===c.length,l=0;l<b.length;l++){var t=b[l];this.vertices.push(c[t.a],c[t.b],c[t.c]);var p=
+t.vertexNormals;3===p.length?this.normals.push(p[0],p[1],p[2]):(p=t.normal,this.normals.push(p,p,p));p=t.vertexColors;3===p.length?this.colors.push(p[0],p[1],p[2]):(p=t.color,this.colors.push(p,p,p));!0===e&&(p=d[0][l],void 0!==p?this.uvs.push(p[0],p[1],p[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(p=d[1][l],void 0!==p?this.uvs2.push(p[0],p[1],p[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
+l),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(p=t.vertexTangents,3===p.length?this.tangents.push(p[0],p[1],p[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",l),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(p=0;p<k;p++){var u=h[p].vertices;this.morphTargets[p].push(u[t.a],u[t.b],u[t.c])}n&&this.skinIndices.push(m[t.a],m[t.b],m[t.c]);q&&this.skinWeights.push(r[t.a],r[t.b],r[t.c])}this.verticesNeedUpdate=
 a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.tangentsNeedUpdate=a.tangentsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
 THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=
@@ -234,14 +234,14 @@ a.needsUpdate=!0),b.lineDistancesNeedUpdate=!1);return this},fromGeometry:functi
 b.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&(b=new THREE.Float32Attribute(4*a.skinWeights.length,4),this.addAttribute("skinWeight",b.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;
 if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=new THREE.Box3,
 b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
-this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;if(a.index)for(var r=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,
-count:r.length,index:0}],q=0,u=t.length;q<u;++q){e=t[q].start;f=t[q].count;for(var w=t[q].index,d=e,e=e+f;d<e;d+=3)f=3*(w+r[d]),g=3*(w+r[d+1]),h=3*(w+r[d+2]),k.fromArray(b,f),l.fromArray(b,g),m.fromArray(b,h),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),m.fromArray(b,d+6),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[d]=p.x,
-c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);n.fromArray(d,3*b);r.fromArray(d,3*c);t.fromArray(f,2*a);q.fromArray(f,2*b);u.fromArray(f,2*c);w=n.x-p.x;x=r.x-p.x;z=n.y-p.y;v=r.y-p.y;I=n.z-p.z;K=r.z-p.z;A=q.x-t.x;y=u.x-t.x;F=q.y-t.y;G=u.y-t.y;C=1/(A*G-y*F);J.set((G*w-F*x)*C,(G*z-F*v)*C,(G*I-F*K)*C);O.set((A*x-y*w)*C,(A*v-y*z)*C,(A*K-y*I)*C);k[a].add(J);
-k[b].add(J);k[c].add(J);l[a].add(O);l[b].add(O);l[c].add(O)}function b(a){H.fromArray(e,3*a);ea.copy(H);ma=k[a];U.copy(ma);U.sub(H.multiplyScalar(H.dot(ma))).normalize();L.crossVectors(ea,ma);va=L.dot(l[a]);ra=0>va?-1:1;h[4*a]=U.x;h[4*a+1]=U.y;h[4*a+2]=U.z;h[4*a+3]=ra}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
-else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],m=0;m<g;m++)k[m]=new THREE.Vector3,l[m]=new THREE.Vector3;var p=new THREE.Vector3,n=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector2,q=new THREE.Vector2,u=new THREE.Vector2,w,x,z,v,I,K,
-A,y,F,G,C,J=new THREE.Vector3,O=new THREE.Vector3,E,D,B,N,R;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var T=this.drawcalls,m=0;for(D=T.length;m<D;++m){E=T[m].start;B=T[m].count;var P=T[m].index,g=E;for(E+=B;g<E;g+=3)B=P+c[g],N=P+c[g+1],R=P+c[g+2],a(B,N,R)}var U=new THREE.Vector3,L=new THREE.Vector3,H=new THREE.Vector3,ea=new THREE.Vector3,ra,ma,va,m=0;for(D=T.length;m<D;++m)for(E=T[m].start,B=T[m].count,P=T[m].index,g=E,E+=B;g<E;g+=3)B=P+c[g],N=P+c[g+1],R=P+c[g+2],b(B),b(N),b(R)}},
-computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,m=0,p=new Int32Array(6),n=new Int32Array(c.length),r=new Int32Array(c.length),t=0;t<c.length;t++)n[t]=-1,r[t]=-1;for(c=0;c<d;c++){for(var q=m=0;3>q;q++)t=b[3*c+q],-1===n[t]?(p[2*q]=t,p[2*q+1]=-1,m++):
-n[t]<k.index?(p[2*q]=t,p[2*q+1]=-1,l++):(p[2*q]=t,p[2*q+1]=n[t]);if(g+m>k.index+a)for(k={start:f,count:0,index:g},h.push(k),m=0;6>m;m+=2)q=p[m+1],-1<q&&q<k.index&&(p[m+1]=-1);for(m=0;6>m;m+=2)t=p[m],q=p[m+1],-1===q&&(q=g++),n[t]=q,r[q]=t,e[f++]=q-k.index,k.count++}this.reorderBuffers(e,r,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===
+this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,r=new THREE.Vector3,n=new THREE.Vector3;if(a.index)for(var q=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,
+count:q.length,index:0}],p=0,u=t.length;p<u;++p){e=t[p].start;f=t[p].count;for(var w=t[p].index,d=e,e=e+f;d<e;d+=3)f=3*(w+q[d]),g=3*(w+q[d+1]),h=3*(w+q[d+2]),k.fromArray(b,f),l.fromArray(b,g),m.fromArray(b,h),r.subVectors(m,l),n.subVectors(k,l),r.cross(n),c[f]+=r.x,c[f+1]+=r.y,c[f+2]+=r.z,c[g]+=r.x,c[g+1]+=r.y,c[g+2]+=r.z,c[h]+=r.x,c[h+1]+=r.y,c[h+2]+=r.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),m.fromArray(b,d+6),r.subVectors(m,l),n.subVectors(k,l),r.cross(n),c[d]=r.x,
+c[d+1]=r.y,c[d+2]=r.z,c[d+3]=r.x,c[d+4]=r.y,c[d+5]=r.z,c[d+6]=r.x,c[d+7]=r.y,c[d+8]=r.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){r.fromArray(d,3*a);n.fromArray(d,3*b);q.fromArray(d,3*c);t.fromArray(f,2*a);p.fromArray(f,2*b);u.fromArray(f,2*c);w=n.x-r.x;x=q.x-r.x;z=n.y-r.y;v=q.y-r.y;H=n.z-r.z;K=q.z-r.z;A=p.x-t.x;y=u.x-t.x;G=p.y-t.y;F=u.y-t.y;C=1/(A*F-y*G);L.set((F*w-G*x)*C,(F*z-G*v)*C,(F*H-G*K)*C);O.set((A*x-y*w)*C,(A*v-y*z)*C,(A*K-y*H)*C);k[a].add(L);
+k[b].add(L);k[c].add(L);l[a].add(O);l[b].add(O);l[c].add(O)}function b(a){I.fromArray(e,3*a);ea.copy(I);ma=k[a];U.copy(ma);U.sub(I.multiplyScalar(I.dot(ma))).normalize();J.crossVectors(ea,ma);va=J.dot(l[a]);ra=0>va?-1:1;h[4*a]=U.x;h[4*a+1]=U.y;h[4*a+2]=U.z;h[4*a+3]=ra}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
+else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],m=0;m<g;m++)k[m]=new THREE.Vector3,l[m]=new THREE.Vector3;var r=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,t=new THREE.Vector2,p=new THREE.Vector2,u=new THREE.Vector2,w,x,z,v,H,K,
+A,y,G,F,C,L=new THREE.Vector3,O=new THREE.Vector3,E,D,B,N,R;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var T=this.drawcalls,m=0;for(D=T.length;m<D;++m){E=T[m].start;B=T[m].count;var P=T[m].index,g=E;for(E+=B;g<E;g+=3)B=P+c[g],N=P+c[g+1],R=P+c[g+2],a(B,N,R)}var U=new THREE.Vector3,J=new THREE.Vector3,I=new THREE.Vector3,ea=new THREE.Vector3,ra,ma,va,m=0;for(D=T.length;m<D;++m)for(E=T[m].start,B=T[m].count,P=T[m].index,g=E,E+=B;g<E;g+=3)B=P+c[g],N=P+c[g+1],R=P+c[g+2],b(B),b(N),b(R)}},
+computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,m=0,r=new Int32Array(6),n=new Int32Array(c.length),q=new Int32Array(c.length),t=0;t<c.length;t++)n[t]=-1,q[t]=-1;for(c=0;c<d;c++){for(var p=m=0;3>p;p++)t=b[3*c+p],-1===n[t]?(r[2*p]=t,r[2*p+1]=-1,m++):
+n[t]<k.index?(r[2*p]=t,r[2*p+1]=-1,l++):(r[2*p]=t,r[2*p+1]=n[t]);if(g+m>k.index+a)for(k={start:f,count:0,index:g},h.push(k),m=0;6>m;m+=2)p=r[m+1],-1<p&&p<k.index&&(r[m+1]=-1);for(m=0;6>m;m+=2)t=r[m],p=r[m+1],-1===p&&(p=g++),n[t]=p,q[p]=t,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,q,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===
 b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
 c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!==e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],m=0;m<k;m++)l[f*k+m]=h[g*k+m]}this.attributes.index.array=a;for(e in this.attributes)"index"!==e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);
 if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var b=this.attributes,d=this.offsets,e=this.boundingSphere;for(c in b){var f=b[c],g=Array.prototype.slice.call(f.array);a.data.attributes[c]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<d.length&&(a.data.offsets=JSON.parse(JSON.stringify(d)));null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){var a=new THREE.BufferGeometry,
@@ -280,8 +280,8 @@ a.shadowDarkness=this.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shad
 THREE.Cache={files:{},add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.imageLoader=new THREE.ImageLoader;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+
 "%"):b+((a.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=this.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function d(a,
-d,e,g,h,k,q){var u=b+e,w,x=THREE.Loader.Handlers.get(u);null!==x?w=x.load(u):(w=new THREE.Texture,x=f.imageLoader,x.crossOrigin=f.crossOrigin,x.load(u,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);w.image=e}else w.image=a;w.needsUpdate=!0}));w.sourceFile=e;g&&(w.repeat.set(g[0],g[1]),1!==g[0]&&(w.wrapS=THREE.RepeatWrapping),
-1!==g[1]&&(w.wrapT=THREE.RepeatWrapping));h&&w.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(w.wrapS=e[k[0]]),void 0!==e[k[1]]&&(w.wrapT=e[k[1]]));q&&(w.anisotropy=q);a[d]=w}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
+d,e,g,h,k,p){var u=b+e,w,x=THREE.Loader.Handlers.get(u);null!==x?w=x.load(u):(w=new THREE.Texture,x=f.imageLoader,x.crossOrigin=f.crossOrigin,x.load(u,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);w.image=e}else w.image=a;w.needsUpdate=!0}));w.sourceFile=e;g&&(w.repeat.set(g[0],g[1]),1!==g[0]&&(w.wrapS=THREE.RepeatWrapping),
+1!==g[1]&&(w.wrapT=THREE.RepeatWrapping));h&&w.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(w.wrapS=e[k[0]]),void 0!==e[k[1]]&&(w.wrapT=e[k[1]]));p&&(w.anisotropy=p);a[d]=w}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
 "basic"===k&&(g="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]);void 0!==a.transparent&&(h.transparent=a.transparent);void 0!==a.opacity&&1>a.opacity&&(h.transparent=!0);void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);
 void 0!==a.vertexColors&&("face"===a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorEmissive&&(h.emissive=e(a.colorEmissive));void 0!==a.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),a.opacity=a.transparency);void 0!==a.opacity&&(h.opacity=a.opacity);a.specularCoef&&(h.shininess=
 a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapAO&&b&&d(h,"aoMap",a.mapAO,a.mapAORepeat,a.mapAOOffset,a.mapAOWrap,a.mapAOAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,
@@ -293,12 +293,12 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),k=h.metadata;if(void 0!==k){if("object"===k.type){console.error("THREE.JSONLoader: "+b+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===k.type){console.error("THREE.JSONLoader: "+b+" seems to be a Scene. Use THREE.SceneLoader instead.");return}}h=
 a.parse(h,d);c(h.geometry,h.materials)}else console.error("THREE.JSONLoader: "+b+" seems to be unreachable or the file is empty.");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load "+b+" ("+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,m,p,n,r,t,q,u,w,x=a.faces;m=a.vertices;var z=a.normals,v=a.colors,I=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&I++;for(d=0;d<I;d++)c.faceVertexUvs[d]=[]}k=0;for(l=m.length;k<l;)d=new THREE.Vector3,d.x=m[k++]*b,d.y=m[k++]*b,d.z=m[k++]*b,c.vertices.push(d);k=0;for(l=x.length;k<l;)if(b=x[k++],r=b&1,h=b&2,d=b&8,p=b&16,t=b&32,m=b&64,b&=128,r){r=new THREE.Face3;
-r.a=x[k];r.b=x[k+1];r.c=x[k+3];q=new THREE.Face3;q.a=x[k+1];q.b=x[k+2];q.c=x[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<I;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)n=x[k++],w=u[2*n],n=u[2*n+1],w=new THREE.Vector2(w,n),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);p&&(p=3*x[k++],r.normal.set(z[p++],z[p++],z[p]),q.normal.copy(r.normal));if(t)for(d=0;4>d;d++)p=3*x[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),2!==d&&r.vertexNormals.push(t),
-0!==d&&q.vertexNormals.push(t);m&&(m=x[k++],m=v[m],r.color.setHex(m),q.color.setHex(m));if(b)for(d=0;4>d;d++)m=x[k++],m=v[m],2!==d&&r.vertexColors.push(new THREE.Color(m)),0!==d&&q.vertexColors.push(new THREE.Color(m));c.faces.push(r);c.faces.push(q)}else{r=new THREE.Face3;r.a=x[k++];r.b=x[k++];r.c=x[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<I;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)n=x[k++],w=u[2*n],n=u[2*n+1],w=new THREE.Vector2(w,n),c.faceVertexUvs[d][h].push(w);p&&(p=3*x[k++],
-r.normal.set(z[p++],z[p++],z[p]));if(t)for(d=0;3>d;d++)p=3*x[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),r.vertexNormals.push(t);m&&(m=x[k++],r.color.setHex(v[m]));if(b)for(d=0;3>d;d++)m=x[k++],r.vertexColors.push(new THREE.Color(v[m]));c.faces.push(r)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,m,r,n,q,t,p,u,w,x=a.faces;m=a.vertices;var z=a.normals,v=a.colors,H=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&H++;for(d=0;d<H;d++)c.faceVertexUvs[d]=[]}k=0;for(l=m.length;k<l;)d=new THREE.Vector3,d.x=m[k++]*b,d.y=m[k++]*b,d.z=m[k++]*b,c.vertices.push(d);k=0;for(l=x.length;k<l;)if(b=x[k++],q=b&1,h=b&2,d=b&8,r=b&16,t=b&32,m=b&64,b&=128,q){q=new THREE.Face3;
+q.a=x[k];q.b=x[k+1];q.c=x[k+3];p=new THREE.Face3;p.a=x[k+1];p.b=x[k+2];p.c=x[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)n=x[k++],w=u[2*n],n=u[2*n+1],w=new THREE.Vector2(w,n),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);r&&(r=3*x[k++],q.normal.set(z[r++],z[r++],z[r]),p.normal.copy(q.normal));if(t)for(d=0;4>d;d++)r=3*x[k++],t=new THREE.Vector3(z[r++],z[r++],z[r]),2!==d&&q.vertexNormals.push(t),
+0!==d&&p.vertexNormals.push(t);m&&(m=x[k++],m=v[m],q.color.setHex(m),p.color.setHex(m));if(b)for(d=0;4>d;d++)m=x[k++],m=v[m],2!==d&&q.vertexColors.push(new THREE.Color(m)),0!==d&&p.vertexColors.push(new THREE.Color(m));c.faces.push(q);c.faces.push(p)}else{q=new THREE.Face3;q.a=x[k++];q.b=x[k++];q.c=x[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)n=x[k++],w=u[2*n],n=u[2*n+1],w=new THREE.Vector2(w,n),c.faceVertexUvs[d][h].push(w);r&&(r=3*x[k++],
+q.normal.set(z[r++],z[r++],z[r]));if(t)for(d=0;3>d;d++)r=3*x[k++],t=new THREE.Vector3(z[r++],z[r++],z[r]),q.vertexNormals.push(t);m&&(m=x[k++],q.color.setHex(v[m]));if(b)for(d=0;3>d;d++)m=x[k++],q.vertexColors.push(new THREE.Color(v[m]));c.faces.push(q)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?
 a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("THREE.JSONLoader: When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+
-") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,m;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,m=a.morphTargets[d].vertices,h=0,k=m.length;h<k;h+=3){var p=new THREE.Vector3;p.x=m[h]*b;p.y=m[h+1]*b;p.z=m[h+2]*b;l.push(p)}}if(void 0!==a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]=
+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,m;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,m=a.morphTargets[d].vertices,h=0,k=m.length;h<k;h+=3){var r=new THREE.Vector3;r.x=m[h]*b;r.y=m[h+1]*b;r.z=m[h+2]*b;l.push(r)}}if(void 0!==a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]=
 {},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)m=new THREE.Color(16755200),m.setRGB(l[b],l[b+1],l[b+2]),k.push(m)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};
 THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.data.attributes,d;for(d in c){var e=c[d],f=new self[e.type](e.array);b.addAttribute(d,new THREE.BufferAttribute(f,e.itemSize))}c=a.data.offsets;void 0!==c&&(b.offsets=JSON.parse(JSON.stringify(c)));
@@ -372,14 +372,14 @@ THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.T
 THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);THREE.Group.prototype.constructor=THREE.Group;THREE.Group.prototype.clone=function(a){void 0===a&&(a=new THREE.Group);THREE.Object3D.prototype.clone.call(this,a);return a};THREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.type="PointCloud";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()})};
 THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);THREE.PointCloud.prototype.constructor=THREE.PointCloud;
 THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,f=e.geometry,g=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===f.boundingBox||!1!==b.isIntersectionBox(f.boundingBox)){var g=g/((this.scale.x+this.scale.y+this.scale.z)/3),h=g*g,k=new THREE.Vector3,g=function(a,g){var f=b.distanceSqToPoint(a);if(f<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var l=c.ray.origin.distanceTo(k);
-l<c.near||l>c.far||d.push({distance:l,distanceToRay:Math.sqrt(f),point:k.clone(),index:g,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,m=l.position.array;if(void 0!==l.index){var l=l.index.array,p=f.offsets;0===p.length&&p.push({start:0,count:l.length,index:0});for(var n=0,r=p.length;n<r;++n)for(var t=p[n],q=t.start,u=t.index,f=q,t=q+t.count;f<t;f++)q=u+l[f],k.fromArray(m,3*q),g(k,q)}else for(f=0,l=m.length/3;f<l;f++)k.fromArray(m,3*f),g(k,f)}else for(k=f.vertices,
+l<c.near||l>c.far||d.push({distance:l,distanceToRay:Math.sqrt(f),point:k.clone(),index:g,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,m=l.position.array;if(void 0!==l.index){var l=l.index.array,r=f.offsets;0===r.length&&r.push({start:0,count:l.length,index:0});for(var n=0,q=r.length;n<q;++n)for(var t=r[n],p=t.start,u=t.index,f=p,t=p+t.count;f<t;f++)p=u+l[f],k.fromArray(m,3*p),g(k,p)}else for(f=0,l=m.length/3;f<l;f++)k.fromArray(m,3*f),g(k,f)}else for(k=f.vertices,
 f=0,l=k.length;f<l;f++)g(k[f],f)}}}();THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};
 THREE.PointCloud.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};
 THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};THREE.Line=function(a,b,c){1===c&&console.error("THREE.Line: THREE.LinePieces mode has been removed. Use THREE.LineSegments instead.");THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()})};THREE.Line.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Line.prototype.constructor=THREE.Line;
-THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(g instanceof
-THREE.BufferGeometry){var n=g.attributes;if(void 0!==n.index){var r=n.index.array,n=n.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:r.length,index:0}]);for(var q=0;q<t.length;q++)for(var u=t[q].start,w=t[q].count,x=t[q].index,g=u;g<u+w-1;g+=p){var z=x+r[g+1];h.fromArray(n,3*(x+r[g]));k.fromArray(n,3*z);z=b.distanceSqToSegment(h,k,m,l);z>f||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:q,face:null,faceIndex:null,
-object:this}))}}else for(n=n.position.array,g=0;g<n.length/3-1;g+=p)h.fromArray(n,3*g),k.fromArray(n,3*g+3),z=b.distanceSqToSegment(h,k,m,l),z>f||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;g<k-1;g+=p)z=b.distanceSqToSegment(h[g],h[g+1],m,l),z>f||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),
+THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,r=this instanceof THREE.LineSegments?2:1;if(g instanceof
+THREE.BufferGeometry){var n=g.attributes;if(void 0!==n.index){var q=n.index.array,n=n.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:q.length,index:0}]);for(var p=0;p<t.length;p++)for(var u=t[p].start,w=t[p].count,x=t[p].index,g=u;g<u+w-1;g+=r){var z=x+q[g+1];h.fromArray(n,3*(x+q[g]));k.fromArray(n,3*z);z=b.distanceSqToSegment(h,k,m,l);z>f||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:p,face:null,faceIndex:null,
+object:this}))}}else for(n=n.position.array,g=0;g<n.length/3-1;g+=r)h.fromArray(n,3*g),k.fromArray(n,3*g+3),z=b.distanceSqToSegment(h,k,m,l),z>f||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;g<k-1;g+=r)z=b.distanceSqToSegment(h[g],h[g+1],m,l),z>f||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),
 index:g,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE[this.type](this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};
 THREE.Line.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};
 THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;THREE.LineSegments.prototype.clone=function(a){void 0===a&&(a=new THREE.LineSegments(this.geometry,this.material));THREE.Line.prototype.clone.call(this,a);return a};THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};
@@ -387,10 +387,10 @@ THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototyp
 THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
 THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry,l=this.material;if(void 0!==l&&(null===k.boundingSphere&&k.computeBoundingSphere(),c.copy(k.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))){var m,
-p,n;if(k instanceof THREE.BufferGeometry)if(m=k.attributes,void 0!==m.index){var r=m.index.array,t=m.position.array,q=k.offsets;0===q.length&&(q=[{start:0,count:r.length,index:0}]);for(var u=0,w=q.length;u<w;++u){m=q[u].start;for(var x=q[u].index,k=m,z=m+q[u].count;k<z;k+=3){m=x+r[k];p=x+r[k+1];n=x+r[k+2];d.fromArray(t,3*m);e.fromArray(t,3*p);f.fromArray(t,3*n);var v=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==v){v.applyMatrix4(this.matrixWorld);
-var I=g.ray.origin.distanceTo(v);I<g.near||I>g.far||h.push({distance:I,point:v,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,f)),faceIndex:Math.floor(k/3),object:this})}}}}else for(t=m.position.array,r=k=0,z=t.length;k<z;k+=3,r+=9)m=k,p=k+1,n=k+2,d.fromArray(t,r),e.fromArray(t,r+3),f.fromArray(t,r+6),v=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==v&&(v.applyMatrix4(this.matrixWorld),I=g.ray.origin.distanceTo(v),I<g.near||
-I>g.far||h.push({distance:I,point:v,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,f)),index:Math.floor(k/3),object:this}));else if(k instanceof THREE.Geometry)for(r=l instanceof THREE.MeshFaceMaterial,t=!0===r?l.materials:null,q=k.vertices,u=k.faces,w=0,x=u.length;w<x;w++)if(z=u[w],v=!0===r?t[z.materialIndex]:l,void 0!==v){m=q[z.a];p=q[z.b];n=q[z.c];if(!0===v.morphTargets){var I=k.morphTargets,K=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,0,0);for(var A=0,y=I.length;A<y;A++){var F=
-K[A];if(0!==F){var G=I[A].vertices;d.x+=(G[z.a].x-m.x)*F;d.y+=(G[z.a].y-m.y)*F;d.z+=(G[z.a].z-m.z)*F;e.x+=(G[z.b].x-p.x)*F;e.y+=(G[z.b].y-p.y)*F;e.z+=(G[z.b].z-p.z)*F;f.x+=(G[z.c].x-n.x)*F;f.y+=(G[z.c].y-n.y)*F;f.z+=(G[z.c].z-n.z)*F}}d.add(m);e.add(p);f.add(n);m=d;p=e;n=f}v=v.side===THREE.BackSide?b.intersectTriangle(n,p,m,!0):b.intersectTriangle(m,p,n,v.side!==THREE.DoubleSide);null!==v&&(v.applyMatrix4(this.matrixWorld),I=g.ray.origin.distanceTo(v),I<g.near||I>g.far||h.push({distance:I,point:v,
+r,n;if(k instanceof THREE.BufferGeometry)if(m=k.attributes,void 0!==m.index){var q=m.index.array,t=m.position.array,p=k.offsets;0===p.length&&(p=[{start:0,count:q.length,index:0}]);for(var u=0,w=p.length;u<w;++u){m=p[u].start;for(var x=p[u].index,k=m,z=m+p[u].count;k<z;k+=3){m=x+q[k];r=x+q[k+1];n=x+q[k+2];d.fromArray(t,3*m);e.fromArray(t,3*r);f.fromArray(t,3*n);var v=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==v){v.applyMatrix4(this.matrixWorld);
+var H=g.ray.origin.distanceTo(v);H<g.near||H>g.far||h.push({distance:H,point:v,face:new THREE.Face3(m,r,n,THREE.Triangle.normal(d,e,f)),faceIndex:Math.floor(k/3),object:this})}}}}else for(t=m.position.array,q=k=0,z=t.length;k<z;k+=3,q+=9)m=k,r=k+1,n=k+2,d.fromArray(t,q),e.fromArray(t,q+3),f.fromArray(t,q+6),v=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==v&&(v.applyMatrix4(this.matrixWorld),H=g.ray.origin.distanceTo(v),H<g.near||
+H>g.far||h.push({distance:H,point:v,face:new THREE.Face3(m,r,n,THREE.Triangle.normal(d,e,f)),index:Math.floor(k/3),object:this}));else if(k instanceof THREE.Geometry)for(q=l instanceof THREE.MeshFaceMaterial,t=!0===q?l.materials:null,p=k.vertices,u=k.faces,w=0,x=u.length;w<x;w++)if(z=u[w],v=!0===q?t[z.materialIndex]:l,void 0!==v){m=p[z.a];r=p[z.b];n=p[z.c];if(!0===v.morphTargets){var H=k.morphTargets,K=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,0,0);for(var A=0,y=H.length;A<y;A++){var G=
+K[A];if(0!==G){var F=H[A].vertices;d.x+=(F[z.a].x-m.x)*G;d.y+=(F[z.a].y-m.y)*G;d.z+=(F[z.a].z-m.z)*G;e.x+=(F[z.b].x-r.x)*G;e.y+=(F[z.b].y-r.y)*G;e.z+=(F[z.b].z-r.z)*G;f.x+=(F[z.c].x-n.x)*G;f.y+=(F[z.c].y-n.y)*G;f.z+=(F[z.c].z-n.z)*G}}d.add(m);e.add(r);f.add(n);m=d;r=e;n=f}v=v.side===THREE.BackSide?b.intersectTriangle(n,r,m,!0):b.intersectTriangle(m,r,n,v.side!==THREE.DoubleSide);null!==v&&(v.applyMatrix4(this.matrixWorld),H=g.ray.origin.distanceTo(v),H<g.near||H>g.far||h.push({distance:H,point:v,
 face:z,faceIndex:w,object:this}))}}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};
 THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.clone=function(a){void 0===a&&(a=new THREE.Bone(this.skin));THREE.Object3D.prototype.clone.call(this,a);a.skin=this.skin;return a};
@@ -487,94 +487,94 @@ THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sa
 "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",
 THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};
 THREE.WebGLRenderer=function(a){function b(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=W.get("ANGLE_instanced_arrays"),null===e)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var g=c.attributes;b=b.getAttributes();a=a.defaultAttributeValues;for(var f in b){var h=b[f];if(0<=h){var k=g[f];if(void 0!==k){var l=k.itemSize;S.enableAttribute(h);var n=aa.getAttributeBuffer(k);
-if(k instanceof THREE.InterleavedBufferAttribute){var m=k.data,p=m.stride,k=k.offset;s.bindBuffer(s.ARRAY_BUFFER,n);s.vertexAttribPointer(h,l,s.FLOAT,!1,p*m.array.BYTES_PER_ELEMENT,(d*p+k)*m.array.BYTES_PER_ELEMENT);if(m instanceof THREE.InstancedInterleavedBuffer){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,m.meshPerAttribute);void 0===
+if(k instanceof THREE.InterleavedBufferAttribute){var m=k.data,r=m.stride,k=k.offset;s.bindBuffer(s.ARRAY_BUFFER,n);s.vertexAttribPointer(h,l,s.FLOAT,!1,r*m.array.BYTES_PER_ELEMENT,(d*r+k)*m.array.BYTES_PER_ELEMENT);if(m instanceof THREE.InstancedInterleavedBuffer){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,m.meshPerAttribute);void 0===
 c.maxInstancedCount&&(c.maxInstancedCount=m.array.length/m.stride*m.meshPerAttribute)}}else if(s.bindBuffer(s.ARRAY_BUFFER,n),s.vertexAttribPointer(h,l,s.FLOAT,!1,0,d*l*4),k instanceof THREE.InstancedBufferAttribute){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,k.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=k.array.length/
 k.itemSize*k.meshPerAttribute)}}else if(void 0!==a&&(l=a[f],void 0!==l))switch(l.length){case 2:s.vertexAttrib2fv(h,l);break;case 3:s.vertexAttrib3fv(h,l);break;case 4:s.vertexAttrib4fv(h,l);break;default:s.vertexAttrib1fv(h,l)}}}S.disableUnusedAttributes()}function c(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function d(a,b){return a.object.renderOrder!==
-b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),aa.init(a),a instanceof THREE.Light)R.push(a);else if(a instanceof THREE.Sprite)U.push(a);else if(a instanceof THREE.LensFlare)L.push(a);else{var b=aa.objects[a.id];if(b&&(!1===a.frustumCulled||!0===za.intersectsObject(a))){var c=a.material;Z.get(c)&&(c.program=Z.get(c).program);
-c.transparent?P.push(b):T.push(b);!0===H.sortObjects&&(ka.setFromMatrixPosition(a.matrixWorld),ka.applyProjection(Ha),b.z=ka.z)}}b=0;for(c=a.children.length;b<c;b++)e(a.children[b])}}function f(a,b,c,d,e){for(var g=e,f=0,h=a.length;f<h;f++){var k=a[f].object,l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);null===e&&(g=k.material);if(g instanceof THREE.MeshFaceMaterial)for(var l=g.materials,n=0,m=l.length;n<m;n++)H.renderBufferDirect(b,
-c,d,l[n],k);else H.renderBufferDirect(b,c,d,g,k)}}function g(a,b,c,d,e,g){for(var f=g,h=0,k=a.length;h<k;h++){var l=a[h],n=l.object;!0===n.visible&&(null===g&&(f=l[b]),H.renderImmediateObject(c,d,e,f,n))}}function h(a){k(a);!0===a.transparent?S.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):S.setBlending(THREE.NoBlending);S.setDepthFunc(a.depthFunc);S.setDepthTest(a.depthTest);S.setDepthWrite(a.depthWrite);S.setColorWrite(a.colorWrite);
-S.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function k(a){S.setDoubleSided(a.side===THREE.DoubleSide);S.setFlipSided(a.side===THREE.BackSide)}function l(a,b,c,d,e){var g,f,h,k;Xa=0;var l=Z.get(d);if(d.needsUpdate||!l.program){a:{for(var q=Z.get(d),u=Xb[d.type],w=0,v=0,G=0,A=0,I=0,C=b.length;I<C;I++){var B=b[I];B.onlyShadow||!1===B.visible||(B instanceof THREE.DirectionalLight&&w++,B instanceof THREE.PointLight&&v++,B instanceof THREE.SpotLight&&G++,B instanceof THREE.HemisphereLight&&
-A++)}g=w;f=v;h=G;k=A;for(var K,J=0,E=0,F=b.length;E<F;E++){var N=b[E];N.castShadow&&(N instanceof THREE.SpotLight&&J++,N instanceof THREE.DirectionalLight&&!N.shadowCascade&&J++)}K=J;var R;if(fb&&e&&e.skeleton&&e.skeleton.useVertexTexture)R=1024;else{var L=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),O=Math.floor((L-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(O=Math.min(e.skeleton.bones.length,O),O<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+
-", this GPU supports just "+O+" (try OpenGL instead of ANGLE)"));R=O}var ma={precision:y,supportsVertexTextures:gb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,emissiveMap:!!d.emissiveMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,
-logarithmicDepthBuffer:D,skinning:d.skinning,maxBones:R,useVertexTexture:fb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:H.maxMorphTargets,maxMorphNormals:H.maxMorphNormals,maxDirLights:g,maxPointLights:f,maxSpotLights:h,maxHemiLights:k,maxShadows:K,shadowMapEnabled:ja.enabled&&e.receiveShadow&&0<K,shadowMapType:ja.type,shadowMapDebug:ja.debug,shadowMapCascade:ja.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===
-THREE.DoubleSide,flipSided:d.side===THREE.BackSide},P=[];u?P.push(u):(P.push(d.fragmentShader),P.push(d.vertexShader));if(void 0!==d.defines)for(var T in d.defines)P.push(T),P.push(d.defines[T]);for(T in ma)P.push(T),P.push(ma[T]);var U=P.join();if(!q.program)d.addEventListener("dispose",Jb);else if(q.program.code!==U)Kb(d);else if(void 0!==u)break a;else if(q.__webglShader.uniforms===d.uniforms)break a;if(u){var W=THREE.ShaderLib[u];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(W.uniforms),
-vertexShader:W.vertexShader,fragmentShader:W.fragmentShader}}else q.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var la,ya=0,Ma=ea.length;ya<Ma;ya++){var Ga=ea[ya];if(Ga.code===U){la=Ga;la.usedTimes++;break}}void 0===la&&(d.__webglShader=q.__webglShader,la=new THREE.WebGLProgram(H,U,d,ma),ea.push(la),H.info.memory.programs=ea.length);q.program=la;var Fa=la.getAttributes();if(d.morphTargets)for(var aa=d.numSupportedMorphTargets=0;aa<
-H.maxMorphTargets;aa++)0<=Fa["morphTarget"+aa]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(aa=d.numSupportedMorphNormals=0;aa<H.maxMorphNormals;aa++)0<=Fa["morphNormal"+aa]&&d.numSupportedMorphNormals++;q.uniformsList=[];var cb=q.program.getUniforms(),za;for(za in q.__webglShader.uniforms){var Ha=cb[za];Ha&&q.uniformsList.push([q.__webglShader.uniforms[za],Ha])}}d.needsUpdate=!1}var Na=!1,hb=!1,Ya=!1,Pa=l.program,ca=Pa.getUniforms(),M=l.__webglShader.uniforms;Pa.id!==ra&&(s.useProgram(Pa.program),
-ra=Pa.id,Ya=hb=Na=!0);d.id!==va&&(-1===va&&(Ya=!0),va=d.id,hb=!0);if(Na||a!==Oa)s.uniformMatrix4fv(ca.projectionMatrix,!1,a.projectionMatrix.elements),D&&s.uniform1f(ca.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Oa&&(Oa=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==ca.cameraPosition&&(ka.setFromMatrixPosition(a.matrixWorld),s.uniform3f(ca.cameraPosition,ka.x,ka.y,ka.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||
-d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ca.viewMatrix&&s.uniformMatrix4fv(ca.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==ca.bindMatrix&&s.uniformMatrix4fv(ca.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==ca.bindMatrixInverse&&s.uniformMatrix4fv(ca.bindMatrixInverse,!1,e.bindMatrixInverse.elements),fb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==ca.boneTexture){var Ua=p();s.uniform1i(ca.boneTexture,
-Ua);H.setTexture(e.skeleton.boneTexture,Ua)}null!==ca.boneTextureWidth&&s.uniform1i(ca.boneTextureWidth,e.skeleton.boneTextureWidth);null!==ca.boneTextureHeight&&s.uniform1i(ca.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ca.boneGlobalMatrices&&s.uniformMatrix4fv(ca.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(hb){c&&d.fog&&(M.fogColor.value=c.color,c instanceof THREE.Fog?(M.fogNear.value=c.near,M.fogFar.value=c.far):c instanceof THREE.FogExp2&&
-(M.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Za){var Ya=!0,ba,oa,$,ib=0,jb=0,kb=0,Aa,Va,Wa,Ia,lb,da=Lb,mb=da.directional.colors,nb=da.directional.positions,ob=da.point.colors,pb=da.point.positions,db=da.point.distances,eb=da.point.decays,qb=da.spot.colors,rb=da.spot.positions,Eb=da.spot.distances,sb=da.spot.directions,Fb=da.spot.anglesCos,Gb=da.spot.exponents,Hb=da.spot.decays,tb=da.hemi.skyColors,ub=da.hemi.groundColors,
-vb=da.hemi.positions,Qa=0,Ba=0,sa=0,Ja=0,wb=0,xb=0,yb=0,$a=0,Ra=0,Sa=0,wa=0,Ka=0;ba=0;for(oa=b.length;ba<oa;ba++)$=b[ba],$.onlyShadow||(Aa=$.color,Ia=$.intensity,lb=$.distance,$ instanceof THREE.AmbientLight?$.visible&&(ib+=Aa.r,jb+=Aa.g,kb+=Aa.b):$ instanceof THREE.DirectionalLight?(wb+=1,$.visible&&(fa.setFromMatrixPosition($.matrixWorld),ka.setFromMatrixPosition($.target.matrixWorld),fa.sub(ka),fa.normalize(),Ra=3*Qa,nb[Ra+0]=fa.x,nb[Ra+1]=fa.y,nb[Ra+2]=fa.z,n(mb,Ra,Aa,Ia),Qa+=1)):$ instanceof
-THREE.PointLight?(xb+=1,$.visible&&(Sa=3*Ba,n(ob,Sa,Aa,Ia),ka.setFromMatrixPosition($.matrixWorld),pb[Sa+0]=ka.x,pb[Sa+1]=ka.y,pb[Sa+2]=ka.z,db[Ba]=lb,eb[Ba]=0===$.distance?0:$.decay,Ba+=1)):$ instanceof THREE.SpotLight?(yb+=1,$.visible&&(wa=3*sa,n(qb,wa,Aa,Ia),fa.setFromMatrixPosition($.matrixWorld),rb[wa+0]=fa.x,rb[wa+1]=fa.y,rb[wa+2]=fa.z,Eb[sa]=lb,ka.setFromMatrixPosition($.target.matrixWorld),fa.sub(ka),fa.normalize(),sb[wa+0]=fa.x,sb[wa+1]=fa.y,sb[wa+2]=fa.z,Fb[sa]=Math.cos($.angle),Gb[sa]=
-$.exponent,Hb[sa]=0===$.distance?0:$.decay,sa+=1)):$ instanceof THREE.HemisphereLight&&($a+=1,$.visible&&(fa.setFromMatrixPosition($.matrixWorld),fa.normalize(),Ka=3*Ja,vb[Ka+0]=fa.x,vb[Ka+1]=fa.y,vb[Ka+2]=fa.z,Va=$.color,Wa=$.groundColor,n(tb,Ka,Va,Ia),n(ub,Ka,Wa,Ia),Ja+=1)));ba=3*Qa;for(oa=Math.max(mb.length,3*wb);ba<oa;ba++)mb[ba]=0;ba=3*Ba;for(oa=Math.max(ob.length,3*xb);ba<oa;ba++)ob[ba]=0;ba=3*sa;for(oa=Math.max(qb.length,3*yb);ba<oa;ba++)qb[ba]=0;ba=3*Ja;for(oa=Math.max(tb.length,3*$a);ba<
-oa;ba++)tb[ba]=0;ba=3*Ja;for(oa=Math.max(ub.length,3*$a);ba<oa;ba++)ub[ba]=0;da.directional.length=Qa;da.point.length=Ba;da.spot.length=sa;da.hemi.length=Ja;da.ambient[0]=ib;da.ambient[1]=jb;da.ambient[2]=kb;Za=!1}if(Ya){var ia=Lb;M.ambientLightColor.value=ia.ambient;M.directionalLightColor.value=ia.directional.colors;M.directionalLightDirection.value=ia.directional.positions;M.pointLightColor.value=ia.point.colors;M.pointLightPosition.value=ia.point.positions;M.pointLightDistance.value=ia.point.distances;
-M.pointLightDecay.value=ia.point.decays;M.spotLightColor.value=ia.spot.colors;M.spotLightPosition.value=ia.spot.positions;M.spotLightDistance.value=ia.spot.distances;M.spotLightDirection.value=ia.spot.directions;M.spotLightAngleCos.value=ia.spot.anglesCos;M.spotLightExponent.value=ia.spot.exponents;M.spotLightDecay.value=ia.spot.decays;M.hemisphereLightSkyColor.value=ia.hemi.skyColors;M.hemisphereLightGroundColor.value=ia.hemi.groundColors;M.hemisphereLightDirection.value=ia.hemi.positions;m(M,!0)}else m(M,
-!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){M.opacity.value=d.opacity;M.diffuse.value=d.color;M.map.value=d.map;M.specularMap.value=d.specularMap;M.alphaMap.value=d.alphaMap;d.bumpMap&&(M.bumpMap.value=d.bumpMap,M.bumpScale.value=d.bumpScale);d.normalMap&&(M.normalMap.value=d.normalMap,M.normalScale.value.copy(d.normalScale));var ta;d.map?ta=d.map:d.specularMap?ta=d.specularMap:d.normalMap?ta=d.normalMap:d.bumpMap?ta=d.bumpMap:
-d.alphaMap?ta=d.alphaMap:d.emissiveMap&&(ta=d.emissiveMap);if(void 0!==ta){var Mb=ta.offset,Nb=ta.repeat;M.offsetRepeat.value.set(Mb.x,Mb.y,Nb.x,Nb.y)}M.envMap.value=d.envMap;M.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;M.reflectivity.value=d.reflectivity;M.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)M.diffuse.value=d.color,M.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)M.diffuse.value=d.color,M.opacity.value=
-d.opacity,M.dashSize.value=d.dashSize,M.totalSize.value=d.dashSize+d.gapSize,M.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(M.psColor.value=d.color,M.opacity.value=d.opacity,M.size.value=d.size,M.scale.value=z.height/2,M.map.value=d.map,null!==d.map){var Ob=d.map.offset,Pb=d.map.repeat;M.offsetRepeat.value.set(Ob.x,Ob.y,Pb.x,Pb.y)}}else d instanceof THREE.MeshPhongMaterial?(M.shininess.value=d.shininess,M.emissive.value=d.emissive,M.specular.value=d.specular,M.lightMap.value=
-d.lightMap,M.lightMapIntensity.value=d.lightMapIntensity,M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity,M.emissiveMap.value=d.emissiveMap):d instanceof THREE.MeshLambertMaterial?M.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?(M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(M.mNear.value=a.near,M.mFar.value=a.far,M.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(M.opacity.value=d.opacity);if(e.receiveShadow&&
-!d._shadowPass&&M.shadowMatrix)for(var La=0,zb=0,Ib=b.length;zb<Ib;zb++){var ua=b[zb];ua.castShadow&&(ua instanceof THREE.SpotLight||ua instanceof THREE.DirectionalLight&&!ua.shadowCascade)&&(M.shadowMap.value[La]=ua.shadowMap,M.shadowMapSize.value[La]=ua.shadowMapSize,M.shadowMatrix.value[La]=ua.shadowMatrix,M.shadowDarkness.value[La]=ua.shadowDarkness,M.shadowBias.value[La]=ua.shadowBias,La++)}for(var Ab=l.uniformsList,pa,Ca,qa,ab=0,Yb=Ab.length;ab<Yb;ab++){var X=Ab[ab][0];if(!1!==X.needsUpdate){var Qb=
-X.type,Q=X.value,Y=Ab[ab][1];switch(Qb){case "1i":s.uniform1i(Y,Q);break;case "1f":s.uniform1f(Y,Q);break;case "2f":s.uniform2f(Y,Q[0],Q[1]);break;case "3f":s.uniform3f(Y,Q[0],Q[1],Q[2]);break;case "4f":s.uniform4f(Y,Q[0],Q[1],Q[2],Q[3]);break;case "1iv":s.uniform1iv(Y,Q);break;case "3iv":s.uniform3iv(Y,Q);break;case "1fv":s.uniform1fv(Y,Q);break;case "2fv":s.uniform2fv(Y,Q);break;case "3fv":s.uniform3fv(Y,Q);break;case "4fv":s.uniform4fv(Y,Q);break;case "Matrix3fv":s.uniformMatrix3fv(Y,!1,Q);break;
-case "Matrix4fv":s.uniformMatrix4fv(Y,!1,Q);break;case "i":s.uniform1i(Y,Q);break;case "f":s.uniform1f(Y,Q);break;case "v2":s.uniform2f(Y,Q.x,Q.y);break;case "v3":s.uniform3f(Y,Q.x,Q.y,Q.z);break;case "v4":s.uniform4f(Y,Q.x,Q.y,Q.z,Q.w);break;case "c":s.uniform3f(Y,Q.r,Q.g,Q.b);break;case "iv1":s.uniform1iv(Y,Q);break;case "iv":s.uniform3iv(Y,Q);break;case "fv1":s.uniform1fv(Y,Q);break;case "fv":s.uniform3fv(Y,Q);break;case "v2v":void 0===X._array&&(X._array=new Float32Array(2*Q.length));for(var V=
-0,na=Q.length;V<na;V++)qa=2*V,X._array[qa+0]=Q[V].x,X._array[qa+1]=Q[V].y;s.uniform2fv(Y,X._array);break;case "v3v":void 0===X._array&&(X._array=new Float32Array(3*Q.length));V=0;for(na=Q.length;V<na;V++)qa=3*V,X._array[qa+0]=Q[V].x,X._array[qa+1]=Q[V].y,X._array[qa+2]=Q[V].z;s.uniform3fv(Y,X._array);break;case "v4v":void 0===X._array&&(X._array=new Float32Array(4*Q.length));V=0;for(na=Q.length;V<na;V++)qa=4*V,X._array[qa+0]=Q[V].x,X._array[qa+1]=Q[V].y,X._array[qa+2]=Q[V].z,X._array[qa+3]=Q[V].w;
-s.uniform4fv(Y,X._array);break;case "m3":s.uniformMatrix3fv(Y,!1,Q.elements);break;case "m3v":void 0===X._array&&(X._array=new Float32Array(9*Q.length));V=0;for(na=Q.length;V<na;V++)Q[V].flattenToArrayOffset(X._array,9*V);s.uniformMatrix3fv(Y,!1,X._array);break;case "m4":s.uniformMatrix4fv(Y,!1,Q.elements);break;case "m4v":void 0===X._array&&(X._array=new Float32Array(16*Q.length));V=0;for(na=Q.length;V<na;V++)Q[V].flattenToArrayOffset(X._array,16*V);s.uniformMatrix4fv(Y,!1,X._array);break;case "t":pa=
-Q;Ca=p();s.uniform1i(Y,Ca);if(!pa)continue;if(pa instanceof THREE.CubeTexture||Array.isArray(pa.image)&&6===pa.image.length){var ga=pa,Rb=Ca,bb=Z.get(ga);if(6===ga.image.length)if(ga.needsUpdate){bb.__image__webglTextureCube||(ga.addEventListener("dispose",Bb),bb.__image__webglTextureCube=s.createTexture(),H.info.memory.textures++);S.activeTexture(s.TEXTURE0+Rb);S.bindTexture(s.TEXTURE_CUBE_MAP,bb.__image__webglTextureCube);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,ga.flipY);for(var Sb=ga instanceof THREE.CompressedTexture,
-Cb=ga.image[0]instanceof THREE.DataTexture,Da=[],ha=0;6>ha;ha++)Da[ha]=!H.autoScaleCubemaps||Sb||Cb?Cb?ga.image[ha].image:ga.image[ha]:t(ga.image[ha],Zb);var Tb=Da[0],Ub=THREE.Math.isPowerOfTwo(Tb.width)&&THREE.Math.isPowerOfTwo(Tb.height),xa=x(ga.format),Db=x(ga.type);r(s.TEXTURE_CUBE_MAP,ga,Ub);for(ha=0;6>ha;ha++)if(Sb)for(var Ea,Vb=Da[ha].mipmaps,Ta=0,$b=Vb.length;Ta<$b;Ta++)Ea=Vb[Ta],ga.format!==THREE.RGBAFormat&&ga.format!==THREE.RGBFormat?-1<Wb().indexOf(xa)?S.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+
+b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),aa.init(a),a instanceof THREE.Light)R.push(a);else if(a instanceof THREE.Sprite)U.push(a);else if(a instanceof THREE.LensFlare)J.push(a);else{var b=aa.objects[a.id];if(b&&(!1===a.frustumCulled||!0===za.intersectsObject(a))){var c=a.material;Z.get(c)&&(c.program=Z.get(c).program);
+c.transparent?P.push(b):T.push(b);!0===I.sortObjects&&(ka.setFromMatrixPosition(a.matrixWorld),ka.applyProjection(Ha),b.z=ka.z)}}b=0;for(c=a.children.length;b<c;b++)e(a.children[b])}}function f(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g].object,l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);null===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var l=f.materials,n=0,m=l.length;n<m;n++)I.renderBufferDirect(b,
+c,d,l[n],k);else I.renderBufferDirect(b,c,d,f,k)}}function g(a,b,c,d,e,f){for(var g=f,h=0,k=a.length;h<k;h++){var l=a[h],n=l.object;!0===n.visible&&(null===f&&(g=l[b]),I.renderImmediateObject(c,d,e,g,n))}}function h(a){k(a);!0===a.transparent?S.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):S.setBlending(THREE.NoBlending);S.setDepthFunc(a.depthFunc);S.setDepthTest(a.depthTest);S.setDepthWrite(a.depthWrite);S.setColorWrite(a.colorWrite);
+S.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function k(a){a.side!==THREE.DoubleSide?S.enable(s.CULL_FACE):S.disable(s.CULL_FACE);S.setFlipSided(a.side===THREE.BackSide)}function l(a,b,c,d,e){var f,g,h,k;Xa=0;var l=Z.get(d);if(d.needsUpdate||!l.program){a:{for(var p=Z.get(d),u=Xb[d.type],w=0,v=0,G=0,A=0,H=0,C=b.length;H<C;H++){var B=b[H];B.onlyShadow||!1===B.visible||(B instanceof THREE.DirectionalLight&&w++,B instanceof THREE.PointLight&&v++,B instanceof THREE.SpotLight&&
+G++,B instanceof THREE.HemisphereLight&&A++)}f=w;g=v;h=G;k=A;for(var K,F=0,E=0,L=b.length;E<L;E++){var N=b[E];N.castShadow&&(N instanceof THREE.SpotLight&&F++,N instanceof THREE.DirectionalLight&&!N.shadowCascade&&F++)}K=F;var R;if(fb&&e&&e.skeleton&&e.skeleton.useVertexTexture)R=1024;else{var O=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),J=Math.floor((O-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(J=Math.min(e.skeleton.bones.length,J),J<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+
+e.skeleton.bones.length+", this GPU supports just "+J+" (try OpenGL instead of ANGLE)"));R=J}var ma={precision:y,supportsVertexTextures:gb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,emissiveMap:!!d.emissiveMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,
+sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:D,skinning:d.skinning,maxBones:R,useVertexTexture:fb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:I.maxMorphTargets,maxMorphNormals:I.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:K,shadowMapEnabled:ja.enabled&&e.receiveShadow&&0<K,shadowMapType:ja.type,shadowMapDebug:ja.debug,shadowMapCascade:ja.cascade,alphaTest:d.alphaTest,
+metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},P=[];u?P.push(u):(P.push(d.fragmentShader),P.push(d.vertexShader));if(void 0!==d.defines)for(var T in d.defines)P.push(T),P.push(d.defines[T]);for(T in ma)P.push(T),P.push(ma[T]);var U=P.join();if(!p.program)d.addEventListener("dispose",Jb);else if(p.program.code!==U)Kb(d);else if(void 0!==u)break a;else if(p.__webglShader.uniforms===d.uniforms)break a;if(u){var W=THREE.ShaderLib[u];p.__webglShader={name:d.type,
+uniforms:THREE.UniformsUtils.clone(W.uniforms),vertexShader:W.vertexShader,fragmentShader:W.fragmentShader}}else p.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var la,ya=0,Ma=ea.length;ya<Ma;ya++){var Ga=ea[ya];if(Ga.code===U){la=Ga;la.usedTimes++;break}}void 0===la&&(d.__webglShader=p.__webglShader,la=new THREE.WebGLProgram(I,U,d,ma),ea.push(la),I.info.memory.programs=ea.length);p.program=la;var Fa=la.getAttributes();if(d.morphTargets)for(var aa=
+d.numSupportedMorphTargets=0;aa<I.maxMorphTargets;aa++)0<=Fa["morphTarget"+aa]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(aa=d.numSupportedMorphNormals=0;aa<I.maxMorphNormals;aa++)0<=Fa["morphNormal"+aa]&&d.numSupportedMorphNormals++;p.uniformsList=[];var cb=p.program.getUniforms(),za;for(za in p.__webglShader.uniforms){var Ha=cb[za];Ha&&p.uniformsList.push([p.__webglShader.uniforms[za],Ha])}}d.needsUpdate=!1}var Na=!1,hb=!1,Ya=!1,Pa=l.program,ca=Pa.getUniforms(),M=l.__webglShader.uniforms;
+Pa.id!==ra&&(s.useProgram(Pa.program),ra=Pa.id,Ya=hb=Na=!0);d.id!==va&&(-1===va&&(Ya=!0),va=d.id,hb=!0);if(Na||a!==Oa)s.uniformMatrix4fv(ca.projectionMatrix,!1,a.projectionMatrix.elements),D&&s.uniform1f(ca.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Oa&&(Oa=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==ca.cameraPosition&&(ka.setFromMatrixPosition(a.matrixWorld),s.uniform3f(ca.cameraPosition,ka.x,ka.y,ka.z)),(d instanceof THREE.MeshPhongMaterial||
+d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ca.viewMatrix&&s.uniformMatrix4fv(ca.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==ca.bindMatrix&&s.uniformMatrix4fv(ca.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==ca.bindMatrixInverse&&s.uniformMatrix4fv(ca.bindMatrixInverse,!1,e.bindMatrixInverse.elements),fb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==
+ca.boneTexture){var Ua=r();s.uniform1i(ca.boneTexture,Ua);I.setTexture(e.skeleton.boneTexture,Ua)}null!==ca.boneTextureWidth&&s.uniform1i(ca.boneTextureWidth,e.skeleton.boneTextureWidth);null!==ca.boneTextureHeight&&s.uniform1i(ca.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==ca.boneGlobalMatrices&&s.uniformMatrix4fv(ca.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(hb){c&&d.fog&&(M.fogColor.value=c.color,c instanceof THREE.Fog?(M.fogNear.value=
+c.near,M.fogFar.value=c.far):c instanceof THREE.FogExp2&&(M.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Za){var Ya=!0,ba,oa,$,ib=0,jb=0,kb=0,Aa,Va,Wa,Ia,lb,da=Lb,mb=da.directional.colors,nb=da.directional.positions,ob=da.point.colors,pb=da.point.positions,db=da.point.distances,eb=da.point.decays,qb=da.spot.colors,rb=da.spot.positions,Eb=da.spot.distances,sb=da.spot.directions,Fb=da.spot.anglesCos,Gb=da.spot.exponents,Hb=
+da.spot.decays,tb=da.hemi.skyColors,ub=da.hemi.groundColors,vb=da.hemi.positions,Qa=0,Ba=0,sa=0,Ja=0,wb=0,xb=0,yb=0,$a=0,Ra=0,Sa=0,wa=0,Ka=0;ba=0;for(oa=b.length;ba<oa;ba++)$=b[ba],$.onlyShadow||(Aa=$.color,Ia=$.intensity,lb=$.distance,$ instanceof THREE.AmbientLight?$.visible&&(ib+=Aa.r,jb+=Aa.g,kb+=Aa.b):$ instanceof THREE.DirectionalLight?(wb+=1,$.visible&&(fa.setFromMatrixPosition($.matrixWorld),ka.setFromMatrixPosition($.target.matrixWorld),fa.sub(ka),fa.normalize(),Ra=3*Qa,nb[Ra+0]=fa.x,nb[Ra+
+1]=fa.y,nb[Ra+2]=fa.z,n(mb,Ra,Aa,Ia),Qa+=1)):$ instanceof THREE.PointLight?(xb+=1,$.visible&&(Sa=3*Ba,n(ob,Sa,Aa,Ia),ka.setFromMatrixPosition($.matrixWorld),pb[Sa+0]=ka.x,pb[Sa+1]=ka.y,pb[Sa+2]=ka.z,db[Ba]=lb,eb[Ba]=0===$.distance?0:$.decay,Ba+=1)):$ instanceof THREE.SpotLight?(yb+=1,$.visible&&(wa=3*sa,n(qb,wa,Aa,Ia),fa.setFromMatrixPosition($.matrixWorld),rb[wa+0]=fa.x,rb[wa+1]=fa.y,rb[wa+2]=fa.z,Eb[sa]=lb,ka.setFromMatrixPosition($.target.matrixWorld),fa.sub(ka),fa.normalize(),sb[wa+0]=fa.x,sb[wa+
+1]=fa.y,sb[wa+2]=fa.z,Fb[sa]=Math.cos($.angle),Gb[sa]=$.exponent,Hb[sa]=0===$.distance?0:$.decay,sa+=1)):$ instanceof THREE.HemisphereLight&&($a+=1,$.visible&&(fa.setFromMatrixPosition($.matrixWorld),fa.normalize(),Ka=3*Ja,vb[Ka+0]=fa.x,vb[Ka+1]=fa.y,vb[Ka+2]=fa.z,Va=$.color,Wa=$.groundColor,n(tb,Ka,Va,Ia),n(ub,Ka,Wa,Ia),Ja+=1)));ba=3*Qa;for(oa=Math.max(mb.length,3*wb);ba<oa;ba++)mb[ba]=0;ba=3*Ba;for(oa=Math.max(ob.length,3*xb);ba<oa;ba++)ob[ba]=0;ba=3*sa;for(oa=Math.max(qb.length,3*yb);ba<oa;ba++)qb[ba]=
+0;ba=3*Ja;for(oa=Math.max(tb.length,3*$a);ba<oa;ba++)tb[ba]=0;ba=3*Ja;for(oa=Math.max(ub.length,3*$a);ba<oa;ba++)ub[ba]=0;da.directional.length=Qa;da.point.length=Ba;da.spot.length=sa;da.hemi.length=Ja;da.ambient[0]=ib;da.ambient[1]=jb;da.ambient[2]=kb;Za=!1}if(Ya){var ia=Lb;M.ambientLightColor.value=ia.ambient;M.directionalLightColor.value=ia.directional.colors;M.directionalLightDirection.value=ia.directional.positions;M.pointLightColor.value=ia.point.colors;M.pointLightPosition.value=ia.point.positions;
+M.pointLightDistance.value=ia.point.distances;M.pointLightDecay.value=ia.point.decays;M.spotLightColor.value=ia.spot.colors;M.spotLightPosition.value=ia.spot.positions;M.spotLightDistance.value=ia.spot.distances;M.spotLightDirection.value=ia.spot.directions;M.spotLightAngleCos.value=ia.spot.anglesCos;M.spotLightExponent.value=ia.spot.exponents;M.spotLightDecay.value=ia.spot.decays;M.hemisphereLightSkyColor.value=ia.hemi.skyColors;M.hemisphereLightGroundColor.value=ia.hemi.groundColors;M.hemisphereLightDirection.value=
+ia.hemi.positions;m(M,!0)}else m(M,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){M.opacity.value=d.opacity;M.diffuse.value=d.color;M.map.value=d.map;M.specularMap.value=d.specularMap;M.alphaMap.value=d.alphaMap;d.bumpMap&&(M.bumpMap.value=d.bumpMap,M.bumpScale.value=d.bumpScale);d.normalMap&&(M.normalMap.value=d.normalMap,M.normalScale.value.copy(d.normalScale));var ta;d.map?ta=d.map:d.specularMap?ta=d.specularMap:d.normalMap?
+ta=d.normalMap:d.bumpMap?ta=d.bumpMap:d.alphaMap?ta=d.alphaMap:d.emissiveMap&&(ta=d.emissiveMap);if(void 0!==ta){var Mb=ta.offset,Nb=ta.repeat;M.offsetRepeat.value.set(Mb.x,Mb.y,Nb.x,Nb.y)}M.envMap.value=d.envMap;M.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;M.reflectivity.value=d.reflectivity;M.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)M.diffuse.value=d.color,M.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)M.diffuse.value=
+d.color,M.opacity.value=d.opacity,M.dashSize.value=d.dashSize,M.totalSize.value=d.dashSize+d.gapSize,M.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(M.psColor.value=d.color,M.opacity.value=d.opacity,M.size.value=d.size,M.scale.value=z.height/2,M.map.value=d.map,null!==d.map){var Ob=d.map.offset,Pb=d.map.repeat;M.offsetRepeat.value.set(Ob.x,Ob.y,Pb.x,Pb.y)}}else d instanceof THREE.MeshPhongMaterial?(M.shininess.value=d.shininess,M.emissive.value=d.emissive,M.specular.value=
+d.specular,M.lightMap.value=d.lightMap,M.lightMapIntensity.value=d.lightMapIntensity,M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity,M.emissiveMap.value=d.emissiveMap):d instanceof THREE.MeshLambertMaterial?M.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?(M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(M.mNear.value=a.near,M.mFar.value=a.far,M.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(M.opacity.value=
+d.opacity);if(e.receiveShadow&&!d._shadowPass&&M.shadowMatrix)for(var La=0,zb=0,Ib=b.length;zb<Ib;zb++){var ua=b[zb];ua.castShadow&&(ua instanceof THREE.SpotLight||ua instanceof THREE.DirectionalLight&&!ua.shadowCascade)&&(M.shadowMap.value[La]=ua.shadowMap,M.shadowMapSize.value[La]=ua.shadowMapSize,M.shadowMatrix.value[La]=ua.shadowMatrix,M.shadowDarkness.value[La]=ua.shadowDarkness,M.shadowBias.value[La]=ua.shadowBias,La++)}for(var Ab=l.uniformsList,pa,Ca,qa,ab=0,Yb=Ab.length;ab<Yb;ab++){var X=
+Ab[ab][0];if(!1!==X.needsUpdate){var Qb=X.type,Q=X.value,Y=Ab[ab][1];switch(Qb){case "1i":s.uniform1i(Y,Q);break;case "1f":s.uniform1f(Y,Q);break;case "2f":s.uniform2f(Y,Q[0],Q[1]);break;case "3f":s.uniform3f(Y,Q[0],Q[1],Q[2]);break;case "4f":s.uniform4f(Y,Q[0],Q[1],Q[2],Q[3]);break;case "1iv":s.uniform1iv(Y,Q);break;case "3iv":s.uniform3iv(Y,Q);break;case "1fv":s.uniform1fv(Y,Q);break;case "2fv":s.uniform2fv(Y,Q);break;case "3fv":s.uniform3fv(Y,Q);break;case "4fv":s.uniform4fv(Y,Q);break;case "Matrix3fv":s.uniformMatrix3fv(Y,
+!1,Q);break;case "Matrix4fv":s.uniformMatrix4fv(Y,!1,Q);break;case "i":s.uniform1i(Y,Q);break;case "f":s.uniform1f(Y,Q);break;case "v2":s.uniform2f(Y,Q.x,Q.y);break;case "v3":s.uniform3f(Y,Q.x,Q.y,Q.z);break;case "v4":s.uniform4f(Y,Q.x,Q.y,Q.z,Q.w);break;case "c":s.uniform3f(Y,Q.r,Q.g,Q.b);break;case "iv1":s.uniform1iv(Y,Q);break;case "iv":s.uniform3iv(Y,Q);break;case "fv1":s.uniform1fv(Y,Q);break;case "fv":s.uniform3fv(Y,Q);break;case "v2v":void 0===X._array&&(X._array=new Float32Array(2*Q.length));
+for(var V=0,na=Q.length;V<na;V++)qa=2*V,X._array[qa+0]=Q[V].x,X._array[qa+1]=Q[V].y;s.uniform2fv(Y,X._array);break;case "v3v":void 0===X._array&&(X._array=new Float32Array(3*Q.length));V=0;for(na=Q.length;V<na;V++)qa=3*V,X._array[qa+0]=Q[V].x,X._array[qa+1]=Q[V].y,X._array[qa+2]=Q[V].z;s.uniform3fv(Y,X._array);break;case "v4v":void 0===X._array&&(X._array=new Float32Array(4*Q.length));V=0;for(na=Q.length;V<na;V++)qa=4*V,X._array[qa+0]=Q[V].x,X._array[qa+1]=Q[V].y,X._array[qa+2]=Q[V].z,X._array[qa+
+3]=Q[V].w;s.uniform4fv(Y,X._array);break;case "m3":s.uniformMatrix3fv(Y,!1,Q.elements);break;case "m3v":void 0===X._array&&(X._array=new Float32Array(9*Q.length));V=0;for(na=Q.length;V<na;V++)Q[V].flattenToArrayOffset(X._array,9*V);s.uniformMatrix3fv(Y,!1,X._array);break;case "m4":s.uniformMatrix4fv(Y,!1,Q.elements);break;case "m4v":void 0===X._array&&(X._array=new Float32Array(16*Q.length));V=0;for(na=Q.length;V<na;V++)Q[V].flattenToArrayOffset(X._array,16*V);s.uniformMatrix4fv(Y,!1,X._array);break;
+case "t":pa=Q;Ca=r();s.uniform1i(Y,Ca);if(!pa)continue;if(pa instanceof THREE.CubeTexture||Array.isArray(pa.image)&&6===pa.image.length){var ga=pa,Rb=Ca,bb=Z.get(ga);if(6===ga.image.length)if(ga.needsUpdate){bb.__image__webglTextureCube||(ga.addEventListener("dispose",Bb),bb.__image__webglTextureCube=s.createTexture(),I.info.memory.textures++);S.activeTexture(s.TEXTURE0+Rb);S.bindTexture(s.TEXTURE_CUBE_MAP,bb.__image__webglTextureCube);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,ga.flipY);for(var Sb=ga instanceof
+THREE.CompressedTexture,Cb=ga.image[0]instanceof THREE.DataTexture,Da=[],ha=0;6>ha;ha++)Da[ha]=!I.autoScaleCubemaps||Sb||Cb?Cb?ga.image[ha].image:ga.image[ha]:t(ga.image[ha],Zb);var Tb=Da[0],Ub=THREE.Math.isPowerOfTwo(Tb.width)&&THREE.Math.isPowerOfTwo(Tb.height),xa=x(ga.format),Db=x(ga.type);q(s.TEXTURE_CUBE_MAP,ga,Ub);for(ha=0;6>ha;ha++)if(Sb)for(var Ea,Vb=Da[ha].mipmaps,Ta=0,$b=Vb.length;Ta<$b;Ta++)Ea=Vb[Ta],ga.format!==THREE.RGBAFormat&&ga.format!==THREE.RGBFormat?-1<Wb().indexOf(xa)?S.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+
 ha,Ta,xa,Ea.width,Ea.height,0,Ea.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):S.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,Ta,xa,Ea.width,Ea.height,0,xa,Db,Ea.data);else Cb?S.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,xa,Da[ha].width,Da[ha].height,0,xa,Db,Da[ha].data):S.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,xa,xa,Db,Da[ha]);ga.generateMipmaps&&Ub&&s.generateMipmap(s.TEXTURE_CUBE_MAP);ga.needsUpdate=!1;if(ga.onUpdate)ga.onUpdate(ga)}else S.activeTexture(s.TEXTURE0+
-Rb),S.bindTexture(s.TEXTURE_CUBE_MAP,bb.__image__webglTextureCube)}else if(pa instanceof THREE.WebGLRenderTargetCube){var ac=pa;S.activeTexture(s.TEXTURE0+Ca);S.bindTexture(s.TEXTURE_CUBE_MAP,Z.get(ac).__webglTexture)}else H.setTexture(pa,Ca);break;case "tv":void 0===X._array&&(X._array=[]);V=0;for(na=X.value.length;V<na;V++)X._array[V]=p();s.uniform1iv(Y,X._array);V=0;for(na=X.value.length;V<na;V++)pa=X.value[V],Ca=X._array[V],pa&&H.setTexture(pa,Ca);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
+Rb),S.bindTexture(s.TEXTURE_CUBE_MAP,bb.__image__webglTextureCube)}else if(pa instanceof THREE.WebGLRenderTargetCube){var ac=pa;S.activeTexture(s.TEXTURE0+Ca);S.bindTexture(s.TEXTURE_CUBE_MAP,Z.get(ac).__webglTexture)}else I.setTexture(pa,Ca);break;case "tv":void 0===X._array&&(X._array=[]);V=0;for(na=X.value.length;V<na;V++)X._array[V]=r();s.uniform1iv(Y,X._array);V=0;for(na=X.value.length;V<na;V++)pa=X.value[V],Ca=X._array[V],pa&&I.setTexture(pa,Ca);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
 Qb)}}}}s.uniformMatrix4fv(ca.modelViewMatrix,!1,e._modelViewMatrix.elements);ca.normalMatrix&&s.uniformMatrix3fv(ca.normalMatrix,!1,e._normalMatrix.elements);null!==ca.modelMatrix&&s.uniformMatrix4fv(ca.modelMatrix,!1,e.matrixWorld.elements);return Pa}function m(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=
-b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function p(){var a=Xa;a>=Ua&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Ua);Xa+=1;return a}
-function n(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function r(a,b,c){c?(s.texParameteri(a,s.TEXTURE_WRAP_S,x(b.wrapS)),s.texParameteri(a,s.TEXTURE_WRAP_T,x(b.wrapT)),s.texParameteri(a,s.TEXTURE_MAG_FILTER,x(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,x(b.minFilter))):(s.texParameteri(a,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(a,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+
+b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function r(){var a=Xa;a>=Ua&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Ua);Xa+=1;return a}
+function n(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function q(a,b,c){c?(s.texParameteri(a,s.TEXTURE_WRAP_S,x(b.wrapS)),s.texParameteri(a,s.TEXTURE_WRAP_T,x(b.wrapT)),s.texParameteri(a,s.TEXTURE_MAG_FILTER,x(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,x(b.minFilter))):(s.texParameteri(a,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(a,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+
 b.sourceFile+" )"),s.texParameteri(a,s.TEXTURE_MAG_FILTER,w(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,w(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=W.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||Z.get(b).__currentAnisotropy)&&
-(s.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,H.getMaxAnisotropy())),Z.get(b).__currentAnisotropy=b.anisotropy)}function t(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);
-return d}return a}function q(a,b,c){s.bindFramebuffer(s.FRAMEBUFFER,a);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,c,Z.get(b).__webglTexture,0)}function u(a,b){s.bindRenderbuffer(s.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,
+(s.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,I.getMaxAnisotropy())),Z.get(b).__currentAnisotropy=b.anisotropy)}function t(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);
+return d}return a}function p(a,b,c){s.bindFramebuffer(s.FRAMEBUFFER,a);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,c,Z.get(b).__webglTexture,0)}function u(a,b){s.bindRenderbuffer(s.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,
 s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)):s.renderbufferStorage(s.RENDERBUFFER,s.RGBA4,b.width,b.height)}function w(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?s.NEAREST:s.LINEAR}function x(a){var b;if(a===THREE.RepeatWrapping)return s.REPEAT;if(a===THREE.ClampToEdgeWrapping)return s.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return s.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return s.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return s.NEAREST_MIPMAP_NEAREST;
 if(a===THREE.NearestMipMapLinearFilter)return s.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return s.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return s.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return s.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return s.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return s.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return s.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return s.UNSIGNED_SHORT_5_6_5;
 if(a===THREE.ByteType)return s.BYTE;if(a===THREE.ShortType)return s.SHORT;if(a===THREE.UnsignedShortType)return s.UNSIGNED_SHORT;if(a===THREE.IntType)return s.INT;if(a===THREE.UnsignedIntType)return s.UNSIGNED_INT;if(a===THREE.FloatType)return s.FLOAT;b=W.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return s.ALPHA;if(a===THREE.RGBFormat)return s.RGB;if(a===THREE.RGBAFormat)return s.RGBA;if(a===THREE.LuminanceFormat)return s.LUMINANCE;
 if(a===THREE.LuminanceAlphaFormat)return s.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return s.FUNC_ADD;if(a===THREE.SubtractEquation)return s.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return s.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return s.ZERO;if(a===THREE.OneFactor)return s.ONE;if(a===THREE.SrcColorFactor)return s.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return s.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return s.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return s.ONE_MINUS_SRC_ALPHA;
 if(a===THREE.DstAlphaFactor)return s.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return s.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return s.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return s.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return s.SRC_ALPHA_SATURATE;b=W.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;
 if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=W.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=W.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;
-if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),v=void 0!==a.context?a.context:null,I=z.width,K=z.height,A=1,y=void 0!==a.precision?a.precision:"highp",F=void 0!==a.alpha?a.alpha:!1,G=void 0!==a.depth?a.depth:!0,C=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.antialias?a.antialias:!1,O=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,E=void 0!==a.preserveDrawingBuffer?
-a.preserveDrawingBuffer:!1,D=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,B=new THREE.Color(0),N=0,R=[],T=[],P=[],U=[],L=[];this.domElement=z;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};
-var H=this,ea=[],ra=null,ma=null,va=-1,la="",Oa=null,Xa=0,Fa=0,ya=0,Ma=z.width,Ga=z.height,cb=0,Va=0,za=new THREE.Frustum,Ha=new THREE.Matrix4,ka=new THREE.Vector3,fa=new THREE.Vector3,Za=!0,Lb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},s;try{a={alpha:F,depth:G,
-stencil:C,antialias:J,premultipliedAlpha:O,preserveDrawingBuffer:E};s=v||z.getContext("webgl",a)||z.getContext("experimental-webgl",a);if(null===s){if(null!==z.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}z.addEventListener("webglcontextlost",function(a){a.preventDefault();Wa();db();aa.clear();Z.clear()},!1)}catch(Eb){console.error("THREE.WebGLRenderer: "+Eb)}var S=new THREE.WebGLState(s,x);void 0===s.getShaderPrecisionFormat&&
+if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),v=void 0!==a.context?a.context:null,H=z.width,K=z.height,A=1,y=void 0!==a.precision?a.precision:"highp",G=void 0!==a.alpha?a.alpha:!1,F=void 0!==a.depth?a.depth:!0,C=void 0!==a.stencil?a.stencil:!0,L=void 0!==a.antialias?a.antialias:!1,O=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,E=void 0!==a.preserveDrawingBuffer?
+a.preserveDrawingBuffer:!1,D=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,B=new THREE.Color(0),N=0,R=[],T=[],P=[],U=[],J=[];this.domElement=z;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};
+var I=this,ea=[],ra=null,ma=null,va=-1,la="",Oa=null,Xa=0,Fa=0,ya=0,Ma=z.width,Ga=z.height,cb=0,Va=0,za=new THREE.Frustum,Ha=new THREE.Matrix4,ka=new THREE.Vector3,fa=new THREE.Vector3,Za=!0,Lb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},s;try{a={alpha:G,depth:F,
+stencil:C,antialias:L,premultipliedAlpha:O,preserveDrawingBuffer:E};s=v||z.getContext("webgl",a)||z.getContext("experimental-webgl",a);if(null===s){if(null!==z.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}z.addEventListener("webglcontextlost",function(a){a.preventDefault();Wa();db();aa.clear();Z.clear()},!1)}catch(Eb){console.error("THREE.WebGLRenderer: "+Eb)}var S=new THREE.WebGLState(s,x);void 0===s.getShaderPrecisionFormat&&
 (s.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var Z=new THREE.WebGLProperties,aa=new THREE.WebGLObjects(s,Z,this.info),W=new THREE.WebGLExtensions(s);W.get("OES_texture_float");W.get("OES_texture_float_linear");W.get("OES_texture_half_float");W.get("OES_texture_half_float_linear");W.get("OES_standard_derivatives");W.get("ANGLE_instanced_arrays");W.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);D&&W.get("EXT_frag_depth");var Na=function(a,
 b,c,d){!0===O&&(a*=d,b*=d,c*=d);s.clearColor(a,b,c,d)},db=function(){S.init();s.viewport(Fa,ya,Ma,Ga);Na(B.r,B.g,B.b,N)},Wa=function(){Oa=ra=null;la="";va=-1;Za=!0;S.reset()};db();this.context=s;this.extensions=W;this.state=S;var ja=new THREE.WebGLShadowMap(this,R,aa);this.shadowMap=ja;var Ua=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),v=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Fb=s.getParameter(s.MAX_TEXTURE_SIZE),Zb=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),gb=0<v,fb=gb&&W.get("OES_texture_float"),
-Gb=W.get("ANGLE_instanced_arrays"),F=s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT),v=s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT),G=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);a=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT);var Wb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(W.get("WEBGL_compressed_texture_pvrtc")||W.get("WEBGL_compressed_texture_s3tc"))for(var b=s.getParameter(s.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);
-return a}}(),F=0<F.precision&&0<G.precision,v=0<v.precision&&0<a.precision;"highp"!==y||F||(v?(y="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(y="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==y||v||(y="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Hb=new THREE.SpritePlugin(this,U),Ib=new THREE.LensFlarePlugin(this,L);this.getContext=function(){return s};this.forceContextLoss=
+Gb=W.get("ANGLE_instanced_arrays"),G=s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT),v=s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT),F=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);a=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT);var Wb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(W.get("WEBGL_compressed_texture_pvrtc")||W.get("WEBGL_compressed_texture_s3tc"))for(var b=s.getParameter(s.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);
+return a}}(),G=0<G.precision&&0<F.precision,v=0<v.precision&&0<a.precision;"highp"!==y||G||(v?(y="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(y="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==y||v||(y="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Hb=new THREE.SpritePlugin(this,U),Ib=new THREE.LensFlarePlugin(this,J);this.getContext=function(){return s};this.forceContextLoss=
 function(){W.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return gb};this.supportsInstancedArrays=function(){return Gb};this.supportsFloatTextures=function(){return W.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return W.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return W.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return W.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=
-function(){return W.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return W.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=W.get("EXT_texture_filter_anisotropic");return a=null!==b?s.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return y};this.getPixelRatio=function(){return A};this.setPixelRatio=function(a){void 0!==a&&(A=a)};this.getSize=function(){return{width:I,height:K}};
-this.setSize=function(a,b,c){I=a;K=b;z.width=a*A;z.height=b*A;!1!==c&&(z.style.width=a+"px",z.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Fa=a*A;ya=b*A;Ma=c*A;Ga=d*A;s.viewport(Fa,ya,Ma,Ga)};this.setScissor=function(a,b,c,d){s.scissor(a*A,b*A,c*A,d*A)};this.enableScissorTest=function(a){a?s.enable(s.SCISSOR_TEST):s.disable(s.SCISSOR_TEST)};this.getClearColor=function(){return B};this.setClearColor=function(a,b){B.set(a);N=void 0!==b?b:1;Na(B.r,B.g,B.b,N)};this.getClearAlpha=
+function(){return W.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return W.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=W.get("EXT_texture_filter_anisotropic");return a=null!==b?s.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return y};this.getPixelRatio=function(){return A};this.setPixelRatio=function(a){void 0!==a&&(A=a)};this.getSize=function(){return{width:H,height:K}};
+this.setSize=function(a,b,c){H=a;K=b;z.width=a*A;z.height=b*A;!1!==c&&(z.style.width=a+"px",z.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Fa=a*A;ya=b*A;Ma=c*A;Ga=d*A;s.viewport(Fa,ya,Ma,Ga)};this.setScissor=function(a,b,c,d){s.scissor(a*A,b*A,c*A,d*A)};this.enableScissorTest=function(a){a?s.enable(s.SCISSOR_TEST):s.disable(s.SCISSOR_TEST)};this.getClearColor=function(){return B};this.setClearColor=function(a,b){B.set(a);N=void 0!==b?b:1;Na(B.r,B.g,B.b,N)};this.getClearAlpha=
 function(){return N};this.setClearAlpha=function(a){N=a;Na(B.r,B.g,B.b,N)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=s.COLOR_BUFFER_BIT;if(void 0===b||b)d|=s.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=s.STENCIL_BUFFER_BIT;s.clear(d)};this.clearColor=function(){s.clear(s.COLOR_BUFFER_BIT)};this.clearDepth=function(){s.clear(s.DEPTH_BUFFER_BIT)};this.clearStencil=function(){s.clear(s.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=
-Wa;var Bb=function(a){a=a.target;a.removeEventListener("dispose",Bb);a:{var b=Z.get(a);if(a.image&&b.__image__webglTextureCube)s.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;s.deleteTexture(b.__webglTexture)}Z.delete(a)}H.info.memory.textures--},eb=function(a){var b=a.target;b.removeEventListener("dispose",eb);a=Z.get(b);if(b&&void 0!==a.__webglTexture){s.deleteTexture(a.__webglTexture);if(b instanceof THREE.WebGLRenderTargetCube)for(b=0;6>b;b++)s.deleteFramebuffer(a.__webglFramebuffer[b]),
-s.deleteRenderbuffer(a.__webglRenderbuffer[b]);else s.deleteFramebuffer(a.__webglFramebuffer),s.deleteRenderbuffer(a.__webglRenderbuffer);Z.delete(a)}H.info.memory.textures--},Jb=function(a){a=a.target;a.removeEventListener("dispose",Jb);Kb(a)},Kb=function(a){var b=Z.get(a).program.program;if(void 0!==b){a.program=void 0;var c,d,e,g=!1;c=0;for(d=ea.length;c<d;c++)if(e=ea[c],e.program===b){e.usedTimes--;0===e.usedTimes&&(g=!0);break}if(!0===g){g=[];c=0;for(d=ea.length;c<d;c++)e=ea[c],e.program!==b&&
-g.push(e);ea=g;s.deleteProgram(b);H.info.memory.programs--}Z.delete(a)}};this.renderBufferImmediate=function(a,b,c){S.initAttributes();var d=Z.get(a);a.hasPositions&&!d.__webglVertexBuffer&&(d.__webglVertexBuffer=s.createBuffer());a.hasNormals&&!d.__webglNormalBuffer&&(d.__webglNormalBuffer=s.createBuffer());a.hasUvs&&!d.__webglUvBuffer&&(d.__webglUvBuffer=s.createBuffer());a.hasColors&&!d.__webglColorBuffer&&(d.__webglColorBuffer=s.createBuffer());b=b.getAttributes();a.hasPositions&&(s.bindBuffer(s.ARRAY_BUFFER,
-d.__webglVertexBuffer),s.bufferData(s.ARRAY_BUFFER,a.positionArray,s.DYNAMIC_DRAW),S.enableAttribute(b.position),s.vertexAttribPointer(b.position,3,s.FLOAT,!1,0,0));if(a.hasNormals){s.bindBuffer(s.ARRAY_BUFFER,d.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var e,g,f,h,k,l,n,m,p,q,r,t=3*a.count;for(r=0;r<t;r+=9)q=a.normalArray,e=q[r],g=q[r+1],f=q[r+2],h=q[r+3],l=q[r+4],m=q[r+5],k=q[r+6],n=q[r+7],p=q[r+8],e=(e+h+k)/3,g=(g+l+n)/3,f=(f+m+p)/3,q[r]=
-e,q[r+1]=g,q[r+2]=f,q[r+3]=e,q[r+4]=g,q[r+5]=f,q[r+6]=e,q[r+7]=g,q[r+8]=f}s.bufferData(s.ARRAY_BUFFER,a.normalArray,s.DYNAMIC_DRAW);S.enableAttribute(b.normal);s.vertexAttribPointer(b.normal,3,s.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(s.bindBuffer(s.ARRAY_BUFFER,d.__webglUvBuffer),s.bufferData(s.ARRAY_BUFFER,a.uvArray,s.DYNAMIC_DRAW),S.enableAttribute(b.uv),s.vertexAttribPointer(b.uv,2,s.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(s.bindBuffer(s.ARRAY_BUFFER,d.__webglColorBuffer),s.bufferData(s.ARRAY_BUFFER,
-a.colorArray,s.DYNAMIC_DRAW),S.enableAttribute(b.color),s.vertexAttribPointer(b.color,3,s.FLOAT,!1,0,0));S.disableUnusedAttributes();s.drawArrays(s.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,g){if(!1!==e.visible){h(e);var f=aa.geometries.get(g);a=l(a,c,d,e,g);c=!1;d=f.id+"_"+a.id+"_"+(e.wireframe?1:0);d!==la&&(la=d,c=!0);c&&S.initAttributes();if(g instanceof THREE.Mesh)a:{g=c;c=s.TRIANGLES;!0===e.wireframe&&(c=s.LINES,S.setLineWidth(e.wireframeLinewidth*A));var k=f.attributes.index;
-if(k){var n,m=aa.getAttributeBuffer(k);k.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(d=s.UNSIGNED_INT,n=4):(d=s.UNSIGNED_SHORT,n=2);var q=f.offsets;if(0===q.length){g&&(b(e,a,f,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,m));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
-break a}p.drawElementsInstancedANGLE(c,k.array.length,d,0,f.maxInstancedCount)}else s.drawElements(c,k.array.length,d,0);H.info.render.calls++;H.info.render.vertices+=k.array.length;H.info.render.faces+=k.array.length/3}else{g=!0;for(var k=0,r=q.length;k<r;k++){p=q[k].index;g&&(b(e,a,f,p),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,m));if(f instanceof THREE.InstancedBufferGeometry&&0<q[k].instances){p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
-break a}p.drawElementsInstancedANGLE(c,q[k].count,d,q[k].start*n,q[k].count,d,q[k].instances)}else s.drawElements(c,q[k].count,d,q[k].start*n);H.info.render.calls++;H.info.render.vertices+=q[k].count;H.info.render.faces+=q[k].count/3}}}else if(q=f.offsets,0===q.length){g&&b(e,a,f,0);e=f.attributes.position;if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
-break a}e instanceof THREE.InterleavedBufferAttribute?p.drawArraysInstancedANGLE(c,0,e.data.array.length/e.data.stride,f.maxInstancedCount):p.drawArraysInstancedANGLE(c,0,e.array.length/e.itemSize,f.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?s.drawArrays(c,0,e.data.array.length/e.data.stride):s.drawArrays(c,0,e.array.length/e.itemSize);H.info.render.calls++;H.info.render.vertices+=e.array.length/e.itemSize;H.info.render.faces+=e.array.length/(3*e.itemSize)}else for(g&&b(e,
-a,f,0),k=0,r=q.length;k<r;k++){if(f instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else s.drawArrays(c,q[k].start,q[k].count);H.info.render.calls++;H.info.render.vertices+=q[k].count;H.info.render.faces+=q[k].count/3}}else if(g instanceof THREE.Line)if(g=g instanceof THREE.LineSegments?s.LINES:s.LINE_STRIP,S.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*A),p=f.attributes.index)if(q=aa.getAttributeBuffer(p),
-p.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(n=s.UNSIGNED_INT,m=4):(n=s.UNSIGNED_SHORT,m=2),d=f.offsets,0===d.length)c&&(b(e,a,f,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,q)),s.drawElements(g,p.array.length,n,0),H.info.render.calls++,H.info.render.vertices+=p.array.length;else for(1<d.length&&(c=!0),p=0,k=d.length;p<k;p++)r=d[p].index,c&&(b(e,a,f,r),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,q)),s.drawElements(g,d[p].count,n,d[p].start*m),H.info.render.calls++,H.info.render.vertices+=d[p].count;
-else if(c&&b(e,a,f,0),e=f.attributes.position,d=f.offsets,0===d.length)s.drawArrays(g,0,e.array.length/3),H.info.render.calls++,H.info.render.vertices+=e.array.length/3;else for(p=0,k=d.length;p<k;p++)s.drawArrays(g,d[p].index,d[p].count),H.info.render.calls++,H.info.render.vertices+=d[p].count;else if(g instanceof THREE.PointCloud)if(d=c,c=s.POINTS,p=f.attributes.index)if(q=aa.getAttributeBuffer(p),p.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(n=s.UNSIGNED_INT,m=4):(n=s.UNSIGNED_SHORT,
-m=2),g=f.offsets,0===g.length)d&&(b(e,a,f,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,q)),s.drawElements(c,p.array.length,n,0),H.info.render.calls++,H.info.render.points+=p.array.length;else for(1<g.length&&(d=!0),p=0,k=g.length;p<k;p++)r=g[p].index,d&&(b(e,a,f,r),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,q)),s.drawElements(c,g[p].count,n,g[p].start*m),H.info.render.calls++,H.info.render.points+=g[p].count;else if(d&&b(e,a,f,0),e=f.attributes.position,g=f.offsets,0===g.length)s.drawArrays(c,0,e.array.length/
-3),H.info.render.calls++,H.info.render.points+=e.array.length/3;else for(p=0,k=g.length;p<k;p++)s.drawArrays(c,g[p].index,g[p].count),H.info.render.calls++,H.info.render.points+=g[p].count}};this.render=function(a,b,h,k){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var l=a.fog;la="";va=-1;Oa=null;Za=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);
-Ha.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);za.setFromMatrix(Ha);R.length=0;T.length=0;P.length=0;U.length=0;L.length=0;e(a);!0===H.sortObjects&&(T.sort(c),P.sort(d));aa.update(T);aa.update(P);ja.render(a,b);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;H.info.render.points=0;this.setRenderTarget(h);(this.autoClear||k)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);k=0;for(var n=aa.objectsImmediate.length;k<n;k++){var m=aa.objectsImmediate[k],
-p=m.object;if(!0===p.visible){var q=p;q._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,q.matrixWorld);q._normalMatrix.getNormalMatrix(q._modelViewMatrix);p=p.material;p.transparent?(m.transparent=p,m.opaque=null):(m.opaque=p,m.transparent=null)}}a.overrideMaterial?(k=a.overrideMaterial,f(T,b,R,l,k),f(P,b,R,l,k),g(aa.objectsImmediate,"",b,R,l,k)):(S.setBlending(THREE.NoBlending),f(T,b,R,l,null),g(aa.objectsImmediate,"opaque",b,R,l,null),f(P,b,R,l,null),g(aa.objectsImmediate,"transparent",b,
+Wa;var Bb=function(a){a=a.target;a.removeEventListener("dispose",Bb);a:{var b=Z.get(a);if(a.image&&b.__image__webglTextureCube)s.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;s.deleteTexture(b.__webglTexture)}Z.delete(a)}I.info.memory.textures--},eb=function(a){var b=a.target;b.removeEventListener("dispose",eb);a=Z.get(b);if(b&&void 0!==a.__webglTexture){s.deleteTexture(a.__webglTexture);if(b instanceof THREE.WebGLRenderTargetCube)for(b=0;6>b;b++)s.deleteFramebuffer(a.__webglFramebuffer[b]),
+s.deleteRenderbuffer(a.__webglRenderbuffer[b]);else s.deleteFramebuffer(a.__webglFramebuffer),s.deleteRenderbuffer(a.__webglRenderbuffer);Z.delete(a)}I.info.memory.textures--},Jb=function(a){a=a.target;a.removeEventListener("dispose",Jb);Kb(a)},Kb=function(a){var b=Z.get(a).program.program;if(void 0!==b){a.program=void 0;var c,d,e,f=!1;c=0;for(d=ea.length;c<d;c++)if(e=ea[c],e.program===b){e.usedTimes--;0===e.usedTimes&&(f=!0);break}if(!0===f){f=[];c=0;for(d=ea.length;c<d;c++)e=ea[c],e.program!==b&&
+f.push(e);ea=f;s.deleteProgram(b);I.info.memory.programs--}Z.delete(a)}};this.renderBufferImmediate=function(a,b,c){S.initAttributes();var d=Z.get(a);a.hasPositions&&!d.__webglVertexBuffer&&(d.__webglVertexBuffer=s.createBuffer());a.hasNormals&&!d.__webglNormalBuffer&&(d.__webglNormalBuffer=s.createBuffer());a.hasUvs&&!d.__webglUvBuffer&&(d.__webglUvBuffer=s.createBuffer());a.hasColors&&!d.__webglColorBuffer&&(d.__webglColorBuffer=s.createBuffer());b=b.getAttributes();a.hasPositions&&(s.bindBuffer(s.ARRAY_BUFFER,
+d.__webglVertexBuffer),s.bufferData(s.ARRAY_BUFFER,a.positionArray,s.DYNAMIC_DRAW),S.enableAttribute(b.position),s.vertexAttribPointer(b.position,3,s.FLOAT,!1,0,0));if(a.hasNormals){s.bindBuffer(s.ARRAY_BUFFER,d.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var e,f,g,h,k,l,n,m,r,p,q,t=3*a.count;for(q=0;q<t;q+=9)p=a.normalArray,e=p[q],f=p[q+1],g=p[q+2],h=p[q+3],l=p[q+4],m=p[q+5],k=p[q+6],n=p[q+7],r=p[q+8],e=(e+h+k)/3,f=(f+l+n)/3,g=(g+m+r)/3,p[q]=
+e,p[q+1]=f,p[q+2]=g,p[q+3]=e,p[q+4]=f,p[q+5]=g,p[q+6]=e,p[q+7]=f,p[q+8]=g}s.bufferData(s.ARRAY_BUFFER,a.normalArray,s.DYNAMIC_DRAW);S.enableAttribute(b.normal);s.vertexAttribPointer(b.normal,3,s.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(s.bindBuffer(s.ARRAY_BUFFER,d.__webglUvBuffer),s.bufferData(s.ARRAY_BUFFER,a.uvArray,s.DYNAMIC_DRAW),S.enableAttribute(b.uv),s.vertexAttribPointer(b.uv,2,s.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(s.bindBuffer(s.ARRAY_BUFFER,d.__webglColorBuffer),s.bufferData(s.ARRAY_BUFFER,
+a.colorArray,s.DYNAMIC_DRAW),S.enableAttribute(b.color),s.vertexAttribPointer(b.color,3,s.FLOAT,!1,0,0));S.disableUnusedAttributes();s.drawArrays(s.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f){if(!1!==e.visible){h(e);var g=aa.geometries.get(f);a=l(a,c,d,e,f);c=!1;d=g.id+"_"+a.id+"_"+(e.wireframe?1:0);d!==la&&(la=d,c=!0);c&&S.initAttributes();if(f instanceof THREE.Mesh)a:{f=c;c=s.TRIANGLES;!0===e.wireframe&&(c=s.LINES,S.setLineWidth(e.wireframeLinewidth*A));var k=g.attributes.index;
+if(k){var n,m=aa.getAttributeBuffer(k);k.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(d=s.UNSIGNED_INT,n=4):(d=s.UNSIGNED_SHORT,n=2);var p=g.offsets;if(0===p.length){f&&(b(e,a,g,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,m));if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){var q=W.get("ANGLE_instanced_arrays");if(null===q){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
+break a}q.drawElementsInstancedANGLE(c,k.array.length,d,0,g.maxInstancedCount)}else s.drawElements(c,k.array.length,d,0);I.info.render.calls++;I.info.render.vertices+=k.array.length;I.info.render.faces+=k.array.length/3}else{f=!0;for(var k=0,r=p.length;k<r;k++){q=p[k].index;f&&(b(e,a,g,q),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,m));if(g instanceof THREE.InstancedBufferGeometry&&0<p[k].instances){q=W.get("ANGLE_instanced_arrays");if(null===q){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
+break a}q.drawElementsInstancedANGLE(c,p[k].count,d,p[k].start*n,p[k].count,d,p[k].instances)}else s.drawElements(c,p[k].count,d,p[k].start*n);I.info.render.calls++;I.info.render.vertices+=p[k].count;I.info.render.faces+=p[k].count/3}}}else if(p=g.offsets,0===p.length){f&&b(e,a,g,0);e=g.attributes.position;if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){q=W.get("ANGLE_instanced_arrays");if(null===q){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
+break a}e instanceof THREE.InterleavedBufferAttribute?q.drawArraysInstancedANGLE(c,0,e.data.array.length/e.data.stride,g.maxInstancedCount):q.drawArraysInstancedANGLE(c,0,e.array.length/e.itemSize,g.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?s.drawArrays(c,0,e.data.array.length/e.data.stride):s.drawArrays(c,0,e.array.length/e.itemSize);I.info.render.calls++;I.info.render.vertices+=e.array.length/e.itemSize;I.info.render.faces+=e.array.length/(3*e.itemSize)}else for(f&&b(e,
+a,g,0),k=0,r=p.length;k<r;k++){if(g instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else s.drawArrays(c,p[k].start,p[k].count);I.info.render.calls++;I.info.render.vertices+=p[k].count;I.info.render.faces+=p[k].count/3}}else if(f instanceof THREE.Line)if(f=f instanceof THREE.LineSegments?s.LINES:s.LINE_STRIP,S.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*A),q=g.attributes.index)if(p=aa.getAttributeBuffer(q),
+q.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(n=s.UNSIGNED_INT,m=4):(n=s.UNSIGNED_SHORT,m=2),d=g.offsets,0===d.length)c&&(b(e,a,g,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,p)),s.drawElements(f,q.array.length,n,0),I.info.render.calls++,I.info.render.vertices+=q.array.length;else for(1<d.length&&(c=!0),q=0,k=d.length;q<k;q++)r=d[q].index,c&&(b(e,a,g,r),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,p)),s.drawElements(f,d[q].count,n,d[q].start*m),I.info.render.calls++,I.info.render.vertices+=d[q].count;
+else if(c&&b(e,a,g,0),e=g.attributes.position,d=g.offsets,0===d.length)s.drawArrays(f,0,e.array.length/3),I.info.render.calls++,I.info.render.vertices+=e.array.length/3;else for(q=0,k=d.length;q<k;q++)s.drawArrays(f,d[q].index,d[q].count),I.info.render.calls++,I.info.render.vertices+=d[q].count;else if(f instanceof THREE.PointCloud)if(d=c,c=s.POINTS,q=g.attributes.index)if(p=aa.getAttributeBuffer(q),q.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(n=s.UNSIGNED_INT,m=4):(n=s.UNSIGNED_SHORT,
+m=2),f=g.offsets,0===f.length)d&&(b(e,a,g,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,p)),s.drawElements(c,q.array.length,n,0),I.info.render.calls++,I.info.render.points+=q.array.length;else for(1<f.length&&(d=!0),q=0,k=f.length;q<k;q++)r=f[q].index,d&&(b(e,a,g,r),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,p)),s.drawElements(c,f[q].count,n,f[q].start*m),I.info.render.calls++,I.info.render.points+=f[q].count;else if(d&&b(e,a,g,0),e=g.attributes.position,f=g.offsets,0===f.length)s.drawArrays(c,0,e.array.length/
+3),I.info.render.calls++,I.info.render.points+=e.array.length/3;else for(q=0,k=f.length;q<k;q++)s.drawArrays(c,f[q].index,f[q].count),I.info.render.calls++,I.info.render.points+=f[q].count}};this.render=function(a,b,h,k){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var l=a.fog;la="";va=-1;Oa=null;Za=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);
+Ha.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);za.setFromMatrix(Ha);R.length=0;T.length=0;P.length=0;U.length=0;J.length=0;e(a);!0===I.sortObjects&&(T.sort(c),P.sort(d));aa.update(T);aa.update(P);ja.render(a,b);I.info.render.calls=0;I.info.render.vertices=0;I.info.render.faces=0;I.info.render.points=0;this.setRenderTarget(h);(this.autoClear||k)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);k=0;for(var n=aa.objectsImmediate.length;k<n;k++){var m=aa.objectsImmediate[k],
+q=m.object;if(!0===q.visible){var p=q;p._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,p.matrixWorld);p._normalMatrix.getNormalMatrix(p._modelViewMatrix);q=q.material;q.transparent?(m.transparent=q,m.opaque=null):(m.opaque=q,m.transparent=null)}}a.overrideMaterial?(k=a.overrideMaterial,f(T,b,R,l,k),f(P,b,R,l,k),g(aa.objectsImmediate,"",b,R,l,k)):(S.setBlending(THREE.NoBlending),f(T,b,R,l,null),g(aa.objectsImmediate,"opaque",b,R,l,null),f(P,b,R,l,null),g(aa.objectsImmediate,"transparent",b,
 R,l,null));Hb.render(a,b);Ib.render(a,b,cb,Va);h&&h.generateMipmaps&&h.minFilter!==THREE.NearestFilter&&h.minFilter!==THREE.LinearFilter&&(h instanceof THREE.WebGLRenderTargetCube?(S.bindTexture(s.TEXTURE_CUBE_MAP,Z.get(h).__webglTexture),s.generateMipmap(s.TEXTURE_CUBE_MAP),S.bindTexture(s.TEXTURE_CUBE_MAP,null)):(S.bindTexture(s.TEXTURE_2D,Z.get(h).__webglTexture),s.generateMipmap(s.TEXTURE_2D),S.bindTexture(s.TEXTURE_2D,null)));S.setDepthTest(!0);S.setDepthWrite(!0);S.setColorWrite(!0)}};this.renderImmediateObject=
-function(a,b,c,d,e){h(d);var g=l(a,b,c,d,e);la="";e.immediateRenderCallback?e.immediateRenderCallback(g,s,za):e.render(function(a){H.renderBufferImmediate(a,g,d)})};var Xb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?s.disable(s.CULL_FACE):(b===THREE.FrontFaceDirectionCW?
-s.frontFace(s.CW):s.frontFace(s.CCW),a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),s.enable(s.CULL_FACE))};this.setMaterialFaces=k;this.uploadTexture=function(a,b){var c=Z.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",Bb),c.__webglTexture=s.createTexture(),H.info.memory.textures++);S.activeTexture(s.TEXTURE0+b);S.bindTexture(s.TEXTURE_2D,c.__webglTexture);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,
-a.flipY);s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);s.pixelStorei(s.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=t(a.image,Fb);var d=a.image,c=THREE.Math.isPowerOfTwo(d.width)&&THREE.Math.isPowerOfTwo(d.height),e=x(a.format),g=x(a.type);r(s.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var h=0,k=f.length;h<k;h++)d=f[h],S.texImage2D(s.TEXTURE_2D,h,e,d.width,d.height,0,e,g,d.data);a.generateMipmaps=!1}else S.texImage2D(s.TEXTURE_2D,0,
-e,d.width,d.height,0,e,g,d.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=f.length;h<k;h++)d=f[h],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Wb().indexOf(e)?S.compressedTexImage2D(s.TEXTURE_2D,h,e,d.width,d.height,0,d.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):S.texImage2D(s.TEXTURE_2D,h,e,d.width,d.height,0,e,g,d.data);else if(0<f.length&&c){h=0;for(k=f.length;h<k;h++)d=f[h],S.texImage2D(s.TEXTURE_2D,
-h,e,e,g,d);a.generateMipmaps=!1}else S.texImage2D(s.TEXTURE_2D,0,e,e,g,a.image);a.generateMipmaps&&c&&s.generateMipmap(s.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){a.image&&!1!==a.image.complete&&!0===a.__webglInit&&void 0===Z.get(a).__webglInit&&(a.needsUpdate=!0);if(!0===a.needsUpdate){var c=a.image;void 0===c?console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a):!1===c.complete?console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",
-a):H.uploadTexture(a,b)}else S.activeTexture(s.TEXTURE0+b),S.bindTexture(s.TEXTURE_2D,Z.get(a).__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===Z.get(a).__webglFramebuffer){var c=Z.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",eb);c.__webglTexture=s.createTexture();H.info.memory.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),
-e=x(a.format),g=x(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];S.bindTexture(s.TEXTURE_CUBE_MAP,c.__webglTexture);r(s.TEXTURE_CUBE_MAP,a,d);for(var f=0;6>f;f++)c.__webglFramebuffer[f]=s.createFramebuffer(),c.__webglRenderbuffer[f]=s.createRenderbuffer(),S.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,e,a.width,a.height,0,e,g,null),q(c.__webglFramebuffer[f],a,s.TEXTURE_CUBE_MAP_POSITIVE_X+f),u(c.__webglRenderbuffer[f],a);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=
-s.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:s.createRenderbuffer(),S.bindTexture(s.TEXTURE_2D,c.__webglTexture),r(s.TEXTURE_2D,a,d),S.texImage2D(s.TEXTURE_2D,0,e,a.width,a.height,0,e,g,null),q(c.__webglFramebuffer,a,s.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&s.framebufferRenderbuffer(s.FRAMEBUFFER,
+function(a,b,c,d,e){h(d);var f=l(a,b,c,d,e);la="";e.immediateRenderCallback?e.immediateRenderCallback(f,s,za):e.render(function(a){I.renderBufferImmediate(a,f,d)})};var Xb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?S.disable(s.CULL_FACE):(b===THREE.FrontFaceDirectionCW?
+s.frontFace(s.CW):s.frontFace(s.CCW),a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),S.enable(s.CULL_FACE))};this.setMaterialFaces=k;this.uploadTexture=function(a,b){var c=Z.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",Bb),c.__webglTexture=s.createTexture(),I.info.memory.textures++);S.activeTexture(s.TEXTURE0+b);S.bindTexture(s.TEXTURE_2D,c.__webglTexture);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,
+a.flipY);s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);s.pixelStorei(s.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=t(a.image,Fb);var d=a.image,c=THREE.Math.isPowerOfTwo(d.width)&&THREE.Math.isPowerOfTwo(d.height),e=x(a.format),f=x(a.type);q(s.TEXTURE_2D,a,c);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&c){for(var h=0,k=g.length;h<k;h++)d=g[h],S.texImage2D(s.TEXTURE_2D,h,e,d.width,d.height,0,e,f,d.data);a.generateMipmaps=!1}else S.texImage2D(s.TEXTURE_2D,0,
+e,d.width,d.height,0,e,f,d.data);else if(a instanceof THREE.CompressedTexture)for(h=0,k=g.length;h<k;h++)d=g[h],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Wb().indexOf(e)?S.compressedTexImage2D(s.TEXTURE_2D,h,e,d.width,d.height,0,d.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):S.texImage2D(s.TEXTURE_2D,h,e,d.width,d.height,0,e,f,d.data);else if(0<g.length&&c){h=0;for(k=g.length;h<k;h++)d=g[h],S.texImage2D(s.TEXTURE_2D,
+h,e,e,f,d);a.generateMipmaps=!1}else S.texImage2D(s.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&c&&s.generateMipmap(s.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){a.image&&!1!==a.image.complete&&!0===a.__webglInit&&void 0===Z.get(a).__webglInit&&(a.needsUpdate=!0);if(!0===a.needsUpdate){var c=a.image;void 0===c?console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a):!1===c.complete?console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",
+a):I.uploadTexture(a,b)}else S.activeTexture(s.TEXTURE0+b),S.bindTexture(s.TEXTURE_2D,Z.get(a).__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===Z.get(a).__webglFramebuffer){var c=Z.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",eb);c.__webglTexture=s.createTexture();I.info.memory.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),
+e=x(a.format),f=x(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];S.bindTexture(s.TEXTURE_CUBE_MAP,c.__webglTexture);q(s.TEXTURE_CUBE_MAP,a,d);for(var g=0;6>g;g++)c.__webglFramebuffer[g]=s.createFramebuffer(),c.__webglRenderbuffer[g]=s.createRenderbuffer(),S.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+g,0,e,a.width,a.height,0,e,f,null),p(c.__webglFramebuffer[g],a,s.TEXTURE_CUBE_MAP_POSITIVE_X+g),u(c.__webglRenderbuffer[g],a);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=
+s.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:s.createRenderbuffer(),S.bindTexture(s.TEXTURE_2D,c.__webglTexture),q(s.TEXTURE_2D,a,d),S.texImage2D(s.TEXTURE_2D,0,e,a.width,a.height,0,e,f,null),p(c.__webglFramebuffer,a,s.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&s.framebufferRenderbuffer(s.FRAMEBUFFER,
 s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):u(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);b?S.bindTexture(s.TEXTURE_CUBE_MAP,null):S.bindTexture(s.TEXTURE_2D,null);s.bindRenderbuffer(s.RENDERBUFFER,null);s.bindFramebuffer(s.FRAMEBUFFER,null)}a?(c=Z.get(a),b=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ma,a=Ga,d=Fa,e=ya);b!==ma&&(s.bindFramebuffer(s.FRAMEBUFFER,b),s.viewport(d,e,c,a),ma=b);
-cb=c;Va=a};this.readRenderTargetPixels=function(a,b,c,d,e,g){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(Z.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var f=!1;Z.get(a).__webglFramebuffer!==ma&&(s.bindFramebuffer(s.FRAMEBUFFER,Z.get(a).__webglFramebuffer),
-f=!0);s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE?s.readPixels(b,c,d,e,s.RGBA,s.UNSIGNED_BYTE,g):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");f&&s.bindFramebuffer(s.FRAMEBUFFER,ma)}};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=
+cb=c;Va=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(Z.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;Z.get(a).__webglFramebuffer!==ma&&(s.bindFramebuffer(s.FRAMEBUFFER,Z.get(a).__webglFramebuffer),
+g=!0);s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE?s.readPixels(b,c,d,e,s.RGBA,s.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&s.bindFramebuffer(s.FRAMEBUFFER,ma)}};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=
 function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")};this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")};Object.defineProperties(this,{shadowMapEnabled:{get:function(){return ja.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ja.enabled=a}},shadowMapType:{get:function(){return ja.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");
 ja.type=a}},shadowMapCullFace:{get:function(){return ja.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ja.cullFace=a}},shadowMapDebug:{get:function(){return ja.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ja.debug=a}},shadowMapCascade:{get:function(){return ja.cascade},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");ja.cascade=a}}})};
 THREE.WebGLRenderTarget=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,
@@ -586,77 +586,77 @@ break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_t
 THREE.WebGLGeometries=function(a,b){function c(e){e=e.target;var f=d[e.id],g;for(g in f.attributes){var h=f.attributes[g];void 0!==h.buffer&&(a.deleteBuffer(h.buffer),delete h.buffer)}e.removeEventListener("dispose",c);delete d[e.id];b.memory.geometries--}var d={};this.get=function(a){var f=a.geometry;if(void 0!==d[f.id])return d[f.id];f.addEventListener("dispose",c);d[f.id]=f instanceof THREE.BufferGeometry?f:(new THREE.BufferGeometry).setFromObject(a);b.memory.geometries++;return d[f.id]}};
 THREE.WebGLObjects=function(a,b,c){function d(a){a.target.traverse(function(a){a.removeEventListener("remove",d);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete f[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var c=g,e=c.length-1;0<=e;e--)c[e].object===a&&c.splice(e,1);delete a._modelViewMatrix;delete a._normalMatrix;b.delete(a)})}function e(a,b){return b[0]-a[0]}var f={},g=[],h=new Float32Array(8),k=new THREE.WebGLGeometries(a,
 c);this.objects=f;this.objectsImmediate=g;this.geometries=k;this.init=function(a){var c=b.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",d));void 0===c.__webglActive&&(c.__webglActive=!0,a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud?f[a.id]={id:a.id,object:a,z:0}:(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&g.push({id:null,object:a,opaque:null,
-transparent:null,z:0}))};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.update=function(c){for(var d=0,g=c.length;d<g;d++){var f=c[d].object;if(!1!==f.material.visible){var r=f,f=k.get(r);!0===r.geometry.dynamic&&f.updateFromObject(r);if(void 0!==r.morphTargetInfluences){for(var t=[],q=r.morphTargetInfluences,u=0,w=q.length;u<w;u++)t.push([q[u],u]);t.sort(e);8<t.length&&(t.length=8);u=0;for(w=t.length;u<
-w;u++)h[u]=t[u][0],q=f.morphAttributes[t[u][1]],f.addAttribute("morphTarget"+u,q);q=r.material;void 0!==q.program?(q=q.program.getUniforms(),null!==q.morphTargetInfluences&&a.uniform1fv(q.morphTargetInfluences,h)):console.warn("TOFIX: material.program is undefined")}f=f.attributes;r=void 0;for(r in f)if(q=f[r],t="index"===r?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,q=q instanceof THREE.InterleavedBufferAttribute?q.data:q,u=b.get(q),void 0===u.__webglBuffer){u.__webglBuffer=a.createBuffer();a.bindBuffer(t,
-u.__webglBuffer);u=a.STATIC_DRAW;if(q instanceof THREE.DynamicBufferAttribute||q instanceof THREE.InstancedBufferAttribute&&!0===q.dynamic||q instanceof THREE.InterleavedBuffer&&!0===q.dynamic)u=a.DYNAMIC_DRAW;a.bufferData(t,q.array,u);q.needsUpdate=!1}else!0===q.needsUpdate&&(a.bindBuffer(t,u.__webglBuffer),void 0===q.updateRange||-1===q.updateRange.count?a.bufferSubData(t,0,q.array):0===q.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
-(a.bufferSubData(t,q.updateRange.offset*q.array.BYTES_PER_ELEMENT,q.array.subarray(q.updateRange.offset,q.updateRange.offset+q.updateRange.count)),q.updateRange.count=0),q.needsUpdate=!1)}}};this.clear=function(){f={};g=[]}};
-THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var g=a[c];!1!==g&&b.push("#define "+c+" "+g)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,f,g){var h=d.context,k=f.defines,l=f.__webglShader.vertexShader,m=f.__webglShader.fragmentShader,p=f.index0AttributeName,n="SHADOWMAP_TYPE_BASIC";g.shadowMapType===THREE.PCFShadowMap?n="SHADOWMAP_TYPE_PCF":g.shadowMapType===THREE.PCFSoftShadowMap&&(n="SHADOWMAP_TYPE_PCF_SOFT");var r="ENVMAP_TYPE_CUBE",t="ENVMAP_MODE_REFLECTION",
-q="ENVMAP_BLENDING_MULTIPLY";if(g.envMap){switch(f.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:r="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:r="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:r="ENVMAP_TYPE_SPHERE"}switch(f.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_MODE_REFRACTION"}switch(f.combine){case THREE.MultiplyOperation:q=
-"ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:q="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:q="ENVMAP_BLENDING_ADD"}}var u=0<d.gammaFactor?d.gammaFactor:1,w=a(k),x=h.createProgram();f instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+g.precision+" float;","precision "+g.precision+" int;","#define SHADER_NAME "+f.__webglShader.name,w,g.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
+transparent:null,z:0}))};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.update=function(c){for(var d=0,g=c.length;d<g;d++){var f=c[d].object;if(!1!==f.material.visible){var q=f,f=k.get(q);!0===q.geometry.dynamic&&f.updateFromObject(q);if(void 0!==q.morphTargetInfluences){for(var t=[],p=q.morphTargetInfluences,u=0,w=p.length;u<w;u++)t.push([p[u],u]);t.sort(e);8<t.length&&(t.length=8);u=0;for(w=t.length;u<
+w;u++)h[u]=t[u][0],p=f.morphAttributes[t[u][1]],f.addAttribute("morphTarget"+u,p);p=q.material;void 0!==p.program?(p=p.program.getUniforms(),null!==p.morphTargetInfluences&&a.uniform1fv(p.morphTargetInfluences,h)):console.warn("TOFIX: material.program is undefined")}f=f.attributes;q=void 0;for(q in f)if(p=f[q],t="index"===q?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,p=p instanceof THREE.InterleavedBufferAttribute?p.data:p,u=b.get(p),void 0===u.__webglBuffer){u.__webglBuffer=a.createBuffer();a.bindBuffer(t,
+u.__webglBuffer);u=a.STATIC_DRAW;if(p instanceof THREE.DynamicBufferAttribute||p instanceof THREE.InstancedBufferAttribute&&!0===p.dynamic||p instanceof THREE.InterleavedBuffer&&!0===p.dynamic)u=a.DYNAMIC_DRAW;a.bufferData(t,p.array,u);p.needsUpdate=!1}else!0===p.needsUpdate&&(a.bindBuffer(t,u.__webglBuffer),void 0===p.updateRange||-1===p.updateRange.count?a.bufferSubData(t,0,p.array):0===p.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
+(a.bufferSubData(t,p.updateRange.offset*p.array.BYTES_PER_ELEMENT,p.array.subarray(p.updateRange.offset,p.updateRange.offset+p.updateRange.count)),p.updateRange.count=0),p.needsUpdate=!1)}}};this.clear=function(){f={};g=[]}};
+THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var g=a[c];!1!==g&&b.push("#define "+c+" "+g)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,f,g){var h=d.context,k=f.defines,l=f.__webglShader.vertexShader,m=f.__webglShader.fragmentShader,r=f.index0AttributeName,n="SHADOWMAP_TYPE_BASIC";g.shadowMapType===THREE.PCFShadowMap?n="SHADOWMAP_TYPE_PCF":g.shadowMapType===THREE.PCFSoftShadowMap&&(n="SHADOWMAP_TYPE_PCF_SOFT");var q="ENVMAP_TYPE_CUBE",t="ENVMAP_MODE_REFLECTION",
+p="ENVMAP_BLENDING_MULTIPLY";if(g.envMap){switch(f.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:q="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:q="ENVMAP_TYPE_SPHERE"}switch(f.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_MODE_REFRACTION"}switch(f.combine){case THREE.MultiplyOperation:p=
+"ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:p="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:p="ENVMAP_BLENDING_ADD"}}var u=0<d.gammaFactor?d.gammaFactor:1,w=a(k),x=h.createProgram();f instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+g.precision+" float;","precision "+g.precision+" int;","#define SHADER_NAME "+f.__webglShader.name,w,g.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
 u,"#define MAX_DIR_LIGHTS "+g.maxDirLights,"#define MAX_POINT_LIGHTS "+g.maxPointLights,"#define MAX_SPOT_LIGHTS "+g.maxSpotLights,"#define MAX_HEMI_LIGHTS "+g.maxHemiLights,"#define MAX_SHADOWS "+g.maxShadows,"#define MAX_BONES "+g.maxBones,g.map?"#define USE_MAP":"",g.envMap?"#define USE_ENVMAP":"",g.envMap?"#define "+t:"",g.lightMap?"#define USE_LIGHTMAP":"",g.aoMap?"#define USE_AOMAP":"",g.emissiveMap?"#define USE_EMISSIVEMAP":"",g.bumpMap?"#define USE_BUMPMAP":"",g.normalMap?"#define USE_NORMALMAP":
 "",g.specularMap?"#define USE_SPECULARMAP":"",g.alphaMap?"#define USE_ALPHAMAP":"",g.vertexColors?"#define USE_COLOR":"",g.flatShading?"#define FLAT_SHADED":"",g.skinning?"#define USE_SKINNING":"",g.useVertexTexture?"#define BONE_TEXTURE":"",g.morphTargets?"#define USE_MORPHTARGETS":"",g.morphNormals?"#define USE_MORPHNORMALS":"",g.doubleSided?"#define DOUBLE_SIDED":"",g.flipSided?"#define FLIP_SIDED":"",g.shadowMapEnabled?"#define USE_SHADOWMAP":"",g.shadowMapEnabled?"#define "+n:"",g.shadowMapDebug?
 "#define SHADOWMAP_DEBUG":"",g.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",g.sizeAttenuation?"#define USE_SIZEATTENUATION":"",g.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",g.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;",
 "attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;",
 "\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(b).join("\n"),d=[g.bumpMap||g.normalMap||g.flatShading||f.derivatives?"#extension GL_OES_standard_derivatives : enable":"","precision "+g.precision+" float;","precision "+g.precision+" int;","#define SHADER_NAME "+f.__webglShader.name,w,"#define MAX_DIR_LIGHTS "+g.maxDirLights,"#define MAX_POINT_LIGHTS "+g.maxPointLights,"#define MAX_SPOT_LIGHTS "+
-g.maxSpotLights,"#define MAX_HEMI_LIGHTS "+g.maxHemiLights,"#define MAX_SHADOWS "+g.maxShadows,g.alphaTest?"#define ALPHATEST "+g.alphaTest:"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+u,g.useFog&&g.fog?"#define USE_FOG":"",g.useFog&&g.fogExp?"#define FOG_EXP2":"",g.map?"#define USE_MAP":"",g.envMap?"#define USE_ENVMAP":"",g.envMap?"#define "+r:"",g.envMap?"#define "+t:"",g.envMap?"#define "+q:"",g.lightMap?"#define USE_LIGHTMAP":"",g.aoMap?
+g.maxSpotLights,"#define MAX_HEMI_LIGHTS "+g.maxHemiLights,"#define MAX_SHADOWS "+g.maxShadows,g.alphaTest?"#define ALPHATEST "+g.alphaTest:"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+u,g.useFog&&g.fog?"#define USE_FOG":"",g.useFog&&g.fogExp?"#define FOG_EXP2":"",g.map?"#define USE_MAP":"",g.envMap?"#define USE_ENVMAP":"",g.envMap?"#define "+q:"",g.envMap?"#define "+t:"",g.envMap?"#define "+p:"",g.lightMap?"#define USE_LIGHTMAP":"",g.aoMap?
 "#define USE_AOMAP":"",g.emissiveMap?"#define USE_EMISSIVEMAP":"",g.bumpMap?"#define USE_BUMPMAP":"",g.normalMap?"#define USE_NORMALMAP":"",g.specularMap?"#define USE_SPECULARMAP":"",g.alphaMap?"#define USE_ALPHAMAP":"",g.vertexColors?"#define USE_COLOR":"",g.flatShading?"#define FLAT_SHADED":"",g.metal?"#define METAL":"",g.doubleSided?"#define DOUBLE_SIDED":"",g.flipSided?"#define FLIP_SIDED":"",g.shadowMapEnabled?"#define USE_SHADOWMAP":"",g.shadowMapEnabled?"#define "+n:"",g.shadowMapDebug?"#define SHADOWMAP_DEBUG":
-"",g.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",g.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",g.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(b).join("\n"));m=d+m;l=new THREE.WebGLShader(h,h.VERTEX_SHADER,k+l);m=new THREE.WebGLShader(h,h.FRAGMENT_SHADER,m);h.attachShader(x,l);h.attachShader(x,m);void 0!==p&&h.bindAttribLocation(x,0,p);h.linkProgram(x);p=h.getProgramInfoLog(x);
-k=h.getShaderInfoLog(l);d=h.getShaderInfoLog(m);!1===h.getProgramParameter(x,h.LINK_STATUS)&&console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(x,h.VALIDATE_STATUS),"gl.getProgramInfoLog",p,k,d);""!==p&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",p);h.deleteShader(l);h.deleteShader(m);var z=function(){return this._cachedUniforms};this.getUniforms=function(){for(var a={},b=h.getProgramParameter(x,h.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=
+"",g.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",g.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",g.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(b).join("\n"));m=d+m;l=new THREE.WebGLShader(h,h.VERTEX_SHADER,k+l);m=new THREE.WebGLShader(h,h.FRAGMENT_SHADER,m);h.attachShader(x,l);h.attachShader(x,m);void 0!==r&&h.bindAttribLocation(x,0,r);h.linkProgram(x);r=h.getProgramInfoLog(x);
+k=h.getShaderInfoLog(l);d=h.getShaderInfoLog(m);!1===h.getProgramParameter(x,h.LINK_STATUS)&&console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(x,h.VALIDATE_STATUS),"gl.getProgramInfoLog",r,k,d);""!==r&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",r);h.deleteShader(l);h.deleteShader(m);var z=function(){return this._cachedUniforms};this.getUniforms=function(){for(var a={},b=h.getProgramParameter(x,h.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=
 h.getActiveUniform(x,c).name,e=h.getUniformLocation(x,d),f=d.lastIndexOf("[0]");-1!==f&&f===d.length-3&&(a[d.substr(0,f)]=e);a[d]=e}this._cachedUniforms=a;this.getUniforms=z;return a};var v=function(){return this._cachedAttributes};this.getAttributes=function(){for(var a={},b=h.getProgramParameter(x,h.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=h.getActiveAttrib(x,c).name;a[d]=h.getAttribLocation(x,d)}this._cachedAttributes=a;this.getAttributes=v;return a};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");
 return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.id=c++;this.code=e;this.usedTimes=1;this.program=x;this.vertexShader=l;this.fragmentShader=m;return this}}();THREE.WebGLProperties=function(){var a={};this.get=function(b){void 0===a[b.uuid]&&(a[b.uuid]={});return a[b.uuid]};this.delete=function(b){delete a[b.uuid]};this.clear=function(){a={}}};
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
-THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===g.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),n.push(e));for(var e=0,f=a.children.length;e<f;e++)d(a.children[e],b)}}var e=a.context,f=a.state,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,m=c.objectsImmediate,p=new THREE.Vector3,n=[],r=THREE.ShaderLib.depthRGBA,t=THREE.UniformsUtils.clone(r.uniforms),
-q=new THREE.ShaderMaterial({uniforms:t,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}),u=new THREE.ShaderMaterial({uniforms:t,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,morphTargets:!0}),w=new THREE.ShaderMaterial({uniforms:t,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,skinning:!0}),x=new THREE.ShaderMaterial({uniforms:t,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,morphTargets:!0,skinning:!0});q._shadowPass=!0;u._shadowPass=!0;w._shadowPass=
-!0;x._shadowPass=!0;var z=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,r){if(!1!==z.enabled){var t,A,y,F,G,C,J,O=[];F=0;e.clearColor(1,1,1,1);f.setBlend(!1);e.enable(e.CULL_FACE);e.frontFace(e.CCW);z.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);f.setDepthTest(!0);t=0;for(A=b.length;t<A;t++)if(y=b[t],y.castShadow)if(y instanceof THREE.DirectionalLight&&y.shadowCascade)for(G=0;G<y.shadowCascadeCount;G++){var E;
-if(y.shadowCascadeArray[G])E=y.shadowCascadeArray[G];else{var D=y;J=G;E=new THREE.DirectionalLight;E.isVirtual=!0;E.onlyShadow=!0;E.castShadow=!0;E.shadowCameraNear=D.shadowCameraNear;E.shadowCameraFar=D.shadowCameraFar;E.shadowCameraLeft=D.shadowCameraLeft;E.shadowCameraRight=D.shadowCameraRight;E.shadowCameraBottom=D.shadowCameraBottom;E.shadowCameraTop=D.shadowCameraTop;E.shadowCameraVisible=D.shadowCameraVisible;E.shadowDarkness=D.shadowDarkness;E.shadowBias=D.shadowCascadeBias[J];E.shadowMapWidth=
-D.shadowCascadeWidth[J];E.shadowMapHeight=D.shadowCascadeHeight[J];E.pointsWorld=[];E.pointsFrustum=[];var B=E.pointsWorld;C=E.pointsFrustum;for(var N=0;8>N;N++)B[N]=new THREE.Vector3,C[N]=new THREE.Vector3;B=D.shadowCascadeNearZ[J];D=D.shadowCascadeFarZ[J];C[0].set(-1,-1,B);C[1].set(1,-1,B);C[2].set(-1,1,B);C[3].set(1,1,B);C[4].set(-1,-1,D);C[5].set(1,-1,D);C[6].set(-1,1,D);C[7].set(1,1,D);E.originalCamera=r;C=new THREE.Gyroscope;C.position.copy(y.shadowCascadeOffset);C.add(E);C.add(E.target);r.add(C);
-y.shadowCascadeArray[G]=E}J=y;B=G;D=J.shadowCascadeArray[B];D.position.copy(J.position);D.target.position.copy(J.target.position);D.lookAt(D.target);D.shadowCameraVisible=J.shadowCameraVisible;D.shadowDarkness=J.shadowDarkness;D.shadowBias=J.shadowCascadeBias[B];C=J.shadowCascadeNearZ[B];J=J.shadowCascadeFarZ[B];D=D.pointsFrustum;D[0].z=C;D[1].z=C;D[2].z=C;D[3].z=C;D[4].z=J;D[5].z=J;D[6].z=J;D[7].z=J;O[F]=E;F++}else O[F]=y,F++;t=0;for(A=O.length;t<A;t++){y=O[t];y.shadowMap||(G=THREE.LinearFilter,
-z.type===THREE.PCFSoftShadowMap&&(G=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:G,magFilter:G,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);if(!y.shadowCamera){if(y instanceof THREE.SpotLight)y.shadowCamera=new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear,y.shadowCameraFar);else if(y instanceof THREE.DirectionalLight)y.shadowCamera=
-new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",y);continue}c.add(y.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),c.add(y.cameraHelper));if(y.isVirtual&&E.originalCamera==r){G=r;F=y.shadowCamera;C=y.pointsFrustum;D=y.pointsWorld;
-k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(J=0;8>J;J++)B=D[J],B.copy(C[J]),B.unproject(G),B.applyMatrix4(F.matrixWorldInverse),B.x<k.x&&(k.x=B.x),B.x>l.x&&(l.x=B.x),B.y<k.y&&(k.y=B.y),B.y>l.y&&(l.y=B.y),B.z<k.z&&(k.z=B.z),B.z>l.z&&(l.z=B.z);F.left=k.x;F.right=l.x;F.top=l.y;F.bottom=k.y;F.updateProjectionMatrix()}F=y.shadowMap;C=y.shadowMatrix;G=y.shadowCamera;G.position.setFromMatrixPosition(y.matrixWorld);p.setFromMatrixPosition(y.target.matrixWorld);G.lookAt(p);G.updateMatrixWorld();
-G.matrixWorldInverse.getInverse(G.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);C.multiply(G.projectionMatrix);C.multiply(G.matrixWorldInverse);h.multiplyMatrices(G.projectionMatrix,G.matrixWorldInverse);g.setFromMatrix(h);a.setRenderTarget(F);a.clear();n.length=0;d(c,G);y=0;for(F=n.length;y<F;y++)C=n[y],C=C.object,D=C.material instanceof THREE.MeshFaceMaterial?C.material.materials[0]:
-C.material,J=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&D.morphTargets,B=C instanceof THREE.SkinnedMesh&&D.skinning,J=C.customDepthMaterial?C.customDepthMaterial:B?J?x:w:J?u:q,a.setMaterialFaces(D),a.renderBufferDirect(G,b,null,J,C);y=0;for(F=m.length;y<F;y++)C=m[y],C=C.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(G.matrixWorldInverse,C.matrixWorld),a.renderImmediateObject(G,b,null,q,C))}t=a.getClearColor();A=a.getClearAlpha();e.clearColor(t.r,t.g,
-t.b,A);f.setBlend(!0);z.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
-THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),f=null,g=null,h=null,k=null,l=null,m=null,p=null,n=null,r=null,t=null,q=null,u=null,w=null,x=null,z=null,v=null,I=null,K=null,A=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),y=void 0,F={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);a.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);a.enable(a.CULL_FACE);a.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA,
-a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&(a.disableVertexAttribArray(b),e[b]=0)};this.setBlend=function(b){b!==f&&(b?a.enable(a.BLEND):a.disable(a.BLEND),f=b)};this.setBlending=function(c,d,e,f,q,r,t){c!==g&&(c===THREE.NoBlending?this.setBlend(!1):c===THREE.AdditiveBlending?
-(this.setBlend(!0),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(this.setBlend(!0),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(this.setBlend(!0),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?this.setBlend(!0):(this.setBlend(!0),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),g=
-c);if(c===THREE.CustomBlending){q=q||d;r=r||e;t=t||f;if(d!==h||q!==m)a.blendEquationSeparate(b(d),b(q)),h=d,m=q;if(e!==k||f!==l||r!==p||t!==n)a.blendFuncSeparate(b(e),b(f),b(r),b(t)),k=e,l=f,p=r,n=t}else n=p=m=l=k=h=null};this.setDepthFunc=function(b){if(r!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);
-break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);r=b}};this.setDepthTest=function(b){t!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),t=b)};this.setDepthWrite=function(b){q!==b&&(a.depthMask(b),q=b)};this.setColorWrite=function(b){u!==b&&(a.colorMask(b,b,b,b),u=b)};this.setDoubleSided=function(b){w!==b&&(b?a.disable(a.CULL_FACE):
-a.enable(a.CULL_FACE),w=b)};this.setFlipSided=function(b){x!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),x=b)};this.setLineWidth=function(b){b!==z&&(a.lineWidth(b),z=b)};this.setPolygonOffset=function(b,c,d){v!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),v=b);!b||I===c&&K===d||(a.polygonOffset(c,d),I=c,K=d)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+A-1);y!==b&&(a.activeTexture(b),y=b)};this.bindTexture=function(b,d){void 0===y&&c.activeTexture();var e=F[y];
-void 0===e&&(e={type:void 0,texture:void 0},F[y]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);x=w=u=q=t=g=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,m,p,n=a.context,r=a.state,t,q,u,w,x,z;this.render=function(v,I,K,A){if(0!==b.length){v=new THREE.Vector3;var y=A/K,F=.5*K,G=.5*A,C=16/A,J=new THREE.Vector2(C*y,C),O=new THREE.Vector3(1,1,0),E=new THREE.Vector2(1,1);if(void 0===u){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),D=new Uint16Array([0,1,2,0,2,3]);t=n.createBuffer();q=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,t);n.bufferData(n.ARRAY_BUFFER,C,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
-q);n.bufferData(n.ELEMENT_ARRAY_BUFFER,D,n.STATIC_DRAW);x=n.createTexture();z=n.createTexture();r.bindTexture(n.TEXTURE_2D,x);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);r.bindTexture(n.TEXTURE_2D,z);n.texImage2D(n.TEXTURE_2D,0,
+THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===g.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),n.push(e));for(var e=0,f=a.children.length;e<f;e++)d(a.children[e],b)}}var e=a.context,f=a.state,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,m=c.objectsImmediate,r=new THREE.Vector3,n=[],q=THREE.ShaderLib.depthRGBA,t=THREE.UniformsUtils.clone(q.uniforms),
+p=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader}),u=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0}),w=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,skinning:!0}),x=new THREE.ShaderMaterial({uniforms:t,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0,skinning:!0});p._shadowPass=!0;u._shadowPass=!0;w._shadowPass=
+!0;x._shadowPass=!0;var z=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=!1;this.render=function(c,q){if(!1!==z.enabled){var t,A,y,G,F,C,L,O=[];G=0;e.clearColor(1,1,1,1);f.disable(e.BLEND);f.enable(e.CULL_FACE);e.frontFace(e.CCW);z.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);f.setDepthTest(!0);t=0;for(A=b.length;t<A;t++)if(y=b[t],y.castShadow)if(y instanceof THREE.DirectionalLight&&y.shadowCascade)for(F=0;F<y.shadowCascadeCount;F++){var E;
+if(y.shadowCascadeArray[F])E=y.shadowCascadeArray[F];else{var D=y;L=F;E=new THREE.DirectionalLight;E.isVirtual=!0;E.onlyShadow=!0;E.castShadow=!0;E.shadowCameraNear=D.shadowCameraNear;E.shadowCameraFar=D.shadowCameraFar;E.shadowCameraLeft=D.shadowCameraLeft;E.shadowCameraRight=D.shadowCameraRight;E.shadowCameraBottom=D.shadowCameraBottom;E.shadowCameraTop=D.shadowCameraTop;E.shadowCameraVisible=D.shadowCameraVisible;E.shadowDarkness=D.shadowDarkness;E.shadowBias=D.shadowCascadeBias[L];E.shadowMapWidth=
+D.shadowCascadeWidth[L];E.shadowMapHeight=D.shadowCascadeHeight[L];E.pointsWorld=[];E.pointsFrustum=[];var B=E.pointsWorld;C=E.pointsFrustum;for(var N=0;8>N;N++)B[N]=new THREE.Vector3,C[N]=new THREE.Vector3;B=D.shadowCascadeNearZ[L];D=D.shadowCascadeFarZ[L];C[0].set(-1,-1,B);C[1].set(1,-1,B);C[2].set(-1,1,B);C[3].set(1,1,B);C[4].set(-1,-1,D);C[5].set(1,-1,D);C[6].set(-1,1,D);C[7].set(1,1,D);E.originalCamera=q;C=new THREE.Gyroscope;C.position.copy(y.shadowCascadeOffset);C.add(E);C.add(E.target);q.add(C);
+y.shadowCascadeArray[F]=E}L=y;B=F;D=L.shadowCascadeArray[B];D.position.copy(L.position);D.target.position.copy(L.target.position);D.lookAt(D.target);D.shadowCameraVisible=L.shadowCameraVisible;D.shadowDarkness=L.shadowDarkness;D.shadowBias=L.shadowCascadeBias[B];C=L.shadowCascadeNearZ[B];L=L.shadowCascadeFarZ[B];D=D.pointsFrustum;D[0].z=C;D[1].z=C;D[2].z=C;D[3].z=C;D[4].z=L;D[5].z=L;D[6].z=L;D[7].z=L;O[G]=E;G++}else O[G]=y,G++;t=0;for(A=O.length;t<A;t++){y=O[t];y.shadowMap||(F=THREE.LinearFilter,
+z.type===THREE.PCFSoftShadowMap&&(F=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:F,magFilter:F,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);if(!y.shadowCamera){if(y instanceof THREE.SpotLight)y.shadowCamera=new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,y.shadowCameraNear,y.shadowCameraFar);else if(y instanceof THREE.DirectionalLight)y.shadowCamera=
+new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",y);continue}c.add(y.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),c.add(y.cameraHelper));if(y.isVirtual&&E.originalCamera==q){F=q;G=y.shadowCamera;C=y.pointsFrustum;D=y.pointsWorld;
+k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(L=0;8>L;L++)B=D[L],B.copy(C[L]),B.unproject(F),B.applyMatrix4(G.matrixWorldInverse),B.x<k.x&&(k.x=B.x),B.x>l.x&&(l.x=B.x),B.y<k.y&&(k.y=B.y),B.y>l.y&&(l.y=B.y),B.z<k.z&&(k.z=B.z),B.z>l.z&&(l.z=B.z);G.left=k.x;G.right=l.x;G.top=l.y;G.bottom=k.y;G.updateProjectionMatrix()}G=y.shadowMap;C=y.shadowMatrix;F=y.shadowCamera;F.position.setFromMatrixPosition(y.matrixWorld);r.setFromMatrixPosition(y.target.matrixWorld);F.lookAt(r);F.updateMatrixWorld();
+F.matrixWorldInverse.getInverse(F.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);C.multiply(F.projectionMatrix);C.multiply(F.matrixWorldInverse);h.multiplyMatrices(F.projectionMatrix,F.matrixWorldInverse);g.setFromMatrix(h);a.setRenderTarget(G);a.clear();n.length=0;d(c,F);y=0;for(G=n.length;y<G;y++)C=n[y],C=C.object,D=C.material instanceof THREE.MeshFaceMaterial?C.material.materials[0]:
+C.material,L=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&D.morphTargets,B=C instanceof THREE.SkinnedMesh&&D.skinning,L=C.customDepthMaterial?C.customDepthMaterial:B?L?x:w:L?u:p,a.setMaterialFaces(D),a.renderBufferDirect(F,b,null,L,C);y=0;for(G=m.length;y<G;y++)C=m[y],C=C.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,C.matrixWorld),a.renderImmediateObject(F,b,null,p,C))}t=a.getClearColor();A=a.getClearAlpha();e.clearColor(t.r,t.g,
+t.b,A);f.enable(e.BLEND);z.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
+THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),f={},g=null,h=null,k=null,l=null,m=null,r=null,n=null,q=null,t=null,p=null,u=null,w=null,x=null,z=null,v=null,H=null,K=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),A=void 0,y={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);a.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA,
+a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&(a.disableVertexAttribArray(b),e[b]=0)};this.enable=function(b){!0!==f[b]&&(a.enable(b),f[b]=!0)};this.disable=function(b){!1!==f[b]&&(a.disable(b),f[b]=!1)};this.setBlending=function(c,d,e,f,q,p,t){c!==g&&(c===THREE.NoBlending?this.disable(a.BLEND):
+c===THREE.AdditiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?this.enable(a.BLEND):(this.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,
+a.ONE,a.ONE_MINUS_SRC_ALPHA)),g=c);if(c===THREE.CustomBlending){q=q||d;p=p||e;t=t||f;if(d!==h||q!==m)a.blendEquationSeparate(b(d),b(q)),h=d,m=q;if(e!==k||f!==l||p!==r||t!==n)a.blendFuncSeparate(b(e),b(f),b(p),b(t)),k=e,l=f,r=p,n=t}else n=r=m=l=k=h=null};this.setDepthFunc=function(b){if(q!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);
+break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);q=b}};this.setDepthTest=function(b){t!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),t=b)};this.setDepthWrite=function(b){p!==b&&(a.depthMask(b),p=b)};this.setColorWrite=function(b){u!==b&&(a.colorMask(b,b,b,b),u=b)};
+this.setFlipSided=function(b){w!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),w=b)};this.setLineWidth=function(b){b!==x&&(a.lineWidth(b),x=b)};this.setPolygonOffset=function(b,c,d){z!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),z=b);!b||v===c&&H===d||(a.polygonOffset(c,d),v=c,H=d)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+K-1);A!==b&&(a.activeTexture(b),A=b)};this.bindTexture=function(b,d){void 0===A&&c.activeTexture();var e=y[A];void 0===e&&(e={type:void 0,
+texture:void 0},y[A]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);f={};w=u=p=t=g=null}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,m,r,n=a.context,q=a.state,t,p,u,w,x,z;this.render=function(v,H,K,A){if(0!==b.length){v=new THREE.Vector3;var y=A/K,G=.5*K,F=.5*A,C=16/A,L=new THREE.Vector2(C*y,C),O=new THREE.Vector3(1,1,0),E=new THREE.Vector2(1,1);if(void 0===u){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),D=new Uint16Array([0,1,2,0,2,3]);t=n.createBuffer();p=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,t);n.bufferData(n.ARRAY_BUFFER,C,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
+p);n.bufferData(n.ELEMENT_ARRAY_BUFFER,D,n.STATIC_DRAW);x=n.createTexture();z=n.createTexture();q.bindTexture(n.TEXTURE_2D,x);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);q.bindTexture(n.TEXTURE_2D,z);n.texImage2D(n.TEXTURE_2D,0,
 n.RGBA,16,16,0,n.RGBA,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);var C=(w=0<n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
-D=n.createProgram(),B=n.createShader(n.FRAGMENT_SHADER),N=n.createShader(n.VERTEX_SHADER),R="precision "+a.getPrecision()+" float;\n";n.shaderSource(B,R+C.fragmentShader);n.shaderSource(N,R+C.vertexShader);n.compileShader(B);n.compileShader(N);n.attachShader(D,B);n.attachShader(D,N);n.linkProgram(D);u=D;m=n.getAttribLocation(u,"position");p=n.getAttribLocation(u,"uv");c=n.getUniformLocation(u,"renderType");d=n.getUniformLocation(u,"map");e=n.getUniformLocation(u,"occlusionMap");f=n.getUniformLocation(u,
-"opacity");g=n.getUniformLocation(u,"color");h=n.getUniformLocation(u,"scale");k=n.getUniformLocation(u,"rotation");l=n.getUniformLocation(u,"screenPosition")}n.useProgram(u);r.initAttributes();r.enableAttribute(m);r.enableAttribute(p);r.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,t);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(p,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,q);n.disable(n.CULL_FACE);n.depthMask(!1);D=0;for(B=
-b.length;D<B;D++)if(C=16/A,J.set(C*y,C),N=b[D],v.set(N.matrixWorld.elements[12],N.matrixWorld.elements[13],N.matrixWorld.elements[14]),v.applyMatrix4(I.matrixWorldInverse),v.applyProjection(I.projectionMatrix),O.copy(v),E.x=O.x*F+F,E.y=O.y*G+G,w||0<E.x&&E.x<K&&0<E.y&&E.y<A){r.activeTexture(n.TEXTURE0);r.bindTexture(n.TEXTURE_2D,null);r.activeTexture(n.TEXTURE1);r.bindTexture(n.TEXTURE_2D,x);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,E.x-8,E.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,J.x,J.y);n.uniform3f(l,
-O.x,O.y,O.z);r.setBlend(!1);n.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);r.activeTexture(n.TEXTURE0);r.bindTexture(n.TEXTURE_2D,z);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,E.x-8,E.y-8,16,16,0);n.uniform1i(c,1);n.disable(n.DEPTH_TEST);r.activeTexture(n.TEXTURE1);r.bindTexture(n.TEXTURE_2D,x);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);N.positionScreen.copy(O);N.customUpdateCallback?N.customUpdateCallback(N):N.updateLensFlares();n.uniform1i(c,2);r.setBlend(!0);for(var R=
-0,T=N.lensFlares.length;R<T;R++){var P=N.lensFlares[R];.001<P.opacity&&.001<P.scale&&(O.x=P.x,O.y=P.y,O.z=P.z,C=P.size*P.scale/A,J.x=C*y,J.y=C,n.uniform3f(l,O.x,O.y,O.z),n.uniform2f(h,J.x,J.y),n.uniform1f(k,P.rotation),n.uniform1f(f,P.opacity),n.uniform3f(g,P.color.r,P.color.g,P.color.b),r.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),a.setTexture(P.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}n.enable(n.CULL_FACE);n.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,m,p,n,r,t,q,u,w,x;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var v=a.context,I=a.state,K,A,y,F,G=new THREE.Vector3,C=new THREE.Quaternion,J=new THREE.Vector3;this.render=function(O,E){if(0!==b.length){if(void 0===y){var D=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),B=new Uint16Array([0,1,2,0,2,3]);K=v.createBuffer();A=v.createBuffer();v.bindBuffer(v.ARRAY_BUFFER,K);v.bufferData(v.ARRAY_BUFFER,D,v.STATIC_DRAW);v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,
+D=n.createProgram(),B=n.createShader(n.FRAGMENT_SHADER),N=n.createShader(n.VERTEX_SHADER),R="precision "+a.getPrecision()+" float;\n";n.shaderSource(B,R+C.fragmentShader);n.shaderSource(N,R+C.vertexShader);n.compileShader(B);n.compileShader(N);n.attachShader(D,B);n.attachShader(D,N);n.linkProgram(D);u=D;m=n.getAttribLocation(u,"position");r=n.getAttribLocation(u,"uv");c=n.getUniformLocation(u,"renderType");d=n.getUniformLocation(u,"map");e=n.getUniformLocation(u,"occlusionMap");f=n.getUniformLocation(u,
+"opacity");g=n.getUniformLocation(u,"color");h=n.getUniformLocation(u,"scale");k=n.getUniformLocation(u,"rotation");l=n.getUniformLocation(u,"screenPosition")}n.useProgram(u);q.initAttributes();q.enableAttribute(m);q.enableAttribute(r);q.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,t);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(r,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,p);q.disable(n.CULL_FACE);n.depthMask(!1);D=0;for(B=
+b.length;D<B;D++)if(C=16/A,L.set(C*y,C),N=b[D],v.set(N.matrixWorld.elements[12],N.matrixWorld.elements[13],N.matrixWorld.elements[14]),v.applyMatrix4(H.matrixWorldInverse),v.applyProjection(H.projectionMatrix),O.copy(v),E.x=O.x*G+G,E.y=O.y*F+F,w||0<E.x&&E.x<K&&0<E.y&&E.y<A){q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,null);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,x);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,E.x-8,E.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,L.x,L.y);n.uniform3f(l,
+O.x,O.y,O.z);q.disable(n.BLEND);n.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,z);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,E.x-8,E.y-8,16,16,0);n.uniform1i(c,1);n.disable(n.DEPTH_TEST);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,x);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);N.positionScreen.copy(O);N.customUpdateCallback?N.customUpdateCallback(N):N.updateLensFlares();n.uniform1i(c,2);q.enable(n.BLEND);for(var R=
+0,T=N.lensFlares.length;R<T;R++){var P=N.lensFlares[R];.001<P.opacity&&.001<P.scale&&(O.x=P.x,O.y=P.y,O.z=P.z,C=P.size*P.scale/A,L.x=C*y,L.y=C,n.uniform3f(l,O.x,O.y,O.z),n.uniform2f(h,L.x,L.y),n.uniform1f(k,P.rotation),n.uniform1f(f,P.opacity),n.uniform3f(g,P.color.r,P.color.g,P.color.b),q.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),a.setTexture(P.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}q.enable(n.CULL_FACE);n.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,m,r,n,q,t,p,u,w,x;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var v=a.context,H=a.state,K,A,y,G,F=new THREE.Vector3,C=new THREE.Quaternion,L=new THREE.Vector3;this.render=function(O,E){if(0!==b.length){if(void 0===y){var D=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),B=new Uint16Array([0,1,2,0,2,3]);K=v.createBuffer();A=v.createBuffer();v.bindBuffer(v.ARRAY_BUFFER,K);v.bufferData(v.ARRAY_BUFFER,D,v.STATIC_DRAW);v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,
 A);v.bufferData(v.ELEMENT_ARRAY_BUFFER,B,v.STATIC_DRAW);var D=v.createProgram(),B=v.createShader(v.VERTEX_SHADER),N=v.createShader(v.FRAGMENT_SHADER);v.shaderSource(B,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
 v.shaderSource(N,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = 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"));
-v.compileShader(B);v.compileShader(N);v.attachShader(D,B);v.attachShader(D,N);v.linkProgram(D);y=D;w=v.getAttribLocation(y,"position");x=v.getAttribLocation(y,"uv");c=v.getUniformLocation(y,"uvOffset");d=v.getUniformLocation(y,"uvScale");e=v.getUniformLocation(y,"rotation");f=v.getUniformLocation(y,"scale");g=v.getUniformLocation(y,"color");h=v.getUniformLocation(y,"map");k=v.getUniformLocation(y,"opacity");l=v.getUniformLocation(y,"modelViewMatrix");m=v.getUniformLocation(y,"projectionMatrix");p=
-v.getUniformLocation(y,"fogType");n=v.getUniformLocation(y,"fogDensity");r=v.getUniformLocation(y,"fogNear");t=v.getUniformLocation(y,"fogFar");q=v.getUniformLocation(y,"fogColor");u=v.getUniformLocation(y,"alphaTest");D=document.createElement("canvas");D.width=8;D.height=8;B=D.getContext("2d");B.fillStyle="white";B.fillRect(0,0,8,8);F=new THREE.Texture(D);F.needsUpdate=!0}v.useProgram(y);I.initAttributes();I.enableAttribute(w);I.enableAttribute(x);I.disableUnusedAttributes();v.disable(v.CULL_FACE);
-I.setBlend(!0);v.bindBuffer(v.ARRAY_BUFFER,K);v.vertexAttribPointer(w,2,v.FLOAT,!1,16,0);v.vertexAttribPointer(x,2,v.FLOAT,!1,16,8);v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,A);v.uniformMatrix4fv(m,!1,E.projectionMatrix.elements);I.activeTexture(v.TEXTURE0);v.uniform1i(h,0);B=D=0;(N=O.fog)?(v.uniform3f(q,N.color.r,N.color.g,N.color.b),N instanceof THREE.Fog?(v.uniform1f(r,N.near),v.uniform1f(t,N.far),v.uniform1i(p,1),B=D=1):N instanceof THREE.FogExp2&&(v.uniform1f(n,N.density),v.uniform1i(p,2),B=D=2)):
-(v.uniform1i(p,0),B=D=0);for(var N=0,R=b.length;N<R;N++){var T=b[N];T._modelViewMatrix.multiplyMatrices(E.matrixWorldInverse,T.matrixWorld);T.z=-T._modelViewMatrix.elements[14]}b.sort(z);for(var P=[],N=0,R=b.length;N<R;N++){var T=b[N],U=T.material;v.uniform1f(u,U.alphaTest);v.uniformMatrix4fv(l,!1,T._modelViewMatrix.elements);T.matrixWorld.decompose(G,C,J);P[0]=J.x;P[1]=J.y;T=0;O.fog&&U.fog&&(T=B);D!==T&&(v.uniform1i(p,T),D=T);null!==U.map?(v.uniform2f(c,U.map.offset.x,U.map.offset.y),v.uniform2f(d,
-U.map.repeat.x,U.map.repeat.y)):(v.uniform2f(c,0,0),v.uniform2f(d,1,1));v.uniform1f(k,U.opacity);v.uniform3f(g,U.color.r,U.color.g,U.color.b);v.uniform1f(e,U.rotation);v.uniform2fv(f,P);I.setBlending(U.blending,U.blendEquation,U.blendSrc,U.blendDst);I.setDepthTest(U.depthTest);I.setDepthWrite(U.depthWrite);U.map&&U.map.image&&U.map.image.width?a.setTexture(U.map,0):a.setTexture(F,0);v.drawElements(v.TRIANGLES,6,v.UNSIGNED_SHORT,0)}v.enable(v.CULL_FACE);a.resetGLState()}}};
+v.compileShader(B);v.compileShader(N);v.attachShader(D,B);v.attachShader(D,N);v.linkProgram(D);y=D;w=v.getAttribLocation(y,"position");x=v.getAttribLocation(y,"uv");c=v.getUniformLocation(y,"uvOffset");d=v.getUniformLocation(y,"uvScale");e=v.getUniformLocation(y,"rotation");f=v.getUniformLocation(y,"scale");g=v.getUniformLocation(y,"color");h=v.getUniformLocation(y,"map");k=v.getUniformLocation(y,"opacity");l=v.getUniformLocation(y,"modelViewMatrix");m=v.getUniformLocation(y,"projectionMatrix");r=
+v.getUniformLocation(y,"fogType");n=v.getUniformLocation(y,"fogDensity");q=v.getUniformLocation(y,"fogNear");t=v.getUniformLocation(y,"fogFar");p=v.getUniformLocation(y,"fogColor");u=v.getUniformLocation(y,"alphaTest");D=document.createElement("canvas");D.width=8;D.height=8;B=D.getContext("2d");B.fillStyle="white";B.fillRect(0,0,8,8);G=new THREE.Texture(D);G.needsUpdate=!0}v.useProgram(y);H.initAttributes();H.enableAttribute(w);H.enableAttribute(x);H.disableUnusedAttributes();H.disable(v.CULL_FACE);
+H.enable(v.BLEND);v.bindBuffer(v.ARRAY_BUFFER,K);v.vertexAttribPointer(w,2,v.FLOAT,!1,16,0);v.vertexAttribPointer(x,2,v.FLOAT,!1,16,8);v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,A);v.uniformMatrix4fv(m,!1,E.projectionMatrix.elements);H.activeTexture(v.TEXTURE0);v.uniform1i(h,0);B=D=0;(N=O.fog)?(v.uniform3f(p,N.color.r,N.color.g,N.color.b),N instanceof THREE.Fog?(v.uniform1f(q,N.near),v.uniform1f(t,N.far),v.uniform1i(r,1),B=D=1):N instanceof THREE.FogExp2&&(v.uniform1f(n,N.density),v.uniform1i(r,2),B=D=2)):
+(v.uniform1i(r,0),B=D=0);for(var N=0,R=b.length;N<R;N++){var T=b[N];T._modelViewMatrix.multiplyMatrices(E.matrixWorldInverse,T.matrixWorld);T.z=-T._modelViewMatrix.elements[14]}b.sort(z);for(var P=[],N=0,R=b.length;N<R;N++){var T=b[N],U=T.material;v.uniform1f(u,U.alphaTest);v.uniformMatrix4fv(l,!1,T._modelViewMatrix.elements);T.matrixWorld.decompose(F,C,L);P[0]=L.x;P[1]=L.y;T=0;O.fog&&U.fog&&(T=B);D!==T&&(v.uniform1i(r,T),D=T);null!==U.map?(v.uniform2f(c,U.map.offset.x,U.map.offset.y),v.uniform2f(d,
+U.map.repeat.x,U.map.repeat.y)):(v.uniform2f(c,0,0),v.uniform2f(d,1,1));v.uniform1f(k,U.opacity);v.uniform3f(g,U.color.r,U.color.g,U.color.b);v.uniform1f(e,U.rotation);v.uniform2fv(f,P);H.setBlending(U.blending,U.blendEquation,U.blendSrc,U.blendDst);H.setDepthTest(U.depthTest);H.setDepthWrite(U.depthWrite);U.map&&U.map.image&&U.map.image.width?a.setTexture(U.map,0):a.setTexture(G,0);v.drawElements(v.TRIANGLES,6,v.UNSIGNED_SHORT,0)}H.enable(v.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);e.load(a,function(a){f.image=a;f.needsUpdate=!0;c&&c(f)},void 0,function(a){d&&d(a)});f.sourceFile=a;return f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a;g+=1;6===g&&(f.needsUpdate=!0,c&&
 c(f))},void 0,d)};for(var h=0,k=a.length;h<k;++h)b(h);return f},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");
-f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,m=0;m<d;m++)for(var p=0;p<e;p++){var n=0>p-1?0:p-1,r=p+1>e-1?e-1:p+1,t=0>m-1?0:m-1,q=m+1>d-1?d-1:m+1,u=[],w=[0,0,h[4*(p*d+m)]/255*b];u.push([-1,0,h[4*(p*d+t)]/255*b]);u.push([-1,-1,h[4*(n*d+t)]/255*b]);u.push([0,-1,h[4*(n*d+m)]/255*b]);u.push([1,-1,h[4*(n*d+q)]/255*b]);u.push([1,0,h[4*(p*d+q)]/255*b]);u.push([1,1,h[4*(r*d+q)]/255*b]);u.push([0,1,h[4*(r*d+m)]/255*
-b]);u.push([-1,1,h[4*(r*d+t)]/255*b]);n=[];t=u.length;for(r=0;r<t;r++){var q=u[r],x=u[(r+1)%t],q=[q[0]-w[0],q[1]-w[1],q[2]-w[2]],x=[x[0]-w[0],x[1]-w[1],x[2]-w[2]];n.push(c([q[1]*x[2]-q[2]*x[1],q[2]*x[0]-q[0]*x[2],q[0]*x[1]-q[1]*x[0]]))}u=[0,0,0];for(r=0;r<n.length;r++)u[0]+=n[r][0],u[1]+=n[r][1],u[2]+=n[r][2];u[0]/=n.length;u[1]/=n.length;u[2]/=n.length;w=4*(p*d+m);l[w]=(u[0]+1)/2*255|0;l[w+1]=(u[1]+1)/2*255|0;l[w+2]=255*u[2]|0;l[w+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
+f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,m=0;m<d;m++)for(var r=0;r<e;r++){var n=0>r-1?0:r-1,q=r+1>e-1?e-1:r+1,t=0>m-1?0:m-1,p=m+1>d-1?d-1:m+1,u=[],w=[0,0,h[4*(r*d+m)]/255*b];u.push([-1,0,h[4*(r*d+t)]/255*b]);u.push([-1,-1,h[4*(n*d+t)]/255*b]);u.push([0,-1,h[4*(n*d+m)]/255*b]);u.push([1,-1,h[4*(n*d+p)]/255*b]);u.push([1,0,h[4*(r*d+p)]/255*b]);u.push([1,1,h[4*(q*d+p)]/255*b]);u.push([0,1,h[4*(q*d+m)]/255*
+b]);u.push([-1,1,h[4*(q*d+t)]/255*b]);n=[];t=u.length;for(q=0;q<t;q++){var p=u[q],x=u[(q+1)%t],p=[p[0]-w[0],p[1]-w[1],p[2]-w[2]],x=[x[0]-w[0],x[1]-w[1],x[2]-w[2]];n.push(c([p[1]*x[2]-p[2]*x[1],p[2]*x[0]-p[0]*x[2],p[0]*x[1]-p[1]*x[0]]))}u=[0,0,0];for(q=0;q<n.length;q++)u[0]+=n[q][0],u[1]+=n[q][1],u[2]+=n[q][2];u[0]/=n.length;u[1]/=n.length;u[2]/=n.length;w=4*(r*d+m);l[w]=(u[0]+1)/2*255|0;l[w+1]=(u[1]+1)/2*255|0;l[w+2]=255*u[2]|0;l[w+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face.toLowerCase()][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing.";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=
-a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,m,p,n,r,t,q,u,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;m=b[a++]*c;e.moveTo(k,m);
-break;case "l":k=b[a++]*c+d;m=b[a++]*c;e.lineTo(k,m);break;case "q":k=b[a++]*c+d;m=b[a++]*c;r=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(r,t,k,m);if(g=f[f.length-1])for(p=g.x,n=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,p,r,k);THREE.Shape.Utils.b2(x,n,t,m)}break;case "b":if(k=b[a++]*c+d,m=b[a++]*c,r=b[a++]*c+d,t=b[a++]*c,q=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(r,t,q,u,k,m),g=f[f.length-1])for(p=g.x,n=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,p,r,q,k),THREE.Shape.Utils.b3(x,
+a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,m,r,n,q,t,p,u,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;m=b[a++]*c;e.moveTo(k,m);
+break;case "l":k=b[a++]*c+d;m=b[a++]*c;e.lineTo(k,m);break;case "q":k=b[a++]*c+d;m=b[a++]*c;q=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(q,t,k,m);if(g=f[f.length-1])for(r=g.x,n=g.y,g=1,h=this.divisions;g<=h;g++){var x=g/h;THREE.Shape.Utils.b2(x,r,q,k);THREE.Shape.Utils.b2(x,n,t,m)}break;case "b":if(k=b[a++]*c+d,m=b[a++]*c,q=b[a++]*c+d,t=b[a++]*c,p=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,t,p,u,k,m),g=f[f.length-1])for(r=g.x,n=g.y,g=1,h=this.divisions;g<=h;g++)x=g/h,THREE.Shape.Utils.b3(x,r,q,p,k),THREE.Shape.Utils.b3(x,
 n,t,u,m)}return{offset:w.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,m;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var n;a:{var r=n=void 0,t=void 0,q=void 0,
-u=void 0,w=void 0,x=void 0,z=void 0,v=void 0,r=a[g[k]].x,t=a[g[k]].y,q=a[g[l]].x,u=a[g[l]].y,w=a[g[m]].x,x=a[g[m]].y;if(1E-10>(q-r)*(x-t)-(u-t)*(w-r))n=!1;else{var I=void 0,K=void 0,A=void 0,y=void 0,F=void 0,G=void 0,C=void 0,J=void 0,O=void 0,E=void 0,O=J=C=v=z=void 0,I=w-q,K=x-u,A=r-w,y=t-x,F=q-r,G=u-t;for(n=0;n<e;n++)if(z=a[g[n]].x,v=a[g[n]].y,!(z===r&&v===t||z===q&&v===u||z===w&&v===x)&&(C=z-r,J=v-t,O=z-q,E=v-u,z-=w,v-=x,O=I*E-K*O,C=F*J-G*C,J=A*v-y*z,-1E-10<=O&&-1E-10<=J&&-1E-10<=C)){n=!1;break a}n=
-!0}}if(n){f.push([a[g[k]],a[g[l]],a[g[m]]]);h.push([g[k],g[l],g[m]]);k=l;for(m=l+1;m<e;k++,m++)g[k]=g[m];e--;p=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,m;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var r=2*e;for(l=e-1;2<e;){if(0>=r--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var n;a:{var q=n=void 0,t=void 0,p=void 0,
+u=void 0,w=void 0,x=void 0,z=void 0,v=void 0,q=a[g[k]].x,t=a[g[k]].y,p=a[g[l]].x,u=a[g[l]].y,w=a[g[m]].x,x=a[g[m]].y;if(1E-10>(p-q)*(x-t)-(u-t)*(w-q))n=!1;else{var H=void 0,K=void 0,A=void 0,y=void 0,G=void 0,F=void 0,C=void 0,L=void 0,O=void 0,E=void 0,O=L=C=v=z=void 0,H=w-p,K=x-u,A=q-w,y=t-x,G=p-q,F=u-t;for(n=0;n<e;n++)if(z=a[g[n]].x,v=a[g[n]].y,!(z===q&&v===t||z===p&&v===u||z===w&&v===x)&&(C=z-q,L=v-t,O=z-p,E=v-u,z-=w,v-=x,O=H*E-K*O,C=G*L-F*C,L=A*v-y*z,-1E-10<=O&&-1E-10<=L&&-1E-10<=C)){n=!1;break a}n=
+!0}}if(n){f.push([a[g[k]],a[g[l]],a[g[m]]]);h.push([g[k],g[l],g[m]]);k=l;for(m=l+1;m<e;k++,m++)g[k]=g[m];e--;r=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;
 THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
 THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{var a=this.context.createBufferSource();a.buffer=this.source.buffer;a.loop=this.source.loop;a.onended=this.source.onended;a.connect(this.panner);a.start(0,this.startTime);this.isPlaying=!0;this.source=a}};THREE.Audio.prototype.pause=function(){this.source.stop();this.startTime=this.context.currentTime};THREE.Audio.prototype.stop=function(){this.source.stop();this.startTime=0};
@@ -671,7 +671,7 @@ THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)
 THREE.Curve.create=function(a,b){a.prototype=Object.create(THREE.Curve.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=!1};THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype);THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};
 THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a};
-THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,m,p=a[0]instanceof THREE.Vector3;m=p?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),p&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),m.add(h);a={minX:e,minY:f,maxX:b,maxY:c};p&&(a.maxZ=d,a.minZ=g);return a};
+THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,m,r=a[0]instanceof THREE.Vector3;m=r?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),r&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),m.add(h);a={minX:e,minY:f,maxX:b,maxY:c};r&&(a.maxZ=d,a.minZ=g);return a};
 THREE.CurvePath.prototype.createPointsGeometry=function(a){a=this.getPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){a=this.getSpacedPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vector3(a[c].x,a[c].y,a[c].z||0));return b};THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)};
 THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};
 THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,f,g,h,k;d=0;for(e=a.length;d<e;d++)f=a[d],g=f.x,h=f.y,k=g/c.maxX,k=b.getUtoTmapping(k,g),g=b.getPoint(k),k=b.getTangent(k),k.set(-k.y,k.x).multiplyScalar(h),f.x=g.x+k.x,f.y=g.y+k.y;return a};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);THREE.Gyroscope.prototype.constructor=THREE.Gyroscope;
@@ -684,22 +684,22 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};
 THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,m,p,n,r,t,q;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];p=f[0];n=f[1];0<c.length?(g=c[c.length-1],r=g.x,t=g.y):(g=this.actions[d-
-1].args,r=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)q=f/a,g=THREE.Shape.Utils.b2(q,r,p,h),q=THREE.Shape.Utils.b2(q,t,n,k),c.push(new THREE.Vector2(g,q));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];p=f[0];n=f[1];l=f[2];m=f[3];0<c.length?(g=c[c.length-1],r=g.x,t=g.y):(g=this.actions[d-1].args,r=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)q=f/a,g=THREE.Shape.Utils.b3(q,r,p,l,h),q=THREE.Shape.Utils.b3(q,t,n,m,k),c.push(new THREE.Vector2(g,q));break;case THREE.PathActions.CSPLINE_THRU:g=
-this.actions[d-1].args;q=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;q=q.concat(f[0]);q=new THREE.SplineCurve(q);for(f=1;f<=g;f++)c.push(q.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];n=f[2];l=f[3];g=f[4];p=!!f[5];r=g-l;t=2*a;for(f=1;f<=t;f++)q=f/t,p||(q=1-q),q=l+q*r,g=h+n*Math.cos(q),q=k+n*Math.sin(q),c.push(new THREE.Vector2(g,q));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],n=f[2],m=f[3],l=f[4],g=f[5],p=!!f[6],r=g-l,t=2*a,f=1;f<=t;f++)q=f/t,p||
-(q=1-q),q=l+q*r,g=h+n*Math.cos(q),q=k+m*Math.sin(q),c.push(new THREE.Vector2(g,q))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
+THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,m,r,n,q,t,p;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];r=f[0];n=f[1];0<c.length?(g=c[c.length-1],q=g.x,t=g.y):(g=this.actions[d-
+1].args,q=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)p=f/a,g=THREE.Shape.Utils.b2(p,q,r,h),p=THREE.Shape.Utils.b2(p,t,n,k),c.push(new THREE.Vector2(g,p));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];r=f[0];n=f[1];l=f[2];m=f[3];0<c.length?(g=c[c.length-1],q=g.x,t=g.y):(g=this.actions[d-1].args,q=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)p=f/a,g=THREE.Shape.Utils.b3(p,q,r,l,h),p=THREE.Shape.Utils.b3(p,t,n,m,k),c.push(new THREE.Vector2(g,p));break;case THREE.PathActions.CSPLINE_THRU:g=
+this.actions[d-1].args;p=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;p=p.concat(f[0]);p=new THREE.SplineCurve(p);for(f=1;f<=g;f++)c.push(p.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];n=f[2];l=f[3];g=f[4];r=!!f[5];q=g-l;t=2*a;for(f=1;f<=t;f++)p=f/t,r||(p=1-p),p=l+p*q,g=h+n*Math.cos(p),p=k+n*Math.sin(p),c.push(new THREE.Vector2(g,p));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],n=f[2],m=f[3],l=f[4],g=f[5],r=!!f[6],q=g-l,t=2*a,f=1;f<=t;f++)p=f/t,r||
+(p=1-p),p=l+p*q,g=h+n*Math.cos(p),p=k+m*Math.sin(p),c.push(new THREE.Vector2(g,p))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
 THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,l=h.y-g.y;if(1E-10<Math.abs(l)){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&
 a.x<=h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d===THREE.PathActions.MOVE_TO&&0!==g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!==g.actions.length&&f.push(g);return f}(this.actions);if(0===e.length)return[];if(!0===b)return c(e);var f,g,h,k=[];if(1===e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),
-l=a?!l:l;h=[];var m=[],p=[],n=0,r;m[n]=void 0;p[n]=[];var t,q;t=0;for(q=e.length;t<q;t++)g=e[t],r=g.getPoints(),f=THREE.Shape.Utils.isClockWise(r),(f=a?!f:f)?(!l&&m[n]&&n++,m[n]={s:new THREE.Shape,p:r},m[n].s.actions=g.actions,m[n].s.curves=g.curves,l&&n++,p[n]=[]):p[n].push({h:g,p:r[0]});if(!m[0])return c(e);if(1<m.length){t=!1;q=[];g=0;for(e=m.length;g<e;g++)h[g]=[];g=0;for(e=m.length;g<e;g++)for(f=p[g],l=0;l<f.length;l++){n=f[l];r=!0;for(var u=0;u<m.length;u++)d(n.p,m[u].p)&&(g!==u&&q.push({froms:g,
-tos:u,hole:l}),r?(r=!1,h[u].push(n)):t=!0);r&&h[g].push(n)}0<q.length&&(t||(p=h))}t=0;for(q=m.length;t<q;t++)for(h=m[t].s,k.push(h),g=p[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
+l=a?!l:l;h=[];var m=[],r=[],n=0,q;m[n]=void 0;r[n]=[];var t,p;t=0;for(p=e.length;t<p;t++)g=e[t],q=g.getPoints(),f=THREE.Shape.Utils.isClockWise(q),(f=a?!f:f)?(!l&&m[n]&&n++,m[n]={s:new THREE.Shape,p:q},m[n].s.actions=g.actions,m[n].s.curves=g.curves,l&&n++,r[n]=[]):r[n].push({h:g,p:q[0]});if(!m[0])return c(e);if(1<m.length){t=!1;p=[];g=0;for(e=m.length;g<e;g++)h[g]=[];g=0;for(e=m.length;g<e;g++)for(f=r[g],l=0;l<f.length;l++){n=f[l];q=!0;for(var u=0;u<m.length;u++)d(n.p,m[u].p)&&(g!==u&&p.push({froms:g,
+tos:u,hole:l}),q?(q=!1,h[u].push(n)):t=!0);q&&h[g].push(n)}0<p.length&&(t||(r=h))}t=0;for(p=m.length;t<p;t++)for(h=m[t].s,k.push(h),g=r[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,m=a.x-d.x,p=a.y-d.y,A=h*k-g*l,y=h*m-g*p;if(1E-10<Math.abs(A)){if(0<A){if(0>y||y>A)return[];k=l*m-k*p;if(0>k||k>A)return[]}else{if(0<y||y<A)return[];k=l*m-k*p;if(0<k||k<A)return[]}if(0===k)return!f||0!==y&&y!==A?[a]:[];if(k===A)return!f||0!==y&&y!==A?[b]:[];if(0===
-y)return[d];if(y===A)return[e];f=k/A;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==y||l*m!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,A=d.x,l=e,d=e.x):(b=e,A=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,A=d.y,l=e,d=e.y):(b=e,A=e.y,l=d,d=d.y));return k<=A?a<A?[]:a===A?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,m=a.x-d.x,r=a.y-d.y,A=h*k-g*l,y=h*m-g*r;if(1E-10<Math.abs(A)){if(0<A){if(0>y||y>A)return[];k=l*m-k*r;if(0>k||k>A)return[]}else{if(0<y||y<A)return[];k=l*m-k*r;if(0<k||k<A)return[]}if(0===k)return!f||0!==y&&y!==A?[a]:[];if(k===A)return!f||0!==y&&y!==A?[b]:[];if(0===
+y)return[d];if(y===A)return[e];f=k/A;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==y||l*m!==k*r)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,A=d.x,l=e,d=e.x):(b=e,A=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,A=d.y,l=e,d=e.y):(b=e,A=e.y,l=d,d=d.y));return k<=A?a<A?[]:a===A?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
 k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,m={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==m[l]&&console.warn("THREE.Shape: Duplicate point",l),m[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
-0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],m,p,K,A,y,F=[],G,C,J,O=0;for(m=b.length;O<m;O++)l.push(O);G=0;for(var E=2*
-l.length;0<l.length;){E--;if(0>E){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=G;p<h.length;p++){K=h[p];m=-1;for(O=0;O<l.length;O++)if(A=l[O],y=K.x+":"+K.y+":"+A,void 0===F[y]){k=b[A];for(C=0;C<k.length;C++)if(A=k[C],c(p,C)&&!f(K,A)&&!g(K,A)){m=C;l.splice(O,1);G=h.slice(0,p+1);A=h.slice(p);C=k.slice(m);J=k.slice(0,m+1);h=G.concat(C).concat(J).concat(A);G=p;break}if(0<=m)break;F[y]=!0}if(0<=m)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(f,
-!1);f=0;for(g=p.length;f<g;f++)for(k=p[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=m[l],void 0!==l&&(k[h]=l);return p.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-
+0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],m,r,K,A,y,G=[],F,C,L,O=0;for(m=b.length;O<m;O++)l.push(O);F=0;for(var E=2*
+l.length;0<l.length;){E--;if(0>E){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(r=F;r<h.length;r++){K=h[r];m=-1;for(O=0;O<l.length;O++)if(A=l[O],y=K.x+":"+K.y+":"+A,void 0===G[y]){k=b[A];for(C=0;C<k.length;C++)if(A=k[C],c(r,C)&&!f(K,A)&&!g(K,A)){m=C;l.splice(O,1);F=h.slice(0,r+1);A=h.slice(r);C=k.slice(m);L=k.slice(0,m+1);h=F.concat(C).concat(L).concat(A);F=r;break}if(0<=m)break;G[y]=!0}if(0<=m)break}}return h}(a,b);var r=THREE.FontUtils.Triangulate(f,
+!1);f=0;for(g=r.length;f<g;f++)for(k=r[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=m[l],void 0!==l&&(k[h]=l);return r.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
 a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
 THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
 THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return b};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);return b.normalize()};
@@ -712,9 +712,9 @@ THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1
 THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b=new THREE.Vector3;b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return b});
 THREE.SplineCurve3=THREE.Curve.create(function(a){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3");this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,
 b.z,a);return c});
-THREE.CatmullRomCurve3=function(){function a(){}var b=new THREE.Vector3,c=new a,d=new a,e=new a;a.prototype.init=function(a,b,c,d){this.c0=a;this.c1=c;this.c2=-3*a+3*b-2*c-d;this.c3=2*a-2*b+c+d};a.prototype.initNonuniformCatmullRom=function(a,b,c,d,e,m,p){a=((b-a)/e-(c-a)/(e+m)+(c-b)/m)*m;d=((c-b)/m-(d-b)/(m+p)+(d-c)/p)*m;this.init(b,c,a,d)};a.prototype.initCatmullRom=function(a,b,c,d,e){this.init(b,c,e*(c-a),e*(d-b))};a.prototype.calc=function(a){var b=a*a;return this.c0+this.c1*a+this.c2*b+this.c3*
-b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var g=this.points,h,k;k=g.length;2>k&&console.log("duh, you need at least 2 points");a*=k-1;h=Math.floor(a);a-=h;0===a&&h===k-1&&(h=k-2,a=1);var l,m,p;0===h?(b.subVectors(g[0],g[1]).add(g[0]),l=b):l=g[h-1];m=g[h];p=g[h+1];h+2<k?g=g[h+2]:(b.subVectors(g[k-1],g[k-2]).add(g[k-2]),g=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var n="chordal"===this.type?.5:.25;k=Math.pow(l.distanceToSquared(m),n);
-h=Math.pow(m.distanceToSquared(p),n);n=Math.pow(p.distanceToSquared(g),n);1E-4>h&&(h=1);1E-4>k&&(k=h);1E-4>n&&(n=h);c.initNonuniformCatmullRom(l.x,m.x,p.x,g.x,k,h,n);d.initNonuniformCatmullRom(l.y,m.y,p.y,g.y,k,h,n);e.initNonuniformCatmullRom(l.z,m.z,p.z,g.z,k,h,n)}else"catmullrom"===this.type&&(k=void 0!==this.tension?this.tension:.5,c.initCatmullRom(l.x,m.x,p.x,g.x,k),d.initCatmullRom(l.y,m.y,p.y,g.y,k),e.initCatmullRom(l.z,m.z,p.z,g.z,k));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}();
+THREE.CatmullRomCurve3=function(){function a(){}var b=new THREE.Vector3,c=new a,d=new a,e=new a;a.prototype.init=function(a,b,c,d){this.c0=a;this.c1=c;this.c2=-3*a+3*b-2*c-d;this.c3=2*a-2*b+c+d};a.prototype.initNonuniformCatmullRom=function(a,b,c,d,e,m,r){a=((b-a)/e-(c-a)/(e+m)+(c-b)/m)*m;d=((c-b)/m-(d-b)/(m+r)+(d-c)/r)*m;this.init(b,c,a,d)};a.prototype.initCatmullRom=function(a,b,c,d,e){this.init(b,c,e*(c-a),e*(d-b))};a.prototype.calc=function(a){var b=a*a;return this.c0+this.c1*a+this.c2*b+this.c3*
+b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var g=this.points,h,k;k=g.length;2>k&&console.log("duh, you need at least 2 points");a*=k-1;h=Math.floor(a);a-=h;0===a&&h===k-1&&(h=k-2,a=1);var l,m,r;0===h?(b.subVectors(g[0],g[1]).add(g[0]),l=b):l=g[h-1];m=g[h];r=g[h+1];h+2<k?g=g[h+2]:(b.subVectors(g[k-1],g[k-2]).add(g[k-2]),g=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var n="chordal"===this.type?.5:.25;k=Math.pow(l.distanceToSquared(m),n);
+h=Math.pow(m.distanceToSquared(r),n);n=Math.pow(r.distanceToSquared(g),n);1E-4>h&&(h=1);1E-4>k&&(k=h);1E-4>n&&(n=h);c.initNonuniformCatmullRom(l.x,m.x,r.x,g.x,k,h,n);d.initNonuniformCatmullRom(l.y,m.y,r.y,g.y,k,h,n);e.initNonuniformCatmullRom(l.z,m.z,r.z,g.z,k,h,n)}else"catmullrom"===this.type&&(k=void 0!==this.tension?this.tension:.5,c.initCatmullRom(l.x,m.x,r.x,g.x,k),d.initCatmullRom(l.y,m.y,r.y,g.y,k),e.initCatmullRom(l.z,m.z,r.z,g.z,k));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}();
 THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0<c?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],f=b[(c+1)%b.length],b=b[(c+2)%b.length],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a);return c});
 THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){console.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){console.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){console.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(a){if(!0===a.initialized)return a;for(var b=0;b<a.hierarchy.length;b++){for(var c=0;c<a.hierarchy[b].keys.length;c++)if(0>a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time=
 0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;c<a.hierarchy[b].keys.length;c++)for(var e=0;e<a.hierarchy[b].keys[c].morphTargets.length;e++){var f=a.hierarchy[b].keys[c].morphTargets[e];d[f]=-1}a.hierarchy[b].usedMorphTargets=d;for(c=0;c<a.hierarchy[b].keys.length;c++){var g=
@@ -723,12 +723,12 @@ THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(
 for(b=0;b<this.animations.length;b++)this.animations[b].update(a)}};THREE.Animation=function(a,b){this.root=a;this.data=THREE.AnimationHandler.init(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=!0;this.weight=0;this.interpolationType=THREE.AnimationHandler.LINEAR};
 THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","scl"],play:function(a,b){this.currentTime=void 0!==a?a:0;this.weight=void 0!==b?b:1;this.isPlaying=!0;this.reset();THREE.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1;THREE.AnimationHandler.stop(this)},reset:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});
 var d=this.data.name,e=c.animationCache.animations,f=e[d];void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f);for(c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(d,a,1);g.time<this.currentTime&&g.index>e.index;)e=g,g=this.getNextKeyWith(d,a,g.index+1);f.prevKey[d]=e;f.nextKey[d]=g}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a].animationCache;void 0!==
-c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,n,r,t,q;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];r=a[c[1]];t=a[c[2]];q=a[c[3]];c=e*e;n=e*c;d[0]=f(p[0],r[0],t[0],q[0],e,c,n);d[1]=f(p[1],r[1],t[1],q[1],e,c,n);d[2]=f(p[2],r[2],t[2],q[2],e,c,n);return d},f=function(a,b,c,d,
-e,f,n){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*n+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],m=k.animationCache.blending,p=0;3>p;p++){var n=this.keyTypes[p],
-r=l.prevKey[n],t=l.nextKey[n];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&r.time>=this.currentTime){r=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(n,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(n,f,t.index+1);l.prevKey[n]=r;l.nextKey[n]=t}var q=(this.currentTime-r.time)/(t.time-r.time),u=r[n],w=t[n];0>q&&(q=0);1<q&&(q=1);if("pos"===n)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(w[0]-u[0])*q,c.y=u[1]+(w[1]-u[1])*q,
-c.z=u[2]+(w[2]-u[2])*q,r=this.weight/(this.weight+m.positionWeight),k.position.lerp(c,r),m.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,r.index-1).pos,a[1]=u,a[2]=w,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,q=.33*q+.33,t=e(a,q),r=this.weight/(this.weight+m.positionWeight),m.positionWeight+=this.weight,n=k.position,n.x+=(t[0]-n.x)*r,n.y+=(t[1]-
-n.y)*r,n.z+=(t[2]-n.z)*r,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(q=e(a,1.01*q),b.set(q[0],q[1],q[2]),b.sub(n),b.y=0,b.normalize(),q=Math.atan2(b.x,b.z),k.rotation.set(0,q,0))}else"rot"===n?(THREE.Quaternion.slerp(u,w,d,q),0===m.quaternionWeight?(k.quaternion.copy(d),m.quaternionWeight=this.weight):(r=this.weight/(this.weight+m.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,r),m.quaternionWeight+=this.weight)):"scl"===n&&(c.x=u[0]+(w[0]-u[0])*q,c.y=
-u[1]+(w[1]-u[1])*q,c.z=u[2]+(w[2]-u[2])*q,r=this.weight/(this.weight+m.scaleWeight),k.scale.lerp(c,r),m.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
+c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,r,n,q,t,p;e=(a.length-1)*b;r=Math.floor(e);e-=r;c[0]=0===r?r:r-1;c[1]=r;c[2]=r>a.length-2?r:r+1;c[3]=r>a.length-3?r:r+2;r=a[c[0]];q=a[c[1]];t=a[c[2]];p=a[c[3]];c=e*e;n=e*c;d[0]=f(r[0],q[0],t[0],p[0],e,c,n);d[1]=f(r[1],q[1],t[1],p[1],e,c,n);d[2]=f(r[2],q[2],t[2],p[2],e,c,n);return d},f=function(a,b,c,d,
+e,f,n){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*n+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],m=k.animationCache.blending,r=0;3>r;r++){var n=this.keyTypes[r],
+q=l.prevKey[n],t=l.nextKey[n];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&q.time>=this.currentTime){q=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(n,f,1);t.time<this.currentTime&&t.index>q.index;)q=t,t=this.getNextKeyWith(n,f,t.index+1);l.prevKey[n]=q;l.nextKey[n]=t}var p=(this.currentTime-q.time)/(t.time-q.time),u=q[n],w=t[n];0>p&&(p=0);1<p&&(p=1);if("pos"===n)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(w[0]-u[0])*p,c.y=u[1]+(w[1]-u[1])*p,
+c.z=u[2]+(w[2]-u[2])*p,q=this.weight/(this.weight+m.positionWeight),k.position.lerp(c,q),m.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,q.index-1).pos,a[1]=u,a[2]=w,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,p=.33*p+.33,t=e(a,p),q=this.weight/(this.weight+m.positionWeight),m.positionWeight+=this.weight,n=k.position,n.x+=(t[0]-n.x)*q,n.y+=(t[1]-
+n.y)*q,n.z+=(t[2]-n.z)*q,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(p=e(a,1.01*p),b.set(p[0],p[1],p[2]),b.sub(n),b.y=0,b.normalize(),p=Math.atan2(b.x,b.z),k.rotation.set(0,p,0))}else"rot"===n?(THREE.Quaternion.slerp(u,w,d,p),0===m.quaternionWeight?(k.quaternion.copy(d),m.quaternionWeight=this.weight):(q=this.weight/(this.weight+m.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,q),m.quaternionWeight+=this.weight)):"scl"===n&&(c.x=u[0]+(w[0]-u[0])*p,c.y=
+u[1]+(w[1]-u[1])*p,c.z=u[2]+(w[2]-u[2])*p,q=this.weight/(this.weight+m.scaleWeight),k.scale.lerp(c,q),m.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
 this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]}};
 THREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
@@ -739,75 +739,75 @@ f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld
 THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);c[b]=this.currentTime%a/a;c[this.lastFrame]=1-c[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g){var q,u=h.widthSegments,w=h.heightSegments,x=e/2,z=f/2,v=h.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",w=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)q="x",u=h.depthSegments;var I=u+1,K=w+1,A=e/u,y=f/w,F=new THREE.Vector3;F[q]=0<g?1:-1;for(e=0;e<K;e++)for(f=0;f<I;f++){var G=new THREE.Vector3;G[a]=(f*A-x)*c;G[b]=(e*y-z)*d;G[q]=g;h.vertices.push(G)}for(e=0;e<
-w;e++)for(f=0;f<u;f++)z=f+I*e,a=f+I*(e+1),b=f+1+I*(e+1),c=f+1+I*e,d=new THREE.Vector2(f/u,1-e/w),g=new THREE.Vector2(f/u,1-(e+1)/w),q=new THREE.Vector2((f+1)/u,1-(e+1)/w),x=new THREE.Vector2((f+1)/u,1-e/w),z=new THREE.Face3(z+v,a+v,c+v),z.normal.copy(F),z.vertexNormals.push(F.clone(),F.clone(),F.clone()),h.faces.push(z),h.faceVertexUvs[0].push([d,g,x]),z=new THREE.Face3(a+v,b+v,c+v),z.normal.copy(F),z.vertexNormals.push(F.clone(),F.clone(),F.clone()),h.faces.push(z),h.faceVertexUvs[0].push([g.clone(),
-q,x.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d);g("z","y",1,-1,c,b,-d);g("x","z",1,1,a,c,e);g("x","z",1,-1,a,c,-e);g("x","y",1,-1,a,b,f);g("x","y",-1,-1,a,b,-f);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g){var p,u=h.widthSegments,w=h.heightSegments,x=e/2,z=f/2,v=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)p="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)p="y",w=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)p="x",u=h.depthSegments;var H=u+1,K=w+1,A=e/u,y=f/w,G=new THREE.Vector3;G[p]=0<g?1:-1;for(e=0;e<K;e++)for(f=0;f<H;f++){var F=new THREE.Vector3;F[a]=(f*A-x)*c;F[b]=(e*y-z)*d;F[p]=g;h.vertices.push(F)}for(e=0;e<
+w;e++)for(f=0;f<u;f++)z=f+H*e,a=f+H*(e+1),b=f+1+H*(e+1),c=f+1+H*e,d=new THREE.Vector2(f/u,1-e/w),g=new THREE.Vector2(f/u,1-(e+1)/w),p=new THREE.Vector2((f+1)/u,1-(e+1)/w),x=new THREE.Vector2((f+1)/u,1-e/w),z=new THREE.Face3(z+v,a+v,c+v),z.normal.copy(G),z.vertexNormals.push(G.clone(),G.clone(),G.clone()),h.faces.push(z),h.faceVertexUvs[0].push([d,g,x]),z=new THREE.Face3(a+v,b+v,c+v),z.normal.copy(G),z.vertexNormals.push(G.clone(),G.clone(),G.clone()),h.faces.push(z),h.faceVertexUvs[0].push([g.clone(),
+p,x.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d);g("z","y",1,-1,c,b,-d);g("x","z",1,1,a,c,e);g("x","z",1,-1,a,c,-e);g("x","y",1,-1,a,b,f);g("x","y",-1,-1,a,b,-f);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.CubeGeometry=THREE.BoxGeometry;
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
 THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,f=new Float32Array(3*e),g=new Float32Array(3*e),e=new Float32Array(2*e);g[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var m=c+h/b*d;f[k]=a*Math.cos(m);f[k+1]=a*Math.sin(m);g[k+2]=1;e[l]=(f[k]/a+1)/2;e[l+1]=(f[k+1]/a+1)/2}c=
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(f,3));this.addAttribute("normal",new THREE.BufferAttribute(g,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
-THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,m,p=[],n=[];for(m=0;m<=e;m++){var r=[],t=[],q=m/e,u=q*(b-a)+a;for(l=0;l<=d;l++){var w=l/d,x=new THREE.Vector3;x.x=u*Math.sin(w*h+
-g);x.y=-q*c+k;x.z=u*Math.cos(w*h+g);this.vertices.push(x);r.push(this.vertices.length-1);t.push(new THREE.Vector2(w,1-q))}p.push(r);n.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(g=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var r=p[m][l],t=p[m+1][l],q=p[m+1][l+1],u=p[m][l+1],w=g.clone(),x=g.clone(),
-z=h.clone(),v=h.clone(),I=n[m][l].clone(),K=n[m+1][l].clone(),A=n[m+1][l+1].clone(),y=n[m][l+1].clone();this.faces.push(new THREE.Face3(r,t,u,[w,x,v]));this.faceVertexUvs[0].push([I,K,y]);this.faces.push(new THREE.Face3(t,q,u,[x.clone(),z,v.clone()]));this.faceVertexUvs[0].push([K.clone(),A,y.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)r=p[0][l],t=p[0][l+1],q=this.vertices.length-1,w=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
-1,0),I=n[0][l].clone(),K=n[0][l+1].clone(),A=new THREE.Vector2(K.x,0),this.faces.push(new THREE.Face3(r,t,q,[w,x,z])),this.faceVertexUvs[0].push([I,K,A]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)r=p[e][l+1],t=p[e][l],q=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),I=n[e][l+1].clone(),K=n[e][l].clone(),A=new THREE.Vector2(K.x,1),this.faces.push(new THREE.Face3(r,t,q,[w,x,z])),this.faceVertexUvs[0].push([I,
+THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,m,r=[],n=[];for(m=0;m<=e;m++){var q=[],t=[],p=m/e,u=p*(b-a)+a;for(l=0;l<=d;l++){var w=l/d,x=new THREE.Vector3;x.x=u*Math.sin(w*h+
+g);x.y=-p*c+k;x.z=u*Math.cos(w*h+g);this.vertices.push(x);q.push(this.vertices.length-1);t.push(new THREE.Vector2(w,1-p))}r.push(q);n.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[r[0][l]].clone(),h=this.vertices[r[0][l+1]].clone()):(g=this.vertices[r[1][l]].clone(),h=this.vertices[r[1][l+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var q=r[m][l],t=r[m+1][l],p=r[m+1][l+1],u=r[m][l+1],w=g.clone(),x=g.clone(),
+z=h.clone(),v=h.clone(),H=n[m][l].clone(),K=n[m+1][l].clone(),A=n[m+1][l+1].clone(),y=n[m][l+1].clone();this.faces.push(new THREE.Face3(q,t,u,[w,x,v]));this.faceVertexUvs[0].push([H,K,y]);this.faces.push(new THREE.Face3(t,p,u,[x.clone(),z,v.clone()]));this.faceVertexUvs[0].push([K.clone(),A,y.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=r[0][l],t=r[0][l+1],p=this.vertices.length-1,w=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
+1,0),H=n[0][l].clone(),K=n[0][l+1].clone(),A=new THREE.Vector2(K.x,0),this.faces.push(new THREE.Face3(q,t,p,[w,x,z])),this.faceVertexUvs[0].push([H,K,A]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=r[e][l+1],t=r[e][l],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),H=n[e][l+1].clone(),K=n[e][l].clone(),A=new THREE.Vector2(K.x,1),this.faces.push(new THREE.Face3(q,t,p,[w,x,z])),this.faceVertexUvs[0].push([H,
 K,A]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
-THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,m=h.length;l<m;l++)for(var p=h[l],n=0;3>n;n++){d[0]=p[g[n]];d[1]=p[g[(n+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?e[r]={vert1:d[0],vert2:d[1],face1:l,
-face2:void 0}:e[r].face2=l}d=[];for(r in e)if(f=e[r],void 0===f.face2||h[f.face1].normal.dot(h[f.face2].normal)<=c)g=k[f.vert1],d.push(g.x),d.push(g.y),d.push(g.z),g=k[f.vert2],d.push(g.x),d.push(g.y),d.push(g.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
+THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,m=h.length;l<m;l++)for(var r=h[l],n=0;3>n;n++){d[0]=r[g[n]];d[1]=r[g[(n+1)%3]];d.sort(f);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l,
+face2:void 0}:e[q].face2=l}d=[];for(q in e)if(f=e[q],void 0===f.face2||h[f.face1].normal.dot(h[f.face2].normal)<=c)g=k[f.vert1],d.push(g.x),d.push(g.y),d.push(g.z),g=k[f.vert2],d.push(g.x),d.push(g.y),d.push(g.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
-!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(L=a.length;0<=--L;){c=L;d=L-1;0>d&&(d=a.length-1);for(var e=0,f=r+2*m,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+G,g=g+G,l=l+G,h=h+G;F.faces.push(new THREE.Face3(k,g,h));F.faces.push(new THREE.Face3(g,l,h));k=w.generateSideWallUV(F,k,g,l,h);F.faceVertexUvs[0].push([k[0],k[1],k[3]]);F.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function f(a,b,c){F.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=G;b+=G;c+=G;F.faces.push(new THREE.Face3(a,b,c));a=w.generateTopUV(F,a,b,c);F.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,
-q,u=!1,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,z,v,I;t&&(q=t.getSpacedPoints(r),u=!0,p=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),z=new THREE.Vector3,v=new THREE.Vector3,I=new THREE.Vector3);p||(l=k=m=0);var K,A,y,F=this,G=this.vertices.length,t=a.extractPoints(n),n=t.shape,C=t.holes;if(t=!THREE.Shape.Utils.isClockWise(n)){n=n.reverse();A=0;for(y=C.length;A<y;A++)K=C[A],THREE.Shape.Utils.isClockWise(K)&&(C[A]=K.reverse());t=
-!1}var J=THREE.Shape.Utils.triangulateShape(n,C),O=n;A=0;for(y=C.length;A<y;A++)K=C[A],n=n.concat(K);var E,D,B,N,R,T=n.length,P,U=J.length,t=[],L=0;B=O.length;E=B-1;for(D=L+1;L<B;L++,E++,D++)E===B&&(E=0),D===B&&(D=0),t[L]=d(O[L],O[E],O[D]);var H=[],ea,ra=t.concat();A=0;for(y=C.length;A<y;A++){K=C[A];ea=[];L=0;B=K.length;E=B-1;for(D=L+1;L<B;L++,E++,D++)E===B&&(E=0),D===B&&(D=0),ea[L]=d(K[L],K[E],K[D]);H.push(ea);ra=ra.concat(ea)}for(E=0;E<m;E++){B=E/m;N=k*(1-B);D=l*Math.sin(B*Math.PI/2);L=0;for(B=
-O.length;L<B;L++)R=c(O[L],t[L],D),f(R.x,R.y,-N);A=0;for(y=C.length;A<y;A++)for(K=C[A],ea=H[A],L=0,B=K.length;L<B;L++)R=c(K[L],ea[L],D),f(R.x,R.y,-N)}D=l;for(L=0;L<T;L++)R=p?c(n[L],ra[L],D):n[L],u?(v.copy(x.normals[0]).multiplyScalar(R.x),z.copy(x.binormals[0]).multiplyScalar(R.y),I.copy(q[0]).add(v).add(z),f(I.x,I.y,I.z)):f(R.x,R.y,0);for(B=1;B<=r;B++)for(L=0;L<T;L++)R=p?c(n[L],ra[L],D):n[L],u?(v.copy(x.normals[B]).multiplyScalar(R.x),z.copy(x.binormals[B]).multiplyScalar(R.y),I.copy(q[B]).add(v).add(z),
-f(I.x,I.y,I.z)):f(R.x,R.y,h/r*B);for(E=m-1;0<=E;E--){B=E/m;N=k*(1-B);D=l*Math.sin(B*Math.PI/2);L=0;for(B=O.length;L<B;L++)R=c(O[L],t[L],D),f(R.x,R.y,h+N);A=0;for(y=C.length;A<y;A++)for(K=C[A],ea=H[A],L=0,B=K.length;L<B;L++)R=c(K[L],ea[L],D),u?f(R.x,R.y+q[r-1].y,q[r-1].x+N):f(R.x,R.y,h+N)}(function(){if(p){var a;a=0*T;for(L=0;L<U;L++)P=J[L],g(P[2]+a,P[1]+a,P[0]+a);a=r+2*m;a*=T;for(L=0;L<U;L++)P=J[L],g(P[0]+a,P[1]+a,P[2]+a)}else{for(L=0;L<U;L++)P=J[L],g(P[2],P[1],P[0]);for(L=0;L<U;L++)P=J[L],g(P[0]+
-T*r,P[1]+T*r,P[2]+T*r)}})();(function(){var a=0;e(O,a);a+=O.length;A=0;for(y=C.length;A<y;A++)K=C[A],e(K,a),a+=K.length})()};
+!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(J=a.length;0<=--J;){c=J;d=J-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*m,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+F,g=g+F,l=l+F,h=h+F;G.faces.push(new THREE.Face3(k,g,h));G.faces.push(new THREE.Face3(g,l,h));k=w.generateSideWallUV(G,k,g,l,h);G.faceVertexUvs[0].push([k[0],k[1],k[3]]);G.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function f(a,b,c){G.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=F;b+=F;c+=F;G.faces.push(new THREE.Face3(a,b,c));a=w.generateTopUV(G,a,b,c);G.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,r=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,
+p,u=!1,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,z,v,H;t&&(p=t.getSpacedPoints(q),u=!0,r=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,!1),z=new THREE.Vector3,v=new THREE.Vector3,H=new THREE.Vector3);r||(l=k=m=0);var K,A,y,G=this,F=this.vertices.length,t=a.extractPoints(n),n=t.shape,C=t.holes;if(t=!THREE.Shape.Utils.isClockWise(n)){n=n.reverse();A=0;for(y=C.length;A<y;A++)K=C[A],THREE.Shape.Utils.isClockWise(K)&&(C[A]=K.reverse());t=
+!1}var L=THREE.Shape.Utils.triangulateShape(n,C),O=n;A=0;for(y=C.length;A<y;A++)K=C[A],n=n.concat(K);var E,D,B,N,R,T=n.length,P,U=L.length,t=[],J=0;B=O.length;E=B-1;for(D=J+1;J<B;J++,E++,D++)E===B&&(E=0),D===B&&(D=0),t[J]=d(O[J],O[E],O[D]);var I=[],ea,ra=t.concat();A=0;for(y=C.length;A<y;A++){K=C[A];ea=[];J=0;B=K.length;E=B-1;for(D=J+1;J<B;J++,E++,D++)E===B&&(E=0),D===B&&(D=0),ea[J]=d(K[J],K[E],K[D]);I.push(ea);ra=ra.concat(ea)}for(E=0;E<m;E++){B=E/m;N=k*(1-B);D=l*Math.sin(B*Math.PI/2);J=0;for(B=
+O.length;J<B;J++)R=c(O[J],t[J],D),f(R.x,R.y,-N);A=0;for(y=C.length;A<y;A++)for(K=C[A],ea=I[A],J=0,B=K.length;J<B;J++)R=c(K[J],ea[J],D),f(R.x,R.y,-N)}D=l;for(J=0;J<T;J++)R=r?c(n[J],ra[J],D):n[J],u?(v.copy(x.normals[0]).multiplyScalar(R.x),z.copy(x.binormals[0]).multiplyScalar(R.y),H.copy(p[0]).add(v).add(z),f(H.x,H.y,H.z)):f(R.x,R.y,0);for(B=1;B<=q;B++)for(J=0;J<T;J++)R=r?c(n[J],ra[J],D):n[J],u?(v.copy(x.normals[B]).multiplyScalar(R.x),z.copy(x.binormals[B]).multiplyScalar(R.y),H.copy(p[B]).add(v).add(z),
+f(H.x,H.y,H.z)):f(R.x,R.y,h/q*B);for(E=m-1;0<=E;E--){B=E/m;N=k*(1-B);D=l*Math.sin(B*Math.PI/2);J=0;for(B=O.length;J<B;J++)R=c(O[J],t[J],D),f(R.x,R.y,h+N);A=0;for(y=C.length;A<y;A++)for(K=C[A],ea=I[A],J=0,B=K.length;J<B;J++)R=c(K[J],ea[J],D),u?f(R.x,R.y+p[q-1].y,p[q-1].x+N):f(R.x,R.y,h+N)}(function(){if(r){var a;a=0*T;for(J=0;J<U;J++)P=L[J],g(P[2]+a,P[1]+a,P[0]+a);a=q+2*m;a*=T;for(J=0;J<U;J++)P=L[J],g(P[0]+a,P[1]+a,P[2]+a)}else{for(J=0;J<U;J++)P=L[J],g(P[2],P[1],P[0]);for(J=0;J<U;J++)P=L[J],g(P[0]+
+T*q,P[1]+T*q,P[2]+T*q)}})();(function(){var a=0;e(O,a);a+=O.length;A=0;for(y=C.length;A<y;A++)K=C[A],e(K,a),a+=K.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var m=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
 k=k.concat(g);l=k.length;f=m.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=m[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,l))};
-THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),m=Math.sin(k),k=0,p=a.length;k<p;k++){var n=a[k],r=new THREE.Vector3;r.x=l*n.x-m*n.y;r.y=m*n.x+l*n.y;r.z=n.z;this.vertices.push(r)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,p=a.length-1;k<p;k++){b=m=k+c*g;d=m+c;var l=m+1+c,m=m+1,n=g*f,r=k*e,t=
-n+f,q=r+e;this.faces.push(new THREE.Face3(b,d,m));this.faceVertexUvs[0].push([new THREE.Vector2(n,r),new THREE.Vector2(t,r),new THREE.Vector2(n,q)]);this.faces.push(new THREE.Face3(d,l,m));this.faceVertexUvs[0].push([new THREE.Vector2(t,r),new THREE.Vector2(t,q),new THREE.Vector2(n,q)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),m=Math.sin(k),k=0,r=a.length;k<r;k++){var n=a[k],q=new THREE.Vector3;q.x=l*n.x-m*n.y;q.y=m*n.x+l*n.y;q.z=n.z;this.vertices.push(q)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,r=a.length-1;k<r;k++){b=m=k+c*g;d=m+c;var l=m+1+c,m=m+1,n=g*f,q=k*e,t=
+n+f,p=q+e;this.faces.push(new THREE.Face3(b,d,m));this.faceVertexUvs[0].push([new THREE.Vector2(n,q),new THREE.Vector2(t,q),new THREE.Vector2(n,p)]);this.faces.push(new THREE.Face3(d,l,m));this.faceVertexUvs[0].push([new THREE.Vector2(t,q),new THREE.Vector2(t,p),new THREE.Vector2(n,p)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
 THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var m=new Float32Array(g*h*2),p=0,n=0,r=0;r<h;r++)for(var t=r*l-f,q=0;q<g;q++)b[p]=q*k-e,b[p+1]=-t,a[p+2]=1,m[n]=q/c,m[n+1]=1-r/d,p+=3,n+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
-d*6);for(r=0;r<d;r++)for(q=0;q<c;q++)f=q+g*(r+1),h=q+1+g*(r+1),k=q+1+g*r,e[p]=q+g*r,e[p+1]=f,e[p+2]=k,e[p+3]=f,e[p+4]=h,e[p+5]=k,p+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(m,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
-THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var m=new THREE.Vector3,p=e+g/c*f;m.x=k*Math.cos(p);m.y=k*Math.sin(p);this.vertices.push(m);h.push(new THREE.Vector2((m.x/b+1)/2,
-(m.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=p=g+e,l=p+c+1,m=p+c+2,this.faces.push(new THREE.Face3(f,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[m].clone()]),f=p,l=p+c+2,m=p+1,this.faces.push(new THREE.Face3(f,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[m].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
+THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var m=new Float32Array(g*h*2),r=0,n=0,q=0;q<h;q++)for(var t=q*l-f,p=0;p<g;p++)b[r]=p*k-e,b[r+1]=-t,a[r+2]=1,m[n]=p/c,m[n+1]=1-q/d,r+=3,n+=2;r=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
+d*6);for(q=0;q<d;q++)for(p=0;p<c;p++)f=p+g*(q+1),h=p+1+g*(q+1),k=p+1+g*q,e[r]=p+g*q,e[r+1]=f,e[r+2]=k,e[r+3]=f,e[r+4]=h,e[r+5]=k,r+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(m,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
+THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var m=new THREE.Vector3,r=e+g/c*f;m.x=k*Math.cos(r);m.y=k*Math.sin(r);this.vertices.push(m);h.push(new THREE.Vector2((m.x/b+1)/2,
+(m.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=r=g+e,l=r+c+1,m=r+c+2,this.faces.push(new THREE.Face3(f,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[m].clone()]),f=r,l=r+c+2,m=r+1,this.faces.push(new THREE.Face3(f,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[m].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;
-THREE.SphereGeometry=function(a,b,c,d,e,f,g){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(2,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],m=[];for(k=0;k<=c;k++){var p=
-[],n=[];for(h=0;h<=b;h++){var r=h/b,t=k/c,q=new THREE.Vector3;q.x=-a*Math.cos(d+r*e)*Math.sin(f+t*g);q.y=a*Math.cos(f+t*g);q.z=a*Math.sin(d+r*e)*Math.sin(f+t*g);this.vertices.push(q);p.push(this.vertices.length-1);n.push(new THREE.Vector2(r,1-t))}l.push(p);m.push(n)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),r=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),
-q=m[k][h+1].clone(),u=m[k][h].clone(),w=m[k+1][h].clone(),x=m[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(q.x=(q.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[p,r,t])),this.faceVertexUvs[0].push([q,w,x])):Math.abs(this.vertices[f].y)===a?(w.x=(w.x+x.x)/2,this.faces.push(new THREE.Face3(d,e,f,[p,n,r])),this.faceVertexUvs[0].push([q,u,w])):(this.faces.push(new THREE.Face3(d,e,g,[p,n,t])),this.faceVertexUvs[0].push([q,u,x]),this.faces.push(new THREE.Face3(e,f,g,[n.clone(),r,t.clone()])),this.faceVertexUvs[0].push([u.clone(),
+THREE.SphereGeometry=function(a,b,c,d,e,f,g){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(2,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],m=[];for(k=0;k<=c;k++){var r=
+[],n=[];for(h=0;h<=b;h++){var q=h/b,t=k/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+q*e)*Math.sin(f+t*g);p.y=a*Math.cos(f+t*g);p.z=a*Math.sin(d+q*e)*Math.sin(f+t*g);this.vertices.push(p);r.push(this.vertices.length-1);n.push(new THREE.Vector2(q,1-t))}l.push(r);m.push(n)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var r=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),q=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),
+p=m[k][h+1].clone(),u=m[k][h].clone(),w=m[k+1][h].clone(),x=m[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(p.x=(p.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[r,q,t])),this.faceVertexUvs[0].push([p,w,x])):Math.abs(this.vertices[f].y)===a?(w.x=(w.x+x.x)/2,this.faces.push(new THREE.Face3(d,e,f,[r,n,q])),this.faceVertexUvs[0].push([p,u,w])):(this.faces.push(new THREE.Face3(d,e,g,[r,n,t])),this.faceVertexUvs[0].push([p,u,x]),this.faces.push(new THREE.Face3(e,f,g,[n.clone(),q,t.clone()])),this.faceVertexUvs[0].push([u.clone(),
 w,x.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.SphereBufferGeometry=function(a,b,c,d,e,f,g){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(2,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;for(var h=(b+1)*(c+1),k=new THREE.BufferAttribute(new Float32Array(3*h),3),l=new THREE.BufferAttribute(new Float32Array(3*h),
-3),h=new THREE.BufferAttribute(new Float32Array(2*h),2),m=0,p=[],n=new THREE.Vector3,r=0;r<=c;r++){for(var t=[],q=r/c,u=0;u<=b;u++){var w=u/b,x=-a*Math.cos(d+w*e)*Math.sin(f+q*g),z=a*Math.cos(f+q*g),v=a*Math.sin(d+w*e)*Math.sin(f+q*g);n.set(x,z,v).normalize();k.setXYZ(m,x,z,v);l.setXYZ(m,n.x,n.y,n.z);h.setXY(m,w,1-q);t.push(m);m++}p.push(t)}d=[];for(r=0;r<c;r++)for(u=0;u<b;u++)e=p[r][u+1],f=p[r][u],g=p[r+1][u],m=p[r+1][u+1],0!==r&&d.push(e,f,m),r!==c-1&&d.push(f,g,m);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(d),
+3),h=new THREE.BufferAttribute(new Float32Array(2*h),2),m=0,r=[],n=new THREE.Vector3,q=0;q<=c;q++){for(var t=[],p=q/c,u=0;u<=b;u++){var w=u/b,x=-a*Math.cos(d+w*e)*Math.sin(f+p*g),z=a*Math.cos(f+p*g),v=a*Math.sin(d+w*e)*Math.sin(f+p*g);n.set(x,z,v).normalize();k.setXYZ(m,x,z,v);l.setXYZ(m,n.x,n.y,n.z);h.setXY(m,w,1-p);t.push(m);m++}r.push(t)}d=[];for(q=0;q<c;q++)for(u=0;u<b;u++)e=r[q][u+1],f=r[q][u],g=r[q+1][u],m=r[q+1][u+1],0!==q&&d.push(e,f,m),q!==c-1&&d.push(f,g,m);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(d),
 1));this.addAttribute("position",k);this.addAttribute("normal",l);this.addAttribute("uv",h);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
 THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
-THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var m=l/d*e,p=k/c*Math.PI*2;f.x=a*Math.cos(m);f.y=a*Math.sin(m);var n=new THREE.Vector3;n.x=(a+b*Math.cos(p))*Math.cos(m);n.y=(a+b*Math.cos(p))*Math.sin(m);n.z=b*Math.sin(p);this.vertices.push(n);g.push(new THREE.Vector2(l/
+THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var m=l/d*e,r=k/c*Math.PI*2;f.x=a*Math.cos(m);f.y=a*Math.sin(m);var n=new THREE.Vector3;n.x=(a+b*Math.cos(r))*Math.cos(m);n.y=(a+b*Math.cos(r))*Math.sin(m);n.z=b*Math.sin(r);this.vertices.push(n);g.push(new THREE.Vector2(l/
 d,k/c));h.push(n.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,m=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),m=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
-THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=0;n<c;++n){k[n]=
-Array(d);var r=n/c*2*e*Math.PI,t=h(r,f,e,a,g),r=h(r+.01,f,e,a,g);l.subVectors(r,t);m.addVectors(r,t);p.crossVectors(l,m);m.crossVectors(p,l);p.normalize();m.normalize();for(r=0;r<d;++r){var q=r/d*2*Math.PI,u=-b*Math.cos(q),q=b*Math.sin(q),w=new THREE.Vector3;w.x=t.x+u*m.x+q*p.x;w.y=t.y+u*m.y+q*p.y;w.z=t.z+u*m.z+q*p.z;k[n][r]=this.vertices.push(w)-1}}for(n=0;n<c;++n)for(r=0;r<d;++r)e=(n+1)%c,f=(r+1)%d,a=k[n][r],b=k[e][r],e=k[e][f],f=k[n][f],g=new THREE.Vector2(n/c,r/d),l=new THREE.Vector2((n+1)/c,
-r/d),m=new THREE.Vector2((n+1)/c,(r+1)/d),p=new THREE.Vector2(n/c,(r+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,p]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),m,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
-THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,l=b+1,m,p,n,r,t,q=new THREE.Vector3,u,w,x;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);w=u.normals;x=u.binormals;this.tangents=u.tangents;this.normals=w;this.binormals=x;for(u=0;u<l;u++)for(g[u]=[],m=u/(l-1),t=a.getPointAt(m),h=w[u],k=x[u],n=c*f(m),m=0;m<d;m++)p=
-m/d*2*Math.PI,r=-n*Math.cos(p),p=n*Math.sin(p),q.copy(t),q.x+=r*h.x+p*k.x,q.y+=r*h.y+p*k.y,q.z+=r*h.z+p*k.z,g[u][m]=this.vertices.push(new THREE.Vector3(q.x,q.y,q.z))-1;for(u=0;u<b;u++)for(m=0;m<d;m++)f=e?(u+1)%b:u+1,l=(m+1)%d,a=g[u][m],c=g[f][m],f=g[f][l],l=g[u][l],q=new THREE.Vector2(u/b,m/d),w=new THREE.Vector2((u+1)/b,m/d),x=new THREE.Vector2((u+1)/b,(m+1)/d),h=new THREE.Vector2(u/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([q,w,h]),this.faces.push(new THREE.Face3(c,
+THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,m=new THREE.Vector3,r=new THREE.Vector3,n=0;n<c;++n){k[n]=
+Array(d);var q=n/c*2*e*Math.PI,t=h(q,f,e,a,g),q=h(q+.01,f,e,a,g);l.subVectors(q,t);m.addVectors(q,t);r.crossVectors(l,m);m.crossVectors(r,l);r.normalize();m.normalize();for(q=0;q<d;++q){var p=q/d*2*Math.PI,u=-b*Math.cos(p),p=b*Math.sin(p),w=new THREE.Vector3;w.x=t.x+u*m.x+p*r.x;w.y=t.y+u*m.y+p*r.y;w.z=t.z+u*m.z+p*r.z;k[n][q]=this.vertices.push(w)-1}}for(n=0;n<c;++n)for(q=0;q<d;++q)e=(n+1)%c,f=(q+1)%d,a=k[n][q],b=k[e][q],e=k[e][f],f=k[n][f],g=new THREE.Vector2(n/c,q/d),l=new THREE.Vector2((n+1)/c,
+q/d),m=new THREE.Vector2((n+1)/c,(q+1)/d),r=new THREE.Vector2(n/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,r]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),m,r.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
+THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,l=b+1,m,r,n,q,t,p=new THREE.Vector3,u,w,x;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);w=u.normals;x=u.binormals;this.tangents=u.tangents;this.normals=w;this.binormals=x;for(u=0;u<l;u++)for(g[u]=[],m=u/(l-1),t=a.getPointAt(m),h=w[u],k=x[u],n=c*f(m),m=0;m<d;m++)r=
+m/d*2*Math.PI,q=-n*Math.cos(r),r=n*Math.sin(r),p.copy(t),p.x+=q*h.x+r*k.x,p.y+=q*h.y+r*k.y,p.z+=q*h.z+r*k.z,g[u][m]=this.vertices.push(new THREE.Vector3(p.x,p.y,p.z))-1;for(u=0;u<b;u++)for(m=0;m<d;m++)f=e?(u+1)%b:u+1,l=(m+1)%d,a=g[u][m],c=g[f][m],f=g[f][l],l=g[u][l],p=new THREE.Vector2(u/b,m/d),w=new THREE.Vector2((u+1)/b,m/d),x=new THREE.Vector2((u+1)/b,(m+1)/d),h=new THREE.Vector2(u/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([p,w,h]),this.faces.push(new THREE.Face3(c,
 f,l)),this.faceVertexUvs[0].push([w.clone(),x,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
-THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,m,p;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)m=l/(b-1),e[l]=a.getTangentAt(m),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);m=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));m<=a&&(a=m,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
+THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,m,r;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)m=l/(b-1),e[l]=a.getTangentAt(m),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);m=Math.abs(e[0].y);r=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));m<=a&&(a=m,d.set(0,1,0));r<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
 h);g[0].crossVectors(e[0],f[0]);for(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],f[l])};
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);u.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(u.z,-u.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,
-b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(g.clone().lerp(h,m/c)),q=c-m,r=0;r<=q;r++)l[m][r]=0===r&&m===c?n:e(n.clone().lerp(p,r/q))}for(m=0;m<c;m++)for(r=0;r<2*(c-m)-1;r++)d=Math.floor(r/2),0===r%2?f(l[m][d+1],l[m+1][d],l[m][d]):f(l[m][d+1],l[m+1][d+1],l[m+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y));
-return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,m=a.length;l<m;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],n=l=0,m=b.length;l<m;l+=3,n++){var r=a[b[l]],t=a[b[l+1]],q=a[b[l+2]];p[n]=new THREE.Face3(r.index,t.index,q.index,[r.clone(),t.clone(),q.clone()])}for(var u=new THREE.Vector3,l=0,m=p.length;l<m;l++)g(p[l],d);l=0;for(m=this.faceVertexUvs[0].length;l<
-m;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,p=b[2].x,n=Math.max(d,Math.max(a,p)),r=Math.min(d,Math.min(a,p)),.9<n&&.1>r&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(m=this.vertices.length;l<m;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
+b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(g.clone().lerp(h,m/c)),r=c-m,q=0;q<=r;q++)l[m][q]=0===q&&m===c?n:e(n.clone().lerp(p,q/r))}for(m=0;m<c;m++)for(q=0;q<2*(c-m)-1;q++)d=Math.floor(q/2),0===q%2?f(l[m][d+1],l[m+1][d],l[m][d]):f(l[m][d+1],l[m+1][d+1],l[m+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y));
+return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,m=a.length;l<m;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var r=[],n=l=0,m=b.length;l<m;l+=3,n++){var q=a[b[l]],t=a[b[l+1]],p=a[b[l+2]];r[n]=new THREE.Face3(q.index,t.index,p.index,[q.clone(),t.clone(),p.clone()])}for(var u=new THREE.Vector3,l=0,m=r.length;l<m;l++)g(r[l],d);l=0;for(m=this.faceVertexUvs[0].length;l<
+m;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,r=b[2].x,n=Math.max(d,Math.max(a,r)),q=Math.min(d,Math.min(a,r)),.9<n&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>r&&(b[2].x+=1));l=0;for(m=this.vertices.length;l<m;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
 THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,
 11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b)};THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry;
 THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b}};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b}};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b}};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
-THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,m=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,n,r,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*m+h,d=g*m+h+1,l=(g+1)*m+h+1,k=(g+1)*m+h,p=new THREE.Vector2(h/b,g/c),n=new THREE.Vector2((h+1)/b,g/c),r=new THREE.Vector2((h+1)/b,(g+1)/c),t=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
-d,k)),f.push([p,n,t]),e.push(new THREE.Face3(d,l,k)),f.push([n.clone(),r,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
-THREE.WireframeGeometry=function(a){THREE.BufferGeometry.call(this);var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c"];if(a instanceof THREE.Geometry){var f=a.vertices,g=a.faces,h=0,k=new Uint32Array(6*g.length);a=0;for(var l=g.length;a<l;a++)for(var m=g[a],p=0;3>p;p++){b[0]=m[e[p]];b[1]=m[e[(p+1)%3]];b.sort(d);var n=b.toString();void 0===c[n]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)h=f[k[2*a+p]],e=6*a+3*p,b[e+0]=h.x,b[e+1]=h.y,
-b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){f=a.attributes.position;l=a.attributes.index.array;g=a.drawcalls;h=0;0===g.length&&(g=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),m=0,r=g.length;m<r;++m){p=g[m].start;n=g[m].count;e=g[m].index;a=p;for(var t=p+n;a<t;a+=3)for(p=0;3>p;p++)b[0]=e+l[a+p],b[1]=e+l[a+(p+1)%3],b.sort(d),n=b.toString(),void 0===c[n]&&(k[2*h]=b[0],k[2*
-h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)e=6*a+3*p,h=k[2*a+p],b[e+0]=f.getX(h),b[e+1]=f.getY(h),b[e+2]=f.getZ(h)}else for(f=a.attributes.position.array,h=f.length/3,k=h/3,b=new Float32Array(6*h),a=0,l=k;a<l;a++)for(p=0;3>p;p++)e=18*a+6*p,k=9*a+3*p,b[e+0]=f[k],b[e+1]=f[k+1],b[e+2]=f[k+2],h=9*a+(p+1)%3*3,b[e+3]=f[h],b[e+4]=f[h+1],b[e+5]=f[h+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
+THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,m=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var r,n,q,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*m+h,d=g*m+h+1,l=(g+1)*m+h+1,k=(g+1)*m+h,r=new THREE.Vector2(h/b,g/c),n=new THREE.Vector2((h+1)/b,g/c),q=new THREE.Vector2((h+1)/b,(g+1)/c),t=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
+d,k)),f.push([r,n,t]),e.push(new THREE.Face3(d,l,k)),f.push([n.clone(),q,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
+THREE.WireframeGeometry=function(a){THREE.BufferGeometry.call(this);var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c"];if(a instanceof THREE.Geometry){var f=a.vertices,g=a.faces,h=0,k=new Uint32Array(6*g.length);a=0;for(var l=g.length;a<l;a++)for(var m=g[a],r=0;3>r;r++){b[0]=m[e[r]];b[1]=m[e[(r+1)%3]];b.sort(d);var n=b.toString();void 0===c[n]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(r=0;2>r;r++)h=f[k[2*a+r]],e=6*a+3*r,b[e+0]=h.x,b[e+1]=h.y,
+b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){f=a.attributes.position;l=a.attributes.index.array;g=a.drawcalls;h=0;0===g.length&&(g=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),m=0,q=g.length;m<q;++m){r=g[m].start;n=g[m].count;e=g[m].index;a=r;for(var t=r+n;a<t;a+=3)for(r=0;3>r;r++)b[0]=e+l[a+r],b[1]=e+l[a+(r+1)%3],b.sort(d),n=b.toString(),void 0===c[n]&&(k[2*h]=b[0],k[2*
+h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(r=0;2>r;r++)e=6*a+3*r,h=k[2*a+r],b[e+0]=f.getX(h),b[e+1]=f.getY(h),b[e+2]=f.getZ(h)}else for(f=a.attributes.position.array,h=f.length/3,k=h/3,b=new Float32Array(6*h),a=0,l=k;a<l;a++)for(r=0;3>r;r++)e=18*a+6*r,k=9*a+3*r,b[e+0]=f[k],b[e+1]=f[k+1],b[e+2]=f[k+2],h=9*a+(r+1)%3*3,b[e+3]=f[h],b[e+4]=f[h+1],b[e+5]=f[h+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
 THREE.WireframeGeometry.prototype.constructor=THREE.WireframeGeometry;THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry;a.addAttribute("position",new THREE.BufferAttribute(b,3));a.addAttribute("color",new THREE.BufferAttribute(c,3));b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.LineSegments.call(this,a,b)};THREE.AxisHelper.prototype=Object.create(THREE.LineSegments.prototype);
 THREE.AxisHelper.prototype.constructor=THREE.AxisHelper;
 THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));return function(c,d,e,f,g,h){THREE.Object3D.call(this);void 0===f&&(f=16776960);void 0===e&&(e=1);void 0===g&&(g=.2*e);void 0===h&&(h=.2*g);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f}));this.line.matrixAutoUpdate=!1;this.add(this.line);
@@ -846,12 +846,12 @@ THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper;THREE.SpotLigh
 THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();
 THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16711680;d=void 0!==d?d:1;b=0;c=this.object.geometry;c instanceof THREE.Geometry?b=3*c.faces.length:c instanceof THREE.BufferGeometry&&(b=c.attributes.normal.count);c=new THREE.BufferGeometry;b=new THREE.Float32Attribute(6*b,3);c.addAttribute("position",b);THREE.LineSegments.call(this,c,new THREE.LineBasicMaterial({color:a,linewidth:d}));this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};
 THREE.VertexNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper;
-THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=["a","b","c"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);var d=this.object.matrixWorld,e=this.geometry.attributes.position,f=this.object.geometry;if(f instanceof THREE.Geometry)for(var g=f.vertices,h=f.faces,k=f=0,l=h.length;k<l;k++)for(var m=h[k],p=0,n=m.vertexNormals.length;p<n;p++){var r=m.vertexNormals[p];a.copy(g[m[c[p]]]).applyMatrix4(d);
-b.copy(r).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a);e.setXYZ(f,a.x,a.y,a.z);f+=1;e.setXYZ(f,b.x,b.y,b.z);f+=1}else if(f instanceof THREE.BufferGeometry)for(c=f.attributes.position,g=f.attributes.normal,p=f=0,n=c.count;p<n;p++)a.set(c.getX(p),c.getY(p),c.getZ(p)).applyMatrix4(d),b.set(g.getX(p),g.getY(p),g.getZ(p)),b.applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a),e.setXYZ(f,a.x,a.y,a.z),f+=1,e.setXYZ(f,b.x,b.y,b.z),f+=1;e.needsUpdate=
+THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=["a","b","c"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);var d=this.object.matrixWorld,e=this.geometry.attributes.position,f=this.object.geometry;if(f instanceof THREE.Geometry)for(var g=f.vertices,h=f.faces,k=f=0,l=h.length;k<l;k++)for(var m=h[k],r=0,n=m.vertexNormals.length;r<n;r++){var q=m.vertexNormals[r];a.copy(g[m[c[r]]]).applyMatrix4(d);
+b.copy(q).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a);e.setXYZ(f,a.x,a.y,a.z);f+=1;e.setXYZ(f,b.x,b.y,b.z);f+=1}else if(f instanceof THREE.BufferGeometry)for(c=f.attributes.position,g=f.attributes.normal,r=f=0,n=c.count;r<n;r++)a.set(c.getX(r),c.getY(r),c.getZ(r)).applyMatrix4(d),b.set(g.getX(r),g.getY(r),g.getZ(r)),b.applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a),e.setXYZ(f,a.x,a.y,a.z),f+=1,e.setXYZ(f,b.x,b.y,b.z),f+=1;e.needsUpdate=
 !0;return this}}();THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:255;d=void 0!==d?d:1;b=0;c=this.object.geometry;c instanceof THREE.Geometry?b=3*c.faces.length:c instanceof THREE.BufferGeometry&&(b=c.attributes.tangent.count);c=new THREE.BufferGeometry;b=new THREE.Float32Attribute(6*b,3);c.addAttribute("position",b);THREE.LineSegments.call(this,c,new THREE.LineBasicMaterial({color:a,linewidth:d}));this.matrixAutoUpdate=!1;this.update()};
 THREE.VertexTangentsHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper;
-THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3,c=new THREE.Vector3;return function(){var a=["a","b","c"];this.object.updateMatrixWorld(!0);var e=this.object.matrixWorld,f=this.geometry.attributes.position,g=this.object.geometry;if(g instanceof THREE.Geometry)for(var h=g.vertices,k=g.faces,l=g=0,m=k.length;l<m;l++)for(var p=k[l],n=0,r=p.vertexTangents.length;n<r;n++){var t=p.vertexTangents[n];b.copy(h[p[a[n]]]).applyMatrix4(e);c.set(t.x,t.y,t.z);c.transformDirection(e).multiplyScalar(this.size).add(b);
-f.setXYZ(g,b.x,b.y,b.z);g+=1;f.setXYZ(g,c.x,c.y,c.z);g+=1}else if(g instanceof THREE.BufferGeometry)for(a=g.attributes.position,h=g.attributes.tangent,n=g=0,r=a.count;n<r;n++)b.set(a.getX(n),a.getY(n),a.getZ(n)).applyMatrix4(e),c.set(h.getX(n),h.getY(n),h.getZ(n)),c.transformDirection(e).multiplyScalar(this.size).add(b),f.setXYZ(g,b.x,b.y,b.z),g+=1,f.setXYZ(g,c.x,c.y,c.z),g+=1;f.needsUpdate=!0;return this}}();
+THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3,c=new THREE.Vector3;return function(){var a=["a","b","c"];this.object.updateMatrixWorld(!0);var e=this.object.matrixWorld,f=this.geometry.attributes.position,g=this.object.geometry;if(g instanceof THREE.Geometry)for(var h=g.vertices,k=g.faces,l=g=0,m=k.length;l<m;l++)for(var r=k[l],n=0,q=r.vertexTangents.length;n<q;n++){var t=r.vertexTangents[n];b.copy(h[r[a[n]]]).applyMatrix4(e);c.set(t.x,t.y,t.z);c.transformDirection(e).multiplyScalar(this.size).add(b);
+f.setXYZ(g,b.x,b.y,b.z);g+=1;f.setXYZ(g,c.x,c.y,c.z);g+=1}else if(g instanceof THREE.BufferGeometry)for(a=g.attributes.position,h=g.attributes.tangent,n=g=0,q=a.count;n<q;n++)b.set(a.getX(n),a.getY(n),a.getZ(n)).applyMatrix4(e),c.set(h.getX(n),h.getY(n),h.getZ(n)),c.transformDirection(e).multiplyScalar(this.size).add(b),f.setXYZ(g,b.x,b.y,b.z),g+=1,f.setXYZ(g,c.x,c.y,c.z),g+=1;f.needsUpdate=!0;return this}}();
 THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215;THREE.LineSegments.call(this,new THREE.WireframeGeometry(a.geometry),new THREE.LineBasicMaterial({color:c}));this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper;THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);
 THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;
 THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)};