Pārlūkot izejas kodu

Updated builds.

Mr.doob 10 gadi atpakaļ
vecāks
revīzija
e423d57d5c
2 mainītis faili ar 364 papildinājumiem un 350 dzēšanām
  1. 96 82
      build/three.js
  2. 268 268
      build/three.min.js

+ 96 - 82
build/three.js

@@ -8259,9 +8259,11 @@ THREE.Object3D.prototype = {
 
 		callback( this );
 
-		for ( var i = 0, l = this.children.length; i < l; i ++ ) {
+		var children = this.children;
+
+		for ( var i = 0, l = children.length; i < l; i ++ ) {
 
-			this.children[ i ].traverse( callback );
+			children[ i ].traverse( callback );
 
 		}
 
@@ -8273,9 +8275,11 @@ THREE.Object3D.prototype = {
 
 		callback( this );
 
-		for ( var i = 0, l = this.children.length; i < l; i ++ ) {
+		var children = this.children;
+
+		for ( var i = 0, l = children.length; i < l; i ++ ) {
 
-			this.children[ i ].traverseVisible( callback );
+			children[ i ].traverseVisible( callback );
 
 		}
 
@@ -8283,11 +8287,13 @@ THREE.Object3D.prototype = {
 
 	traverseAncestors: function ( callback ) {
 
-		if ( this.parent ) {
+		var parent = this.parent;
 
-			callback( this.parent );
+		if ( parent !== undefined ) {
 
-			this.parent.traverseAncestors( callback );
+			callback( parent );
+
+			parent.traverseAncestors( callback );
 
 		}
 
@@ -15829,6 +15835,8 @@ THREE.MeshFaceMaterial = function ( materials ) {
 
 	this.materials = materials instanceof Array ? materials : [];
 
+	this.visible = true;
+
 };
 
 THREE.MeshFaceMaterial.prototype = {
@@ -15854,6 +15862,8 @@ THREE.MeshFaceMaterial.prototype = {
 
 		}
 
+		output.visible = this.visible;
+
 		return output;
 
 	},
@@ -15868,6 +15878,8 @@ THREE.MeshFaceMaterial.prototype = {
 
 		}
 
+		material.visible = this.visible;
+
 		return material;
 
 	}
@@ -19850,17 +19862,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		}
 
-		_canvas.addEventListener( 'webglcontextlost', function ( event ) {
-
-			event.preventDefault();
-
-			resetGLState();
-			setDefaultGLState();
-
-			objects.clear();
-			properties.clear();
-
-		}, false );
+		_canvas.addEventListener( 'webglcontextlost', onContextLost, false );
 
 	} catch ( error ) {
 
@@ -20284,8 +20286,26 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	this.resetGLState = resetGLState;
 
+	this.dispose = function() {
+
+		_canvas.removeEventListener( 'webglcontextlost', onContextLost, false );
+
+	};
+
 	// Events
 
+	function onContextLost( event ) {
+
+		event.preventDefault();
+
+		resetGLState();
+		setDefaultGLState();
+
+		objects.clear();
+		properties.clear();
+
+	};
+
 	function onTextureDispose( event ) {
 
 		var texture = event.target;
@@ -20544,7 +20564,11 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			for ( var i = 0, il = materials.length; i < il; i ++ ) {
 
-				_this.renderBufferDirect( camera, lights, fog, materials[ i ], object );
+				material = materials[ i ];
+
+				if ( material === null || material.visible === false ) continue;
+
+				_this.renderBufferDirect( camera, lights, fog, material, object );
 
 			}
 
@@ -20552,8 +20576,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		}
 
-		if ( material.visible === false ) return;
-
 		setMaterial( material );
 
 		var geometry = objects.geometries.get( object );
@@ -21384,56 +21406,58 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	function projectObject( object ) {
 
-		if ( object.visible === true ) {
+		if ( object.visible === false ) return;
 
-			if ( object instanceof THREE.Scene || object instanceof THREE.Group ) {
+		if ( object instanceof THREE.Scene || object instanceof THREE.Group ) {
 
-				// skip
+			// skip
 
-			} else {
+		} else {
 
-				// update Skeleton objects
-				if ( object instanceof THREE.SkinnedMesh ) {
+			// update Skeleton objects
+			if ( object instanceof THREE.SkinnedMesh ) {
 
-					object.skeleton.update();
+				object.skeleton.update();
 
-				}
+			}
 
-				objects.init( object );
+			objects.init( object );
 
-				if ( object instanceof THREE.Light ) {
+			if ( object instanceof THREE.Light ) {
 
-					lights.push( object );
+				lights.push( object );
 
-				} else if ( object instanceof THREE.Sprite ) {
+			} else if ( object instanceof THREE.Sprite ) {
 
-					sprites.push( object );
+				sprites.push( object );
 
-				} else if ( object instanceof THREE.LensFlare ) {
+			} else if ( object instanceof THREE.LensFlare ) {
 
-					lensFlares.push( object );
+				lensFlares.push( object );
 
-				} else if ( object instanceof THREE.ImmediateRenderObject ) {
+			} else if ( object instanceof THREE.ImmediateRenderObject ) {
 
-					var material = object.material;
+				var material = object.material;
 
-					if ( material.transparent ) {
+				if ( material.transparent ) {
 
-						transparentImmediateObjects.push( object );
+					transparentImmediateObjects.push( object );
 
-					} else {
+				} else {
 
-						opaqueImmediateObjects.push( object );
+					opaqueImmediateObjects.push( object );
 
-					}
+				}
 
-				} else {
+			} else {
+
+				var webglObject = objects.objects[ object.id ];
 
-					var webglObject = objects.objects[ object.id ];
+				if ( webglObject && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
 
-					if ( webglObject && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
+					var material = object.material;
 
-						var material = object.material;
+					if ( material !== null && material.visible === true ) {
 
 						if ( properties.get( material ) ) {
 
@@ -21466,11 +21490,13 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			}
 
-			for ( var i = 0, l = object.children.length; i < l; i ++ ) {
+		}
 
-				projectObject( object.children[ i ] );
+		var children = object.children;
 
-			}
+		for ( var i = 0, l = children.length; i < l; i ++ ) {
+
+			projectObject( children[ i ] );
 
 		}
 
@@ -24267,13 +24293,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
 
 		for ( var i = 0, ul = renderList.length; i < ul; i ++ ) {
 
-			var object = renderList[ i ].object;
-
-			if ( object.material.visible !== false ) {
-
-				updateObject( object );
-
-			}
+			updateObject( renderList[ i ].object );
 
 		}
 
@@ -25079,19 +25099,18 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 				webglObject = _renderList[ j ];
 
 				object = webglObject.object;
+				objectMaterial = object.material;
 
-				// culling is overridden globally for all objects
-				// while rendering depth map
+				if ( objectMaterial instanceof THREE.MeshFaceMaterial ) {
 
-				// need to deal with MeshFaceMaterial somehow
-				// in that case just use the first of material.materials for now
-				// (proper solution would require to break objects by materials
-				//  similarly to regular rendering and then set corresponding
-				//  depth materials per each chunk instead of just once per object)
+					// For the moment just ignore objects that have multiple materials with different animation methods
+					// Only the first material will be taken into account for deciding which depth material to use for shadow maps
 
-				objectMaterial = getObjectMaterial( object );
+					objectMaterial = object.material.materials[ 0 ];
 
-				if ( objectMaterial.visible === false ) continue;
+					if ( objectMaterial === null || objectMaterial.visible === false ) continue;
+
+				}
 
 				useMorphing = object.geometry.morphTargets !== undefined && object.geometry.morphTargets.length > 0 && objectMaterial.morphTargets;
 				useSkinning = object instanceof THREE.SkinnedMesh && objectMaterial.skinning;
@@ -25142,35 +25161,30 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 
 	function projectObject( object, camera ) {
 
-		if ( object.visible === true ) {
-
-			var webglObject = _objects.objects[ object.id ];
+		if ( object.visible === false ) return;
 
-			if ( webglObject && object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
+		var webglObject = _objects.objects[ object.id ];
 
-				object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
-				_renderList.push( webglObject );
+		if ( webglObject && object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
 
-			}
+			var material = object.material;
 
-			for ( var i = 0, l = object.children.length; i < l; i ++ ) {
+			if ( material !== null && material.visible === true ) {
 
-				projectObject( object.children[ i ], camera );
+				object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
+				_renderList.push( webglObject );
 
 			}
 
 		}
 
-	}
+		var children = object.children;
 
-	// For the moment just ignore objects that have multiple materials with different animation methods
-	// Only the first material will be taken into account for deciding which depth material to use for shadow maps
+		for ( var i = 0, l = children.length; i < l; i ++ ) {
 
-	function getObjectMaterial( object ) {
+			projectObject( children[ i ], camera );
 
-		return object.material instanceof THREE.MeshFaceMaterial
-			? object.material.materials[ 0 ]
-			: object.material;
+		}
 
 	}
 

+ 268 - 268
build/three.min.js

@@ -71,8 +71,8 @@ this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){re
 return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},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,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 g=e[4],f=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(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-g,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(f,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(-g,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(-g,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(f,e))):"XZY"===b?(this._z=Math.asin(-d(g,-1,1)),.99999>
+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 g=e[4],f=e[8],h=e[1],k=e[5],l=e[9],n=e[2],p=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-g,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(f,e),this._z=Math.atan2(h,k)):(this._y=Math.atan2(-n,
+a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-n,e),this._z=Math.atan2(-g,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(n,-1,1)),.99999>Math.abs(n)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-g,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(-n,a)):(this._x=0,this._y=Math.atan2(f,e))):"XZY"===b?(this._z=Math.asin(-d(g,-1,1)),.99999>
 Math.abs(g)?(this._x=Math.atan2(p,k),this._y=Math.atan2(f,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};
@@ -98,22 +98,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,g,f,h,k,l,m,p,n,q,s,t){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=g;u[9]=f;u[13]=h;u[2]=k;u[6]=l;u[10]=m;u[14]=p;u[3]=n;u[7]=q;u[11]=s;u[15]=t;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,g,f,h,k,l,n,p,m,q,s,t){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=g;u[9]=f;u[13]=h;u[2]=k;u[6]=l;u[10]=n;u[14]=p;u[3]=m;u[7]=q;u[11]=s;u[15]=t;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(),g=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]*g;c[9]=b[9]*g;c[10]=b[10]*g;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,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=
-g*h;var k=g*e,l=c*h,m=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+l*d;b[5]=a-m*d;b[9]=-c*f;b[2]=m-a*d;b[6]=l+k*d;b[10]=g*f}else"YXZ"===a.order?(a=f*h,k=f*e,l=d*h,m=d*e,b[0]=a+m*c,b[4]=l*c-k,b[8]=g*d,b[1]=g*e,b[5]=g*h,b[9]=-c,b[2]=k*c-l,b[6]=m+a*c,b[10]=g*f):"ZXY"===a.order?(a=f*h,k=f*e,l=d*h,m=d*e,b[0]=a-m*c,b[4]=-g*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=g*h,b[9]=m-a*c,b[2]=-g*d,b[6]=c,b[10]=g*f):"ZYX"===a.order?(a=g*h,k=g*e,l=c*h,m=c*e,b[0]=f*h,b[4]=l*d-k,b[8]=a*d+m,b[1]=f*e,b[5]=m*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*
-f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,m=c*d,b[0]=f*h,b[4]=m-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-m*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,m=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=g*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,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var l=c*h,c=c*k,m=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(m+e);b[4]=l-g;b[8]=c+h;b[1]=l+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;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,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var f=this.elements;c.subVectors(d,
+g*h;var k=g*e,l=c*h,n=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+l*d;b[5]=a-n*d;b[9]=-c*f;b[2]=n-a*d;b[6]=l+k*d;b[10]=g*f}else"YXZ"===a.order?(a=f*h,k=f*e,l=d*h,n=d*e,b[0]=a+n*c,b[4]=l*c-k,b[8]=g*d,b[1]=g*e,b[5]=g*h,b[9]=-c,b[2]=k*c-l,b[6]=n+a*c,b[10]=g*f):"ZXY"===a.order?(a=f*h,k=f*e,l=d*h,n=d*e,b[0]=a-n*c,b[4]=-g*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=g*h,b[9]=n-a*c,b[2]=-g*d,b[6]=c,b[10]=g*f):"ZYX"===a.order?(a=g*h,k=g*e,l=c*h,n=c*e,b[0]=f*h,b[4]=l*d-k,b[8]=a*d+n,b[1]=f*e,b[5]=n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*
+f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
+makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(n+e);b[4]=l-g;b[8]=c+h;b[1]=l+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var f=this.elements;c.subVectors(d,
 e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,
-d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],m=c[5],p=c[9],n=c[13],q=c[2],s=c[6],t=c[10],u=c[14],x=c[3],v=c[7],y=c[11],c=c[15],w=d[0],z=d[4],C=d[8],A=d[12],B=d[1],O=d[5],I=d[9],E=d[13],S=d[2],K=d[6],F=d[10],J=d[14],D=d[3],L=d[7],R=d[11],d=d[15];e[0]=g*w+f*B+h*S+k*D;e[4]=g*z+f*O+h*K+k*L;e[8]=g*C+f*I+h*F+k*R;e[12]=g*A+f*E+h*J+k*d;e[1]=l*w+m*B+p*S+n*D;e[5]=l*z+m*O+p*K+n*L;e[9]=l*C+m*I+p*F+n*R;e[13]=l*A+m*E+p*J+n*d;e[2]=q*w+s*B+t*S+u*D;e[6]=q*z+s*O+t*K+u*L;e[10]=q*C+s*I+t*F+u*R;e[14]=
-q*A+s*E+t*J+u*d;e[3]=x*w+v*B+y*S+c*D;e[7]=x*z+v*O+y*K+c*L;e[11]=x*C+v*I+y*F+c*R;e[15]=x*A+v*E+y*J+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,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],n=c[5],p=c[9],m=c[13],q=c[2],s=c[6],t=c[10],u=c[14],x=c[3],v=c[7],y=c[11],c=c[15],w=d[0],z=d[4],C=d[8],A=d[12],B=d[1],S=d[5],I=d[9],D=d[13],P=d[2],K=d[6],N=d[10],E=d[14],F=d[3],J=d[7],R=d[11],d=d[15];e[0]=g*w+f*B+h*P+k*F;e[4]=g*z+f*S+h*K+k*J;e[8]=g*C+f*I+h*N+k*R;e[12]=g*A+f*D+h*E+k*d;e[1]=l*w+n*B+p*P+m*F;e[5]=l*z+n*S+p*K+m*J;e[9]=l*C+n*I+p*N+m*R;e[13]=l*A+n*D+p*E+m*d;e[2]=q*w+s*B+t*P+u*F;e[6]=q*z+s*S+t*K+u*J;e[10]=q*C+s*I+t*N+u*R;e[14]=
+q*A+s*D+t*E+u*d;e[3]=x*w+v*B+y*P+c*F;e[7]=x*z+v*S+y*K+c*J;e[11]=x*C+v*I+y*N+c*R;e[15]=x*A+v*D+y*E+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],g=a[1],f=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*f*p+c*k*p+d*f*n-c*h*n)+a[7]*(+b*h*n-b*k*p+e*g*p-d*g*n+d*k*l-e*h*l)+a[11]*(+b*k*m-b*f*n-e*g*m+c*g*n+e*f*l-c*k*l)+a[15]*(-d*f*l-b*h*m+b*f*p+d*g*m-c*g*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],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*k*
+n-e*f*p+c*k*p+d*f*m-c*h*m)+a[7]*(+b*h*m-b*k*p+e*g*p-d*g*m+d*k*l-e*h*l)+a[11]*(+b*k*n-b*f*m-e*g*n+c*g*m+e*f*l-c*k*l)+a[15]*(-d*f*l-b*h*n+b*f*p+d*g*n-c*g*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]=
 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],g=d[4],f=d[8],h=d[12],k=d[1],l=d[5],m=d[9],p=d[13],n=d[2],q=d[6],s=d[10],t=d[14],u=d[3],x=d[7],v=d[11],d=d[15];c[0]=m*t*x-p*s*x+p*q*v-l*t*v-m*q*d+l*s*d;c[4]=h*s*x-f*t*x-h*q*v+g*t*v+f*q*d-g*s*d;c[8]=f*p*x-h*m*x+h*l*v-g*p*v-f*l*d+g*m*d;c[12]=h*m*q-f*p*q-h*l*s+g*p*s+f*l*t-g*m*t;c[1]=p*s*u-m*t*u-p*n*v+k*t*v+m*n*d-k*s*d;c[5]=f*t*u-h*s*u+h*n*v-e*t*v-f*n*d+e*s*d;c[9]=h*m*u-f*p*u-h*k*v+e*p*v+f*k*d-e*m*d;c[13]=f*p*n-h*m*n+h*k*s-e*p*s-f*k*t+e*m*t;c[2]=l*t*u-p*q*u+p*n*x-k*t*
-x-l*n*d+k*q*d;c[6]=h*q*u-g*t*u-h*n*x+e*t*x+g*n*d-e*q*d;c[10]=g*p*u-h*l*u+h*k*x-e*p*x-g*k*d+e*l*d;c[14]=h*l*n-g*p*n-h*k*q+e*p*q+g*k*t-e*l*t;c[3]=m*q*u-l*s*u-m*n*x+k*s*x+l*n*v-k*q*v;c[7]=g*s*u-f*q*u+f*n*x-e*s*x-g*n*v+e*q*v;c[11]=f*l*u-g*m*u-f*k*x+e*m*x+g*k*v-e*l*v;c[15]=g*m*n-f*l*n+f*k*q-e*m*q-g*k*s+e*l*s;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],g=d[4],f=d[8],h=d[12],k=d[1],l=d[5],n=d[9],p=d[13],m=d[2],q=d[6],s=d[10],t=d[14],u=d[3],x=d[7],v=d[11],d=d[15];c[0]=n*t*x-p*s*x+p*q*v-l*t*v-n*q*d+l*s*d;c[4]=h*s*x-f*t*x-h*q*v+g*t*v+f*q*d-g*s*d;c[8]=f*p*x-h*n*x+h*l*v-g*p*v-f*l*d+g*n*d;c[12]=h*n*q-f*p*q-h*l*s+g*p*s+f*l*t-g*n*t;c[1]=p*s*u-n*t*u-p*m*v+k*t*v+n*m*d-k*s*d;c[5]=f*t*u-h*s*u+h*m*v-e*t*v-f*m*d+e*s*d;c[9]=h*n*u-f*p*u-h*k*v+e*p*v+f*k*d-e*n*d;c[13]=f*p*m-h*n*m+h*k*s-e*p*s-f*k*t+e*n*t;c[2]=l*t*u-p*q*u+p*m*x-k*t*
+x-l*m*d+k*q*d;c[6]=h*q*u-g*t*u-h*m*x+e*t*x+g*m*d-e*q*d;c[10]=g*p*u-h*l*u+h*k*x-e*p*x-g*k*d+e*l*d;c[14]=h*l*m-g*p*m-h*k*q+e*p*q+g*k*t-e*l*t;c[3]=n*q*u-l*s*u-n*m*x+k*s*x+l*m*v-k*q*v;c[7]=g*s*u-f*q*u+f*m*x-e*s*x-g*m*v+e*q*v;c[11]=f*l*u-g*n*u-f*k*x+e*n*x+g*k*v-e*l*v;c[15]=g*n*m-f*l*m+f*k*q-e*n*q-g*k*s+e*l*s;c=e*c[0]+k*c[4]+m*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,g=a.x,f=a.y,h=a.z,k=e*g,l=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,l*f+c,l*h-d*g,0,k*h-d*f,l*h+d*g,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,
@@ -123,8 +123,8 @@ a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function
 a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}};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,g,f){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),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)+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<=-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)+p):e<=q?(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);g&&g.copy(this.direction).multiplyScalar(d).add(this.origin);f&&f.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,g,f){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),n=-c.dot(b),p=c.lengthSq(),m=Math.abs(1-k*k),q;0<m?(d=k*n-l,e=k*l-n,q=h*m,0<=d?e>=-q?e<=q?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*n)+p):(e=h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p):(e=-h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p):e<=-q?(d=Math.max(0,-(-k*h+l)),e=
+0<d?-h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+p):e<=q?(d=0,e=Math.min(Math.max(-h,-n),h),k=e*(e+2*n)+p):(d=Math.max(0,-(k*h+l)),e=0<d?h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+p)):(e=0<k?-h:h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p);g&&g.copy(this.direction).multiplyScalar(d).add(this.origin);f&&f.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,g=b.radius*b.radius;if(e>g)return null;g=Math.sqrt(g-e);e=d-g;d+=g;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,g,f;d=1/this.direction.x;g=1/this.direction.y;f=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<=g?(e=(a.min.y-h.y)*g,g*=a.max.y-h.y):(e=(a.max.y-h.y)*g,g*=a.min.y-h.y);if(c>g||e>d)return null;
 if(e>c||c!==c)c=e;if(g<d||d!==d)d=g;0<=f?(e=(a.min.z-h.z)*f,f*=a.max.z-h.z):(e=(a.max.z-h.z)*f,f*=a.min.z-h.z);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(f<d||d!==d)d=f;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,g,f,h,k){b.subVectors(g,e);c.subVectors(f,e);d.crossVectors(b,c);g=this.direction.dot(d);if(0<g){if(h)return null;h=1}else if(0>g)h=-1,g=-g;else return null;a.subVectors(this.origin,
@@ -134,8 +134,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,g){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!==g?g:new THREE.Plane]};
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,g){var f=this.planes;f[0].copy(a);f[1].copy(b);f[2].copy(c);f[3].copy(d);f[4].copy(e);f[5].copy(g);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],g=c[3],f=c[4],h=c[5],k=c[6],l=c[7],m=c[8],p=c[9],n=c[10],q=c[11],s=c[12],t=c[13],u=c[14],c=c[15];b[0].setComponents(g-a,l-f,q-m,c-s).normalize();b[1].setComponents(g+
-a,l+f,q+m,c+s).normalize();b[2].setComponents(g+d,l+h,q+p,c+t).normalize();b[3].setComponents(g-d,l-h,q-p,c-t).normalize();b[4].setComponents(g-e,l-k,q-n,c-u).normalize();b[5].setComponents(g+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,
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,g){var f=this.planes;f[0].copy(a);f[1].copy(b);f[2].copy(c);f[3].copy(d);f[4].copy(e);f[5].copy(g);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],g=c[3],f=c[4],h=c[5],k=c[6],l=c[7],n=c[8],p=c[9],m=c[10],q=c[11],s=c[12],t=c[13],u=c[14],c=c[15];b[0].setComponents(g-a,l-f,q-n,c-s).normalize();b[1].setComponents(g+
+a,l+f,q+n,c+s).normalize();b[2].setComponents(g+d,l+h,q+p,c+t).normalize();b[3].setComponents(g-d,l-h,q-p,c-t).normalize();b[4].setComponents(g-e,l-k,q-m,c-u).normalize();b[5].setComponents(g+e,l+k,q+m,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 g=d[e];a.x=0<g.normal.x?c.min.x:c.max.x;b.x=0<g.normal.x?c.max.x:c.min.x;a.y=0<g.normal.y?c.min.y:c.max.y;b.y=0<g.normal.y?c.max.y:c.min.y;a.z=0<g.normal.z?c.min.z:c.max.z;b.z=0<g.normal.z?c.max.z:c.min.z;var f=g.distanceToPoint(a),g=g.distanceToPoint(b);if(0>f&&0>g)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,
@@ -146,8 +146,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 a+Math.floor(Math.random()*(b-a+1))},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,g,f){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,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;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?this.points.length-1:g+1;c[3]=g>this.points.length-3?this.points.length-1:g+
-2;l=this.points[c[0]];m=this.points[c[1]];p=this.points[c[2]];n=this.points[c[3]];h=f*f;k=f*h;d.x=b(l.x,m.x,p.x,n.x,f,h,k);d.y=b(l.y,m.y,p.y,n.y,f,h,k);d.z=b(l.z,m.z,p.z,n.z,f,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,g=new THREE.Vector3,f=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=
+THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,k,l,n,p,m;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;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?this.points.length-1:g+1;c[3]=g>this.points.length-3?this.points.length-1:g+
+2;l=this.points[c[0]];n=this.points[c[1]];p=this.points[c[2]];m=this.points[c[3]];h=f*f;k=f*h;d.x=b(l.x,n.x,p.x,m.x,f,h,k);d.y=b(l.y,n.y,p.y,m.y,f,h,k);d.z=b(l.z,n.z,p.z,m.z,f,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,g=new THREE.Vector3,f=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=
 a/c,d=this.getPoint(b),f.copy(d),k+=f.distanceTo(g),g.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,g,f,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];f=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);g=b/(this.points.length-1);for(c=1;c<f-1;c++)d=e+1/f*c*(g-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,g,f,h){a.subVectors(f,e);b.subVectors(g,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);g=a.dot(c);var k=b.dot(b);f=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*g-e*f)*l;d=(d*f-e*g)*l;return h.set(1-k-d,d,k)}}();
@@ -172,8 +172,8 @@ new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,b)}}()
 return this}if(a===this)return console.error("THREE.Object3D.add: object can't be added as a child of itself.",a),this;a instanceof THREE.Object3D?(void 0!==a.parent&&a.parent.remove(a),a.parent=this,a.dispatchEvent({type:"added"}),this.children.push(a)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",a);return this},remove:function(a){if(1<arguments.length)for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);b=this.children.indexOf(a);-1!==b&&(a.parent=void 0,
 a.dispatchEvent({type:"removed"}),this.children.splice(b,1))},getChildByName:function(a){console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(a)},getObjectById:function(a){return this.getObjectByProperty("id",a)},getObjectByName:function(a){return this.getObjectByProperty("name",a)},getObjectByProperty:function(a,b){if(this[a]===b)return this;for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c].getObjectByProperty(a,b);
 if(void 0!==e)return e}},getWorldPosition:function(a){a=a||new THREE.Vector3;this.updateMatrixWorld(!0);return a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){c=c||new THREE.Quaternion;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,c,b);return c}}(),getWorldRotation:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Euler;this.getWorldQuaternion(a);return b.setFromQuaternion(a,this.rotation.order,
-!1)}}(),getWorldScale:function(){var a=new THREE.Vector3,b=new THREE.Quaternion;return function(c){c=c||new THREE.Vector3;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,b,c);return c}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverse(a)},traverseVisible:function(a){if(!1!==
-this.visible){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverseVisible(a)}},traverseAncestors:function(a){this.parent&&(a(this.parent),this.parent.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,
+!1)}}(),getWorldScale:function(){var a=new THREE.Vector3,b=new THREE.Quaternion;return function(c){c=c||new THREE.Vector3;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,b,c);return c}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverse(a)},traverseVisible:function(a){if(!1!==
+this.visible){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverseVisible(a)}},traverseAncestors:function(a){var b=this.parent;void 0!==b&&(a(b),b.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,
 this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},toJSON:function(a){function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var c=void 0===a,d={};c&&(a={geometries:{},materials:{},textures:{},images:{}},d.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});d.uuid=this.uuid;d.type=this.type;""!==this.name&&(d.name=this.name);"{}"!==JSON.stringify(this.userData)&&(d.userData=
 this.userData);!0!==this.visible&&(d.visible=this.visible);d.matrix=this.matrix.toArray();if(0<this.children.length){d.children=[];for(var e=0;e<this.children.length;e++)d.children.push(this.children[e].toJSON(a).object)}e={};if(c){var c=b(a.geometries),g=b(a.materials),f=b(a.textures);a=b(a.images);0<c.length&&(e.geometries=c);0<g.length&&(e.materials=g);0<f.length&&(e.textures=f);0<a.length&&(e.images=a)}e.object=d;return e},clone:function(a){return(new THREE.Object3D).copy(this,a)},copy:function(a,
 b){void 0===b&&(b=!0);this.name=a.name;this.up.copy(a.up);this.position.copy(a.position);this.quaternion.copy(a.quaternion);this.scale.copy(a.scale);this.rotationAutoUpdate=a.rotationAutoUpdate;this.matrix.copy(a.matrix);this.matrixWorld.copy(a.matrixWorld);this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrixWorldNeedsUpdate=a.matrixWorldNeedsUpdate;this.visible=a.visible;this.castShadow=a.castShadow;this.receiveShadow=a.receiveShadow;this.frustumCulled=a.frustumCulled;this.renderOrder=a.renderOrder;
@@ -199,31 +199,31 @@ return this},setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data
 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,g=a.vertexNormals.length;e<g;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,g=void 0!==c.normal?c.normal.array:void 0,f=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=[],q=[],s=c=0,t=0;c<d.length;c+=3,s+=2,t+=4)b.vertices.push(new THREE.Vector3(d[c],
-d[c+1],d[c+2])),void 0!==g&&m.push(new THREE.Vector3(g[c],g[c+1],g[c+2])),void 0!==f&&b.colors.push(new THREE.Color(f[c],f[c+1],f[c+2])),void 0!==h&&p.push(new THREE.Vector2(h[s],h[s+1])),void 0!==k&&n.push(new THREE.Vector2(k[s],k[s+1])),void 0!==l&&q.push(new THREE.Vector4(l[t],l[t+1],l[t+2],l[t+3]));t=function(a,c,d){var e=void 0!==g?[m[a].clone(),m[c].clone(),m[d].clone()]:[],s=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[],e=new THREE.Face3(a,c,d,e,s);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(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 s=d[c],u=s.start,x=s.count,v=s.index,s=u,u=u+x;s<u;s+=3)t(v+e[s],v+e[s+1],v+e[s+2]);else for(c=0;c<e.length;c+=3)t(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)t(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,g=void 0!==c.normal?c.normal.array:void 0,f=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 n=[],p=[],m=[],q=[],s=c=0,t=0;c<d.length;c+=3,s+=2,t+=4)b.vertices.push(new THREE.Vector3(d[c],
+d[c+1],d[c+2])),void 0!==g&&n.push(new THREE.Vector3(g[c],g[c+1],g[c+2])),void 0!==f&&b.colors.push(new THREE.Color(f[c],f[c+1],f[c+2])),void 0!==h&&p.push(new THREE.Vector2(h[s],h[s+1])),void 0!==k&&m.push(new THREE.Vector2(k[s],k[s+1])),void 0!==l&&q.push(new THREE.Vector4(l[t],l[t+1],l[t+2],l[t+3]));t=function(a,c,d){var e=void 0!==g?[n[a].clone(),n[c].clone(),n[d].clone()]:[],s=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[],e=new THREE.Face3(a,c,d,e,s);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([m[a].clone(),m[c].clone(),m[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 s=d[c],u=s.start,x=s.count,v=s.index,s=u,u=u+x;s<u;s+=3)t(v+e[s],v+e[s+1],v+e[s+2]);else for(c=0;c<e.length;c+=3)t(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)t(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],g=this.vertices[e.a],f=this.vertices[e.b];a.subVectors(this.vertices[e.c],f);b.subVectors(g,f);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,g,f,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],g=this.vertices[c.b],f=this.vertices[c.c],h.subVectors(f,g),k.subVectors(e,g),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 g=new THREE.Geometry;
 g.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var f=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();
-c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,g,f,h,k,l,m,p,n,q,s,t,u,x=[],v=[];c=new THREE.Vector3;var y=new THREE.Vector3,w=new THREE.Vector3,z=new THREE.Vector3,C=new THREE.Vector3;
-a=0;for(b=this.vertices.length;a<b;a++)x[a]=new THREE.Vector3,v[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,f=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=g[0],m=g[1],p=g[2],g=h.x-f.x,n=k.x-f.x,q=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=m.x-l.x,t=p.x-l.x,m=m.y-l.y,l=p.y-l.y,p=1/(k*l-t*m),c.set((l*g-m*n)*p,(l*q-m*s)*p,(l*h-m*f)*p),y.set((k*n-t*g)*p,(k*s-t*q)*p,(k*f-t*h)*p),x[d].add(c),x[u].add(c),x[e].add(c),v[d].add(y),
+c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,g,f,h,k,l,n,p,m,q,s,t,u,x=[],v=[];c=new THREE.Vector3;var y=new THREE.Vector3,w=new THREE.Vector3,z=new THREE.Vector3,C=new THREE.Vector3;
+a=0;for(b=this.vertices.length;a<b;a++)x[a]=new THREE.Vector3,v[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,f=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=g[0],n=g[1],p=g[2],g=h.x-f.x,m=k.x-f.x,q=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=n.x-l.x,t=p.x-l.x,n=n.y-l.y,l=p.y-l.y,p=1/(k*l-t*n),c.set((l*g-n*m)*p,(l*q-n*s)*p,(l*h-n*f)*p),y.set((k*m-t*g)*p,(k*s-t*q)*p,(k*f-t*h)*p),x[d].add(c),x[u].add(c),x[e].add(c),v[d].add(y),
 v[u].add(y),v[e].add(y);y=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)C.copy(e.vertexNormals[c]),d=e[y[c]],u=x[d],w.copy(u),w.sub(C.multiplyScalar(C.dot(u))).normalize(),z.crossVectors(e.vertexNormals[c],u),d=z.dot(v[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(w.x,w.y,w.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=
 a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,g=this.vertices,f=a.vertices,h=this.faces,
-k=a.faces,l=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(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);g.push(n)}m=0;for(p=k.length;m<p;m++){var f=k[m],q,s=f.vertexNormals,t=f.vertexColors,n=new THREE.Face3(f.a+e,f.b+e,f.c+e);n.normal.copy(f.normal);void 0!==d&&n.normal.applyMatrix3(d).normalize();b=0;for(g=s.length;b<g;b++)q=s[b].clone(),void 0!==d&&q.applyMatrix3(d).normalize(),n.vertexNormals.push(q);
-n.color.copy(f.color);b=0;for(g=t.length;b<g;b++)q=t[b],n.vertexColors.push(q.clone());n.materialIndex=f.materialIndex+c;h.push(n)}m=0;for(p=a.length;m<p;m++)if(c=a[m],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(c[b].clone());l.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,
+k=a.faces,l=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,p=f.length;n<p;n++){var m=f[n].clone();void 0!==b&&m.applyMatrix4(b);g.push(m)}n=0;for(p=k.length;n<p;n++){var f=k[n],q,s=f.vertexNormals,t=f.vertexColors,m=new THREE.Face3(f.a+e,f.b+e,f.c+e);m.normal.copy(f.normal);void 0!==d&&m.normal.applyMatrix3(d).normalize();b=0;for(g=s.length;b<g;b++)q=s[b].clone(),void 0!==d&&q.applyMatrix3(d).normalize(),m.vertexNormals.push(q);
+m.color.copy(f.color);b=0;for(g=t.length;b<g;b++)q=t[b],m.vertexColors.push(q.clone());m.materialIndex=f.materialIndex+c;h.push(m)}n=0;for(p=a.length;n<p;n++)if(c=a[n],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(c[b].clone());l.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),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=this.vertices[g],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];a=[];g=0;for(f=this.faces.length;g<f;g++)for(e=this.faces[g],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(g);break}for(g=a.length-1;0<=g;g--)for(e=a[g],this.faces.splice(e,1),c=0,f=this.faceVertexUvs.length;c<f;c++)this.faceVertexUvs[c].splice(e,1);g=
-this.vertices.length-b.length;this.vertices=b;return g},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!==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 g=this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],l={},m=[],p={},n=[],q={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],t=void 0!==this.faceVertexUvs[0][f],u=0<s.normal.length(),x=0<s.vertexNormals.length,
-v=1!==s.color.r||1!==s.color.g||1!==s.color.b,y=0<s.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,t),w=a(w,4,u),w=a(w,5,x),w=a(w,6,v),w=a(w,7,y);h.push(w);h.push(s.a,s.b,s.c);t&&(t=this.faceVertexUvs[0][f],h.push(d(t[0]),d(t[1]),d(t[2])));u&&h.push(b(s.normal));x&&(u=s.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));v&&h.push(c(s.color));y&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<m.length&&(e.data.colors=m);0<n.length&&
-(e.data.uvs=[n]);e.data.faces=h;return e},clone:function(){return(new THREE.Geometry).copy(this)},copy:function(a){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];for(var b=a.vertices,c=0,d=b.length;c<d;c++)this.vertices.push(b[c].clone());b=a.faces;c=0;for(d=b.length;c<d;c++)this.faces.push(b[c].clone());c=0;for(d=a.faceVertexUvs.length;c<d;c++){b=a.faceVertexUvs[c];void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]);for(var e=0,g=b.length;e<g;e++){for(var f=b[e],h=[],k=0,l=f.length;k<
+this.vertices.length-b.length;this.vertices=b;return g},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]=n.length;n.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=m.length/2;m.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 g=this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],l={},n=[],p={},m=[],q={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],t=void 0!==this.faceVertexUvs[0][f],u=0<s.normal.length(),x=0<s.vertexNormals.length,
+v=1!==s.color.r||1!==s.color.g||1!==s.color.b,y=0<s.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,t),w=a(w,4,u),w=a(w,5,x),w=a(w,6,v),w=a(w,7,y);h.push(w);h.push(s.a,s.b,s.c);t&&(t=this.faceVertexUvs[0][f],h.push(d(t[0]),d(t[1]),d(t[2])));u&&h.push(b(s.normal));x&&(u=s.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));v&&h.push(c(s.color));y&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<n.length&&(e.data.colors=n);0<m.length&&
+(e.data.uvs=[m]);e.data.faces=h;return e},clone:function(){return(new THREE.Geometry).copy(this)},copy:function(a){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];for(var b=a.vertices,c=0,d=b.length;c<d;c++)this.vertices.push(b[c].clone());b=a.faces;c=0;for(d=b.length;c<d;c++)this.faces.push(b[c].clone());c=0;for(d=a.faceVertexUvs.length;c<d;c++){b=a.faceVertexUvs[c];void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]);for(var e=0,g=b.length;e<g;e++){for(var f=b[e],h=[],k=0,l=f.length;k<
 l;k++)h.push(f[k].clone());this.faceVertexUvs[c].push(h)}}return this},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.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.tangents=[];this.morphTargets={};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){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,g=d[1]&&0<d[1].length,f=a.hasTangents,h=a.morphTargets,k=h.length;if(0<k){for(var l=[],m=0;m<k;m++)l[m]=[];this.morphTargets.position=l}var p=a.morphNormals,n=p.length;if(0<n){for(var q=[],m=0;m<n;m++)q[m]=[];this.morphTargets.normal=q}for(var s=a.skinIndices,t=a.skinWeights,u=s.length===c.length,x=t.length===c.length,m=0;m<b.length;m++){var v=b[m];this.vertices.push(c[v.a],c[v.b],c[v.c]);var y=
-v.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(y=v.normal,this.normals.push(y,y,y));y=v.vertexColors;3===y.length?this.colors.push(y[0],y[1],y[2]):(y=v.color,this.colors.push(y,y,y));!0===e&&(y=d[0][m],void 0!==y?this.uvs.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",m),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(y=d[1][m],void 0!==y?this.uvs2.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
-m),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(y=v.vertexTangents,3===y.length?this.tangents.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",m),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(y=0;y<k;y++){var w=h[y].vertices;l[y].push(w[v.a],w[v.b],w[v.c])}for(y=0;y<n;y++)w=p[y].vertexNormals[m],q[y].push(w.a,w.b,w.c);u&&this.skinIndices.push(s[v.a],s[v.b],s[v.c]);x&&this.skinWeights.push(t[v.a],
+return this},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,g=d[1]&&0<d[1].length,f=a.hasTangents,h=a.morphTargets,k=h.length;if(0<k){for(var l=[],n=0;n<k;n++)l[n]=[];this.morphTargets.position=l}var p=a.morphNormals,m=p.length;if(0<m){for(var q=[],n=0;n<m;n++)q[n]=[];this.morphTargets.normal=q}for(var s=a.skinIndices,t=a.skinWeights,u=s.length===c.length,x=t.length===c.length,n=0;n<b.length;n++){var v=b[n];this.vertices.push(c[v.a],c[v.b],c[v.c]);var y=
+v.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(y=v.normal,this.normals.push(y,y,y));y=v.vertexColors;3===y.length?this.colors.push(y[0],y[1],y[2]):(y=v.color,this.colors.push(y,y,y));!0===e&&(y=d[0][n],void 0!==y?this.uvs.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",n),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(y=d[1][n],void 0!==y?this.uvs2.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
+n),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(y=v.vertexTangents,3===y.length?this.tangents.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",n),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(y=0;y<k;y++){var w=h[y].vertices;l[y].push(w[v.a],w[v.b],w[v.c])}for(y=0;y<m;y++)w=p[y].vertexNormals[n],q[y].push(w.a,w.b,w.c);u&&this.skinIndices.push(s[v.a],s[v.b],s[v.c]);x&&this.skinWeights.push(t[v.a],
 t[v.b],t[v.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.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]},removeAttribute:function(a){delete this.attributes[a]},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .drawcalls.");
@@ -238,16 +238,16 @@ a.colors.length),this.addAttribute("color",(new THREE.BufferAttribute(b,3)).copy
 (c=new THREE.Float32Attribute(4*a.skinWeights.length,4),this.addAttribute("skinWeight",c.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,g=c.length;e<g;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
-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,g,f,h,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;if(a.index){var q=a.index.array;0===this.drawcalls.length&&this.addDrawCall(0,
-q.length);for(var s=0,t=this.drawcalls.length;s<t;++s){e=this.drawcalls[s].start;g=this.drawcalls[s].count;for(var u=this.drawcalls[s].index,d=e,e=e+g;d<e;d+=3)g=3*(u+q[d]),f=3*(u+q[d+1]),h=3*(u+q[d+2]),k.fromArray(b,g),l.fromArray(b,f),m.fromArray(b,h),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[f]+=p.x,c[f+1]+=p.y,c[f+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);q.fromArray(d,3*c);s.fromArray(g,2*a);t.fromArray(g,2*b);u.fromArray(g,2*c);x=n.x-p.x;v=q.x-p.x;y=n.y-p.y;w=q.y-p.y;z=n.z-p.z;C=q.z-p.z;A=t.x-s.x;B=u.x-s.x;O=t.y-s.y;I=u.y-s.y;E=1/(A*I-B*O);S.set((I*x-O*v)*E,(I*y-O*w)*E,(I*z-O*C)*E);K.set((A*
-v-B*x)*E,(A*w-B*y)*E,(A*C-B*z)*E);k[a].add(S);k[b].add(S);k[c].add(S);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){$.fromArray(e,3*a);ea.copy($);la=k[a];T.copy(la);T.sub($.multiplyScalar($.dot(la))).normalize();H.crossVectors(ea,la);na=H.dot(l[a]);fa=0>na?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=fa}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,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],m=0;m<f;m++)k[m]=new THREE.Vector3,l[m]=new THREE.Vector3;var p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,s=new THREE.Vector2,t=new THREE.Vector2,u=new THREE.Vector2,x,v,y,w,z,C,
-A,B,O,I,E,S=new THREE.Vector3,K=new THREE.Vector3,F,J,D,L,R;0===this.drawcalls.length&&this.addDrawCall(0,c.length);var U=this.drawcalls,m=0;for(J=U.length;m<J;++m){F=U[m].start;D=U[m].count;var Q=U[m].index,f=F;for(F+=D;f<F;f+=3)D=Q+c[f],L=Q+c[f+1],R=Q+c[f+2],a(D,L,R)}var T=new THREE.Vector3,H=new THREE.Vector3,$=new THREE.Vector3,ea=new THREE.Vector3,fa,la,na,m=0;for(J=U.length;m<J;++m)for(F=U[m].start,D=U[m].count,Q=U[m].index,f=F,F+=D;f<F;f+=3)D=Q+c[f],L=Q+c[f+1],R=Q+c[f+2],b(D),b(L),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),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,m=0,p=new Int32Array(6),n=new Int32Array(c.length),q=new Int32Array(c.length),s=0;s<c.length;s++)n[s]=-1,q[s]=-1;for(c=0;c<d;c++){for(var t=m=0;3>t;t++)s=b[3*c+t],-1===n[s]?(p[2*t]=s,p[2*t+1]=-1,m++):n[s]<k.index?(p[2*t]=s,p[2*t+1]=-1,
-l++):(p[2*t]=s,p[2*t+1]=n[s]);if(f+m>k.index+a)for(k={start:g,count:0,index:f},h.push(k),m=0;6>m;m+=2)t=p[m+1],-1<t&&t<k.index&&(p[m+1]=-1);for(m=0;6>m;m+=2)s=p[m],t=p[m+1],-1===t&&(t=f++),n[s]=t,q[t]=s,e[g++]=t-k.index,k.count++}this.reorderBuffers(e,q,f);this.clearDrawCalls();for(a=0;a<h.length;a++)b=h[a],this.addDrawCall(b.start,b.count,b.index)},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
+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,g,f,h,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index){var q=a.index.array;0===this.drawcalls.length&&this.addDrawCall(0,
+q.length);for(var s=0,t=this.drawcalls.length;s<t;++s){e=this.drawcalls[s].start;g=this.drawcalls[s].count;for(var u=this.drawcalls[s].index,d=e,e=e+g;d<e;d+=3)g=3*(u+q[d]),f=3*(u+q[d+1]),h=3*(u+q[d+2]),k.fromArray(b,g),l.fromArray(b,f),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[f]+=p.x,c[f+1]+=p.y,c[f+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),n.fromArray(b,d+6),p.subVectors(n,
+l),m.subVectors(k,l),p.cross(m),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);m.fromArray(d,3*b);q.fromArray(d,3*c);s.fromArray(g,2*a);t.fromArray(g,2*b);u.fromArray(g,2*c);x=m.x-p.x;v=q.x-p.x;y=m.y-p.y;w=q.y-p.y;z=m.z-p.z;C=q.z-p.z;A=t.x-s.x;B=u.x-s.x;S=t.y-s.y;I=u.y-s.y;D=1/(A*I-B*S);P.set((I*x-S*v)*D,(I*y-S*w)*D,(I*z-S*C)*D);K.set((A*
+v-B*x)*D,(A*w-B*y)*D,(A*C-B*z)*D);k[a].add(P);k[b].add(P);k[c].add(P);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){qa.fromArray(e,3*a);$.copy(qa);fa=k[a];T.copy(fa);T.sub(qa.multiplyScalar(qa.dot(fa))).normalize();H.crossVectors($,fa);ra=H.dot(l[a]);ja=0>ra?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=ja}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,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<f;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,q=new THREE.Vector3,s=new THREE.Vector2,t=new THREE.Vector2,u=new THREE.Vector2,x,v,y,w,z,C,
+A,B,S,I,D,P=new THREE.Vector3,K=new THREE.Vector3,N,E,F,J,R;0===this.drawcalls.length&&this.addDrawCall(0,c.length);var U=this.drawcalls,n=0;for(E=U.length;n<E;++n){N=U[n].start;F=U[n].count;var Q=U[n].index,f=N;for(N+=F;f<N;f+=3)F=Q+c[f],J=Q+c[f+1],R=Q+c[f+2],a(F,J,R)}var T=new THREE.Vector3,H=new THREE.Vector3,qa=new THREE.Vector3,$=new THREE.Vector3,ja,fa,ra,n=0;for(E=U.length;n<E;++n)for(N=U[n].start,F=U[n].count,Q=U[n].index,f=N,N+=F;f<N;f+=3)F=Q+c[f],J=Q+c[f+1],R=Q+c[f+2],b(F),b(J),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),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),q=new Int32Array(c.length),s=0;s<c.length;s++)m[s]=-1,q[s]=-1;for(c=0;c<d;c++){for(var t=n=0;3>t;t++)s=b[3*c+t],-1===m[s]?(p[2*t]=s,p[2*t+1]=-1,n++):m[s]<k.index?(p[2*t]=s,p[2*t+1]=-1,
+l++):(p[2*t]=s,p[2*t+1]=m[s]);if(f+n>k.index+a)for(k={start:g,count:0,index:f},h.push(k),n=0;6>n;n+=2)t=p[n+1],-1<t&&t<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)s=p[n],t=p[n+1],-1===t&&(t=f++),m[s]=t,q[t]=s,e[g++]=t-k.index,k.count++}this.reorderBuffers(e,q,f);this.clearDrawCalls();for(a=0;a<h.length;a++)b=h[a],this.addDrawCall(b.start,b.count,b.index)},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,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
-c));for(var g=0;g<c;g++){var f=b[g];for(e in this.attributes)if("index"!==e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],m=0;m<k;m++)l[g*k+m]=h[f*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);
+c));for(var g=0;g<c;g++){var f=b[g];for(e in this.attributes)if("index"!==e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],n=0;n<k;n++)l[g*k+n]=h[f*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!==e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=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.drawcalls,e=this.boundingSphere;for(c in b){var g=b[c],f=Array.prototype.slice.call(g.array);a.data.attributes[c]={itemSize:g.itemSize,type:g.array.constructor.name,array:f}}0<d.length&&(a.data.drawcalls=JSON.parse(JSON.stringify(d)));null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){return(new THREE.BufferGeometry).copy(this)},
 copy:function(a){for(var b in a.attributes)this.addAttribute(b,a.attributes[b].clone());b=0;for(var c=a.drawcalls.length;b<c;b++){var d=a.drawcalls[b];this.addDrawCall(d.start,d.count,d.index)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.BufferGeometry.MaxIndex=65535;
 THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c,d){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0,instances:d})};
@@ -255,8 +255,8 @@ THREE.InstancedBufferGeometry.prototype.clone=function(){var a=new THREE.Instanc
 THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();
 THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();THREE.Camera.prototype.clone=function(){return(new THREE.Camera).copy(this)};THREE.Camera.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.matrixWorldInverse.copy(a.matrixWorldInverse);this.projectionMatrix.copy(a.projectionMatrix);return this};
 THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,1);g.lookAt(new THREE.Vector3(0,1,0));this.add(g);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,-1);f.lookAt(new THREE.Vector3(0,-1,0));
-this.add(f);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){void 0===this.parent&&this.updateMatrixWorld();var c=this.renderTarget,n=c.generateMipmaps;c.generateMipmaps=
-!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,g,c);c.activeCubeFace=3;a.render(b,f,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=n;c.activeCubeFace=5;a.render(b,k,c);a.setRenderTarget(null)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.CubeCamera.prototype.constructor=THREE.CubeCamera;
+this.add(f);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){void 0===this.parent&&this.updateMatrixWorld();var c=this.renderTarget,m=c.generateMipmaps;c.generateMipmaps=
+!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,g,c);c.activeCubeFace=3;a.render(b,f,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=m;c.activeCubeFace=5;a.render(b,k,c);a.setRenderTarget(null)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.CubeCamera.prototype.constructor=THREE.CubeCamera;
 THREE.OrthographicCamera=function(a,b,c,d,e,g){THREE.Camera.call(this);this.type="OrthographicCamera";this.zoom=1;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==g?g:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;
 THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var a=(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(c-a,c+a,d+b,d-b,this.near,this.far)};
 THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;a.copy(this);a.zoom=this.zoom;a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;return a};
@@ -294,13 +294,13 @@ void 0!==this.responseType&&(f.responseType=this.responseType);void 0!==this.wit
 THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,g=THREE.Cache.get(a);if(void 0!==g)return b&&setTimeout(function(){b(g)},0),g;var f=document.createElement("img");f.addEventListener("load",function(c){THREE.Cache.add(a,this);b&&b(this);e.manager.itemEnd(a)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);e.manager.itemStart(a);
 f.src=a;return f},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this.withCredentials=!1};
 THREE.JSONLoader.prototype={constructor:THREE.JSONLoader,load:function(a,b,c,d){var e=this,g=this.texturePath&&"string"===typeof this.texturePath?this.texturePath:THREE.Loader.prototype.extractUrlBase(a);c=new THREE.XHRLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.setWithCredentials(this.withCredentials);c.load(a,function(c){c=JSON.parse(c);var d=c.metadata;if(void 0!==d){if("object"===d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===
-d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,g);b(c.geometry,c.materials)})},setCrossOrigin:function(a){this.crossOrigin=a},setTexturePath:function(a){this.texturePath=a},parse:function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,l,m,p,n,q,s,t,u,x,v=a.faces;m=a.vertices;var y=a.normals,w=a.colors,z=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&z++;for(d=0;d<z;d++)c.faceVertexUvs[d]=
-[]}k=0;for(l=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=v.length;k<l;)if(b=v[k++],q=b&1,h=b&2,d=b&8,p=b&16,s=b&32,m=b&64,b&=128,q){q=new THREE.Face3;q.a=v[k];q.b=v[k+1];q.c=v[k+3];t=new THREE.Face3;t.a=v[k+1];t.b=v[k+2];t.c=v[k+3];k+=4;h&&(h=v[k++],q.materialIndex=h,t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)n=v[k++],x=u[2*n],n=u[2*n+1],x=new THREE.Vector2(x,
-n),2!==f&&c.faceVertexUvs[d][h].push(x),0!==f&&c.faceVertexUvs[d][h+1].push(x);p&&(p=3*v[k++],q.normal.set(y[p++],y[p++],y[p]),t.normal.copy(q.normal));if(s)for(d=0;4>d;d++)p=3*v[k++],s=new THREE.Vector3(y[p++],y[p++],y[p]),2!==d&&q.vertexNormals.push(s),0!==d&&t.vertexNormals.push(s);m&&(m=v[k++],m=w[m],q.color.setHex(m),t.color.setHex(m));if(b)for(d=0;4>d;d++)m=v[k++],m=w[m],2!==d&&q.vertexColors.push(new THREE.Color(m)),0!==d&&t.vertexColors.push(new THREE.Color(m));c.faces.push(q);c.faces.push(t)}else{q=
-new THREE.Face3;q.a=v[k++];q.b=v[k++];q.c=v[k++];h&&(h=v[k++],q.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)n=v[k++],x=u[2*n],n=u[2*n+1],x=new THREE.Vector2(x,n),c.faceVertexUvs[d][h].push(x);p&&(p=3*v[k++],q.normal.set(y[p++],y[p++],y[p]));if(s)for(d=0;3>d;d++)p=3*v[k++],s=new THREE.Vector3(y[p++],y[p++],y[p]),q.vertexNormals.push(s);m&&(m=v[k++],q.color.setHex(w[m]));if(b)for(d=0;3>d;d++)m=v[k++],q.vertexColors.push(new THREE.Color(w[m]));
+d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,g);b(c.geometry,c.materials)})},setCrossOrigin:function(a){this.crossOrigin=a},setTexturePath:function(a){this.texturePath=a},parse:function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,l,n,p,m,q,s,t,u,x,v=a.faces;n=a.vertices;var y=a.normals,w=a.colors,z=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&z++;for(d=0;d<z;d++)c.faceVertexUvs[d]=
+[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=v.length;k<l;)if(b=v[k++],q=b&1,h=b&2,d=b&8,p=b&16,s=b&32,n=b&64,b&=128,q){q=new THREE.Face3;q.a=v[k];q.b=v[k+1];q.c=v[k+3];t=new THREE.Face3;t.a=v[k+1];t.b=v[k+2];t.c=v[k+3];k+=4;h&&(h=v[k++],q.materialIndex=h,t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)m=v[k++],x=u[2*m],m=u[2*m+1],x=new THREE.Vector2(x,
+m),2!==f&&c.faceVertexUvs[d][h].push(x),0!==f&&c.faceVertexUvs[d][h+1].push(x);p&&(p=3*v[k++],q.normal.set(y[p++],y[p++],y[p]),t.normal.copy(q.normal));if(s)for(d=0;4>d;d++)p=3*v[k++],s=new THREE.Vector3(y[p++],y[p++],y[p]),2!==d&&q.vertexNormals.push(s),0!==d&&t.vertexNormals.push(s);n&&(n=v[k++],n=w[n],q.color.setHex(n),t.color.setHex(n));if(b)for(d=0;4>d;d++)n=v[k++],n=w[n],2!==d&&q.vertexColors.push(new THREE.Color(n)),0!==d&&t.vertexColors.push(new THREE.Color(n));c.faces.push(q);c.faces.push(t)}else{q=
+new THREE.Face3;q.a=v[k++];q.b=v[k++];q.c=v[k++];h&&(h=v[k++],q.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)m=v[k++],x=u[2*m],m=u[2*m+1],x=new THREE.Vector2(x,m),c.faceVertexUvs[d][h].push(x);p&&(p=3*v[k++],q.normal.set(y[p++],y[p++],y[p]));if(s)for(d=0;3>d;d++)p=3*v[k++],s=new THREE.Vector3(y[p++],y[p++],y[p]),q.vertexNormals.push(s);n&&(n=v[k++],q.color.setHex(w[n]));if(b)for(d=0;3>d;d++)n=v[k++],q.vertexColors.push(new THREE.Color(w[n]));
 c.faces.push(q)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;d<f;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,f=a.skinIndices.length;d<f;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<
-c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,f,h,k,l,m;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=
-[],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,f=a.morphColors.length;d<f;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,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();
+c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,f,h,k,l,n;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=
+[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var p=new THREE.Vector3;p.x=n[h]*b;p.y=n[h+1]*b;p.z=n[h+2]*b;l.push(p)}}if(void 0!==a.morphColors)for(d=0,f=a.morphColors.length;d<f;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();
 if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=THREE.Loader.prototype.initMaterials(a.materials,b,this.crossOrigin);THREE.Loader.prototype.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}}};
 THREE.LoadingManager=function(a,b,c){var d=this,e=!1,g=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++;if(!1===e&&void 0!==d.onStart)d.onStart(a,g,f);e=!0};this.itemEnd=function(a){g++;if(void 0!==d.onProgress)d.onProgress(a,g,f);if(g===f&&(e=!1,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,g=new THREE.XHRLoader(e.manager);g.setCrossOrigin(this.crossOrigin);g.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],g=new self[e.type](e.array);b.addAttribute(d,new THREE.BufferAttribute(g,e.itemSize))}c=a.data.drawcalls||a.data.offsets;if(void 0!==
@@ -326,8 +326,8 @@ THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b
 THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(a,b,c,d){var e=this,g=new THREE.DataTexture,f=new THREE.XHRLoader(this.manager);f.setCrossOrigin(this.crossOrigin);f.setResponseType("arraybuffer");f.load(a,function(a){if(a=e._parser(a))void 0!==a.image?g.image=a.image:void 0!==a.data&&(g.image.width=a.width,g.image.height=a.height,g.image.data=a.data),g.wrapS=void 0!==a.wrapS?a.wrapS:THREE.ClampToEdgeWrapping,g.wrapT=void 0!==a.wrapT?a.wrapT:THREE.ClampToEdgeWrapping,
 g.magFilter=void 0!==a.magFilter?a.magFilter:THREE.LinearFilter,g.minFilter=void 0!==a.minFilter?a.minFilter:THREE.LinearMipMapLinearFilter,g.anisotropy=void 0!==a.anisotropy?a.anisotropy:1,void 0!==a.format&&(g.format=a.format),void 0!==a.type&&(g.type=a.type),void 0!==a.mipmaps&&(g.mipmaps=a.mipmaps),1===a.mipmapCount&&(g.minFilter=THREE.LinearFilter),g.needsUpdate=!0,b&&b(g,a)},c,d);return g},setCrossOrigin:function(a){this.crossOrigin=a}};
 THREE.CompressedTextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this._parser=null};
-THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c,d){var e=this,g=[],f=new THREE.CompressedTexture;f.image=g;var h=new THREE.XHRLoader(this.manager);h.setCrossOrigin(this.crossOrigin);h.setResponseType("arraybuffer");if(Array.isArray(a))for(var k=0,l=function(n){h.load(a[n],function(a){a=e._parser(a,!0);g[n]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};k+=1;6===k&&(1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=
-a.format,f.needsUpdate=!0,b&&b(f))},c,d)},m=0,p=a.length;m<p;++m)l(m);else h.load(a,function(a){a=e._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,d=0;d<c;d++){g[d]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)g[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+h]),g[d].format=a.format,g[d].width=a.width,g[d].height=a.height}else f.image.width=a.width,f.image.height=a.height,f.mipmaps=a.mipmaps;1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter);f.format=a.format;f.needsUpdate=!0;b&&
+THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c,d){var e=this,g=[],f=new THREE.CompressedTexture;f.image=g;var h=new THREE.XHRLoader(this.manager);h.setCrossOrigin(this.crossOrigin);h.setResponseType("arraybuffer");if(Array.isArray(a))for(var k=0,l=function(l){h.load(a[l],function(a){a=e._parser(a,!0);g[l]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};k+=1;6===k&&(1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=
+a.format,f.needsUpdate=!0,b&&b(f))},c,d)},n=0,p=a.length;n<p;++n)l(n);else h.load(a,function(a){a=e._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,d=0;d<c;d++){g[d]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)g[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+h]),g[d].format=a.format,g[d].width=a.width,g[d].height=a.height}else f.image.width=a.width,f.image.height=a.height,f.mipmaps=a.mipmaps;1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter);f.format=a.format;f.needsUpdate=!0;b&&
 b(f)},c,d);return f},setCrossOrigin:function(a){this.crossOrigin=a}};
 THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=THREE.LessEqualDepth;this.colorWrite=this.depthWrite=
 this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this._needsUpdate=this.visible=!0};
@@ -354,8 +354,8 @@ THREE.MeshPhongMaterial.prototype.copy=function(a){THREE.Material.prototype.copy
 this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.fog=a.fog;this.shading=a.shading;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.vertexColors=a.vertexColors;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};
 THREE.MeshPhongMaterial.prototype.clone=function(){return(new THREE.MeshPhongMaterial).copy(this)};THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.type="MeshDepthMaterial";this.wireframe=this.morphTargets=!1;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;
 THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;a.copy(this);a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.type="MeshNormalMaterial";this.wireframe=!1;this.wireframeLinewidth=1;this.morphTargets=!1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;
-THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;a.copy(this);a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};THREE.MeshFaceMaterial=function(a){this.uuid=THREE.Math.generateUUID();this.type="MeshFaceMaterial";this.materials=a instanceof Array?a:[]};
-THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},b=0,c=this.materials.length;b<c;b++)a.materials.push(this.materials[b].toJSON());return a},clone:function(){for(var a=new THREE.MeshFaceMaterial,b=0;b<this.materials.length;b++)a.materials.push(this.materials[b].clone());return a}};
+THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;a.copy(this);a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};THREE.MeshFaceMaterial=function(a){this.uuid=THREE.Math.generateUUID();this.type="MeshFaceMaterial";this.materials=a instanceof Array?a:[];this.visible=!0};
+THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},b=0,c=this.materials.length;b<c;b++)a.materials.push(this.materials[b].toJSON());a.visible=this.visible;return a},clone:function(){for(var a=new THREE.MeshFaceMaterial,b=0;b<this.materials.length;b++)a.materials.push(this.materials[b].clone());a.visible=this.visible;return a}};
 THREE.PointCloudMaterial=function(a){THREE.Material.call(this);this.type="PointCloudMaterial";this.color=new THREE.Color(16777215);this.map=null;this.size=1;this.sizeAttenuation=!0;this.vertexColors=THREE.NoColors;this.fog=!0;this.setValues(a)};THREE.PointCloudMaterial.prototype=Object.create(THREE.Material.prototype);THREE.PointCloudMaterial.prototype.constructor=THREE.PointCloudMaterial;
 THREE.PointCloudMaterial.prototype.clone=function(){var a=new THREE.PointCloudMaterial;a.copy(this);a.color.copy(this.color);a.map=this.map;a.size=this.size;a.sizeAttenuation=this.sizeAttenuation;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};THREE.ParticleBasicMaterial=function(a){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial.");return new THREE.PointCloudMaterial(a)};
 THREE.ParticleSystemMaterial=function(a){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial.");return new THREE.PointCloudMaterial(a)};
@@ -372,31 +372,31 @@ THREE.Texture.prototype={constructor:THREE.Texture,set needsUpdate(a){!0===a&&th
 a.premultiplyAlpha;this.flipY=a.flipY;this.unpackAlignment=a.unpackAlignment;return this},toJSON:function(a){if(void 0!==a.textures[this.uuid])return a.textures[this.uuid];var b={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy};if(void 0!==this.image){var c=
 this.image;void 0===c.uuid&&(c.uuid=THREE.Math.generateUUID());if(void 0===a.images[c.uuid]){var d=a.images,e=c.uuid,g=c.uuid,f;void 0!==c.toDataURL?f=c:(f=document.createElement("canvas"),f.width=c.width,f.height=c.height,f.getContext("2d").drawImage(c,0,0,c.width,c.height));f=2048<f.width||2048<f.height?f.toDataURL("image/jpeg",.6):f.toDataURL("image/png");d[e]={uuid:g,url:f}}b.image=c.uuid}return a.textures[this.uuid]=b},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);
 THREE.TextureIdCount=0;THREE.CubeTexture=function(a,b,c,d,e,g,f,h,k){b=void 0!==b?b:THREE.CubeReflectionMapping;THREE.Texture.call(this,a,b,c,d,e,g,f,h,k);this.images=a;this.flipY=!1};THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CubeTexture.prototype.constructor=THREE.CubeTexture;THREE.CubeTexture.clone=function(){var a=new THREE.CubeTexture;a.copy(this);a.images=this.images;return a};
-THREE.CompressedTexture=function(a,b,c,d,e,g,f,h,k,l,m){THREE.Texture.call(this,null,g,f,h,k,l,d,e,m);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture;THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;a.copy(this);return a};
-THREE.DataTexture=function(a,b,c,d,e,g,f,h,k,l,m){THREE.Texture.call(this,null,g,f,h,k,l,d,e,m);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture;THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;a.copy(this);return a};
-THREE.VideoTexture=function(a,b,c,d,e,g,f,h,k){THREE.Texture.call(this,a,b,c,d,e,g,f,h,k);this.generateMipmaps=!1;var l=this,m=function(){requestAnimationFrame(m);a.readyState===a.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)};m()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);
+THREE.CompressedTexture=function(a,b,c,d,e,g,f,h,k,l,n){THREE.Texture.call(this,null,g,f,h,k,l,d,e,n);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture;THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;a.copy(this);return a};
+THREE.DataTexture=function(a,b,c,d,e,g,f,h,k,l,n){THREE.Texture.call(this,null,g,f,h,k,l,d,e,n);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture;THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;a.copy(this);return a};
+THREE.VideoTexture=function(a,b,c,d,e,g,f,h,k){THREE.Texture.call(this,a,b,c,d,e,g,f,h,k);this.generateMipmaps=!1;var l=this,n=function(){requestAnimationFrame(n);a.readyState===a.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)};n()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;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(){return(new THREE.Group).copy(this)};THREE.Group.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);return this};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,g=e.geometry,f=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===g.boundingBox||!1!==b.isIntersectionBox(g.boundingBox)){var f=f/((this.scale.x+this.scale.y+this.scale.z)/3),h=f*f,k=new THREE.Vector3,f=function(a,f){var g=b.distanceSqToPoint(a);if(g<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(g),point:k.clone(),index:f,face:null,object:e})}};if(g instanceof THREE.BufferGeometry){var l=g.attributes,m=l.position.array;if(void 0!==l.index){var l=l.index.array,p=g.drawcalls;0===p.length&&(p=[{start:0,count:l.length,index:0}]);for(var n=0,q=p.length;n<q;++n)for(var s=p[n],t=s.start,u=s.index,g=t,s=t+s.count;g<s;g++)t=u+l[g],k.fromArray(m,3*t),f(k,t)}else for(g=0,l=m.length/3;g<l;g++)k.fromArray(m,3*g),f(k,g)}else for(k=g.vertices,
+l<c.near||l>c.far||d.push({distance:l,distanceToRay:Math.sqrt(g),point:k.clone(),index:f,face:null,object:e})}};if(g instanceof THREE.BufferGeometry){var l=g.attributes,n=l.position.array;if(void 0!==l.index){var l=l.index.array,p=g.drawcalls;0===p.length&&(p=[{start:0,count:l.length,index:0}]);for(var m=0,q=p.length;m<q;++m)for(var s=p[m],t=s.start,u=s.index,g=t,s=t+s.count;g<s;g++)t=u+l[g],k.fromArray(n,3*t),f(k,t)}else for(g=0,l=n.length/3;g<l;g++)k.fromArray(n,3*g),f(k,g)}else for(k=g.vertices,
 g=0,l=k.length;g<l;g++)f(k[g],g)}}}();THREE.PointCloud.prototype.clone=function(){return(new THREE.PointCloud(this.geometry,this.material)).copy(this)};THREE.PointCloud.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);return this};
 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 g=d.linePrecision,g=g*g,f=this.geometry;null===f.boundingSphere&&f.computeBoundingSphere();c.copy(f.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(f instanceof
-THREE.BufferGeometry){var n=f.attributes;if(void 0!==n.index){var q=n.index.array,n=n.position.array,s=f.drawcalls;0===s.length&&(s=[{start:0,count:q.length,index:0}]);for(var t=0;t<s.length;t++)for(var u=s[t].start,x=s[t].count,v=s[t].index,f=u;f<u+x-1;f+=p){var y=v+q[f+1];h.fromArray(n,3*(v+q[f]));k.fromArray(n,3*y);y=b.distanceSqToSegment(h,k,m,l);y>g||(y=b.origin.distanceTo(m),y<d.near||y>d.far||e.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:f,offsetIndex:t,face:null,
-faceIndex:null,object:this}))}}else for(n=n.position.array,f=0;f<n.length/3-1;f+=p)h.fromArray(n,3*f),k.fromArray(n,3*f+3),y=b.distanceSqToSegment(h,k,m,l),y>g||(y=b.origin.distanceTo(m),y<d.near||y>d.far||e.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}else if(f instanceof THREE.Geometry)for(h=f.vertices,k=h.length,f=0;f<k-1;f+=p)y=b.distanceSqToSegment(h[f],h[f+1],m,l),y>g||(y=b.origin.distanceTo(m),y<d.near||y>d.far||e.push({distance:y,
+THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var g=d.linePrecision,g=g*g,f=this.geometry;null===f.boundingSphere&&f.computeBoundingSphere();c.copy(f.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,n=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(f instanceof
+THREE.BufferGeometry){var m=f.attributes;if(void 0!==m.index){var q=m.index.array,m=m.position.array,s=f.drawcalls;0===s.length&&(s=[{start:0,count:q.length,index:0}]);for(var t=0;t<s.length;t++)for(var u=s[t].start,x=s[t].count,v=s[t].index,f=u;f<u+x-1;f+=p){var y=v+q[f+1];h.fromArray(m,3*(v+q[f]));k.fromArray(m,3*y);y=b.distanceSqToSegment(h,k,n,l);y>g||(y=b.origin.distanceTo(n),y<d.near||y>d.far||e.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:f,offsetIndex:t,face:null,
+faceIndex:null,object:this}))}}else for(m=m.position.array,f=0;f<m.length/3-1;f+=p)h.fromArray(m,3*f),k.fromArray(m,3*f+3),y=b.distanceSqToSegment(h,k,n,l),y>g||(y=b.origin.distanceTo(n),y<d.near||y>d.far||e.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}else if(f instanceof THREE.Geometry)for(h=f.vertices,k=h.length,f=0;f<k-1;f+=p)y=b.distanceSqToSegment(h[f],h[f+1],n,l),y>g||(y=b.origin.distanceTo(n),y<d.near||y>d.far||e.push({distance:y,
 point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(){return(new THREE.Line(this.geometry,this.material)).copy(this)};THREE.Line.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);return this};
 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(){var a=new THREE.LineSegments(this.geometry,this.material);a.copy(this);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()};
 THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototype.constructor=THREE.Mesh;
 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,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3;return function(l,m){var p=this.geometry,n=this.material;if(void 0!==n&&(null===p.boundingSphere&&p.computeBoundingSphere(),c.copy(p.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==l.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(l.ray).applyMatrix4(a),null===
-p.boundingBox||!1!==b.isIntersectionBox(p.boundingBox)))){var q,s,t;if(p instanceof THREE.BufferGeometry)if(q=p.attributes,void 0!==q.index){var u=q.index.array,x=q.position.array,p=p.drawcalls;0===p.length&&(p=[{start:0,count:u.length,index:0}]);for(var v=0,y=p.length;v<y;++v){q=p[v].start;for(var w=p[v].index,z=q,C=q+p[v].count;z<C;z+=3){q=w+u[z];s=w+u[z+1];t=w+u[z+2];d.fromArray(x,3*q);e.fromArray(x,3*s);g.fromArray(x,3*t);var A=n.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,
-e,g,n.side!==THREE.DoubleSide);if(null!==A){A.applyMatrix4(this.matrixWorld);var B=l.ray.origin.distanceTo(A);B<l.near||B>l.far||m.push({distance:B,point:A,face:new THREE.Face3(q,s,t,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(z/3),object:this})}}}}else for(x=q.position.array,z=0,C=x.length;z<C;z+=9)d.fromArray(x,z),e.fromArray(x,z+3),g.fromArray(x,z+6),A=n.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,n.side!==THREE.DoubleSide),null!==A&&(A.applyMatrix4(this.matrixWorld),
-B=l.ray.origin.distanceTo(A),B<l.near||B>l.far||(q=z/3,s=q+1,t=q+2,m.push({distance:B,point:A,face:new THREE.Face3(q,s,t,THREE.Triangle.normal(d,e,g)),index:q,object:this})));else if(p instanceof THREE.Geometry)for(u=n instanceof THREE.MeshFaceMaterial,x=!0===u?n.materials:null,v=p.vertices,y=p.faces,w=0,z=y.length;w<z;w++)if(C=y[w],A=!0===u?x[C.materialIndex]:n,void 0!==A){q=v[C.a];s=v[C.b];t=v[C.c];if(!0===A.morphTargets){var B=p.morphTargets,O=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,
-0);g.set(0,0,0);for(var I=0,E=B.length;I<E;I++){var S=O[I];if(0!==S){var K=B[I].vertices;d.addScaledVector(f.subVectors(K[C.a],q),S);e.addScaledVector(h.subVectors(K[C.b],s),S);g.addScaledVector(k.subVectors(K[C.c],t),S)}}d.add(q);e.add(s);g.add(t);q=d;s=e;t=g}A=A.side===THREE.BackSide?b.intersectTriangle(t,s,q,!0):b.intersectTriangle(q,s,t,A.side!==THREE.DoubleSide);null!==A&&(A.applyMatrix4(this.matrixWorld),B=l.ray.origin.distanceTo(A),B<l.near||B>l.far||m.push({distance:B,point:A,face:C,faceIndex:w,
+THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3;return function(l,n){var p=this.geometry,m=this.material;if(void 0!==m&&(null===p.boundingSphere&&p.computeBoundingSphere(),c.copy(p.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==l.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(l.ray).applyMatrix4(a),null===
+p.boundingBox||!1!==b.isIntersectionBox(p.boundingBox)))){var q,s,t;if(p instanceof THREE.BufferGeometry)if(q=p.attributes,void 0!==q.index){var u=q.index.array,x=q.position.array,p=p.drawcalls;0===p.length&&(p=[{start:0,count:u.length,index:0}]);for(var v=0,y=p.length;v<y;++v){q=p[v].start;for(var w=p[v].index,z=q,C=q+p[v].count;z<C;z+=3){q=w+u[z];s=w+u[z+1];t=w+u[z+2];d.fromArray(x,3*q);e.fromArray(x,3*s);g.fromArray(x,3*t);var A=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,
+e,g,m.side!==THREE.DoubleSide);if(null!==A){A.applyMatrix4(this.matrixWorld);var B=l.ray.origin.distanceTo(A);B<l.near||B>l.far||n.push({distance:B,point:A,face:new THREE.Face3(q,s,t,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(z/3),object:this})}}}}else for(x=q.position.array,z=0,C=x.length;z<C;z+=9)d.fromArray(x,z),e.fromArray(x,z+3),g.fromArray(x,z+6),A=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide),null!==A&&(A.applyMatrix4(this.matrixWorld),
+B=l.ray.origin.distanceTo(A),B<l.near||B>l.far||(q=z/3,s=q+1,t=q+2,n.push({distance:B,point:A,face:new THREE.Face3(q,s,t,THREE.Triangle.normal(d,e,g)),index:q,object:this})));else if(p instanceof THREE.Geometry)for(u=m instanceof THREE.MeshFaceMaterial,x=!0===u?m.materials:null,v=p.vertices,y=p.faces,w=0,z=y.length;w<z;w++)if(C=y[w],A=!0===u?x[C.materialIndex]:m,void 0!==A){q=v[C.a];s=v[C.b];t=v[C.c];if(!0===A.morphTargets){var B=p.morphTargets,S=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,
+0);g.set(0,0,0);for(var I=0,D=B.length;I<D;I++){var P=S[I];if(0!==P){var K=B[I].vertices;d.addScaledVector(f.subVectors(K[C.a],q),P);e.addScaledVector(h.subVectors(K[C.b],s),P);g.addScaledVector(k.subVectors(K[C.c],t),P)}}d.add(q);e.add(s);g.add(t);q=d;s=e;t=g}A=A.side===THREE.BackSide?b.intersectTriangle(t,s,q,!0):b.intersectTriangle(q,s,t,A.side!==THREE.DoubleSide);null!==A&&(A.applyMatrix4(this.matrixWorld),B=l.ray.origin.distanceTo(A),B<l.near||B>l.far||n.push({distance:B,point:A,face:C,faceIndex:w,
 object:this}))}}}}();THREE.Mesh.prototype.clone=function(){return(new THREE.Mesh(this.geometry,this.material)).copy(this)};THREE.Mesh.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);return this};
 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(){return(new THREE.Bone(this.skin)).copy(this)};THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
@@ -491,97 +491,97 @@ tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.Sh
 THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,
 "}"].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){!0===Q&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)}function c(){M.init();r.viewport(Ha,Ia,Ba,wa);b($.r,$.g,$.b,ea)}function d(){Xa=lb=null;xa="";Ya=-1;fb=!0;M.reset()}function e(a){a=a.target;a.removeEventListener("dispose",e);a:{var b=aa.get(a);if(a.image&&b.__image__webglTextureCube)r.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;r.deleteTexture(b.__webglTexture)}aa.delete(a)}Ca.textures--}function g(a){a=a.target;
-a.removeEventListener("dispose",g);var b=aa.get(a);if(a&&void 0!==b.__webglTexture){r.deleteTexture(b.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var c=0;6>c;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);aa.delete(a)}Ca.textures--}function f(a){a=a.target;a.removeEventListener("dispose",f);h(a);aa.delete(a)}function h(a){var b=aa.get(a).program.program;
-if(void 0!==b){a.program=void 0;a=0;for(var c=va.length;a!==c;++a){var d=va[a];if(d.program===b){0===--d.usedTimes&&(c-=1,va[a]=va[c],va.pop(),r.deleteProgram(b),Ca.programs=c);break}}}}function k(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=V.get("ANGLE_instanced_arrays"),null===e)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}M.initAttributes();var f=c.attributes;
-b=b.getAttributes();a=a.defaultAttributeValues;for(var g in b){var h=b[g];if(0<=h){var k=f[g];if(void 0!==k){M.enableAttribute(h);var l=k.itemSize,n=oa.getAttributeBuffer(k);if(k instanceof THREE.InterleavedBufferAttribute){var m=k.data,p=m.stride,k=k.offset;r.bindBuffer(r.ARRAY_BUFFER,n);r.vertexAttribPointer(h,l,r.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===c.maxInstancedCount&&(c.maxInstancedCount=m.meshPerAttribute*m.count)}}else if(r.bindBuffer(r.ARRAY_BUFFER,n),r.vertexAttribPointer(h,l,r.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.meshPerAttribute*k.count)}}else if(void 0!==a&&(l=a[g],void 0!==l))switch(l.length){case 2:r.vertexAttrib2fv(h,l);break;case 3:r.vertexAttrib3fv(h,l);break;case 4:r.vertexAttrib4fv(h,l);break;default:r.vertexAttrib1fv(h,l)}}}M.disableUnusedAttributes()}function l(a,b){return b[0]-a[0]}function m(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 p(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 n(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),oa.init(a),a instanceof THREE.Light)fa.push(a);else if(a instanceof THREE.Sprite)ua.push(a);else if(a instanceof THREE.LensFlare)Ja.push(a);else if(a instanceof THREE.ImmediateRenderObject){var b=
-a.material;b.transparent?Ga.push(a):Aa.push(a)}else{var c=oa.objects[a.id];!c||!1!==a.frustumCulled&&!0!==Za.intersectsObject(a)||(b=a.material,aa.get(b)&&(b.program=aa.get(b).program),b.transparent?na.push(c):la.push(c),!0===ka.sortObjects&&(ma.setFromMatrixPosition(a.matrixWorld),ma.applyProjection(Ka),c.z=ma.z))}b=0;for(c=a.children.length;b<c;b++)n(a.children[b])}}function q(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);ka.renderBufferDirect(b,c,d,f,k)}}function s(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g],l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);!0===k.visible&&(null===e&&(f=k.material),ka.renderImmediateObject(b,c,d,f,k))}}function t(a){a.side!==THREE.DoubleSide?M.enable(r.CULL_FACE):M.disable(r.CULL_FACE);M.setFlipSided(a.side===
-THREE.BackSide);!0===a.transparent?M.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):M.setBlending(THREE.NoBlending);M.setDepthFunc(a.depthFunc);M.setDepthTest(a.depthTest);M.setDepthWrite(a.depthWrite);M.setColorWrite(a.colorWrite);M.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function u(a,b,c,d,g){var k,l,n,m;gb=0;var p=aa.get(d);if(d.needsUpdate||!p.program){a:{for(var q=aa.get(d),s=Zb[d.type],t=
-0,u=0,A=0,B=0,C=0,E=b.length;C<E;C++){var D=b[C];D.onlyShadow||!1===D.visible||(D instanceof THREE.DirectionalLight&&t++,D instanceof THREE.PointLight&&u++,D instanceof THREE.SpotLight&&A++,D instanceof THREE.HemisphereLight&&B++)}k=t;l=u;n=A;m=B;for(var L,F=0,K=0,R=b.length;K<R;K++){var la=b[K];la.castShadow&&(la instanceof THREE.SpotLight&&F++,la instanceof THREE.DirectionalLight&&F++)}L=F;var S;if(mb&&g&&g.skeleton&&g.skeleton.useVertexTexture)S=1024;else{var Q=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),
-U=Math.floor((Q-20)/4);void 0!==g&&g instanceof THREE.SkinnedMesh&&(U=Math.min(g.skeleton.bones.length,U),U<g.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+g.skeleton.bones.length+", this GPU supports just "+U+" (try OpenGL instead of ANGLE)"));S=U}var P={precision:J,supportsVertexTextures:nb,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:H,skinning:d.skinning,maxBones:S,useVertexTexture:mb&&g&&g.skeleton&&g.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:ka.maxMorphTargets,maxMorphNormals:ka.maxMorphNormals,maxDirLights:k,maxPointLights:l,maxSpotLights:n,maxHemiLights:m,
-maxShadows:L,shadowMapEnabled:pa.enabled&&g.receiveShadow&&0<L,shadowMapType:pa.type,shadowMapDebug:pa.debug,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},T=[];s?T.push(s):(T.push(d.fragmentShader),T.push(d.vertexShader));if(void 0!==d.defines)for(var V in d.defines)T.push(V),T.push(d.defines[V]);for(V in P)T.push(V),T.push(P[V]);var na=T.join(),Ga=!0;if(q.program)if(q.program.code!==na)h(d);else if(void 0!==s)break a;else Ga=!1;else d.addEventListener("dispose",
-f);if(s){var Aa=THREE.ShaderLib[s];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(Aa.uniforms),vertexShader:Aa.vertexShader,fragmentShader:Aa.fragmentShader}}else q.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var $,Ja=0,fa=va.length;Ja<fa;Ja++){var Wa=va[Ja];if(Wa.code===na){$=Wa;Ga&&$.usedTimes++;break}}void 0===$&&(d.__webglShader=q.__webglShader,$=new THREE.WebGLProgram(ka,na,d,P),va.push($),Ca.programs=va.length);
-q.program=$;var ea=$.getAttributes();if(d.morphTargets)for(var ua=d.numSupportedMorphTargets=0;ua<ka.maxMorphTargets;ua++)0<=ea["morphTarget"+ua]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(ua=d.numSupportedMorphNormals=0;ua<ka.maxMorphNormals;ua++)0<=ea["morphNormal"+ua]&&d.numSupportedMorphNormals++;q.uniformsList=[];var oa=q.program.getUniforms(),xa;for(xa in q.__webglShader.uniforms){var Ha=oa[xa];Ha&&q.uniformsList.push([q.__webglShader.uniforms[xa],Ha])}}d.needsUpdate=!1}var Ia=!1,Ba=
-!1,wa=!1,$a=p.program,ca=$a.getUniforms(),G=p.__webglShader.uniforms;$a.id!==lb&&(r.useProgram($a.program),lb=$a.id,wa=Ba=Ia=!0);d.id!==Ya&&(-1===Ya&&(wa=!0),Ya=d.id,Ba=!0);if(Ia||a!==Xa)r.uniformMatrix4fv(ca.projectionMatrix,!1,a.projectionMatrix.elements),H&&r.uniform1f(ca.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Xa&&(Xa=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&void 0!==ca.cameraPosition&&(ma.setFromMatrixPosition(a.matrixWorld),r.uniform3f(ca.cameraPosition,
-ma.x,ma.y,ma.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&void 0!==ca.viewMatrix&&r.uniformMatrix4fv(ca.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(g.bindMatrix&&void 0!==ca.bindMatrix&&r.uniformMatrix4fv(ca.bindMatrix,!1,g.bindMatrix.elements),g.bindMatrixInverse&&void 0!==ca.bindMatrixInverse&&r.uniformMatrix4fv(ca.bindMatrixInverse,!1,g.bindMatrixInverse.elements),
-mb&&g.skeleton&&g.skeleton.useVertexTexture){if(void 0!==ca.boneTexture){var Qa=v();r.uniform1i(ca.boneTexture,Qa);ka.setTexture(g.skeleton.boneTexture,Qa)}void 0!==ca.boneTextureWidth&&r.uniform1i(ca.boneTextureWidth,g.skeleton.boneTextureWidth);void 0!==ca.boneTextureHeight&&r.uniform1i(ca.boneTextureHeight,g.skeleton.boneTextureHeight)}else g.skeleton&&g.skeleton.boneMatrices&&void 0!==ca.boneGlobalMatrices&&r.uniformMatrix4fv(ca.boneGlobalMatrices,!1,g.skeleton.boneMatrices);if(Ba){c&&d.fog&&
-(G.fogColor.value=c.color,c instanceof THREE.Fog?(G.fogNear.value=c.near,G.fogFar.value=c.far):c instanceof THREE.FogExp2&&(G.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(fb){var wa=!0,ba,ra,Z,Ka=0,ob=0,pb=0,La,Za,eb,Ra,qb,da=Nb,rb=da.directional.colors,sb=da.directional.positions,tb=da.point.colors,ub=da.point.positions,jb=da.point.distances,kb=da.point.decays,vb=da.spot.colors,wb=da.spot.positions,Ib=da.spot.distances,
-xb=da.spot.directions,Jb=da.spot.anglesCos,Kb=da.spot.exponents,Lb=da.spot.decays,yb=da.hemi.skyColors,zb=da.hemi.groundColors,Ab=da.hemi.positions,ab=0,Ma=0,ya=0,Sa=0,Bb=0,Cb=0,Db=0,hb=0,bb=0,cb=0,Da=0,Ta=0;ba=0;for(ra=b.length;ba<ra;ba++)Z=b[ba],Z.onlyShadow||(La=Z.color,Ra=Z.intensity,qb=Z.distance,Z instanceof THREE.AmbientLight?Z.visible&&(Ka+=La.r,ob+=La.g,pb+=La.b):Z instanceof THREE.DirectionalLight?(Bb+=1,Z.visible&&(ha.setFromMatrixPosition(Z.matrixWorld),ma.setFromMatrixPosition(Z.target.matrixWorld),
-ha.sub(ma),ha.normalize(),bb=3*ab,sb[bb+0]=ha.x,sb[bb+1]=ha.y,sb[bb+2]=ha.z,y(rb,bb,La,Ra),ab+=1)):Z instanceof THREE.PointLight?(Cb+=1,Z.visible&&(cb=3*Ma,y(tb,cb,La,Ra),ma.setFromMatrixPosition(Z.matrixWorld),ub[cb+0]=ma.x,ub[cb+1]=ma.y,ub[cb+2]=ma.z,jb[Ma]=qb,kb[Ma]=0===Z.distance?0:Z.decay,Ma+=1)):Z instanceof THREE.SpotLight?(Db+=1,Z.visible&&(Da=3*ya,y(vb,Da,La,Ra),ha.setFromMatrixPosition(Z.matrixWorld),wb[Da+0]=ha.x,wb[Da+1]=ha.y,wb[Da+2]=ha.z,Ib[ya]=qb,ma.setFromMatrixPosition(Z.target.matrixWorld),
-ha.sub(ma),ha.normalize(),xb[Da+0]=ha.x,xb[Da+1]=ha.y,xb[Da+2]=ha.z,Jb[ya]=Math.cos(Z.angle),Kb[ya]=Z.exponent,Lb[ya]=0===Z.distance?0:Z.decay,ya+=1)):Z instanceof THREE.HemisphereLight&&(hb+=1,Z.visible&&(ha.setFromMatrixPosition(Z.matrixWorld),ha.normalize(),Ta=3*Sa,Ab[Ta+0]=ha.x,Ab[Ta+1]=ha.y,Ab[Ta+2]=ha.z,Za=Z.color,eb=Z.groundColor,y(yb,Ta,Za,Ra),y(zb,Ta,eb,Ra),Sa+=1)));ba=3*ab;for(ra=Math.max(rb.length,3*Bb);ba<ra;ba++)rb[ba]=0;ba=3*Ma;for(ra=Math.max(tb.length,3*Cb);ba<ra;ba++)tb[ba]=0;ba=
-3*ya;for(ra=Math.max(vb.length,3*Db);ba<ra;ba++)vb[ba]=0;ba=3*Sa;for(ra=Math.max(yb.length,3*hb);ba<ra;ba++)yb[ba]=0;ba=3*Sa;for(ra=Math.max(zb.length,3*hb);ba<ra;ba++)zb[ba]=0;da.directional.length=ab;da.point.length=Ma;da.spot.length=ya;da.hemi.length=Sa;da.ambient[0]=Ka;da.ambient[1]=ob;da.ambient[2]=pb;fb=!1}if(wa){var ja=Nb;G.ambientLightColor.value=ja.ambient;G.directionalLightColor.value=ja.directional.colors;G.directionalLightDirection.value=ja.directional.positions;G.pointLightColor.value=
-ja.point.colors;G.pointLightPosition.value=ja.point.positions;G.pointLightDistance.value=ja.point.distances;G.pointLightDecay.value=ja.point.decays;G.spotLightColor.value=ja.spot.colors;G.spotLightPosition.value=ja.spot.positions;G.spotLightDistance.value=ja.spot.distances;G.spotLightDirection.value=ja.spot.directions;G.spotLightAngleCos.value=ja.spot.anglesCos;G.spotLightExponent.value=ja.spot.exponents;G.spotLightDecay.value=ja.spot.decays;G.hemisphereLightSkyColor.value=ja.hemi.skyColors;G.hemisphereLightGroundColor.value=
-ja.hemi.groundColors;G.hemisphereLightDirection.value=ja.hemi.positions;x(G,!0)}else x(G,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){G.opacity.value=d.opacity;G.diffuse.value=d.color;G.map.value=d.map;G.specularMap.value=d.specularMap;G.alphaMap.value=d.alphaMap;d.bumpMap&&(G.bumpMap.value=d.bumpMap,G.bumpScale.value=d.bumpScale);d.normalMap&&(G.normalMap.value=d.normalMap,G.normalScale.value.copy(d.normalScale));var za;
-d.map?za=d.map:d.specularMap?za=d.specularMap:d.normalMap?za=d.normalMap:d.bumpMap?za=d.bumpMap:d.alphaMap?za=d.alphaMap:d.emissiveMap&&(za=d.emissiveMap);if(void 0!==za){var Ob=za.offset,Pb=za.repeat;G.offsetRepeat.value.set(Ob.x,Ob.y,Pb.x,Pb.y)}G.envMap.value=d.envMap;G.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;G.reflectivity.value=d.reflectivity;G.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)G.diffuse.value=d.color,G.opacity.value=
-d.opacity;else if(d instanceof THREE.LineDashedMaterial)G.diffuse.value=d.color,G.opacity.value=d.opacity,G.dashSize.value=d.dashSize,G.totalSize.value=d.dashSize+d.gapSize,G.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(G.psColor.value=d.color,G.opacity.value=d.opacity,G.size.value=d.size,G.scale.value=I.height/2,G.map.value=d.map,null!==d.map){var Qb=d.map.offset,Rb=d.map.repeat;G.offsetRepeat.value.set(Qb.x,Qb.y,Rb.x,Rb.y)}}else d instanceof THREE.MeshPhongMaterial?(G.shininess.value=
+THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===T&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)}function c(){L.init();r.viewport(Ia,Ba,ya,Ja);b($.r,$.g,$.b,ja)}function d(){Ya=mb=null;Ca="";Za=-1;gb=!0;L.reset()}function e(a){a.preventDefault();d();c();la.clear();aa.clear()}function g(a){a=a.target;a.removeEventListener("dispose",g);a:{var b=aa.get(a);if(a.image&&b.__image__webglTextureCube)r.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;r.deleteTexture(b.__webglTexture)}aa.delete(a)}Da.textures--}
+function f(a){a=a.target;a.removeEventListener("dispose",f);var b=aa.get(a);if(a&&void 0!==b.__webglTexture){r.deleteTexture(b.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var c=0;6>c;c++)r.deleteFramebuffer(b.__webglFramebuffer[c]),r.deleteRenderbuffer(b.__webglRenderbuffer[c]);else r.deleteFramebuffer(b.__webglFramebuffer),r.deleteRenderbuffer(b.__webglRenderbuffer);aa.delete(a)}Da.textures--}function h(a){a=a.target;a.removeEventListener("dispose",h);k(a);aa.delete(a)}function k(a){var b=
+aa.get(a).program.program;if(void 0!==b){a.program=void 0;a=0;for(var c=wa.length;a!==c;++a){var d=wa[a];if(d.program===b){0===--d.usedTimes&&(c-=1,wa[a]=wa[c],wa.pop(),r.deleteProgram(b),Da.programs=c);break}}}}function l(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}L.initAttributes();
+var f=c.attributes;b=b.getAttributes();a=a.defaultAttributeValues;for(var g in b){var h=b[g];if(0<=h){var k=f[g];if(void 0!==k){L.enableAttribute(h);var l=k.itemSize,m=la.getAttributeBuffer(k);if(k instanceof THREE.InterleavedBufferAttribute){var n=k.data,p=n.stride,k=k.offset;r.bindBuffer(r.ARRAY_BUFFER,m);r.vertexAttribPointer(h,l,r.FLOAT,!1,p*n.array.BYTES_PER_ELEMENT,(d*p+k)*n.array.BYTES_PER_ELEMENT);if(n 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,n.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=n.meshPerAttribute*n.count)}}else if(r.bindBuffer(r.ARRAY_BUFFER,m),r.vertexAttribPointer(h,l,r.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.meshPerAttribute*k.count)}}else if(void 0!==a&&(l=a[g],void 0!==l))switch(l.length){case 2:r.vertexAttrib2fv(h,l);break;case 3:r.vertexAttrib3fv(h,l);break;case 4:r.vertexAttrib4fv(h,l);break;default:r.vertexAttrib1fv(h,l)}}}L.disableUnusedAttributes()}function n(a,b){return b[0]-a[0]}function p(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 m(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 q(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),la.init(a),a instanceof THREE.Light)fa.push(a);else if(a instanceof THREE.Sprite)Ra.push(a);else if(a instanceof THREE.LensFlare)Sa.push(a);else if(a instanceof THREE.ImmediateRenderObject){var b=
+a.material;b.transparent?Qa.push(a):pa.push(a)}else{var c=la.objects[a.id];!c||!1!==a.frustumCulled&&!0!==$a.intersectsObject(a)||(b=a.material,null!==b&&!0===b.visible&&(aa.get(b)&&(b.program=aa.get(b).program),b.transparent?va.push(c):ra.push(c),!0===ka.sortObjects&&(ma.setFromMatrixPosition(a.matrixWorld),ma.applyProjection(Ka),c.z=ma.z)))}a=a.children;b=0;for(c=a.length;b<c;b++)q(a[b])}}function s(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);ka.renderBufferDirect(b,c,d,f,k)}}function t(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g],l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);!0===k.visible&&(null===e&&(f=k.material),ka.renderImmediateObject(b,c,d,f,k))}}function u(a){a.side!==THREE.DoubleSide?L.enable(r.CULL_FACE):L.disable(r.CULL_FACE);L.setFlipSided(a.side===
+THREE.BackSide);!0===a.transparent?L.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):L.setBlending(THREE.NoBlending);L.setDepthFunc(a.depthFunc);L.setDepthTest(a.depthTest);L.setDepthWrite(a.depthWrite);L.setColorWrite(a.colorWrite);L.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function x(a,b,c,d,e){var f,l,m,n;hb=0;var p=aa.get(d);if(d.needsUpdate||!p.program){a:{for(var q=aa.get(d),s=Zb[d.type],t=
+0,x=0,u=0,A=0,B=0,E=b.length;B<E;B++){var J=b[B];J.onlyShadow||!1===J.visible||(J instanceof THREE.DirectionalLight&&t++,J instanceof THREE.PointLight&&x++,J instanceof THREE.SpotLight&&u++,J instanceof THREE.HemisphereLight&&A++)}f=t;l=x;m=u;n=A;for(var S,R=0,K=0,H=b.length;K<H;K++){var P=b[K];P.castShadow&&(P instanceof THREE.SpotLight&&R++,P instanceof THREE.DirectionalLight&&R++)}S=R;var fa;if(nb&&e&&e.skeleton&&e.skeleton.useVertexTexture)fa=1024;else{var N=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),
+Q=Math.floor((N-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(Q=Math.min(e.skeleton.bones.length,Q),Q<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+Q+" (try OpenGL instead of ANGLE)"));fa=Q}var U={precision:F,supportsVertexTextures:ob,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:qa,skinning:d.skinning,maxBones:fa,useVertexTexture:nb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:ka.maxMorphTargets,maxMorphNormals:ka.maxMorphNormals,maxDirLights:f,maxPointLights:l,maxSpotLights:m,maxHemiLights:n,
+maxShadows:S,shadowMapEnabled:na.enabled&&e.receiveShadow&&0<S,shadowMapType:na.type,shadowMapDebug:na.debug,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},O=[];s?O.push(s):(O.push(d.fragmentShader),O.push(d.vertexShader));if(void 0!==d.defines)for(var T in d.defines)O.push(T),O.push(d.defines[T]);for(T in U)O.push(T),O.push(U[T]);var W=O.join(),ra=!0;if(q.program)if(q.program.code!==W)k(d);else if(void 0!==s)break a;else ra=!1;else d.addEventListener("dispose",
+h);if(s){var va=THREE.ShaderLib[s];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(va.uniforms),vertexShader:va.vertexShader,fragmentShader:va.fragmentShader}}else q.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var pa,$=0,Qa=wa.length;$<Qa;$++){var Ra=wa[$];if(Ra.code===W){pa=Ra;ra&&pa.usedTimes++;break}}void 0===pa&&(d.__webglShader=q.__webglShader,pa=new THREE.WebGLProgram(ka,W,d,U),wa.push(pa),Da.programs=wa.length);
+q.program=pa;var Sa=pa.getAttributes();if(d.morphTargets)for(var xa=d.numSupportedMorphTargets=0;xa<ka.maxMorphTargets;xa++)0<=Sa["morphTarget"+xa]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(xa=d.numSupportedMorphNormals=0;xa<ka.maxMorphNormals;xa++)0<=Sa["morphNormal"+xa]&&d.numSupportedMorphNormals++;q.uniformsList=[];var ja=q.program.getUniforms(),la;for(la in q.__webglShader.uniforms){var Ca=ja[la];Ca&&q.uniformsList.push([q.__webglShader.uniforms[la],Ca])}}d.needsUpdate=!1}var Ia=!1,
+Ba=!1,ya=!1,ab=p.program,ca=ab.getUniforms(),G=p.__webglShader.uniforms;ab.id!==mb&&(r.useProgram(ab.program),mb=ab.id,ya=Ba=Ia=!0);d.id!==Za&&(-1===Za&&(ya=!0),Za=d.id,Ba=!0);if(Ia||a!==Ya)r.uniformMatrix4fv(ca.projectionMatrix,!1,a.projectionMatrix.elements),qa&&r.uniform1f(ca.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Ya&&(Ya=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&void 0!==ca.cameraPosition&&(ma.setFromMatrixPosition(a.matrixWorld),r.uniform3f(ca.cameraPosition,
+ma.x,ma.y,ma.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&void 0!==ca.viewMatrix&&r.uniformMatrix4fv(ca.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&void 0!==ca.bindMatrix&&r.uniformMatrix4fv(ca.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&void 0!==ca.bindMatrixInverse&&r.uniformMatrix4fv(ca.bindMatrixInverse,!1,e.bindMatrixInverse.elements),
+nb&&e.skeleton&&e.skeleton.useVertexTexture){if(void 0!==ca.boneTexture){var Ja=y();r.uniform1i(ca.boneTexture,Ja);ka.setTexture(e.skeleton.boneTexture,Ja)}void 0!==ca.boneTextureWidth&&r.uniform1i(ca.boneTextureWidth,e.skeleton.boneTextureWidth);void 0!==ca.boneTextureHeight&&r.uniform1i(ca.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&void 0!==ca.boneGlobalMatrices&&r.uniformMatrix4fv(ca.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(Ba){c&&d.fog&&
+(G.fogColor.value=c.color,c instanceof THREE.Fog?(G.fogNear.value=c.near,G.fogFar.value=c.far):c instanceof THREE.FogExp2&&(G.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(gb){var ya=!0,ba,sa,Z,Ha=0,Ka=0,pb=0,La,$a,fb,Ta,qb,da=Nb,rb=da.directional.colors,sb=da.directional.positions,tb=da.point.colors,ub=da.point.positions,kb=da.point.distances,lb=da.point.decays,vb=da.spot.colors,wb=da.spot.positions,Ib=da.spot.distances,
+xb=da.spot.directions,Jb=da.spot.anglesCos,Kb=da.spot.exponents,Lb=da.spot.decays,yb=da.hemi.skyColors,zb=da.hemi.groundColors,Ab=da.hemi.positions,bb=0,Ma=0,za=0,Ua=0,Bb=0,Cb=0,Db=0,ib=0,cb=0,db=0,Ea=0,Va=0;ba=0;for(sa=b.length;ba<sa;ba++)Z=b[ba],Z.onlyShadow||(La=Z.color,Ta=Z.intensity,qb=Z.distance,Z instanceof THREE.AmbientLight?Z.visible&&(Ha+=La.r,Ka+=La.g,pb+=La.b):Z instanceof THREE.DirectionalLight?(Bb+=1,Z.visible&&(ga.setFromMatrixPosition(Z.matrixWorld),ma.setFromMatrixPosition(Z.target.matrixWorld),
+ga.sub(ma),ga.normalize(),cb=3*bb,sb[cb+0]=ga.x,sb[cb+1]=ga.y,sb[cb+2]=ga.z,w(rb,cb,La,Ta),bb+=1)):Z instanceof THREE.PointLight?(Cb+=1,Z.visible&&(db=3*Ma,w(tb,db,La,Ta),ma.setFromMatrixPosition(Z.matrixWorld),ub[db+0]=ma.x,ub[db+1]=ma.y,ub[db+2]=ma.z,kb[Ma]=qb,lb[Ma]=0===Z.distance?0:Z.decay,Ma+=1)):Z instanceof THREE.SpotLight?(Db+=1,Z.visible&&(Ea=3*za,w(vb,Ea,La,Ta),ga.setFromMatrixPosition(Z.matrixWorld),wb[Ea+0]=ga.x,wb[Ea+1]=ga.y,wb[Ea+2]=ga.z,Ib[za]=qb,ma.setFromMatrixPosition(Z.target.matrixWorld),
+ga.sub(ma),ga.normalize(),xb[Ea+0]=ga.x,xb[Ea+1]=ga.y,xb[Ea+2]=ga.z,Jb[za]=Math.cos(Z.angle),Kb[za]=Z.exponent,Lb[za]=0===Z.distance?0:Z.decay,za+=1)):Z instanceof THREE.HemisphereLight&&(ib+=1,Z.visible&&(ga.setFromMatrixPosition(Z.matrixWorld),ga.normalize(),Va=3*Ua,Ab[Va+0]=ga.x,Ab[Va+1]=ga.y,Ab[Va+2]=ga.z,$a=Z.color,fb=Z.groundColor,w(yb,Va,$a,Ta),w(zb,Va,fb,Ta),Ua+=1)));ba=3*bb;for(sa=Math.max(rb.length,3*Bb);ba<sa;ba++)rb[ba]=0;ba=3*Ma;for(sa=Math.max(tb.length,3*Cb);ba<sa;ba++)tb[ba]=0;ba=
+3*za;for(sa=Math.max(vb.length,3*Db);ba<sa;ba++)vb[ba]=0;ba=3*Ua;for(sa=Math.max(yb.length,3*ib);ba<sa;ba++)yb[ba]=0;ba=3*Ua;for(sa=Math.max(zb.length,3*ib);ba<sa;ba++)zb[ba]=0;da.directional.length=bb;da.point.length=Ma;da.spot.length=za;da.hemi.length=Ua;da.ambient[0]=Ha;da.ambient[1]=Ka;da.ambient[2]=pb;gb=!1}if(ya){var ia=Nb;G.ambientLightColor.value=ia.ambient;G.directionalLightColor.value=ia.directional.colors;G.directionalLightDirection.value=ia.directional.positions;G.pointLightColor.value=
+ia.point.colors;G.pointLightPosition.value=ia.point.positions;G.pointLightDistance.value=ia.point.distances;G.pointLightDecay.value=ia.point.decays;G.spotLightColor.value=ia.spot.colors;G.spotLightPosition.value=ia.spot.positions;G.spotLightDistance.value=ia.spot.distances;G.spotLightDirection.value=ia.spot.directions;G.spotLightAngleCos.value=ia.spot.anglesCos;G.spotLightExponent.value=ia.spot.exponents;G.spotLightDecay.value=ia.spot.decays;G.hemisphereLightSkyColor.value=ia.hemi.skyColors;G.hemisphereLightGroundColor.value=
+ia.hemi.groundColors;G.hemisphereLightDirection.value=ia.hemi.positions;v(G,!0)}else v(G,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){G.opacity.value=d.opacity;G.diffuse.value=d.color;G.map.value=d.map;G.specularMap.value=d.specularMap;G.alphaMap.value=d.alphaMap;d.bumpMap&&(G.bumpMap.value=d.bumpMap,G.bumpScale.value=d.bumpScale);d.normalMap&&(G.normalMap.value=d.normalMap,G.normalScale.value.copy(d.normalScale));var Aa;
+d.map?Aa=d.map:d.specularMap?Aa=d.specularMap:d.normalMap?Aa=d.normalMap:d.bumpMap?Aa=d.bumpMap:d.alphaMap?Aa=d.alphaMap:d.emissiveMap&&(Aa=d.emissiveMap);if(void 0!==Aa){var Ob=Aa.offset,Pb=Aa.repeat;G.offsetRepeat.value.set(Ob.x,Ob.y,Pb.x,Pb.y)}G.envMap.value=d.envMap;G.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;G.reflectivity.value=d.reflectivity;G.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)G.diffuse.value=d.color,G.opacity.value=
+d.opacity;else if(d instanceof THREE.LineDashedMaterial)G.diffuse.value=d.color,G.opacity.value=d.opacity,G.dashSize.value=d.dashSize,G.totalSize.value=d.dashSize+d.gapSize,G.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(G.psColor.value=d.color,G.opacity.value=d.opacity,G.size.value=d.size,G.scale.value=D.height/2,G.map.value=d.map,null!==d.map){var Qb=d.map.offset,Rb=d.map.repeat;G.offsetRepeat.value.set(Qb.x,Qb.y,Rb.x,Rb.y)}}else d instanceof THREE.MeshPhongMaterial?(G.shininess.value=
 d.shininess,G.emissive.value=d.emissive,G.specular.value=d.specular,G.lightMap.value=d.lightMap,G.lightMapIntensity.value=d.lightMapIntensity,G.aoMap.value=d.aoMap,G.aoMapIntensity.value=d.aoMapIntensity,G.emissiveMap.value=d.emissiveMap):d instanceof THREE.MeshLambertMaterial?G.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?(G.aoMap.value=d.aoMap,G.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(G.mNear.value=a.near,G.mFar.value=a.far,G.opacity.value=
-d.opacity):d instanceof THREE.MeshNormalMaterial&&(G.opacity.value=d.opacity);if(g.receiveShadow&&!d._shadowPass&&G.shadowMatrix)for(var Ua=0,Eb=0,Mb=b.length;Eb<Mb;Eb++){var Ea=b[Eb];Ea.castShadow&&(Ea instanceof THREE.SpotLight||Ea instanceof THREE.DirectionalLight)&&(G.shadowMap.value[Ua]=Ea.shadowMap,G.shadowMapSize.value[Ua]=Ea.shadowMapSize,G.shadowMatrix.value[Ua]=Ea.shadowMatrix,G.shadowDarkness.value[Ua]=Ea.shadowDarkness,G.shadowBias.value[Ua]=Ea.shadowBias,Ua++)}for(var Fb=p.uniformsList,
-sa,Na,ta,ib=0,$b=Fb.length;ib<$b;ib++){var X=Fb[ib][0];if(!1!==X.needsUpdate){var Sb=X.type,N=X.value,Y=Fb[ib][1];switch(Sb){case "1i":r.uniform1i(Y,N);break;case "1f":r.uniform1f(Y,N);break;case "2f":r.uniform2f(Y,N[0],N[1]);break;case "3f":r.uniform3f(Y,N[0],N[1],N[2]);break;case "4f":r.uniform4f(Y,N[0],N[1],N[2],N[3]);break;case "1iv":r.uniform1iv(Y,N);break;case "3iv":r.uniform3iv(Y,N);break;case "1fv":r.uniform1fv(Y,N);break;case "2fv":r.uniform2fv(Y,N);break;case "3fv":r.uniform3fv(Y,N);break;
-case "4fv":r.uniform4fv(Y,N);break;case "Matrix3fv":r.uniformMatrix3fv(Y,!1,N);break;case "Matrix4fv":r.uniformMatrix4fv(Y,!1,N);break;case "i":r.uniform1i(Y,N);break;case "f":r.uniform1f(Y,N);break;case "v2":r.uniform2f(Y,N.x,N.y);break;case "v3":r.uniform3f(Y,N.x,N.y,N.z);break;case "v4":r.uniform4f(Y,N.x,N.y,N.z,N.w);break;case "c":r.uniform3f(Y,N.r,N.g,N.b);break;case "iv1":r.uniform1iv(Y,N);break;case "iv":r.uniform3iv(Y,N);break;case "fv1":r.uniform1fv(Y,N);break;case "fv":r.uniform3fv(Y,N);
-break;case "v2v":void 0===X._array&&(X._array=new Float32Array(2*N.length));for(var W=0,qa=N.length;W<qa;W++)ta=2*W,X._array[ta+0]=N[W].x,X._array[ta+1]=N[W].y;r.uniform2fv(Y,X._array);break;case "v3v":void 0===X._array&&(X._array=new Float32Array(3*N.length));W=0;for(qa=N.length;W<qa;W++)ta=3*W,X._array[ta+0]=N[W].x,X._array[ta+1]=N[W].y,X._array[ta+2]=N[W].z;r.uniform3fv(Y,X._array);break;case "v4v":void 0===X._array&&(X._array=new Float32Array(4*N.length));W=0;for(qa=N.length;W<qa;W++)ta=4*W,X._array[ta+
-0]=N[W].x,X._array[ta+1]=N[W].y,X._array[ta+2]=N[W].z,X._array[ta+3]=N[W].w;r.uniform4fv(Y,X._array);break;case "m3":r.uniformMatrix3fv(Y,!1,N.elements);break;case "m3v":void 0===X._array&&(X._array=new Float32Array(9*N.length));W=0;for(qa=N.length;W<qa;W++)N[W].flattenToArrayOffset(X._array,9*W);r.uniformMatrix3fv(Y,!1,X._array);break;case "m4":r.uniformMatrix4fv(Y,!1,N.elements);break;case "m4v":void 0===X._array&&(X._array=new Float32Array(16*N.length));W=0;for(qa=N.length;W<qa;W++)N[W].flattenToArrayOffset(X._array,
-16*W);r.uniformMatrix4fv(Y,!1,X._array);break;case "t":sa=N;Na=v();r.uniform1i(Y,Na);if(!sa)continue;if(sa instanceof THREE.CubeTexture||Array.isArray(sa.image)&&6===sa.image.length){var ga=sa,Tb=Na,Va=aa.get(ga);if(6===ga.image.length)if(0<ga.version&&Va.__version!==ga.version){Va.__image__webglTextureCube||(ga.addEventListener("dispose",e),Va.__image__webglTextureCube=r.createTexture(),Ca.textures++);M.activeTexture(r.TEXTURE0+Tb);M.bindTexture(r.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,
-ga.flipY);for(var Ub=ga instanceof THREE.CompressedTexture,Gb=ga.image[0]instanceof THREE.DataTexture,Oa=[],ia=0;6>ia;ia++)Oa[ia]=!ka.autoScaleCubemaps||Ub||Gb?Gb?ga.image[ia].image:ga.image[ia]:z(ga.image[ia],ac);var Vb=Oa[0],Wb=THREE.Math.isPowerOfTwo(Vb.width)&&THREE.Math.isPowerOfTwo(Vb.height),Fa=O(ga.format),Hb=O(ga.type);w(r.TEXTURE_CUBE_MAP,ga,Wb);for(ia=0;6>ia;ia++)if(Ub)for(var Pa,Xb=Oa[ia].mipmaps,db=0,bc=Xb.length;db<bc;db++)Pa=Xb[db],ga.format!==THREE.RGBAFormat&&ga.format!==THREE.RGBFormat?
--1<Yb().indexOf(Fa)?M.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ia,db,Fa,Pa.width,Pa.height,0,Pa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):M.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ia,db,Fa,Pa.width,Pa.height,0,Fa,Hb,Pa.data);else Gb?M.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ia,0,Fa,Oa[ia].width,Oa[ia].height,0,Fa,Hb,Oa[ia].data):M.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ia,0,Fa,Fa,Hb,Oa[ia]);ga.generateMipmaps&&
-Wb&&r.generateMipmap(r.TEXTURE_CUBE_MAP);Va.__version=ga.version;if(ga.onUpdate)ga.onUpdate(ga)}else M.activeTexture(r.TEXTURE0+Tb),M.bindTexture(r.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube)}else if(sa instanceof THREE.WebGLRenderTargetCube){var cc=sa;M.activeTexture(r.TEXTURE0+Na);M.bindTexture(r.TEXTURE_CUBE_MAP,aa.get(cc).__webglTexture)}else ka.setTexture(sa,Na);break;case "tv":void 0===X._array&&(X._array=[]);W=0;for(qa=X.value.length;W<qa;W++)X._array[W]=v();r.uniform1iv(Y,X._array);W=0;
-for(qa=X.value.length;W<qa;W++)sa=X.value[W],Na=X._array[W],sa&&ka.setTexture(sa,Na);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Sb)}}}}r.uniformMatrix4fv(ca.modelViewMatrix,!1,g._modelViewMatrix.elements);ca.normalMatrix&&r.uniformMatrix3fv(ca.normalMatrix,!1,g._normalMatrix.elements);void 0!==ca.modelMatrix&&r.uniformMatrix4fv(ca.modelMatrix,!1,g.matrixWorld.elements);return $a}function x(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 v(){var a=
-gb;a>=eb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+eb);gb+=1;return a}function y(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function w(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,O(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,O(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,O(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,O(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.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+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,B(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,B(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=V.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||aa.get(b).__currentAnisotropy)&&(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,ka.getMaxAnisotropy())),aa.get(b).__currentAnisotropy=b.anisotropy)}function z(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 C(a,b,c){r.bindFramebuffer(r.FRAMEBUFFER,a);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,c,aa.get(b).__webglTexture,0)}function A(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,
-r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function B(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function O(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;
+d.opacity):d instanceof THREE.MeshNormalMaterial&&(G.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&G.shadowMatrix)for(var Wa=0,Eb=0,Mb=b.length;Eb<Mb;Eb++){var Fa=b[Eb];Fa.castShadow&&(Fa instanceof THREE.SpotLight||Fa instanceof THREE.DirectionalLight)&&(G.shadowMap.value[Wa]=Fa.shadowMap,G.shadowMapSize.value[Wa]=Fa.shadowMapSize,G.shadowMatrix.value[Wa]=Fa.shadowMatrix,G.shadowDarkness.value[Wa]=Fa.shadowDarkness,G.shadowBias.value[Wa]=Fa.shadowBias,Wa++)}for(var Fb=p.uniformsList,
+ta,Na,ua,jb=0,$b=Fb.length;jb<$b;jb++){var X=Fb[jb][0];if(!1!==X.needsUpdate){var Sb=X.type,M=X.value,Y=Fb[jb][1];switch(Sb){case "1i":r.uniform1i(Y,M);break;case "1f":r.uniform1f(Y,M);break;case "2f":r.uniform2f(Y,M[0],M[1]);break;case "3f":r.uniform3f(Y,M[0],M[1],M[2]);break;case "4f":r.uniform4f(Y,M[0],M[1],M[2],M[3]);break;case "1iv":r.uniform1iv(Y,M);break;case "3iv":r.uniform3iv(Y,M);break;case "1fv":r.uniform1fv(Y,M);break;case "2fv":r.uniform2fv(Y,M);break;case "3fv":r.uniform3fv(Y,M);break;
+case "4fv":r.uniform4fv(Y,M);break;case "Matrix3fv":r.uniformMatrix3fv(Y,!1,M);break;case "Matrix4fv":r.uniformMatrix4fv(Y,!1,M);break;case "i":r.uniform1i(Y,M);break;case "f":r.uniform1f(Y,M);break;case "v2":r.uniform2f(Y,M.x,M.y);break;case "v3":r.uniform3f(Y,M.x,M.y,M.z);break;case "v4":r.uniform4f(Y,M.x,M.y,M.z,M.w);break;case "c":r.uniform3f(Y,M.r,M.g,M.b);break;case "iv1":r.uniform1iv(Y,M);break;case "iv":r.uniform3iv(Y,M);break;case "fv1":r.uniform1fv(Y,M);break;case "fv":r.uniform3fv(Y,M);
+break;case "v2v":void 0===X._array&&(X._array=new Float32Array(2*M.length));for(var V=0,oa=M.length;V<oa;V++)ua=2*V,X._array[ua+0]=M[V].x,X._array[ua+1]=M[V].y;r.uniform2fv(Y,X._array);break;case "v3v":void 0===X._array&&(X._array=new Float32Array(3*M.length));V=0;for(oa=M.length;V<oa;V++)ua=3*V,X._array[ua+0]=M[V].x,X._array[ua+1]=M[V].y,X._array[ua+2]=M[V].z;r.uniform3fv(Y,X._array);break;case "v4v":void 0===X._array&&(X._array=new Float32Array(4*M.length));V=0;for(oa=M.length;V<oa;V++)ua=4*V,X._array[ua+
+0]=M[V].x,X._array[ua+1]=M[V].y,X._array[ua+2]=M[V].z,X._array[ua+3]=M[V].w;r.uniform4fv(Y,X._array);break;case "m3":r.uniformMatrix3fv(Y,!1,M.elements);break;case "m3v":void 0===X._array&&(X._array=new Float32Array(9*M.length));V=0;for(oa=M.length;V<oa;V++)M[V].flattenToArrayOffset(X._array,9*V);r.uniformMatrix3fv(Y,!1,X._array);break;case "m4":r.uniformMatrix4fv(Y,!1,M.elements);break;case "m4v":void 0===X._array&&(X._array=new Float32Array(16*M.length));V=0;for(oa=M.length;V<oa;V++)M[V].flattenToArrayOffset(X._array,
+16*V);r.uniformMatrix4fv(Y,!1,X._array);break;case "t":ta=M;Na=y();r.uniform1i(Y,Na);if(!ta)continue;if(ta instanceof THREE.CubeTexture||Array.isArray(ta.image)&&6===ta.image.length){var ea=ta,Tb=Na,Xa=aa.get(ea);if(6===ea.image.length)if(0<ea.version&&Xa.__version!==ea.version){Xa.__image__webglTextureCube||(ea.addEventListener("dispose",g),Xa.__image__webglTextureCube=r.createTexture(),Da.textures++);L.activeTexture(r.TEXTURE0+Tb);L.bindTexture(r.TEXTURE_CUBE_MAP,Xa.__image__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,
+ea.flipY);for(var Ub=ea instanceof THREE.CompressedTexture,Gb=ea.image[0]instanceof THREE.DataTexture,Oa=[],ha=0;6>ha;ha++)Oa[ha]=!ka.autoScaleCubemaps||Ub||Gb?Gb?ea.image[ha].image:ea.image[ha]:C(ea.image[ha],ac);var Vb=Oa[0],Wb=THREE.Math.isPowerOfTwo(Vb.width)&&THREE.Math.isPowerOfTwo(Vb.height),Ga=I(ea.format),Hb=I(ea.type);z(r.TEXTURE_CUBE_MAP,ea,Wb);for(ha=0;6>ha;ha++)if(Ub)for(var Pa,Xb=Oa[ha].mipmaps,eb=0,bc=Xb.length;eb<bc;eb++)Pa=Xb[eb],ea.format!==THREE.RGBAFormat&&ea.format!==THREE.RGBFormat?
+-1<Yb().indexOf(Ga)?L.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ha,eb,Ga,Pa.width,Pa.height,0,Pa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):L.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ha,eb,Ga,Pa.width,Pa.height,0,Ga,Hb,Pa.data);else Gb?L.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Ga,Oa[ha].width,Oa[ha].height,0,Ga,Hb,Oa[ha].data):L.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Ga,Ga,Hb,Oa[ha]);ea.generateMipmaps&&
+Wb&&r.generateMipmap(r.TEXTURE_CUBE_MAP);Xa.__version=ea.version;if(ea.onUpdate)ea.onUpdate(ea)}else L.activeTexture(r.TEXTURE0+Tb),L.bindTexture(r.TEXTURE_CUBE_MAP,Xa.__image__webglTextureCube)}else if(ta instanceof THREE.WebGLRenderTargetCube){var cc=ta;L.activeTexture(r.TEXTURE0+Na);L.bindTexture(r.TEXTURE_CUBE_MAP,aa.get(cc).__webglTexture)}else ka.setTexture(ta,Na);break;case "tv":void 0===X._array&&(X._array=[]);V=0;for(oa=X.value.length;V<oa;V++)X._array[V]=y();r.uniform1iv(Y,X._array);V=0;
+for(oa=X.value.length;V<oa;V++)ta=X.value[V],Na=X._array[V],ta&&ka.setTexture(ta,Na);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Sb)}}}}r.uniformMatrix4fv(ca.modelViewMatrix,!1,e._modelViewMatrix.elements);ca.normalMatrix&&r.uniformMatrix3fv(ca.normalMatrix,!1,e._normalMatrix.elements);void 0!==ca.modelMatrix&&r.uniformMatrix4fv(ca.modelMatrix,!1,e.matrixWorld.elements);return ab}function v(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 y(){var a=
+hb;a>=fb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+fb);hb+=1;return a}function w(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function z(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,I(b.wrapS)),r.texParameteri(a,r.TEXTURE_WRAP_T,I(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,I(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,I(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.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+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,S(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,S(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||aa.get(b).__currentAnisotropy)&&(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,ka.getMaxAnisotropy())),aa.get(b).__currentAnisotropy=b.anisotropy)}function C(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 A(a,b,c){r.bindFramebuffer(r.FRAMEBUFFER,a);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,c,aa.get(b).__webglTexture,0)}function B(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,
+r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function S(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function I(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;
 if(a===THREE.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return r.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return r.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return r.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;
-if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;if(a===THREE.FloatType)return r.FLOAT;b=V.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;
+if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;if(a===THREE.FloatType)return r.FLOAT;b=W.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;
 if(a===THREE.RGBFormat)return r.RGB;if(a===THREE.RGBAFormat)return r.RGBA;if(a===THREE.LuminanceFormat)return r.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return r.FUNC_ADD;if(a===THREE.SubtractEquation)return r.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return r.ZERO;if(a===THREE.OneFactor)return r.ONE;if(a===THREE.SrcColorFactor)return r.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;
-if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;b=V.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=V.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=V.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 I=void 0!==a.canvas?a.canvas:document.createElement("canvas"),E=void 0!==a.context?a.context:null,S=I.width,K=I.height,F=1,J=void 0!==a.precision?a.precision:"highp",D=void 0!==a.alpha?a.alpha:!1,L=void 0!==a.depth?a.depth:!0,
-R=void 0!==a.stencil?a.stencil:!0,U=void 0!==a.antialias?a.antialias:!1,Q=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,T=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,H=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,$=new THREE.Color(0),ea=0,fa=[],la=[],na=[],Aa=[],Ga=[],Wa=new Float32Array(8),ua=[],Ja=[];this.domElement=I;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;var ka=this,va=[],lb=null,Qa=null,Ya=-1,xa="",Xa=null,gb=0,Ha=0,Ia=0,Ba=I.width,wa=I.height,jb=0,kb=0,Za=new THREE.Frustum,Ka=new THREE.Matrix4,ma=new THREE.Vector3,ha=new THREE.Vector3,fb=!0,Nb={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:[]}},Ca={programs:0,geometries:0,textures:0},P={calls:0,vertices:0,faces:0,points:0};this.info={render:P,memory:Ca,programs:va};var r;try{a={alpha:D,depth:L,stencil:R,antialias:U,premultipliedAlpha:Q,preserveDrawingBuffer:T};r=E||I.getContext("webgl",a)||I.getContext("experimental-webgl",a);if(null===r){if(null!==I.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";
-}I.addEventListener("webglcontextlost",function(a){a.preventDefault();d();c();oa.clear();aa.clear()},!1)}catch(Ib){console.error("THREE.WebGLRenderer: "+Ib)}var M=new THREE.WebGLState(r,O);void 0===r.getShaderPrecisionFormat&&(r.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var aa=new THREE.WebGLProperties,oa=new THREE.WebGLObjects(r,aa,this.info),V=new THREE.WebGLExtensions(r);V.get("OES_texture_float");V.get("OES_texture_float_linear");V.get("OES_texture_half_float");
-V.get("OES_texture_half_float_linear");V.get("OES_standard_derivatives");V.get("ANGLE_instanced_arrays");V.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);H&&V.get("EXT_frag_depth");c();this.context=r;this.extensions=V;this.state=M;var pa=new THREE.WebGLShadowMap(this,fa,oa);this.shadowMap=pa;var eb=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),E=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Jb=r.getParameter(r.MAX_TEXTURE_SIZE),ac=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),
-nb=0<E,mb=nb&&V.get("OES_texture_float"),Kb=V.get("ANGLE_instanced_arrays"),D=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT),E=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT),L=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);a=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT);var Yb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(V.get("WEBGL_compressed_texture_pvrtc")||V.get("WEBGL_compressed_texture_s3tc"))for(var b=r.getParameter(r.COMPRESSED_TEXTURE_FORMATS),
-c=0;c<b.length;c++)a.push(b[c]);return a}}(),D=0<D.precision&&0<L.precision,E=0<E.precision&&0<a.precision;"highp"!==J||D||(E?(J="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(J="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==J||E||(J="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Lb=new THREE.SpritePlugin(this,ua),Mb=new THREE.LensFlarePlugin(this,Ja);this.getContext=
-function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};this.forceContextLoss=function(){V.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return nb};this.supportsInstancedArrays=function(){return Kb};this.supportsFloatTextures=function(){return V.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return V.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return V.get("OES_standard_derivatives")};
-this.supportsCompressedTextureS3TC=function(){return V.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return V.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){return V.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=V.get("EXT_texture_filter_anisotropic");return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return J};this.getPixelRatio=
-function(){return F};this.setPixelRatio=function(a){void 0!==a&&(F=a)};this.getSize=function(){return{width:S,height:K}};this.setSize=function(a,b,c){S=a;K=b;I.width=a*F;I.height=b*F;!1!==c&&(I.style.width=a+"px",I.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ha=a*F;Ia=b*F;Ba=c*F;wa=d*F;r.viewport(Ha,Ia,Ba,wa)};this.setScissor=function(a,b,c,d){r.scissor(a*F,b*F,c*F,d*F)};this.enableScissorTest=function(a){M.setScissorTest(a)};this.getClearColor=function(){return $};
-this.setClearColor=function(a,c){$.set(a);ea=void 0!==c?c:1;b($.r,$.g,$.b,ea)};this.getClearAlpha=function(){return ea};this.setClearAlpha=function(a){ea=a;b($.r,$.g,$.b,ea)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};
-this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.renderBufferImmediate=function(a,b,c){M.initAttributes();var d=aa.get(a);a.hasPositions&&!d.__webglVertexBuffer&&(d.__webglVertexBuffer=r.createBuffer());a.hasNormals&&!d.__webglNormalBuffer&&(d.__webglNormalBuffer=r.createBuffer());a.hasUvs&&!d.__webglUvBuffer&&(d.__webglUvBuffer=r.createBuffer());a.hasColors&&!d.__webglColorBuffer&&(d.__webglColorBuffer=r.createBuffer());b=b.getAttributes();a.hasPositions&&
-(r.bindBuffer(r.ARRAY_BUFFER,d.__webglVertexBuffer),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),M.enableAttribute(b.position),r.vertexAttribPointer(b.position,3,r.FLOAT,!1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,d.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var e,f,g,h,k,l,n,m,p,q,s,t=3*a.count;for(s=0;s<t;s+=9)q=a.normalArray,e=q[s],f=q[s+1],g=q[s+2],h=q[s+3],l=q[s+4],m=q[s+5],k=q[s+6],n=q[s+7],p=q[s+8],e=(e+h+k)/3,
-f=(f+l+n)/3,g=(g+m+p)/3,q[s]=e,q[s+1]=f,q[s+2]=g,q[s+3]=e,q[s+4]=f,q[s+5]=g,q[s+6]=e,q[s+7]=f,q[s+8]=g}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);M.enableAttribute(b.normal);r.vertexAttribPointer(b.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglUvBuffer),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),M.enableAttribute(b.uv),r.vertexAttribPointer(b.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,
-d.__webglColorBuffer),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),M.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));M.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e){if(d instanceof THREE.MeshFaceMaterial){var f=d.materials,g=0;for(d=f.length;g<d;g++)ka.renderBufferDirect(a,b,c,f[g],e)}else if(!1!==d.visible){t(d);f=oa.geometries.get(e);a=u(a,b,c,d,e);g=!1;b=f.id+"_"+a.id+"_"+(d.wireframe?1:
-0);b!==xa&&(xa=b,g=!0);var h=e.morphTargetInfluences;if(void 0!==h){b=[];g=0;for(c=h.length;g<c;g++){var n=h[g];b.push([n,g])}b.sort(l);8<b.length&&(b.length=8);h=f.morphAttributes;g=0;for(c=b.length;g<c;g++)n=b[g],Wa[g]=n[0],0!==n[0]?(n=n[1],!0===d.morphTargets&&f.addAttribute("morphTarget"+g,h.position[n]),!0===d.morphNormals&&f.addAttribute("morphNormal"+g,h.normal[n])):(!0===d.morphTargets&&f.removeAttribute("morphTarget"+g),!0===d.morphNormals&&f.removeAttribute("morphNormal"+g));g=a.getUniforms();
-null!==g.morphTargetInfluences&&r.uniform1fv(g.morphTargetInfluences,Wa);g=!0}if(e instanceof THREE.Mesh)a:{e=r.TRIANGLES;!0===d.wireframe&&(e=r.LINES,M.setLineWidth(d.wireframeLinewidth*F));var m=f.attributes.index;if(m)if(h=oa.getAttributeBuffer(m),m.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(b=r.UNSIGNED_INT,c=4):(b=r.UNSIGNED_SHORT,c=2),n=f.drawcalls,0===n.length){g&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var p=
-V.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(e,m.array.length,b,0,f.maxInstancedCount)}else r.drawElements(e,m.array.length,b,0);P.calls++;P.vertices+=m.array.length;P.faces+=m.array.length/3}else for(var g=!0,m=0,q=n.length;m<q;m++){p=n[m].index;g&&(k(d,a,f,p),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h));if(f instanceof
-THREE.InstancedBufferGeometry&&0<n[m].instances){p=V.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(e,n[m].count,b,n[m].start*c,n[m].count,b,n[m].instances)}else r.drawElements(e,n[m].count,b,n[m].start*c);P.calls++;P.vertices+=n[m].count;P.faces+=n[m].count/3}else if(n=f.drawcalls,0===n.length){g&&k(d,a,f,0);d=f.attributes.position;
-if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){p=V.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}d instanceof THREE.InterleavedBufferAttribute?p.drawArraysInstancedANGLE(e,0,d.data.count,f.maxInstancedCount):p.drawArraysInstancedANGLE(e,0,d.count,f.maxInstancedCount)}else d instanceof THREE.InterleavedBufferAttribute?r.drawArrays(e,
-0,d.data.count):r.drawArrays(e,0,d.count);P.calls++;P.vertices+=d.count;P.faces+=d.array.length/3}else for(g&&k(d,a,f,0),m=0,q=n.length;m<q;m++){if(f instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else r.drawArrays(e,n[m].start,n[m].count);P.calls++;P.vertices+=n[m].count;P.faces+=n[m].count/3}}else if(e instanceof THREE.Line)if(e=e instanceof THREE.LineSegments?r.LINES:r.LINE_STRIP,M.setLineWidth((void 0!==
-d.linewidth?d.linewidth:1)*F),p=f.attributes.index)if(n=oa.getAttributeBuffer(p),p.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(c=r.UNSIGNED_INT,h=4):(c=r.UNSIGNED_SHORT,h=2),b=f.drawcalls,0===b.length)g&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,n)),r.drawElements(e,p.array.length,c,0),P.calls++,P.vertices+=p.array.length;else for(1<b.length&&(g=!0),p=0,m=b.length;p<m;p++)q=b[p].index,g&&(k(d,a,f,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,n)),r.drawElements(e,b[p].count,c,b[p].start*
-h),P.calls++,P.vertices+=b[p].count;else if(g&&k(d,a,f,0),d=f.attributes.position,b=f.drawcalls,0===b.length)r.drawArrays(e,0,d.array.length/3),P.calls++,P.vertices+=d.array.length/3;else for(p=0,m=b.length;p<m;p++)r.drawArrays(e,b[p].index,b[p].count),P.calls++,P.vertices+=b[p].count;else if(e instanceof THREE.PointCloud)if(b=g,e=r.POINTS,p=f.attributes.index)if(n=oa.getAttributeBuffer(p),p.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(c=r.UNSIGNED_INT,h=4):(c=r.UNSIGNED_SHORT,h=
-2),g=f.drawcalls,0===g.length)b&&(k(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,n)),r.drawElements(e,p.array.length,c,0),P.calls++,P.points+=p.array.length;else for(1<g.length&&(b=!0),p=0,m=g.length;p<m;p++)q=g[p].index,b&&(k(d,a,f,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,n)),r.drawElements(e,g[p].count,c,g[p].start*h),P.calls++,P.points+=g[p].count;else if(b&&k(d,a,f,0),d=f.attributes.position,g=f.drawcalls,0===g.length)r.drawArrays(e,0,d.array.length/3),P.calls++,P.points+=d.array.length/3;else for(p=
-0,m=g.length;p<m;p++)r.drawArrays(e,g[p].index,g[p].count),P.calls++,P.points+=g[p].count}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;xa="";Ya=-1;Xa=null;fb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ka.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Za.setFromMatrix(Ka);fa.length=
-0;la.length=0;na.length=0;Aa.length=0;Ga.length=0;ua.length=0;Ja.length=0;n(a);!0===ka.sortObjects&&(la.sort(m),na.sort(p));oa.update(la);oa.update(na);pa.render(a,b);P.calls=0;P.vertices=0;P.faces=0;P.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,q(la,b,fa,e,d),q(na,b,fa,e,d),s(Aa,b,fa,e,d),s(Ga,b,fa,e,d)):(M.setBlending(THREE.NoBlending),q(la,b,fa,e,null),s(Aa,b,fa,e,null),
-q(na,b,fa,e,null),s(Ga,b,fa,e,null));Lb.render(a,b);Mb.render(a,b,jb,kb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(M.bindTexture(r.TEXTURE_CUBE_MAP,aa.get(c).__webglTexture),r.generateMipmap(r.TEXTURE_CUBE_MAP),M.bindTexture(r.TEXTURE_CUBE_MAP,null)):(M.bindTexture(r.TEXTURE_2D,aa.get(c).__webglTexture),r.generateMipmap(r.TEXTURE_2D),M.bindTexture(r.TEXTURE_2D,null)));M.setDepthTest(!0);M.setDepthWrite(!0);
-M.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){t(d);var f=u(a,b,c,d,e);xa="";e.render(function(a){ka.renderBufferImmediate(a,f,d)})};var Zb={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?M.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?
-r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),M.enable(r.CULL_FACE))};this.setTexture=function(a,b){var c=aa.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void 0===
-c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",e),c.__webglTexture=r.createTexture(),Ca.textures++);M.activeTexture(r.TEXTURE0+b);M.bindTexture(r.TEXTURE_2D,c.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=z(a.image,Jb);var f=a.image,d=THREE.Math.isPowerOfTwo(f.width)&&THREE.Math.isPowerOfTwo(f.height),g=O(a.format),h=O(a.type);
-w(r.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,n=k.length;l<n;l++)f=k[l],M.texImage2D(r.TEXTURE_2D,l,g,f.width,f.height,0,g,h,f.data);a.generateMipmaps=!1}else M.texImage2D(r.TEXTURE_2D,0,g,f.width,f.height,0,g,h,f.data);else if(a instanceof THREE.CompressedTexture)for(l=0,n=k.length;l<n;l++)f=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Yb().indexOf(g)?M.compressedTexImage2D(r.TEXTURE_2D,l,g,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):
-M.texImage2D(r.TEXTURE_2D,l,g,f.width,f.height,0,g,h,f.data);else if(0<k.length&&d){l=0;for(n=k.length;l<n;l++)f=k[l],M.texImage2D(r.TEXTURE_2D,l,g,g,h,f);a.generateMipmaps=!1}else M.texImage2D(r.TEXTURE_2D,0,g,g,h,a.image);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else M.activeTexture(r.TEXTURE0+b),M.bindTexture(r.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===
-aa.get(a).__webglFramebuffer){var c=aa.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",g);c.__webglTexture=r.createTexture();Ca.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),e=O(a.format),f=O(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];M.bindTexture(r.TEXTURE_CUBE_MAP,c.__webglTexture);w(r.TEXTURE_CUBE_MAP,a,d);for(var h=0;6>h;h++)c.__webglFramebuffer[h]=r.createFramebuffer(),
-c.__webglRenderbuffer[h]=r.createRenderbuffer(),M.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,a.height,0,e,f,null),C(c.__webglFramebuffer[h],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+h),A(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),M.bindTexture(r.TEXTURE_2D,c.__webglTexture),w(r.TEXTURE_2D,a,d),M.texImage2D(r.TEXTURE_2D,
-0,e,a.width,a.height,0,e,f,null),C(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):A(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);b?M.bindTexture(r.TEXTURE_CUBE_MAP,null):M.bindTexture(r.TEXTURE_2D,
-null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=aa.get(a),b=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ba,a=wa,d=Ha,e=Ia);b!==Qa&&(r.bindFramebuffer(r.FRAMEBUFFER,b),r.viewport(d,e,c,a),Qa=b);jb=c;kb=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(aa.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;aa.get(a).__webglFramebuffer!==Qa&&(r.bindFramebuffer(r.FRAMEBUFFER,aa.get(a).__webglFramebuffer),g=!0);r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,r.RGBA,r.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");
-g&&r.bindFramebuffer(r.FRAMEBUFFER,Qa)}};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 pa.enabled},
-set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");pa.enabled=a}},shadowMapType:{get:function(){return pa.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");pa.type=a}},shadowMapCullFace:{get:function(){return pa.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");pa.cullFace=a}},shadowMapDebug:{get:function(){return pa.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");
-pa.debug=a}}})};
+if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return r.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 D=void 0!==a.canvas?a.canvas:document.createElement("canvas"),P=void 0!==a.context?a.context:null,K=D.width,N=D.height,E=1,F=void 0!==a.precision?a.precision:"highp",J=void 0!==a.alpha?a.alpha:!1,R=void 0!==a.depth?a.depth:!0,
+U=void 0!==a.stencil?a.stencil:!0,Q=void 0!==a.antialias?a.antialias:!1,T=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,H=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,qa=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,$=new THREE.Color(0),ja=0,fa=[],ra=[],va=[],pa=[],Qa=[],xa=new Float32Array(8),Ra=[],Sa=[];this.domElement=D;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;var ka=this,wa=[],mb=null,Ha=null,Za=-1,Ca="",Ya=null,hb=0,Ia=0,Ba=0,ya=D.width,Ja=D.height,kb=0,lb=0,$a=new THREE.Frustum,Ka=new THREE.Matrix4,ma=new THREE.Vector3,ga=new THREE.Vector3,gb=!0,Nb={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:[]}},Da={programs:0,geometries:0,textures:0},O={calls:0,vertices:0,faces:0,points:0};this.info={render:O,memory:Da,programs:wa};var r;try{a={alpha:J,depth:R,stencil:U,antialias:Q,premultipliedAlpha:T,preserveDrawingBuffer:H};r=P||D.getContext("webgl",a)||D.getContext("experimental-webgl",a);if(null===r){if(null!==D.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";
+}D.addEventListener("webglcontextlost",e,!1)}catch(Ib){console.error("THREE.WebGLRenderer: "+Ib)}var L=new THREE.WebGLState(r,I);void 0===r.getShaderPrecisionFormat&&(r.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var aa=new THREE.WebGLProperties,la=new THREE.WebGLObjects(r,aa,this.info),W=new THREE.WebGLExtensions(r);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);qa&&W.get("EXT_frag_depth");c();this.context=r;this.extensions=W;this.state=L;var na=new THREE.WebGLShadowMap(this,fa,la);this.shadowMap=na;var fb=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),P=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Jb=r.getParameter(r.MAX_TEXTURE_SIZE),ac=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),ob=0<P,nb=ob&&W.get("OES_texture_float"),Kb=W.get("ANGLE_instanced_arrays"),
+J=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT),P=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT),R=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);a=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT);var Yb=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=r.getParameter(r.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),J=0<
+J.precision&&0<R.precision,P=0<P.precision&&0<a.precision;"highp"!==F||J||(P?(F="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(F="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==F||P||(F="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Lb=new THREE.SpritePlugin(this,Ra),Mb=new THREE.LensFlarePlugin(this,Sa);this.getContext=function(){return r};this.getContextAttributes=function(){return r.getContextAttributes()};
+this.forceContextLoss=function(){W.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return ob};this.supportsInstancedArrays=function(){return Kb};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?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return F};this.getPixelRatio=function(){return E};this.setPixelRatio=function(a){void 0!==a&&(E=a)};this.getSize=
+function(){return{width:K,height:N}};this.setSize=function(a,b,c){K=a;N=b;D.width=a*E;D.height=b*E;!1!==c&&(D.style.width=a+"px",D.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ia=a*E;Ba=b*E;ya=c*E;Ja=d*E;r.viewport(Ia,Ba,ya,Ja)};this.setScissor=function(a,b,c,d){r.scissor(a*E,b*E,c*E,d*E)};this.enableScissorTest=function(a){L.setScissorTest(a)};this.getClearColor=function(){return $};this.setClearColor=function(a,c){$.set(a);ja=void 0!==c?c:1;b($.r,$.g,$.b,ja)};
+this.getClearAlpha=function(){return ja};this.setClearAlpha=function(a){ja=a;b($.r,$.g,$.b,ja)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,
+c,d)};this.resetGLState=d;this.dispose=function(){D.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){L.initAttributes();var d=aa.get(a);a.hasPositions&&!d.__webglVertexBuffer&&(d.__webglVertexBuffer=r.createBuffer());a.hasNormals&&!d.__webglNormalBuffer&&(d.__webglNormalBuffer=r.createBuffer());a.hasUvs&&!d.__webglUvBuffer&&(d.__webglUvBuffer=r.createBuffer());a.hasColors&&!d.__webglColorBuffer&&(d.__webglColorBuffer=r.createBuffer());b=b.getAttributes();a.hasPositions&&
+(r.bindBuffer(r.ARRAY_BUFFER,d.__webglVertexBuffer),r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),L.enableAttribute(b.position),r.vertexAttribPointer(b.position,3,r.FLOAT,!1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,d.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var e,f,g,h,k,l,m,n,p,q,s,t=3*a.count;for(s=0;s<t;s+=9)q=a.normalArray,e=q[s],f=q[s+1],g=q[s+2],h=q[s+3],l=q[s+4],n=q[s+5],k=q[s+6],m=q[s+7],p=q[s+8],e=(e+h+k)/3,
+f=(f+l+m)/3,g=(g+n+p)/3,q[s]=e,q[s+1]=f,q[s+2]=g,q[s+3]=e,q[s+4]=f,q[s+5]=g,q[s+6]=e,q[s+7]=f,q[s+8]=g}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);L.enableAttribute(b.normal);r.vertexAttribPointer(b.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,d.__webglUvBuffer),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),L.enableAttribute(b.uv),r.vertexAttribPointer(b.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,
+d.__webglColorBuffer),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),L.enableAttribute(b.color),r.vertexAttribPointer(b.color,3,r.FLOAT,!1,0,0));L.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e){if(d instanceof THREE.MeshFaceMaterial)for(var f=d.materials,g=0,h=f.length;g<h;g++)d=f[g],null!==d&&!1!==d.visible&&ka.renderBufferDirect(a,b,c,d,e);else{u(d);f=la.geometries.get(e);a=x(a,b,c,d,e);g=!1;b=f.id+"_"+a.id+"_"+(d.wireframe?
+1:0);b!==Ca&&(Ca=b,g=!0);h=e.morphTargetInfluences;if(void 0!==h){b=[];g=0;for(c=h.length;g<c;g++){var k=h[g];b.push([k,g])}b.sort(n);8<b.length&&(b.length=8);h=f.morphAttributes;g=0;for(c=b.length;g<c;g++)k=b[g],xa[g]=k[0],0!==k[0]?(k=k[1],!0===d.morphTargets&&f.addAttribute("morphTarget"+g,h.position[k]),!0===d.morphNormals&&f.addAttribute("morphNormal"+g,h.normal[k])):(!0===d.morphTargets&&f.removeAttribute("morphTarget"+g),!0===d.morphNormals&&f.removeAttribute("morphNormal"+g));g=a.getUniforms();
+null!==g.morphTargetInfluences&&r.uniform1fv(g.morphTargetInfluences,xa);g=!0}if(e instanceof THREE.Mesh)a:{e=d;d=r.TRIANGLES;!0===e.wireframe&&(d=r.LINES,L.setLineWidth(e.wireframeLinewidth*E));var m=f.attributes.index;if(m)if(h=la.getAttributeBuffer(m),m.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(b=r.UNSIGNED_INT,c=4):(b=r.UNSIGNED_SHORT,c=2),k=f.drawcalls,0===k.length){g&&(l(e,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h));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(d,m.array.length,b,0,f.maxInstancedCount)}else r.drawElements(d,m.array.length,b,0);O.calls++;O.vertices+=m.array.length;O.faces+=m.array.length/3}else for(var g=!0,m=0,q=k.length;m<q;m++){p=k[m].index;g&&(l(e,a,f,p),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h));if(f instanceof
+THREE.InstancedBufferGeometry&&0<k[m].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(d,k[m].count,b,k[m].start*c,k[m].count,b,k[m].instances)}else r.drawElements(d,k[m].count,b,k[m].start*c);O.calls++;O.vertices+=k[m].count;O.faces+=k[m].count/3}else if(k=f.drawcalls,0===k.length){g&&l(e,a,f,0);a=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}a instanceof THREE.InterleavedBufferAttribute?p.drawArraysInstancedANGLE(d,0,a.data.count,f.maxInstancedCount):p.drawArraysInstancedANGLE(d,0,a.count,f.maxInstancedCount)}else a instanceof THREE.InterleavedBufferAttribute?r.drawArrays(d,
+0,a.data.count):r.drawArrays(d,0,a.count);O.calls++;O.vertices+=a.count;O.faces+=a.array.length/3}else for(g&&l(e,a,f,0),m=0,q=k.length;m<q;m++){if(f instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else r.drawArrays(d,k[m].start,k[m].count);O.calls++;O.vertices+=k[m].count;O.faces+=k[m].count/3}}else if(e instanceof THREE.Line)if(e=e instanceof THREE.LineSegments?r.LINES:r.LINE_STRIP,L.setLineWidth((void 0!==
+d.linewidth?d.linewidth:1)*E),p=f.attributes.index)if(k=la.getAttributeBuffer(p),p.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(c=r.UNSIGNED_INT,h=4):(c=r.UNSIGNED_SHORT,h=2),b=f.drawcalls,0===b.length)g&&(l(d,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,k)),r.drawElements(e,p.array.length,c,0),O.calls++,O.vertices+=p.array.length;else for(1<b.length&&(g=!0),p=0,m=b.length;p<m;p++)q=b[p].index,g&&(l(d,a,f,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,k)),r.drawElements(e,b[p].count,c,b[p].start*
+h),O.calls++,O.vertices+=b[p].count;else if(g&&l(d,a,f,0),a=f.attributes.position,b=f.drawcalls,0===b.length)r.drawArrays(e,0,a.array.length/3),O.calls++,O.vertices+=a.array.length/3;else for(p=0,m=b.length;p<m;p++)r.drawArrays(e,b[p].index,b[p].count),O.calls++,O.vertices+=b[p].count;else if(e instanceof THREE.PointCloud)if(e=d,b=g,d=r.POINTS,p=f.attributes.index)if(k=la.getAttributeBuffer(p),p.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(c=r.UNSIGNED_INT,h=4):(c=r.UNSIGNED_SHORT,
+h=2),g=f.drawcalls,0===g.length)b&&(l(e,a,f,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,k)),r.drawElements(d,p.array.length,c,0),O.calls++,O.points+=p.array.length;else for(1<g.length&&(b=!0),p=0,m=g.length;p<m;p++)q=g[p].index,b&&(l(e,a,f,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,k)),r.drawElements(d,g[p].count,c,g[p].start*h),O.calls++,O.points+=g[p].count;else if(b&&l(e,a,f,0),a=f.attributes.position,g=f.drawcalls,0===g.length)r.drawArrays(d,0,a.array.length/3),O.calls++,O.points+=a.array.length/3;else for(p=
+0,m=g.length;p<m;p++)r.drawArrays(d,g[p].index,g[p].count),O.calls++,O.points+=g[p].count}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;Ca="";Za=-1;Ya=null;gb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ka.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);$a.setFromMatrix(Ka);fa.length=
+0;ra.length=0;va.length=0;pa.length=0;Qa.length=0;Ra.length=0;Sa.length=0;q(a);!0===ka.sortObjects&&(ra.sort(p),va.sort(m));la.update(ra);la.update(va);na.render(a,b);O.calls=0;O.vertices=0;O.faces=0;O.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,s(ra,b,fa,e,d),s(va,b,fa,e,d),t(pa,b,fa,e,d),t(Qa,b,fa,e,d)):(L.setBlending(THREE.NoBlending),s(ra,b,fa,e,null),t(pa,b,fa,e,null),
+s(va,b,fa,e,null),t(Qa,b,fa,e,null));Lb.render(a,b);Mb.render(a,b,kb,lb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(L.bindTexture(r.TEXTURE_CUBE_MAP,aa.get(c).__webglTexture),r.generateMipmap(r.TEXTURE_CUBE_MAP),L.bindTexture(r.TEXTURE_CUBE_MAP,null)):(L.bindTexture(r.TEXTURE_2D,aa.get(c).__webglTexture),r.generateMipmap(r.TEXTURE_2D),L.bindTexture(r.TEXTURE_2D,null)));L.setDepthTest(!0);L.setDepthWrite(!0);
+L.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){u(d);var f=x(a,b,c,d,e);Ca="";e.render(function(a){ka.renderBufferImmediate(a,f,d)})};var Zb={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?L.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?
+r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),L.enable(r.CULL_FACE))};this.setTexture=function(a,b){var c=aa.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void 0===
+c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",g),c.__webglTexture=r.createTexture(),Da.textures++);L.activeTexture(r.TEXTURE0+b);L.bindTexture(r.TEXTURE_2D,c.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=C(a.image,Jb);var e=a.image,d=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),f=I(a.format),h=I(a.type);
+z(r.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,m=k.length;l<m;l++)e=k[l],L.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}else L.texImage2D(r.TEXTURE_2D,0,f,e.width,e.height,0,f,h,e.data);else if(a instanceof THREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)e=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Yb().indexOf(f)?L.compressedTexImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):
+L.texImage2D(r.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);else if(0<k.length&&d){l=0;for(m=k.length;l<m;l++)e=k[l],L.texImage2D(r.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}else L.texImage2D(r.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else L.activeTexture(r.TEXTURE0+b),L.bindTexture(r.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===
+aa.get(a).__webglFramebuffer){var c=aa.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",f);c.__webglTexture=r.createTexture();Da.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),e=I(a.format),g=I(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];L.bindTexture(r.TEXTURE_CUBE_MAP,c.__webglTexture);z(r.TEXTURE_CUBE_MAP,a,d);for(var h=0;6>h;h++)c.__webglFramebuffer[h]=r.createFramebuffer(),
+c.__webglRenderbuffer[h]=r.createRenderbuffer(),L.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,a.height,0,e,g,null),A(c.__webglFramebuffer[h],a,r.TEXTURE_CUBE_MAP_POSITIVE_X+h),B(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=r.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),L.bindTexture(r.TEXTURE_2D,c.__webglTexture),z(r.TEXTURE_2D,a,d),L.texImage2D(r.TEXTURE_2D,
+0,e,a.width,a.height,0,e,g,null),A(c.__webglFramebuffer,a,r.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,c.__webglRenderbuffer):B(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);b?L.bindTexture(r.TEXTURE_CUBE_MAP,null):L.bindTexture(r.TEXTURE_2D,
+null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(c=aa.get(a),b=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=ya,a=Ja,d=Ia,e=Ba);b!==Ha&&(r.bindFramebuffer(r.FRAMEBUFFER,b),r.viewport(d,e,c,a),Ha=b);kb=c;lb=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(aa.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;aa.get(a).__webglFramebuffer!==Ha&&(r.bindFramebuffer(r.FRAMEBUFFER,aa.get(a).__webglFramebuffer),g=!0);r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,r.RGBA,r.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");
+g&&r.bindFramebuffer(r.FRAMEBUFFER,Ha)}};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 na.enabled},
+set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");na.enabled=a}},shadowMapType:{get:function(){return na.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");na.type=a}},shadowMapCullFace:{get:function(){return na.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");na.cullFace=a}},shadowMapDebug:{get:function(){return na.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");
+na.debug=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,1);
 this.format=void 0!==c.format?c.format:THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose()},copy:function(a){this.width=a.width;this.height=a.height;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy=a.anisotropy;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.format=a.format;this.type=a.type;this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;
@@ -592,73 +592,73 @@ break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_t
 THREE.WebGLGeometries=function(a,b,c){function d(g){g=g.target;var f=e[g.id],h;for(h in f.attributes){var k=f.attributes[h],l;l=k;l=l instanceof THREE.InterleavedBufferAttribute?b.get(l.data).__webglBuffer:b.get(l).__webglBuffer;void 0!==l&&(a.deleteBuffer(l),k instanceof THREE.InterleavedBufferAttribute?b.delete(k.data):b.delete(k))}g.removeEventListener("dispose",d);delete e[g.id];c.memory.geometries--}var e={};this.get=function(a){var b=a.geometry;if(void 0!==e[b.id])return e[b.id];b.addEventListener("dispose",
 d);b instanceof THREE.BufferGeometry?e[b.id]=b:b instanceof THREE.Geometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new THREE.BufferGeometry).setFromObject(a)),e[b.id]=b._bufferGeometry);c.memory.geometries++;return e[b.id]}};
 THREE.WebGLObjects=function(a,b,c){function d(a){a.target.traverse(function(a){a.removeEventListener("remove",d);(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)&&delete g[a.id];delete a._modelViewMatrix;delete a._normalMatrix;b.delete(a)})}function e(c,d){var e="index"===d?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,f=c instanceof THREE.InterleavedBufferAttribute?c.data:c,g=b.get(f);if(void 0===g.__webglBuffer){g.__webglBuffer=a.createBuffer();a.bindBuffer(e,g.__webglBuffer);
-var n=a.STATIC_DRAW;if(f instanceof THREE.DynamicBufferAttribute||f instanceof THREE.InstancedBufferAttribute&&!0===f.dynamic||f instanceof THREE.InterleavedBuffer&&!0===f.dynamic)n=a.DYNAMIC_DRAW;a.bufferData(e,f.array,n);g.version=f.version}else g.version!==f.version&&(a.bindBuffer(e,g.__webglBuffer),void 0===f.updateRange||-1===f.updateRange.count?a.bufferSubData(e,0,f.array):0===f.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
+var m=a.STATIC_DRAW;if(f instanceof THREE.DynamicBufferAttribute||f instanceof THREE.InstancedBufferAttribute&&!0===f.dynamic||f instanceof THREE.InterleavedBuffer&&!0===f.dynamic)m=a.DYNAMIC_DRAW;a.bufferData(e,f.array,m);g.version=f.version}else g.version!==f.version&&(a.bindBuffer(e,g.__webglBuffer),void 0===f.updateRange||-1===f.updateRange.count?a.bufferSubData(e,0,f.array):0===f.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
 (a.bufferSubData(e,f.updateRange.offset*f.array.BYTES_PER_ELEMENT,f.array.subarray(f.updateRange.offset,f.updateRange.offset+f.updateRange.count)),f.updateRange.count=0),g.version=f.version)}var g={},f=new THREE.WebGLGeometries(a,b,c);this.objects=g;this.geometries=f;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)&&(g[a.id]={id:a.id,object:a,z:0})};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.update=function(a){for(var b=0,c=a.length;b<c;b++){var d=a[b].object;if(!1!==d.material.visible){var g=f.get(d);d.geometry instanceof THREE.Geometry&&g.updateFromObject(d);var n=g.attributes,d=void 0;for(d in n)e(n[d],d);g=g.morphAttributes;for(d in g)for(var n=
-g[d],q=0,s=n.length;q<s;q++)e(n[q],q)}}};this.clear=function(){g={}}};
-THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var f=a[c];!1!==f&&b.push("#define "+c+" "+f)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,g,f){var h=d.context,k=g.defines,l=g.__webglShader.vertexShader,m=g.__webglShader.fragmentShader,p="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?p="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(p="SHADOWMAP_TYPE_PCF_SOFT");var n="ENVMAP_TYPE_CUBE",q="ENVMAP_MODE_REFLECTION",s="ENVMAP_BLENDING_MULTIPLY";
-if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:n="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:n="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:n="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:s="ENVMAP_BLENDING_MULTIPLY";
+THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud)&&(g[a.id]={id:a.id,object:a,z:0})};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.update=function(a){for(var b=0,c=a.length;b<c;b++){var d=a[b].object,g=f.get(d);d.geometry instanceof THREE.Geometry&&g.updateFromObject(d);var m=g.attributes,d=void 0;for(d in m)e(m[d],d);g=g.morphAttributes;for(d in g)for(var m=g[d],q=0,s=m.length;q<
+s;q++)e(m[q],q)}};this.clear=function(){g={}}};
+THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var f=a[c];!1!==f&&b.push("#define "+c+" "+f)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,g,f){var h=d.context,k=g.defines,l=g.__webglShader.vertexShader,n=g.__webglShader.fragmentShader,p="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?p="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(p="SHADOWMAP_TYPE_PCF_SOFT");var m="ENVMAP_TYPE_CUBE",q="ENVMAP_MODE_REFLECTION",s="ENVMAP_BLENDING_MULTIPLY";
+if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:m="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:m="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:m="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:s="ENVMAP_BLENDING_MULTIPLY";
 break;case THREE.MixOperation:s="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:s="ENVMAP_BLENDING_ADD"}}var t=0<d.gammaFactor?d.gammaFactor:1,u=a(k),x=h.createProgram();g instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,u,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+t,"#define MAX_DIR_LIGHTS "+
 f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,"#define MAX_BONES "+f.maxBones,f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+q:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":
 "",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.skinning?"#define USE_SKINNING":"",f.useVertexTexture?"#define BONE_TEXTURE":"",f.morphTargets?"#define USE_MORPHTARGETS":"",f.morphNormals&&!1===f.flatShading?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+p:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":
 "",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.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=[f.bumpMap||f.normalMap||f.flatShading||g.derivatives?"#extension GL_OES_standard_derivatives : enable":"","precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,u,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+
-f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+t,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+n:"",f.envMap?"#define "+q:"",f.envMap?"#define "+s:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":
+f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+t,f.useFog&&f.fog?"#define USE_FOG":"",f.useFog&&f.fogExp?"#define FOG_EXP2":"",f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+m:"",f.envMap?"#define "+q:"",f.envMap?"#define "+s:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":
 "",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.metal?"#define METAL":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+p:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.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=THREE.WebGLShader(h,h.VERTEX_SHADER,k+l);m=THREE.WebGLShader(h,h.FRAGMENT_SHADER,m);h.attachShader(x,l);h.attachShader(x,m);void 0!==g.index0AttributeName?h.bindAttribLocation(x,0,g.index0AttributeName):!0===f.morphTargets&&h.bindAttribLocation(x,0,"position");h.linkProgram(x);f=h.getProgramInfoLog(x);p=h.getShaderInfoLog(l);n=h.getShaderInfoLog(m);
-s=q=!0;if(!1===h.getProgramParameter(x,h.LINK_STATUS))q=!1,console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(x,h.VALIDATE_STATUS),"gl.getProgramInfoLog",f,p,n);else if(""!==f)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f);else if(""===p||""===n)s=!1;s&&(this.diagnostics={runnable:q,material:g,programLog:f,vertexShader:{log:p,prefix:k},fragmentShader:{log:n,prefix:d}});h.deleteShader(l);h.deleteShader(m);var v;this.getUniforms=
+d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(b).join("\n"));n=d+n;l=THREE.WebGLShader(h,h.VERTEX_SHADER,k+l);n=THREE.WebGLShader(h,h.FRAGMENT_SHADER,n);h.attachShader(x,l);h.attachShader(x,n);void 0!==g.index0AttributeName?h.bindAttribLocation(x,0,g.index0AttributeName):!0===f.morphTargets&&h.bindAttribLocation(x,0,"position");h.linkProgram(x);f=h.getProgramInfoLog(x);p=h.getShaderInfoLog(l);m=h.getShaderInfoLog(n);
+s=q=!0;if(!1===h.getProgramParameter(x,h.LINK_STATUS))q=!1,console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(x,h.VALIDATE_STATUS),"gl.getProgramInfoLog",f,p,m);else if(""!==f)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f);else if(""===p||""===m)s=!1;s&&(this.diagnostics={runnable:q,material:g,programLog:f,vertexShader:{log:p,prefix:k},fragmentShader:{log:m,prefix:d}});h.deleteShader(l);h.deleteShader(n);var v;this.getUniforms=
 function(){if(void 0===v){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}v=a}return v};var y;this.getAttributes=function(){if(void 0===y){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)}y=a}return y};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){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c};this.delete=function(b){delete a[b.uuid]};this.clear=function(){a={}}};
+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=n;return this}}();THREE.WebGLProperties=function(){var a={};this.get=function(b){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c};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===f.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),l.push(e));for(var e=0,g=a.children.length;e<g;e++)d(a.children[e],b)}}var e=a.context,g=a.state,f=new THREE.Frustum,h=new THREE.Matrix4;new THREE.Vector3;new THREE.Vector3;var k=new THREE.Vector3,l=[],m=THREE.ShaderLib.depthRGBA,p=THREE.UniformsUtils.clone(m.uniforms),
-n=new THREE.ShaderMaterial({uniforms:p,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}),q=new THREE.ShaderMaterial({uniforms:p,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0}),s=new THREE.ShaderMaterial({uniforms:p,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,skinning:!0}),t=new THREE.ShaderMaterial({uniforms:p,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0,skinning:!0});n._shadowPass=!0;q._shadowPass=!0;s._shadowPass=
-!0;t._shadowPass=!0;var u=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=function(c,m){if(!1!==u.enabled&&(!1!==u.autoUpdate||!1!==u.needsUpdate)){e.clearColor(1,1,1,1);g.disable(e.BLEND);g.enable(e.CULL_FACE);e.frontFace(e.CCW);u.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);g.setDepthTest(!0);for(var p=0,w=b.length;p<w;p++){var z=b[p];if(z.castShadow){if(!z.shadowMap){var C=THREE.LinearFilter;
-u.type===THREE.PCFSoftShadowMap&&(C=THREE.NearestFilter);z.shadowMap=new THREE.WebGLRenderTarget(z.shadowMapWidth,z.shadowMapHeight,{minFilter:C,magFilter:C,format:THREE.RGBAFormat});z.shadowMapSize=new THREE.Vector2(z.shadowMapWidth,z.shadowMapHeight);z.shadowMatrix=new THREE.Matrix4}if(!z.shadowCamera){if(z instanceof THREE.SpotLight)z.shadowCamera=new THREE.PerspectiveCamera(z.shadowCameraFov,z.shadowMapWidth/z.shadowMapHeight,z.shadowCameraNear,z.shadowCameraFar);else if(z instanceof THREE.DirectionalLight)z.shadowCamera=
-new THREE.OrthographicCamera(z.shadowCameraLeft,z.shadowCameraRight,z.shadowCameraTop,z.shadowCameraBottom,z.shadowCameraNear,z.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",z);continue}c.add(z.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}z.shadowCameraVisible&&!z.cameraHelper&&(z.cameraHelper=new THREE.CameraHelper(z.shadowCamera),c.add(z.cameraHelper));var A=z.shadowMap,B=z.shadowMatrix,C=z.shadowCamera;C.position.setFromMatrixPosition(z.matrixWorld);
-k.setFromMatrixPosition(z.target.matrixWorld);C.lookAt(k);C.updateMatrixWorld();C.matrixWorldInverse.getInverse(C.matrixWorld);z.cameraHelper&&(z.cameraHelper.visible=z.shadowCameraVisible);z.shadowCameraVisible&&z.cameraHelper.update();B.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);B.multiply(C.projectionMatrix);B.multiply(C.matrixWorldInverse);h.multiplyMatrices(C.projectionMatrix,C.matrixWorldInverse);f.setFromMatrix(h);a.setRenderTarget(A);a.clear();l.length=0;d(c,C);for(var O,I,z=0,A=l.length;z<
-A;z++)B=l[z],B=B.object,I=B.material instanceof THREE.MeshFaceMaterial?B.material.materials[0]:B.material,!1!==I.visible&&(O=void 0!==B.geometry.morphTargets&&0<B.geometry.morphTargets.length&&I.morphTargets,I=B instanceof THREE.SkinnedMesh&&I.skinning,O=B.customDepthMaterial?B.customDepthMaterial:I?O?t:s:O?q:n,a.renderBufferDirect(C,b,null,O,B))}}p=a.getClearColor();w=a.getClearAlpha();e.clearColor(p.r,p.g,p.b,w);g.enable(e.BLEND);u.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState();
-u.needsUpdate=!1}}};
-THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),g={},f=null,h=null,k=null,l=null,m=null,p=null,n=null,q=null,s=null,t=null,u=null,x=null,v=null,y=null,w=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),z=void 0,C={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.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,
+THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!1!==a.visible){var e=c.objects[a.id];if(e&&a.castShadow&&(!1===a.frustumCulled||!0===f.intersectsObject(a))){var g=a.material;null!==g&&!0===g.visible&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),l.push(e))}for(var e=a.children,g=0,h=e.length;g<h;g++)d(e[g],b)}}var e=a.context,g=a.state,f=new THREE.Frustum,h=new THREE.Matrix4;new THREE.Vector3;new THREE.Vector3;var k=new THREE.Vector3,l=[],n=THREE.ShaderLib.depthRGBA,
+p=THREE.UniformsUtils.clone(n.uniforms),m=new THREE.ShaderMaterial({uniforms:p,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}),q=new THREE.ShaderMaterial({uniforms:p,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0}),s=new THREE.ShaderMaterial({uniforms:p,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,skinning:!0}),t=new THREE.ShaderMaterial({uniforms:p,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0,skinning:!0});m._shadowPass=
+!0;q._shadowPass=!0;s._shadowPass=!0;t._shadowPass=!0;var u=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=function(c,n){if(!1!==u.enabled&&(!1!==u.autoUpdate||!1!==u.needsUpdate)){e.clearColor(1,1,1,1);g.disable(e.BLEND);g.enable(e.CULL_FACE);e.frontFace(e.CCW);u.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);g.setDepthTest(!0);for(var p=0,w=b.length;p<w;p++){var z=b[p];if(z.castShadow){if(!z.shadowMap){var C=
+THREE.LinearFilter;u.type===THREE.PCFSoftShadowMap&&(C=THREE.NearestFilter);z.shadowMap=new THREE.WebGLRenderTarget(z.shadowMapWidth,z.shadowMapHeight,{minFilter:C,magFilter:C,format:THREE.RGBAFormat});z.shadowMapSize=new THREE.Vector2(z.shadowMapWidth,z.shadowMapHeight);z.shadowMatrix=new THREE.Matrix4}if(!z.shadowCamera){if(z instanceof THREE.SpotLight)z.shadowCamera=new THREE.PerspectiveCamera(z.shadowCameraFov,z.shadowMapWidth/z.shadowMapHeight,z.shadowCameraNear,z.shadowCameraFar);else if(z instanceof
+THREE.DirectionalLight)z.shadowCamera=new THREE.OrthographicCamera(z.shadowCameraLeft,z.shadowCameraRight,z.shadowCameraTop,z.shadowCameraBottom,z.shadowCameraNear,z.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",z);continue}c.add(z.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}z.shadowCameraVisible&&!z.cameraHelper&&(z.cameraHelper=new THREE.CameraHelper(z.shadowCamera),c.add(z.cameraHelper));var A=z.shadowMap,B=z.shadowMatrix,C=z.shadowCamera;
+C.position.setFromMatrixPosition(z.matrixWorld);k.setFromMatrixPosition(z.target.matrixWorld);C.lookAt(k);C.updateMatrixWorld();C.matrixWorldInverse.getInverse(C.matrixWorld);z.cameraHelper&&(z.cameraHelper.visible=z.shadowCameraVisible);z.shadowCameraVisible&&z.cameraHelper.update();B.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);B.multiply(C.projectionMatrix);B.multiply(C.matrixWorldInverse);h.multiplyMatrices(C.projectionMatrix,C.matrixWorldInverse);f.setFromMatrix(h);a.setRenderTarget(A);a.clear();
+l.length=0;d(c,C);for(var S,I,z=0,A=l.length;z<A;z++){B=l[z];B=B.object;I=B.material;if(I instanceof THREE.MeshFaceMaterial&&(I=B.material.materials[0],null===I||!1===I.visible))continue;S=void 0!==B.geometry.morphTargets&&0<B.geometry.morphTargets.length&&I.morphTargets;I=B instanceof THREE.SkinnedMesh&&I.skinning;S=B.customDepthMaterial?B.customDepthMaterial:I?S?t:s:S?q:m;a.renderBufferDirect(C,b,null,S,B)}}}p=a.getClearColor();w=a.getClearAlpha();e.clearColor(p.r,p.g,p.b,w);g.enable(e.BLEND);u.cullFace===
+THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState();u.needsUpdate=!1}}};
+THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),g={},f=null,h=null,k=null,l=null,n=null,p=null,m=null,q=null,s=null,t=null,u=null,x=null,v=null,y=null,w=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),z=void 0,C={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.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!==g[b]&&(a.enable(b),g[b]=!0)};this.disable=function(b){!1!==g[b]&&(a.disable(b),g[b]=!1)};this.setBlending=function(c,d,e,g,q,s,t){c!==f&&(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)),f=c);if(c===THREE.CustomBlending){q=q||d;s=s||e;t=t||g;if(d!==h||q!==m)a.blendEquationSeparate(b(d),b(q)),h=d,m=q;if(e!==k||g!==l||s!==p||t!==n)a.blendFuncSeparate(b(e),b(g),b(s),b(t)),k=e,l=g,p=s,n=t}else n=p=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);
+a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=c);if(c===THREE.CustomBlending){q=q||d;s=s||e;t=t||g;if(d!==h||q!==n)a.blendEquationSeparate(b(d),b(q)),h=d,n=q;if(e!==k||g!==l||s!==p||t!==m)a.blendFuncSeparate(b(e),b(g),b(s),b(t)),k=e,l=g,p=s,m=t}else m=p=n=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){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){s!==b&&(a.depthMask(b),s=b)};this.setColorWrite=function(b){t!==b&&(a.colorMask(b,b,b,b),t=b)};this.setFlipSided=
 function(b){u!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),u=b)};this.setLineWidth=function(b){b!==x&&(a.lineWidth(b),x=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||v===c&&y===d||(a.polygonOffset(c,d),v=c,y=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+w-1);z!==b&&(a.activeTexture(b),z=b)};this.bindTexture=function(b,d){void 0===
 z&&c.activeTexture();var e=C[z];void 0===e&&(e={type:void 0,texture:void 0},C[z]=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);g={};u=t=s=f=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n=a.context,q=a.state,s,t,u,x,v,y;this.render=function(w,z,C,A){if(0!==b.length){w=new THREE.Vector3;var B=A/C,O=.5*C,I=.5*A,E=16/A,S=new THREE.Vector2(E*B,E),K=new THREE.Vector3(1,1,0),F=new THREE.Vector2(1,1);if(void 0===u){var E=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),J=new Uint16Array([0,1,2,0,2,3]);s=n.createBuffer();t=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,s);n.bufferData(n.ARRAY_BUFFER,E,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
-t);n.bufferData(n.ELEMENT_ARRAY_BUFFER,J,n.STATIC_DRAW);v=n.createTexture();y=n.createTexture();q.bindTexture(n.TEXTURE_2D,v);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,y);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 E=(x=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}",
+THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m=a.context,q=a.state,s,t,u,x,v,y;this.render=function(w,z,C,A){if(0!==b.length){w=new THREE.Vector3;var B=A/C,S=.5*C,I=.5*A,D=16/A,P=new THREE.Vector2(D*B,D),K=new THREE.Vector3(1,1,0),N=new THREE.Vector2(1,1);if(void 0===u){var D=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),E=new Uint16Array([0,1,2,0,2,3]);s=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,s);m.bufferData(m.ARRAY_BUFFER,D,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
+t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,E,m.STATIC_DRAW);v=m.createTexture();y=m.createTexture();q.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);q.bindTexture(m.TEXTURE_2D,y);m.texImage2D(m.TEXTURE_2D,0,
+m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var D=(x=0<m.getParameter(m.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}"},
-J=n.createProgram(),D=n.createShader(n.FRAGMENT_SHADER),L=n.createShader(n.VERTEX_SHADER),R="precision "+a.getPrecision()+" float;\n";n.shaderSource(D,R+E.fragmentShader);n.shaderSource(L,R+E.vertexShader);n.compileShader(D);n.compileShader(L);n.attachShader(J,D);n.attachShader(J,L);n.linkProgram(J);u=J;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");g=n.getUniformLocation(u,
-"opacity");f=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(p);q.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,s);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(p,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t);q.disable(n.CULL_FACE);n.depthMask(!1);J=0;for(D=
-b.length;J<D;J++)if(E=16/A,S.set(E*B,E),L=b[J],w.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),w.applyMatrix4(z.matrixWorldInverse),w.applyProjection(z.projectionMatrix),K.copy(w),F.x=K.x*O+O,F.y=K.y*I+I,x||0<F.x&&F.x<C&&0<F.y&&F.y<A){q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,null);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,v);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,F.x-8,F.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,S.x,S.y);n.uniform3f(l,
-K.x,K.y,K.z);q.disable(n.BLEND);q.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,y);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,F.x-8,F.y-8,16,16,0);n.uniform1i(c,1);q.disable(n.DEPTH_TEST);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,v);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);L.positionScreen.copy(K);L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares();n.uniform1i(c,2);q.enable(n.BLEND);for(var R=
-0,U=L.lensFlares.length;R<U;R++){var Q=L.lensFlares[R];.001<Q.opacity&&.001<Q.scale&&(K.x=Q.x,K.y=Q.y,K.z=Q.z,E=Q.size*Q.scale/A,S.x=E*B,S.y=E,n.uniform3f(l,K.x,K.y,K.z),n.uniform2f(h,S.x,S.y),n.uniform1f(k,Q.rotation),n.uniform1f(g,Q.opacity),n.uniform3f(f,Q.color.r,Q.color.g,Q.color.b),q.setBlending(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst),a.setTexture(Q.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}q.enable(n.CULL_FACE);q.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n,q,s,t,u,x,v;function y(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,z=a.state,C,A,B,O,I=new THREE.Vector3,E=new THREE.Quaternion,S=new THREE.Vector3;this.render=function(K,F){if(0!==b.length){if(void 0===B){var J=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),D=new Uint16Array([0,1,2,0,2,3]);C=w.createBuffer();A=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,C);w.bufferData(w.ARRAY_BUFFER,J,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
-A);w.bufferData(w.ELEMENT_ARRAY_BUFFER,D,w.STATIC_DRAW);var J=w.createProgram(),D=w.createShader(w.VERTEX_SHADER),L=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(D,["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"));
-w.shaderSource(L,["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"));
-w.compileShader(D);w.compileShader(L);w.attachShader(J,D);w.attachShader(J,L);w.linkProgram(J);B=J;x=w.getAttribLocation(B,"position");v=w.getAttribLocation(B,"uv");c=w.getUniformLocation(B,"uvOffset");d=w.getUniformLocation(B,"uvScale");e=w.getUniformLocation(B,"rotation");g=w.getUniformLocation(B,"scale");f=w.getUniformLocation(B,"color");h=w.getUniformLocation(B,"map");k=w.getUniformLocation(B,"opacity");l=w.getUniformLocation(B,"modelViewMatrix");m=w.getUniformLocation(B,"projectionMatrix");p=
-w.getUniformLocation(B,"fogType");n=w.getUniformLocation(B,"fogDensity");q=w.getUniformLocation(B,"fogNear");s=w.getUniformLocation(B,"fogFar");t=w.getUniformLocation(B,"fogColor");u=w.getUniformLocation(B,"alphaTest");J=document.createElement("canvas");J.width=8;J.height=8;D=J.getContext("2d");D.fillStyle="white";D.fillRect(0,0,8,8);O=new THREE.Texture(J);O.needsUpdate=!0}w.useProgram(B);z.initAttributes();z.enableAttribute(x);z.enableAttribute(v);z.disableUnusedAttributes();z.disable(w.CULL_FACE);
-z.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,C);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,A);w.uniformMatrix4fv(m,!1,F.projectionMatrix.elements);z.activeTexture(w.TEXTURE0);w.uniform1i(h,0);D=J=0;(L=K.fog)?(w.uniform3f(t,L.color.r,L.color.g,L.color.b),L instanceof THREE.Fog?(w.uniform1f(q,L.near),w.uniform1f(s,L.far),w.uniform1i(p,1),D=J=1):L instanceof THREE.FogExp2&&(w.uniform1f(n,L.density),w.uniform1i(p,2),D=J=2)):
-(w.uniform1i(p,0),D=J=0);for(var L=0,R=b.length;L<R;L++){var U=b[L];U._modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,U.matrixWorld);U.z=-U._modelViewMatrix.elements[14]}b.sort(y);for(var Q=[],L=0,R=b.length;L<R;L++){var U=b[L],T=U.material;w.uniform1f(u,T.alphaTest);w.uniformMatrix4fv(l,!1,U._modelViewMatrix.elements);U.matrixWorld.decompose(I,E,S);Q[0]=S.x;Q[1]=S.y;U=0;K.fog&&T.fog&&(U=D);J!==U&&(w.uniform1i(p,U),J=U);null!==T.map?(w.uniform2f(c,T.map.offset.x,T.map.offset.y),w.uniform2f(d,
-T.map.repeat.x,T.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(k,T.opacity);w.uniform3f(f,T.color.r,T.color.g,T.color.b);w.uniform1f(e,T.rotation);w.uniform2fv(g,Q);z.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst);z.setDepthTest(T.depthTest);z.setDepthWrite(T.depthWrite);T.map&&T.map.image&&T.map.image.width?a.setTexture(T.map,0):a.setTexture(O,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}z.enable(w.CULL_FACE);a.resetGLState()}}};
+E=m.createProgram(),F=m.createShader(m.FRAGMENT_SHADER),J=m.createShader(m.VERTEX_SHADER),R="precision "+a.getPrecision()+" float;\n";m.shaderSource(F,R+D.fragmentShader);m.shaderSource(J,R+D.vertexShader);m.compileShader(F);m.compileShader(J);m.attachShader(E,F);m.attachShader(E,J);m.linkProgram(E);u=E;n=m.getAttribLocation(u,"position");p=m.getAttribLocation(u,"uv");c=m.getUniformLocation(u,"renderType");d=m.getUniformLocation(u,"map");e=m.getUniformLocation(u,"occlusionMap");g=m.getUniformLocation(u,
+"opacity");f=m.getUniformLocation(u,"color");h=m.getUniformLocation(u,"scale");k=m.getUniformLocation(u,"rotation");l=m.getUniformLocation(u,"screenPosition")}m.useProgram(u);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,s);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);q.disable(m.CULL_FACE);m.depthMask(!1);E=0;for(F=
+b.length;E<F;E++)if(D=16/A,P.set(D*B,D),J=b[E],w.set(J.matrixWorld.elements[12],J.matrixWorld.elements[13],J.matrixWorld.elements[14]),w.applyMatrix4(z.matrixWorldInverse),w.applyProjection(z.projectionMatrix),K.copy(w),N.x=K.x*S+S,N.y=K.y*I+I,x||0<N.x&&N.x<C&&0<N.y&&N.y<A){q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,null);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,N.x-8,N.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,P.x,P.y);m.uniform3f(l,
+K.x,K.y,K.z);q.disable(m.BLEND);q.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,y);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,N.x-8,N.y-8,16,16,0);m.uniform1i(c,1);q.disable(m.DEPTH_TEST);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);J.positionScreen.copy(K);J.customUpdateCallback?J.customUpdateCallback(J):J.updateLensFlares();m.uniform1i(c,2);q.enable(m.BLEND);for(var R=
+0,U=J.lensFlares.length;R<U;R++){var Q=J.lensFlares[R];.001<Q.opacity&&.001<Q.scale&&(K.x=Q.x,K.y=Q.y,K.z=Q.z,D=Q.size*Q.scale/A,P.x=D*B,P.y=D,m.uniform3f(l,K.x,K.y,K.z),m.uniform2f(h,P.x,P.y),m.uniform1f(k,Q.rotation),m.uniform1f(g,Q.opacity),m.uniform3f(f,Q.color.r,Q.color.g,Q.color.b),q.setBlending(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst),a.setTexture(Q.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}q.enable(m.CULL_FACE);q.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m,q,s,t,u,x,v;function y(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,z=a.state,C,A,B,S,I=new THREE.Vector3,D=new THREE.Quaternion,P=new THREE.Vector3;this.render=function(K,N){if(0!==b.length){if(void 0===B){var E=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),F=new Uint16Array([0,1,2,0,2,3]);C=w.createBuffer();A=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,C);w.bufferData(w.ARRAY_BUFFER,E,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
+A);w.bufferData(w.ELEMENT_ARRAY_BUFFER,F,w.STATIC_DRAW);var E=w.createProgram(),F=w.createShader(w.VERTEX_SHADER),J=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(F,["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"));
+w.shaderSource(J,["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"));
+w.compileShader(F);w.compileShader(J);w.attachShader(E,F);w.attachShader(E,J);w.linkProgram(E);B=E;x=w.getAttribLocation(B,"position");v=w.getAttribLocation(B,"uv");c=w.getUniformLocation(B,"uvOffset");d=w.getUniformLocation(B,"uvScale");e=w.getUniformLocation(B,"rotation");g=w.getUniformLocation(B,"scale");f=w.getUniformLocation(B,"color");h=w.getUniformLocation(B,"map");k=w.getUniformLocation(B,"opacity");l=w.getUniformLocation(B,"modelViewMatrix");n=w.getUniformLocation(B,"projectionMatrix");p=
+w.getUniformLocation(B,"fogType");m=w.getUniformLocation(B,"fogDensity");q=w.getUniformLocation(B,"fogNear");s=w.getUniformLocation(B,"fogFar");t=w.getUniformLocation(B,"fogColor");u=w.getUniformLocation(B,"alphaTest");E=document.createElement("canvas");E.width=8;E.height=8;F=E.getContext("2d");F.fillStyle="white";F.fillRect(0,0,8,8);S=new THREE.Texture(E);S.needsUpdate=!0}w.useProgram(B);z.initAttributes();z.enableAttribute(x);z.enableAttribute(v);z.disableUnusedAttributes();z.disable(w.CULL_FACE);
+z.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,C);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,A);w.uniformMatrix4fv(n,!1,N.projectionMatrix.elements);z.activeTexture(w.TEXTURE0);w.uniform1i(h,0);F=E=0;(J=K.fog)?(w.uniform3f(t,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(w.uniform1f(q,J.near),w.uniform1f(s,J.far),w.uniform1i(p,1),F=E=1):J instanceof THREE.FogExp2&&(w.uniform1f(m,J.density),w.uniform1i(p,2),F=E=2)):
+(w.uniform1i(p,0),F=E=0);for(var J=0,R=b.length;J<R;J++){var U=b[J];U._modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,U.matrixWorld);U.z=-U._modelViewMatrix.elements[14]}b.sort(y);for(var Q=[],J=0,R=b.length;J<R;J++){var U=b[J],T=U.material;w.uniform1f(u,T.alphaTest);w.uniformMatrix4fv(l,!1,U._modelViewMatrix.elements);U.matrixWorld.decompose(I,D,P);Q[0]=P.x;Q[1]=P.y;U=0;K.fog&&T.fog&&(U=F);E!==U&&(w.uniform1i(p,U),E=U);null!==T.map?(w.uniform2f(c,T.map.offset.x,T.map.offset.y),w.uniform2f(d,
+T.map.repeat.x,T.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(k,T.opacity);w.uniform3f(f,T.color.r,T.color.g,T.color.b);w.uniform1f(e,T.rotation);w.uniform2fv(g,Q);z.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst);z.setDepthTest(T.depthTest);z.setDepthWrite(T.depthWrite);T.map&&T.map.image&&T.map.image.width?a.setTexture(T.map,0):a.setTexture(S,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}z.enable(w.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 g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b),f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&c(g))},void 0,
 d)};for(var h=0,k=a.length;h<k;++h)b(h);return g},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,g=document.createElement("canvas");
-g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,k=f.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,q=p+1>e-1?e-1:p+1,s=0>m-1?0:m-1,t=m+1>d-1?d-1:m+1,u=[],x=[0,0,h[4*(p*d+m)]/255*b];u.push([-1,0,h[4*(p*d+s)]/255*b]);u.push([-1,-1,h[4*(n*d+s)]/255*b]);u.push([0,-1,h[4*(n*d+m)]/255*b]);u.push([1,-1,h[4*(n*d+t)]/255*b]);u.push([1,0,h[4*(p*d+t)]/255*b]);u.push([1,1,h[4*(q*d+t)]/255*b]);u.push([0,1,h[4*(q*d+m)]/255*
-b]);u.push([-1,1,h[4*(q*d+s)]/255*b]);n=[];s=u.length;for(q=0;q<s;q++){var t=u[q],v=u[(q+1)%s],t=[t[0]-x[0],t[1]-x[1],t[2]-x[2]],v=[v[0]-x[0],v[1]-x[1],v[2]-x[2]];n.push(c([t[1]*v[2]-t[2]*v[1],t[2]*v[0]-t[0]*v[2],t[0]*v[1]-t[1]*v[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;x=4*(p*d+m);l[x]=(u[0]+1)/2*255|0;l[x+1]=(u[1]+1)/2*255|0;l[x+2]=255*u[2]|0;l[x+3]=255}f.putImageData(k,0,0);return g},generateDataTexture:function(a,
+g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,k=f.createImageData(d,e),l=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var m=0>p-1?0:p-1,q=p+1>e-1?e-1:p+1,s=0>n-1?0:n-1,t=n+1>d-1?d-1:n+1,u=[],x=[0,0,h[4*(p*d+n)]/255*b];u.push([-1,0,h[4*(p*d+s)]/255*b]);u.push([-1,-1,h[4*(m*d+s)]/255*b]);u.push([0,-1,h[4*(m*d+n)]/255*b]);u.push([1,-1,h[4*(m*d+t)]/255*b]);u.push([1,0,h[4*(p*d+t)]/255*b]);u.push([1,1,h[4*(q*d+t)]/255*b]);u.push([0,1,h[4*(q*d+n)]/255*
+b]);u.push([-1,1,h[4*(q*d+s)]/255*b]);m=[];s=u.length;for(q=0;q<s;q++){var t=u[q],v=u[(q+1)%s],t=[t[0]-x[0],t[1]-x[1],t[2]-x[2]],v=[v[0]-x[0],v[1]-x[1],v[2]-x[2]];m.push(c([t[1]*v[2]-t[2]*v[1],t[2]*v[0]-t[0]*v[2],t[0]*v[1]-t[1]*v[0]]))}u=[0,0,0];for(q=0;q<m.length;q++)u[0]+=m[q][0],u[1]+=m[q][1],u[2]+=m[q][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;x=4*(p*d+n);l[x]=(u[0]+1)/2*255|0;l[x+1]=(u[1]+1)/2*255|0;l[x+2]=255*u[2]|0;l[x+3]=255}f.putImageData(k,0,0);return g},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),g=Math.floor(255*c.r),f=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=g,e[3*h+1]=f,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(""),g=e.length,f=[];for(a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,k,l,m,p,n,q,s,t,u,x=b.glyphs[a]||b.glyphs["?"];if(x){if(x.o)for(b=x._cachedOutline||(x._cachedOutline=x.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;s=b[a++]*c;e.quadraticCurveTo(q,s,k,m);if(f=g[g.length-1])for(p=f.x,n=f.y,f=1,h=this.divisions;f<=h;f++){var v=f/h;THREE.Shape.Utils.b2(v,p,q,k);THREE.Shape.Utils.b2(v,n,s,m)}break;case "b":if(k=b[a++]*c+d,m=b[a++]*c,q=b[a++]*c+d,s=b[a++]*c,t=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,s,t,u,k,m),f=g[g.length-1])for(p=f.x,n=f.y,f=1,h=this.divisions;f<=h;f++)v=f/h,THREE.Shape.Utils.b3(v,p,q,t,k),THREE.Shape.Utils.b3(v,
-n,s,u,m)}return{offset:x.ha*c,path:e}}}};
+a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),g=e.length,f=[];for(a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,k,l,n,p,m,q,s,t,u,x=b.glyphs[a]||b.glyphs["?"];if(x){if(x.o)for(b=x._cachedOutline||(x._cachedOutline=x.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
+break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;q=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(q,s,k,n);if(f=g[g.length-1])for(p=f.x,m=f.y,f=1,h=this.divisions;f<=h;f++){var v=f/h;THREE.Shape.Utils.b2(v,p,q,k);THREE.Shape.Utils.b2(v,m,s,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,q=b[a++]*c+d,s=b[a++]*c,t=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,s,t,u,k,n),f=g[g.length-1])for(p=f.x,m=f.y,f=1,h=this.divisions;f<=h;f++)v=f/h,THREE.Shape.Utils.b3(v,p,q,t,k),THREE.Shape.Utils.b3(v,
+m,s,u,n)}return{offset:x.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,m;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[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 q=n=void 0,s=void 0,t=void 0,
-u=void 0,x=void 0,v=void 0,y=void 0,w=void 0,q=a[f[k]].x,s=a[f[k]].y,t=a[f[l]].x,u=a[f[l]].y,x=a[f[m]].x,v=a[f[m]].y;if(1E-10>(t-q)*(v-s)-(u-s)*(x-q))n=!1;else{var z=void 0,C=void 0,A=void 0,B=void 0,O=void 0,I=void 0,E=void 0,S=void 0,K=void 0,F=void 0,K=S=E=w=y=void 0,z=x-t,C=v-u,A=q-x,B=s-v,O=t-q,I=u-s;for(n=0;n<e;n++)if(y=a[f[n]].x,w=a[f[n]].y,!(y===q&&w===s||y===t&&w===u||y===x&&w===v)&&(E=y-q,S=w-s,K=y-t,F=w-u,y-=x,w-=v,K=z*F-C*K,E=O*S-I*E,S=A*w-B*y,-1E-10<=K&&-1E-10<=S&&-1E-10<=E)){n=!1;break a}n=
-!0}}if(n){g.push([a[f[k]],a[f[l]],a[f[m]]]);h.push([f[k],f[l],f[m]]);k=l;for(m=l+1;m<e;k++,m++)f[k]=f[m];e--;p=2*e}}return d?h:g};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,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[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);n=l+1;e<=n&&(n=0);var m;a:{var q=m=void 0,s=void 0,t=void 0,
+u=void 0,x=void 0,v=void 0,y=void 0,w=void 0,q=a[f[k]].x,s=a[f[k]].y,t=a[f[l]].x,u=a[f[l]].y,x=a[f[n]].x,v=a[f[n]].y;if(1E-10>(t-q)*(v-s)-(u-s)*(x-q))m=!1;else{var z=void 0,C=void 0,A=void 0,B=void 0,S=void 0,I=void 0,D=void 0,P=void 0,K=void 0,N=void 0,K=P=D=w=y=void 0,z=x-t,C=v-u,A=q-x,B=s-v,S=t-q,I=u-s;for(m=0;m<e;m++)if(y=a[f[m]].x,w=a[f[m]].y,!(y===q&&w===s||y===t&&w===u||y===x&&w===v)&&(D=y-q,P=w-s,K=y-t,N=w-u,y-=x,w-=v,K=z*N-C*K,D=S*P-I*D,P=A*w-B*y,-1E-10<=K&&-1E-10<=P&&-1E-10<=D)){m=!1;break a}m=
+!0}}if(m){g.push([a[f[k]],a[f[l]],a[f[n]]]);h.push([f[k],f[l],f[n]]);k=l;for(n=l+1;n<e;k++,n++)f[k]=f[n];e--;p=2*e}}return d?h:g};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.playbackRate=1;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.start(0,this.startTime);a.playbackRate.value=this.playbackRate;this.isPlaying=!0;this.source=a;this.connect()}};THREE.Audio.prototype.pause=function(){this.source.stop();this.startTime=this.context.currentTime};
@@ -676,7 +676,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,g,f;b=c=Number.NEGATIVE_INFINITY;e=g=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<g&&(g=h.y),p&&(h.z>d?d=h.z:h.z<f&&(f=h.z)),m.add(h);a={minX:e,minY:g,maxX:b,maxY:c};p&&(a.maxZ=d,a.minZ=f);return a};
+THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,g,f;b=c=Number.NEGATIVE_INFINITY;e=g=Number.POSITIVE_INFINITY;var h,k,l,n,p=a[0]instanceof THREE.Vector3;n=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<g&&(g=h.y),p&&(h.z>d?d=h.z:h.z<f&&(f=h.z)),n.add(h);a={minX:e,minY:g,maxX:b,maxY:c};p&&(a.maxZ=d,a.minZ=f);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,g,f,h,k;d=0;for(e=a.length;d<e;d++)g=a[d],f=g.x,h=g.y,k=f/c.maxX,k=b.getUtoTmapping(k,f),f=b.getPoint(k),k=b.getTangent(k),k.set(-k.y,k.x).multiplyScalar(h),g.x=f.x+k.x,g.y=f.y+k.y;return a};THREE.Path=function(a){THREE.CurvePath.call(this);this.actions=[];a&&this.fromPoints(a)};THREE.Path.prototype=Object.create(THREE.CurvePath.prototype);THREE.Path.prototype.constructor=THREE.Path;
@@ -687,22 +687,22 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,g){var f=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,g){var f=this.actions[this.actions.length-1].args;this.absarc(a+f[f.length-2],b+f[f.length-1],c,d,e,g)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,g){this.absellipse(a,b,c,c,d,e,g)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,g,f){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,g,f)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,g,f){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,g,f);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,g,f,h,k,l,m,p,n,q,s,t;d=0;for(e=this.actions.length;d<e;d++)switch(g=this.actions[d],f=g.action,g=g.args,f){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];k=g[3];p=g[0];n=g[1];0<c.length?(f=c[c.length-1],q=f.x,s=f.y):(f=this.actions[d-
-1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)t=g/a,f=THREE.Shape.Utils.b2(t,q,p,h),t=THREE.Shape.Utils.b2(t,s,n,k),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];p=g[0];n=g[1];l=g[2];m=g[3];0<c.length?(f=c[c.length-1],q=f.x,s=f.y):(f=this.actions[d-1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)t=g/a,f=THREE.Shape.Utils.b3(t,q,p,l,h),t=THREE.Shape.Utils.b3(t,s,n,m,k),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.CSPLINE_THRU:f=
-this.actions[d-1].args;t=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;t=t.concat(g[0]);t=new THREE.SplineCurve(t);for(g=1;g<=f;g++)c.push(t.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];n=g[2];l=g[3];f=g[4];p=!!g[5];q=f-l;s=2*a;for(g=1;g<=s;g++)t=g/s,p||(t=1-t),t=l+t*q,f=h+n*Math.cos(t),t=k+n*Math.sin(t),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],n=g[2],m=g[3],l=g[4],f=g[5],p=!!g[6],q=f-l,s=2*a,g=1;g<=s;g++)t=g/s,p||
-(t=1-t),t=l+t*q,f=h+n*Math.cos(t),t=k+m*Math.sin(t),c.push(new THREE.Vector2(f,t))}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,g,f,h,k,l,n,p,m,q,s,t;d=0;for(e=this.actions.length;d<e;d++)switch(g=this.actions[d],f=g.action,g=g.args,f){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];k=g[3];p=g[0];m=g[1];0<c.length?(f=c[c.length-1],q=f.x,s=f.y):(f=this.actions[d-
+1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)t=g/a,f=THREE.Shape.Utils.b2(t,q,p,h),t=THREE.Shape.Utils.b2(t,s,m,k),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];p=g[0];m=g[1];l=g[2];n=g[3];0<c.length?(f=c[c.length-1],q=f.x,s=f.y):(f=this.actions[d-1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)t=g/a,f=THREE.Shape.Utils.b3(t,q,p,l,h),t=THREE.Shape.Utils.b3(t,s,m,n,k),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.CSPLINE_THRU:f=
+this.actions[d-1].args;t=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;t=t.concat(g[0]);t=new THREE.SplineCurve(t);for(g=1;g<=f;g++)c.push(t.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];m=g[2];l=g[3];f=g[4];p=!!g[5];q=f-l;s=2*a;for(g=1;g<=s;g++)t=g/s,p||(t=1-t),t=l+t*q,f=h+m*Math.cos(t),t=k+m*Math.sin(t),c.push(new THREE.Vector2(f,t));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],m=g[2],n=g[3],l=g[4],f=g[5],p=!!g[6],q=f-l,s=2*a,g=1;g<=s;g++)t=g/s,p||
+(t=1-t),t=l+t*q,f=h+m*Math.cos(t),t=k+n*Math.sin(t),c.push(new THREE.Vector2(f,t))}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 g,f,h,k=[];if(1===e.length)return f=e[0],h=new THREE.Shape,h.actions=f.actions,h.curves=f.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),
-l=a?!l:l;h=[];var m=[],p=[],n=0,q;m[n]=void 0;p[n]=[];var s,t;s=0;for(t=e.length;s<t;s++)f=e[s],q=f.getPoints(),g=THREE.Shape.Utils.isClockWise(q),(g=a?!g:g)?(!l&&m[n]&&n++,m[n]={s:new THREE.Shape,p:q},m[n].s.actions=f.actions,m[n].s.curves=f.curves,l&&n++,p[n]=[]):p[n].push({h:f,p:q[0]});if(!m[0])return c(e);if(1<m.length){s=!1;t=[];f=0;for(e=m.length;f<e;f++)h[f]=[];f=0;for(e=m.length;f<e;f++)for(g=p[f],l=0;l<g.length;l++){n=g[l];q=!0;for(var u=0;u<m.length;u++)d(n.p,m[u].p)&&(f!==u&&t.push({froms:f,
-tos:u,hole:l}),q?(q=!1,h[u].push(n)):s=!0);q&&h[f].push(n)}0<t.length&&(s||(p=h))}s=0;for(t=m.length;s<t;s++)for(h=m[s].s,k.push(h),f=p[s],e=0,g=f.length;e<g;e++)h.holes.push(f[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 n=[],p=[],m=0,q;n[m]=void 0;p[m]=[];var s,t;s=0;for(t=e.length;s<t;s++)f=e[s],q=f.getPoints(),g=THREE.Shape.Utils.isClockWise(q),(g=a?!g:g)?(!l&&n[m]&&m++,n[m]={s:new THREE.Shape,p:q},n[m].s.actions=f.actions,n[m].s.curves=f.curves,l&&m++,p[m]=[]):p[m].push({h:f,p:q[0]});if(!n[0])return c(e);if(1<n.length){s=!1;t=[];f=0;for(e=n.length;f<e;f++)h[f]=[];f=0;for(e=n.length;f<e;f++)for(g=p[f],l=0;l<g.length;l++){m=g[l];q=!0;for(var u=0;u<n.length;u++)d(m.p,n[u].p)&&(f!==u&&t.push({froms:f,
+tos:u,hole:l}),q?(q=!1,h[u].push(m)):s=!0);q&&h[f].push(m)}0<t.length&&(s||(p=h))}s=0;for(t=n.length;s<t;s++)for(h=n[s].s,k.push(h),f=p[s],e=0,g=f.length;e<g;e++)h.holes.push(f[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,B=h*m-g*p;if(1E-10<Math.abs(A)){if(0<A){if(0>B||B>A)return[];k=l*m-k*p;if(0>k||k>A)return[]}else{if(0<B||B<A)return[];k=l*m-k*p;if(0<k||k<A)return[]}if(0===k)return!f||0!==B&&B!==A?[a]:[];if(k===A)return!f||0!==B&&B!==A?[b]:[];if(0===
-B)return[d];if(B===A)return[e];f=k/A;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==B||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?[]:
-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 g,f,h,k,l,m={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)l=h[g].x+":"+h[g].y,void 0!==m[l]&&console.warn("THREE.Shape: Duplicate point",l),m[l]=g;g=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,C,A,B,O=[],I,E,S,K=0;for(m=b.length;K<m;K++)l.push(K);I=0;for(var F=2*
-l.length;0<l.length;){F--;if(0>F){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=I;p<h.length;p++){C=h[p];m=-1;for(K=0;K<l.length;K++)if(A=l[K],B=C.x+":"+C.y+":"+A,void 0===O[B]){k=b[A];for(E=0;E<k.length;E++)if(A=k[E],c(p,E)&&!f(C,A)&&!g(C,A)){m=E;l.splice(K,1);I=h.slice(0,p+1);A=h.slice(p);E=k.slice(m);S=k.slice(0,m+1);h=I.concat(E).concat(S).concat(A);I=p;break}if(0<=m)break;O[B]=!0}if(0<=m)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
-!1);g=0;for(f=p.length;g<f;g++)for(k=p[g],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-
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,A=h*k-g*l,B=h*n-g*p;if(1E-10<Math.abs(A)){if(0<A){if(0>B||B>A)return[];k=l*n-k*p;if(0>k||k>A)return[]}else{if(0<B||B<A)return[];k=l*n-k*p;if(0<k||k<A)return[]}if(0===k)return!f||0!==B&&B!==A?[a]:[];if(k===A)return!f||0!==B&&B!==A?[b]:[];if(0===
+B)return[d];if(B===A)return[e];f=k/A;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==B||l*n!==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?[]:
+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 g,f,h,k,l,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)l=h[g].x+":"+h[g].y,void 0!==n[l]&&console.warn("THREE.Shape: Duplicate point",l),n[l]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
+0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,C,A,B,S=[],I,D,P,K=0;for(n=b.length;K<n;K++)l.push(K);I=0;for(var N=2*
+l.length;0<l.length;){N--;if(0>N){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=I;p<h.length;p++){C=h[p];n=-1;for(K=0;K<l.length;K++)if(A=l[K],B=C.x+":"+C.y+":"+A,void 0===S[B]){k=b[A];for(D=0;D<k.length;D++)if(A=k[D],c(p,D)&&!f(C,A)&&!g(C,A)){n=D;l.splice(K,1);I=h.slice(0,p+1);A=h.slice(p);D=k.slice(n);P=k.slice(0,n+1);h=I.concat(D).concat(P).concat(A);I=p;break}if(0<=n)break;S[B]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
+!1);g=0;for(f=p.length;g<f;g++)for(k=p[g],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=n[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-
 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()};
@@ -715,9 +715,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],g=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,g.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,g.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,g.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 f=this.points,h,k;k=f.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(f[0],f[1]).add(f[0]),l=b):l=f[h-1];m=f[h];p=f[h+1];h+2<k?f=f[h+2]:(b.subVectors(f[k-1],f[k-2]).add(f[k-2]),f=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(f),n);1E-4>h&&(h=1);1E-4>k&&(k=h);1E-4>n&&(n=h);c.initNonuniformCatmullRom(l.x,m.x,p.x,f.x,k,h,n);d.initNonuniformCatmullRom(l.y,m.y,p.y,f.y,k,h,n);e.initNonuniformCatmullRom(l.z,m.z,p.z,f.z,k,h,n)}else"catmullrom"===this.type&&(k=void 0!==this.tension?this.tension:.5,c.initCatmullRom(l.x,m.x,p.x,f.x,k),d.initCatmullRom(l.y,m.y,p.y,f.y,k),e.initCatmullRom(l.z,m.z,p.z,f.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,n,p){a=((b-a)/e-(c-a)/(e+n)+(c-b)/n)*n;d=((c-b)/n-(d-b)/(n+p)+(d-c)/p)*n;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 f=this.points,h,k;k=f.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,n,p;0===h?(b.subVectors(f[0],f[1]).add(f[0]),l=b):l=f[h-1];n=f[h];p=f[h+1];h+2<k?f=f[h+2]:(b.subVectors(f[k-1],f[k-2]).add(f[k-2]),f=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var m="chordal"===this.type?.5:.25;k=Math.pow(l.distanceToSquared(n),m);
+h=Math.pow(n.distanceToSquared(p),m);m=Math.pow(p.distanceToSquared(f),m);1E-4>h&&(h=1);1E-4>k&&(k=h);1E-4>m&&(m=h);c.initNonuniformCatmullRom(l.x,n.x,p.x,f.x,k,h,m);d.initNonuniformCatmullRom(l.y,n.y,p.y,f.y,k,h,m);e.initNonuniformCatmullRom(l.z,n.z,p.z,f.z,k,h,m)}else"catmullrom"===this.type&&(k=void 0!==this.tension?this.tension:.5,c.initCatmullRom(l.x,n.x,p.x,f.x,k),d.initCatmullRom(l.y,n.y,p.y,f.y,k),e.initCatmullRom(l.z,n.z,p.z,f.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],g=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,g.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,g.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,g.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 g=a.hierarchy[b].keys[c].morphTargets[e];d[g]=-1}a.hierarchy[b].usedMorphTargets=d;for(c=0;c<a.hierarchy[b].keys.length;c++){var f=
@@ -726,12 +726,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,g=e[d];void 0===g&&(g={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=g);for(c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],f=this.getNextKeyWith(d,a,1);f.time<this.currentTime&&f.index>e.index;)e=f,f=this.getNextKeyWith(d,a,f.index+1);g.prevKey[d]=e;g.nextKey[d]=f}}},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,q,s,t;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]];q=a[c[1]];s=a[c[2]];t=a[c[3]];c=e*e;n=e*c;d[0]=g(p[0],q[0],s[0],t[0],e,c,n);d[1]=g(p[1],q[1],s[1],t[1],e,c,n);d[2]=g(p[2],q[2],s[2],t[2],e,c,n);return d},g=function(a,b,c,d,
-e,g,n){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*n+(-3*(b-c)-2*a-d)*g+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 g=this.hierarchy.length;f<g;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],
-q=l.prevKey[n],s=l.nextKey[n];if(0<this.timeScale&&s.time<=this.currentTime||0>this.timeScale&&q.time>=this.currentTime){q=this.data.hierarchy[f].keys[0];for(s=this.getNextKeyWith(n,f,1);s.time<this.currentTime&&s.index>q.index;)q=s,s=this.getNextKeyWith(n,f,s.index+1);l.prevKey[n]=q;l.nextKey[n]=s}var t=(this.currentTime-q.time)/(s.time-q.time),u=q[n],x=s[n];0>t&&(t=0);1<t&&(t=1);if("pos"===n)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(x[0]-u[0])*t,c.y=u[1]+(x[1]-u[1])*t,
-c.z=u[2]+(x[2]-u[2])*t,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]=x,a[3]=this.getNextKeyWith("pos",f,s.index+1).pos,t=.33*t+.33,s=e(a,t),q=this.weight/(this.weight+m.positionWeight),m.positionWeight+=this.weight,n=k.position,n.x+=(s[0]-n.x)*q,n.y+=(s[1]-
-n.y)*q,n.z+=(s[2]-n.z)*q,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(t=e(a,1.01*t),b.set(t[0],t[1],t[2]),b.sub(n),b.y=0,b.normalize(),t=Math.atan2(b.x,b.z),k.rotation.set(0,t,0))}else"rot"===n?(THREE.Quaternion.slerp(u,x,d,t),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]+(x[0]-u[0])*t,c.y=
-u[1]+(x[1]-u[1])*t,c.z=u[2]+(x[2]-u[2])*t,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=
+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,m,q,s,t;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]];q=a[c[1]];s=a[c[2]];t=a[c[3]];c=e*e;m=e*c;d[0]=g(p[0],q[0],s[0],t[0],e,c,m);d[1]=g(p[1],q[1],s[1],t[1],e,c,m);d[2]=g(p[2],q[2],s[2],t[2],e,c,m);return d},g=function(a,b,c,d,
+e,g,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+(-3*(b-c)-2*a-d)*g+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 g=this.hierarchy.length;f<g;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],n=k.animationCache.blending,p=0;3>p;p++){var m=this.keyTypes[p],
+q=l.prevKey[m],s=l.nextKey[m];if(0<this.timeScale&&s.time<=this.currentTime||0>this.timeScale&&q.time>=this.currentTime){q=this.data.hierarchy[f].keys[0];for(s=this.getNextKeyWith(m,f,1);s.time<this.currentTime&&s.index>q.index;)q=s,s=this.getNextKeyWith(m,f,s.index+1);l.prevKey[m]=q;l.nextKey[m]=s}var t=(this.currentTime-q.time)/(s.time-q.time),u=q[m],x=s[m];0>t&&(t=0);1<t&&(t=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(x[0]-u[0])*t,c.y=u[1]+(x[1]-u[1])*t,
+c.z=u[2]+(x[2]-u[2])*t,q=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,q),n.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]=x,a[3]=this.getNextKeyWith("pos",f,s.index+1).pos,t=.33*t+.33,s=e(a,t),q=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,m=k.position,m.x+=(s[0]-m.x)*q,m.y+=(s[1]-
+m.y)*q,m.z+=(s[2]-m.z)*q,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(t=e(a,1.01*t),b.set(t[0],t[1],t[2]),b.sub(m),b.y=0,b.normalize(),t=Math.atan2(b.x,b.z),k.rotation.set(0,t,0))}else"rot"===m?(THREE.Quaternion.slerp(u,x,d,t),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(q=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,q),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(x[0]-u[0])*t,c.y=
+u[1]+(x[1]-u[1])*t,c.z=u[2]+(x[2]-u[2])*t,q=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,q),n.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 g=c[e],f=this.getNextKeyWith(g,a,0);f&&f.apply(g)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
@@ -742,71 +742,71 @@ g.interpolate(f,f.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);var b=this.duration/this.frames;a=Math.floor(this.currentTime/b);var c=this.mesh.morphTargetInfluences;a!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 1,c[a]=0,this.lastFrame=this.currentFrame,this.currentFrame=a);b=this.currentTime%b/b;c[a]=b;c[this.lastFrame]=1-b}}};
-THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,t){var u,x=h.widthSegments,v=h.heightSegments,y=e/2,w=f/2,z=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",x=h.depthSegments;var C=x+1,A=v+1,B=e/x,O=f/v,I=new THREE.Vector3;I[u]=0<g?1:-1;for(e=0;e<A;e++)for(f=0;f<C;f++){var E=new THREE.Vector3;E[a]=(f*B-y)*c;E[b]=(e*O-w)*d;E[u]=g;h.vertices.push(E)}for(e=
+THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,t){var u,x=h.widthSegments,v=h.heightSegments,y=e/2,w=f/2,z=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",x=h.depthSegments;var C=x+1,A=v+1,B=e/x,S=f/v,I=new THREE.Vector3;I[u]=0<g?1:-1;for(e=0;e<A;e++)for(f=0;f<C;f++){var D=new THREE.Vector3;D[a]=(f*B-y)*c;D[b]=(e*S-w)*d;D[u]=g;h.vertices.push(D)}for(e=
 0;e<v;e++)for(f=0;f<x;f++)w=f+C*e,a=f+C*(e+1),b=f+1+C*(e+1),c=f+1+C*e,d=new THREE.Vector2(f/x,1-e/v),g=new THREE.Vector2(f/x,1-(e+1)/v),u=new THREE.Vector2((f+1)/x,1-(e+1)/v),y=new THREE.Vector2((f+1)/x,1-e/v),w=new THREE.Face3(w+z,a+z,c+z),w.normal.copy(I),w.vertexNormals.push(I.clone(),I.clone(),I.clone()),w.materialIndex=t,h.faces.push(w),h.faceVertexUvs[0].push([d,g,y]),w=new THREE.Face3(a+z,b+z,c+z),w.normal.copy(I),w.vertexNormals.push(I.clone(),I.clone(),I.clone()),w.materialIndex=t,h.faces.push(w),
 h.faceVertexUvs[0].push([g.clone(),u,y.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.BoxGeometry.prototype.clone=function(){return new THREE.BoxGeometry(this.parameters.width,this.parameters.height,this.parameters.depth,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.depthSegments)};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,g=[];e=new THREE.Vector3;var f=new THREE.Vector2(.5,.5);this.vertices.push(e);g.push(f);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);g.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([g[e].clone(),g[e+1].clone(),f.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
 THREE.CircleGeometry.prototype.clone=function(){return new THREE.CircleGeometry(this.parameters.radius,this.parameters.segments,this.parameters.thetaStart,this.parameters.thetaLength)};
-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,g=new Float32Array(3*e),f=new Float32Array(3*e),e=new Float32Array(2*e);f[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;g[k]=a*Math.cos(m);g[k+1]=a*Math.sin(m);f[k+2]=1;e[l]=(g[k]/a+1)/2;e[l+1]=(g[k+1]/a+1)/2}c=
+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,g=new Float32Array(3*e),f=new Float32Array(3*e),e=new Float32Array(2*e);f[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var n=c+h/b*d;g[k]=a*Math.cos(n);g[k+1]=a*Math.sin(n);f[k+2]=1;e[l]=(g[k]/a+1)/2;e[l+1]=(g[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(g,3));this.addAttribute("normal",new THREE.BufferAttribute(f,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.CircleBufferGeometry.prototype.clone=function(){var a=new THREE.CircleBufferGeometry(this.parameters.radius,this.parameters.segments,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
-THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,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;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,m,p=[],n=[];for(m=0;m<=e;m++){var q=[],s=[],t=m/e,u=t*(b-a)+a;for(l=0;l<=d;l++){var x=l/d,v=new THREE.Vector3;v.x=u*Math.sin(x*h+
-f);v.y=-t*c+k;v.z=u*Math.cos(x*h+f);this.vertices.push(v);q.push(this.vertices.length-1);s.push(new THREE.Vector2(x,1-t))}p.push(q);n.push(s)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var q=p[m][l],s=p[m+1][l],t=p[m+1][l+1],u=p[m][l+1],x=f.clone(),v=f.clone(),
-y=h.clone(),w=h.clone(),z=n[m][l].clone(),C=n[m+1][l].clone(),A=n[m+1][l+1].clone(),B=n[m][l+1].clone();this.faces.push(new THREE.Face3(q,s,u,[x,v,w]));this.faceVertexUvs[0].push([z,C,B]);this.faces.push(new THREE.Face3(s,t,u,[v.clone(),y,w.clone()]));this.faceVertexUvs[0].push([C.clone(),A,B.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],s=p[0][l+1],t=this.vertices.length-1,x=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,
-1,0),z=n[0][l].clone(),C=n[0][l+1].clone(),A=new THREE.Vector2(C.x,0),this.faces.push(new THREE.Face3(q,s,t,[x,v,y])),this.faceVertexUvs[0].push([z,C,A]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],s=p[e][l],t=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),z=n[e][l+1].clone(),C=n[e][l].clone(),A=new THREE.Vector2(C.x,1),this.faces.push(new THREE.Face3(q,s,t,[x,v,y])),this.faceVertexUvs[0].push([z,
+THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,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;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,n,p=[],m=[];for(n=0;n<=e;n++){var q=[],s=[],t=n/e,u=t*(b-a)+a;for(l=0;l<=d;l++){var x=l/d,v=new THREE.Vector3;v.x=u*Math.sin(x*h+
+f);v.y=-t*c+k;v.z=u*Math.cos(x*h+f);this.vertices.push(v);q.push(this.vertices.length-1);s.push(new THREE.Vector2(x,1-t))}p.push(q);m.push(s)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var q=p[n][l],s=p[n+1][l],t=p[n+1][l+1],u=p[n][l+1],x=f.clone(),v=f.clone(),
+y=h.clone(),w=h.clone(),z=m[n][l].clone(),C=m[n+1][l].clone(),A=m[n+1][l+1].clone(),B=m[n][l+1].clone();this.faces.push(new THREE.Face3(q,s,u,[x,v,w]));this.faceVertexUvs[0].push([z,C,B]);this.faces.push(new THREE.Face3(s,t,u,[v.clone(),y,w.clone()]));this.faceVertexUvs[0].push([C.clone(),A,B.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],s=p[0][l+1],t=this.vertices.length-1,x=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,
+1,0),z=m[0][l].clone(),C=m[0][l+1].clone(),A=new THREE.Vector2(C.x,0),this.faces.push(new THREE.Face3(q,s,t,[x,v,y])),this.faceVertexUvs[0].push([z,C,A]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],s=p[e][l],t=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),z=m[e][l+1].clone(),C=m[e][l].clone(),A=new THREE.Vector2(C.x,1),this.faces.push(new THREE.Face3(q,s,t,[x,v,y])),this.faceVertexUvs[0].push([z,
 C,A]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.CylinderGeometry.prototype.clone=function(){return new THREE.CylinderGeometry(this.parameters.radiusTop,this.parameters.radiusBottom,this.parameters.height,this.parameters.radialSegments,this.parameters.heightSegments,this.parameters.openEnded,this.parameters.thetaStart,this.parameters.thetaLength)};
-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={},g=function(a,b){return a-b},f=["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[f[n]];d[1]=p[f[(n+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l,
+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={},g=function(a,b){return a-b},f=["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,n=h.length;l<n;l++)for(var p=h[l],m=0;3>m;m++){d[0]=p[f[m]];d[1]=p[f[(m+1)%3]];d.sort(g);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(g=e[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)f=k[g.vert1],d.push(f.x),d.push(f.y),d.push(f.z),f=k[g.vert2],d.push(f.x),d.push(f.y),d.push(f.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(H=a.length;0<=--H;){c=H;d=H-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*m,e=0;e<f;e++){var g=U*e,h=U*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+I,g=g+I,l=l+I,h=h+I;O.faces.push(new THREE.Face3(k,g,h));O.faces.push(new THREE.Face3(g,l,h));k=x.generateSideWallUV(O,k,g,l,h);O.faceVertexUvs[0].push([k[0],k[1],k[3]]);O.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function g(a,b,c){O.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=I;b+=I;c+=I;O.faces.push(new THREE.Face3(a,b,c));a=x.generateTopUV(O,a,b,c);O.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,q=void 0!==b.steps?b.steps:1,s=b.extrudePath,
-t,u=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,y,w,z;s&&(t=s.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,q,!1),y=new THREE.Vector3,w=new THREE.Vector3,z=new THREE.Vector3);p||(l=k=m=0);var C,A,B,O=this,I=this.vertices.length,s=a.extractPoints(n),n=s.shape,E=s.holes;if(s=!THREE.Shape.Utils.isClockWise(n)){n=n.reverse();A=0;for(B=E.length;A<B;A++)C=E[A],THREE.Shape.Utils.isClockWise(C)&&(E[A]=C.reverse());s=
-!1}var S=THREE.Shape.Utils.triangulateShape(n,E),K=n;A=0;for(B=E.length;A<B;A++)C=E[A],n=n.concat(C);var F,J,D,L,R,U=n.length,Q,T=S.length,s=[],H=0;D=K.length;F=D-1;for(J=H+1;H<D;H++,F++,J++)F===D&&(F=0),J===D&&(J=0),s[H]=d(K[H],K[F],K[J]);var $=[],ea,fa=s.concat();A=0;for(B=E.length;A<B;A++){C=E[A];ea=[];H=0;D=C.length;F=D-1;for(J=H+1;H<D;H++,F++,J++)F===D&&(F=0),J===D&&(J=0),ea[H]=d(C[H],C[F],C[J]);$.push(ea);fa=fa.concat(ea)}for(F=0;F<m;F++){D=F/m;L=k*(1-D);J=l*Math.sin(D*Math.PI/2);H=0;for(D=
-K.length;H<D;H++)R=c(K[H],s[H],J),g(R.x,R.y,-L);A=0;for(B=E.length;A<B;A++)for(C=E[A],ea=$[A],H=0,D=C.length;H<D;H++)R=c(C[H],ea[H],J),g(R.x,R.y,-L)}J=l;for(H=0;H<U;H++)R=p?c(n[H],fa[H],J):n[H],u?(w.copy(v.normals[0]).multiplyScalar(R.x),y.copy(v.binormals[0]).multiplyScalar(R.y),z.copy(t[0]).add(w).add(y),g(z.x,z.y,z.z)):g(R.x,R.y,0);for(D=1;D<=q;D++)for(H=0;H<U;H++)R=p?c(n[H],fa[H],J):n[H],u?(w.copy(v.normals[D]).multiplyScalar(R.x),y.copy(v.binormals[D]).multiplyScalar(R.y),z.copy(t[D]).add(w).add(y),
-g(z.x,z.y,z.z)):g(R.x,R.y,h/q*D);for(F=m-1;0<=F;F--){D=F/m;L=k*(1-D);J=l*Math.sin(D*Math.PI/2);H=0;for(D=K.length;H<D;H++)R=c(K[H],s[H],J),g(R.x,R.y,h+L);A=0;for(B=E.length;A<B;A++)for(C=E[A],ea=$[A],H=0,D=C.length;H<D;H++)R=c(C[H],ea[H],J),u?g(R.x,R.y+t[q-1].y,t[q-1].x+L):g(R.x,R.y,h+L)}(function(){if(p){var a;a=0*U;for(H=0;H<T;H++)Q=S[H],f(Q[2]+a,Q[1]+a,Q[0]+a);a=q+2*m;a*=U;for(H=0;H<T;H++)Q=S[H],f(Q[0]+a,Q[1]+a,Q[2]+a)}else{for(H=0;H<T;H++)Q=S[H],f(Q[2],Q[1],Q[0]);for(H=0;H<T;H++)Q=S[H],f(Q[0]+
-U*q,Q[1]+U*q,Q[2]+U*q)}})();(function(){var a=0;e(K,a);a+=K.length;A=0;for(B=E.length;A<B;A++)C=E[A],e(C,a),a+=C.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(H=a.length;0<=--H;){c=H;d=H-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=U*e,h=U*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+I,g=g+I,l=l+I,h=h+I;S.faces.push(new THREE.Face3(k,g,h));S.faces.push(new THREE.Face3(g,l,h));k=x.generateSideWallUV(S,k,g,l,h);S.faceVertexUvs[0].push([k[0],k[1],k[3]]);S.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function g(a,b,c){S.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=I;b+=I;c+=I;S.faces.push(new THREE.Face3(a,b,c));a=x.generateTopUV(S,a,b,c);S.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,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,s=b.extrudePath,
+t,u=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,y,w,z;s&&(t=s.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,q,!1),y=new THREE.Vector3,w=new THREE.Vector3,z=new THREE.Vector3);p||(l=k=n=0);var C,A,B,S=this,I=this.vertices.length,s=a.extractPoints(m),m=s.shape,D=s.holes;if(s=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();A=0;for(B=D.length;A<B;A++)C=D[A],THREE.Shape.Utils.isClockWise(C)&&(D[A]=C.reverse());s=
+!1}var P=THREE.Shape.Utils.triangulateShape(m,D),K=m;A=0;for(B=D.length;A<B;A++)C=D[A],m=m.concat(C);var N,E,F,J,R,U=m.length,Q,T=P.length,s=[],H=0;F=K.length;N=F-1;for(E=H+1;H<F;H++,N++,E++)N===F&&(N=0),E===F&&(E=0),s[H]=d(K[H],K[N],K[E]);var qa=[],$,ja=s.concat();A=0;for(B=D.length;A<B;A++){C=D[A];$=[];H=0;F=C.length;N=F-1;for(E=H+1;H<F;H++,N++,E++)N===F&&(N=0),E===F&&(E=0),$[H]=d(C[H],C[N],C[E]);qa.push($);ja=ja.concat($)}for(N=0;N<n;N++){F=N/n;J=k*(1-F);E=l*Math.sin(F*Math.PI/2);H=0;for(F=K.length;H<
+F;H++)R=c(K[H],s[H],E),g(R.x,R.y,-J);A=0;for(B=D.length;A<B;A++)for(C=D[A],$=qa[A],H=0,F=C.length;H<F;H++)R=c(C[H],$[H],E),g(R.x,R.y,-J)}E=l;for(H=0;H<U;H++)R=p?c(m[H],ja[H],E):m[H],u?(w.copy(v.normals[0]).multiplyScalar(R.x),y.copy(v.binormals[0]).multiplyScalar(R.y),z.copy(t[0]).add(w).add(y),g(z.x,z.y,z.z)):g(R.x,R.y,0);for(F=1;F<=q;F++)for(H=0;H<U;H++)R=p?c(m[H],ja[H],E):m[H],u?(w.copy(v.normals[F]).multiplyScalar(R.x),y.copy(v.binormals[F]).multiplyScalar(R.y),z.copy(t[F]).add(w).add(y),g(z.x,
+z.y,z.z)):g(R.x,R.y,h/q*F);for(N=n-1;0<=N;N--){F=N/n;J=k*(1-F);E=l*Math.sin(F*Math.PI/2);H=0;for(F=K.length;H<F;H++)R=c(K[H],s[H],E),g(R.x,R.y,h+J);A=0;for(B=D.length;A<B;A++)for(C=D[A],$=qa[A],H=0,F=C.length;H<F;H++)R=c(C[H],$[H],E),u?g(R.x,R.y+t[q-1].y,t[q-1].x+J):g(R.x,R.y,h+J)}(function(){if(p){var a;a=0*U;for(H=0;H<T;H++)Q=P[H],f(Q[2]+a,Q[1]+a,Q[0]+a);a=q+2*n;a*=U;for(H=0;H<T;H++)Q=P[H],f(Q[0]+a,Q[1]+a,Q[2]+a)}else{for(H=0;H<T;H++)Q=P[H],f(Q[2],Q[1],Q[0]);for(H=0;H<T;H++)Q=P[H],f(Q[0]+U*q,Q[1]+
+U*q,Q[2]+U*q)}})();(function(){var a=0;e(K,a);a+=K.length;A=0;for(B=D.length;A<B;A++)C=D[A],e(C,a),a+=C.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,g,f,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,g=l.length;e<g;e++)f=l[e],THREE.Shape.Utils.isClockWise(f)&&(l[e]=f.reverse());var m=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(g=l.length;e<g;e++)f=l[e],
-k=k.concat(f);l=k.length;g=m.length;for(e=0;e<l;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)l=m[e],k=l[0]+h,f=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,f,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,f,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),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,l=Math.cos(k),m=Math.sin(k),k=0,p=a.length;k<p;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;f=0;for(h=b;f<h;f++)for(k=0,p=a.length-1;k<p;k++){b=m=k+c*f;d=m+c;var l=m+1+c,m=m+1,n=f*g,q=k*e,s=
-n+g,t=q+e;this.faces.push(new THREE.Face3(b,d,m));this.faceVertexUvs[0].push([new THREE.Vector2(n,q),new THREE.Vector2(s,q),new THREE.Vector2(n,t)]);this.faces.push(new THREE.Face3(d,l,m));this.faceVertexUvs[0].push([new THREE.Vector2(s,q),new THREE.Vector2(s,t),new THREE.Vector2(n,t)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+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,g,f,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,g=l.length;e<g;e++)f=l[e],THREE.Shape.Utils.isClockWise(f)&&(l[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(g=l.length;e<g;e++)f=l[e],
+k=k.concat(f);l=k.length;g=n.length;for(e=0;e<l;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)l=n[e],k=l[0]+h,f=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,f,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,f,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),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,l=Math.cos(k),n=Math.sin(k),k=0,p=a.length;k<p;k++){var m=a[k],q=new THREE.Vector3;q.x=l*m.x-n*m.y;q.y=n*m.x+l*m.y;q.z=m.z;this.vertices.push(q)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,p=a.length-1;k<p;k++){b=n=k+c*f;d=n+c;var l=n+1+c,n=n+1,m=f*g,q=k*e,s=
+m+g,t=q+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(m,q),new THREE.Vector2(s,q),new THREE.Vector2(m,t)]);this.faces.push(new THREE.Face3(d,l,n));this.faceVertexUvs[0].push([new THREE.Vector2(s,q),new THREE.Vector2(s,t),new THREE.Vector2(m,t)])}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.PlaneGeometry.prototype.clone=function(){return new THREE.PlaneGeometry(this.parameters.width,this.parameters.height,this.parameters.widthSegments,this.parameters.heightSegments)};
-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,g=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var f=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var m=new Float32Array(f*h*2),p=0,n=0,q=0;q<h;q++)for(var s=q*l-g,t=0;t<f;t++)b[p]=t*k-e,b[p+1]=-s,a[p+2]=1,m[n]=t/c,m[n+1]=1-q/d,p+=3,n+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
-d*6);for(q=0;q<d;q++)for(t=0;t<c;t++)g=t+f*(q+1),h=t+1+f*(q+1),k=t+1+f*q,e[p]=t+f*q,e[p+1]=g,e[p+2]=k,e[p+3]=g,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.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,g=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var f=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var n=new Float32Array(f*h*2),p=0,m=0,q=0;q<h;q++)for(var s=q*l-g,t=0;t<f;t++)b[p]=t*k-e,b[p+1]=-s,a[p+2]=1,n[m]=t/c,n[m+1]=1-q/d,p+=3,m+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
+d*6);for(q=0;q<d;q++)for(t=0;t<c;t++)g=t+f*(q+1),h=t+1+f*(q+1),k=t+1+f*q,e[p]=t+f*q,e[p+1]=g,e[p+2]=k,e[p+3]=g,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(n,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
 THREE.PlaneBufferGeometry.prototype.clone=function(){var a=new THREE.PlaneBufferGeometry(this.parameters.width,this.parameters.height,this.parameters.widthSegments,this.parameters.heightSegments);a.copy(this);return a};
-THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:g};a=a||0;b=b||50;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var f,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(f=0;f<c+1;f++){var m=new THREE.Vector3,p=e+f/c*g;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),f=0;f<c;f++)g=p=f+e,l=p+c+1,m=p+c+2,this.faces.push(new THREE.Face3(g,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[m].clone()]),g=p,l=p+c+2,m=p+1,this.faces.push(new THREE.Face3(g,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[m].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
+THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:g};a=a||0;b=b||50;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var f,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(f=0;f<c+1;f++){var n=new THREE.Vector3,p=e+f/c*g;n.x=k*Math.cos(p);n.y=k*Math.sin(p);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
+(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),f=0;f<c;f++)g=p=f+e,l=p+c+1,n=p+c+2,this.faces.push(new THREE.Face3(g,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[n].clone()]),g=p,l=p+c+2,n=p+1,this.faces.push(new THREE.Face3(g,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[n].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.RingGeometry.prototype.clone=function(){return new THREE.RingGeometry(this.parameters.innerRadius,this.parameters.outerRadius,this.parameters.thetaSegments,this.parameters.phiSegments,this.parameters.thetaStart,this.parameters.thetaLength)};
-THREE.SphereGeometry=function(a,b,c,d,e,g,f){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:g,thetaLength:f};a=a||50;b=Math.max(3,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;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;var h,k,l=[],m=[];for(k=0;k<=c;k++){var p=
-[],n=[];for(h=0;h<=b;h++){var q=h/b,s=k/c,t=new THREE.Vector3;t.x=-a*Math.cos(d+q*e)*Math.sin(g+s*f);t.y=a*Math.cos(g+s*f);t.z=a*Math.sin(d+q*e)*Math.sin(g+s*f);this.vertices.push(t);p.push(this.vertices.length-1);n.push(new THREE.Vector2(q,1-s))}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];g=l[k+1][h];f=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),q=this.vertices[g].clone().normalize(),s=this.vertices[f].clone().normalize(),
-t=m[k][h+1].clone(),u=m[k][h].clone(),x=m[k+1][h].clone(),v=m[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(t.x=(t.x+u.x)/2,this.faces.push(new THREE.Face3(d,g,f,[p,q,s])),this.faceVertexUvs[0].push([t,x,v])):Math.abs(this.vertices[g].y)===a?(x.x=(x.x+v.x)/2,this.faces.push(new THREE.Face3(d,e,g,[p,n,q])),this.faceVertexUvs[0].push([t,u,x])):(this.faces.push(new THREE.Face3(d,e,f,[p,n,s])),this.faceVertexUvs[0].push([t,u,v]),this.faces.push(new THREE.Face3(e,g,f,[n.clone(),q,s.clone()])),this.faceVertexUvs[0].push([u.clone(),
+THREE.SphereGeometry=function(a,b,c,d,e,g,f){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:g,thetaLength:f};a=a||50;b=Math.max(3,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;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var p=
+[],m=[];for(h=0;h<=b;h++){var q=h/b,s=k/c,t=new THREE.Vector3;t.x=-a*Math.cos(d+q*e)*Math.sin(g+s*f);t.y=a*Math.cos(g+s*f);t.z=a*Math.sin(d+q*e)*Math.sin(g+s*f);this.vertices.push(t);p.push(this.vertices.length-1);m.push(new THREE.Vector2(q,1-s))}l.push(p);n.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];g=l[k+1][h];f=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),q=this.vertices[g].clone().normalize(),s=this.vertices[f].clone().normalize(),
+t=n[k][h+1].clone(),u=n[k][h].clone(),x=n[k+1][h].clone(),v=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(t.x=(t.x+u.x)/2,this.faces.push(new THREE.Face3(d,g,f,[p,q,s])),this.faceVertexUvs[0].push([t,x,v])):Math.abs(this.vertices[g].y)===a?(x.x=(x.x+v.x)/2,this.faces.push(new THREE.Face3(d,e,g,[p,m,q])),this.faceVertexUvs[0].push([t,u,x])):(this.faces.push(new THREE.Face3(d,e,f,[p,m,s])),this.faceVertexUvs[0].push([t,u,v]),this.faces.push(new THREE.Face3(e,g,f,[m.clone(),q,s.clone()])),this.faceVertexUvs[0].push([u.clone(),
 x,v.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.SphereGeometry.prototype.clone=function(){return new THREE.SphereGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength)};
-THREE.SphereBufferGeometry=function(a,b,c,d,e,g,f){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,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;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;for(var h=g+f,k=(b+1)*(c+1),l=new THREE.BufferAttribute(new Float32Array(3*k),3),m=new THREE.BufferAttribute(new Float32Array(3*
-k),3),k=new THREE.BufferAttribute(new Float32Array(2*k),2),p=0,n=[],q=new THREE.Vector3,s=0;s<=c;s++){for(var t=[],u=s/c,x=0;x<=b;x++){var v=x/b,y=-a*Math.cos(d+v*e)*Math.sin(g+u*f),w=a*Math.cos(g+u*f),z=a*Math.sin(d+v*e)*Math.sin(g+u*f);q.set(y,w,z).normalize();l.setXYZ(p,y,w,z);m.setXYZ(p,q.x,q.y,q.z);k.setXY(p,v,1-u);t.push(p);p++}n.push(t)}d=[];for(s=0;s<c;s++)for(x=0;x<b;x++)e=n[s][x+1],f=n[s][x],p=n[s+1][x],q=n[s+1][x+1],(0!==s||0<g)&&d.push(e,f,q),(s!==c-1||h<Math.PI)&&d.push(f,p,q);this.addAttribute("index",
-new THREE.BufferAttribute(new Uint16Array(d),1));this.addAttribute("position",l);this.addAttribute("normal",m);this.addAttribute("uv",k);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
+THREE.SphereBufferGeometry=function(a,b,c,d,e,g,f){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,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;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;for(var h=g+f,k=(b+1)*(c+1),l=new THREE.BufferAttribute(new Float32Array(3*k),3),n=new THREE.BufferAttribute(new Float32Array(3*
+k),3),k=new THREE.BufferAttribute(new Float32Array(2*k),2),p=0,m=[],q=new THREE.Vector3,s=0;s<=c;s++){for(var t=[],u=s/c,x=0;x<=b;x++){var v=x/b,y=-a*Math.cos(d+v*e)*Math.sin(g+u*f),w=a*Math.cos(g+u*f),z=a*Math.sin(d+v*e)*Math.sin(g+u*f);q.set(y,w,z).normalize();l.setXYZ(p,y,w,z);n.setXYZ(p,q.x,q.y,q.z);k.setXY(p,v,1-u);t.push(p);p++}m.push(t)}d=[];for(s=0;s<c;s++)for(x=0;x<b;x++)e=m[s][x+1],f=m[s][x],p=m[s+1][x],q=m[s+1][x+1],(0!==s||0<g)&&d.push(e,f,q),(s!==c-1||h<Math.PI)&&d.push(f,p,q);this.addAttribute("index",
+new THREE.BufferAttribute(new Uint16Array(d),1));this.addAttribute("position",l);this.addAttribute("normal",n);this.addAttribute("uv",k);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
 THREE.SphereBufferGeometry.prototype.clone=function(){var a=new THREE.SphereBufferGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
 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 g=new THREE.Vector3,f=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var m=l/d*e,p=k/c*Math.PI*2;g.x=a*Math.cos(m);g.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);f.push(new THREE.Vector2(l/
-d,k/c));h.push(n.clone().sub(g).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,g=(d+1)*k+l,m=new THREE.Face3(a,b,g,[h[a].clone(),h[b].clone(),h[g].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([f[a].clone(),f[b].clone(),f[g].clone()]),m=new THREE.Face3(b,e,g,[h[b].clone(),h[e].clone(),h[g].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([f[b].clone(),f[e].clone(),f[g].clone()]);this.computeFaceNormals()};
+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 g=new THREE.Vector3,f=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var n=l/d*e,p=k/c*Math.PI*2;g.x=a*Math.cos(n);g.y=a*Math.sin(n);var m=new THREE.Vector3;m.x=(a+b*Math.cos(p))*Math.cos(n);m.y=(a+b*Math.cos(p))*Math.sin(n);m.z=b*Math.sin(p);this.vertices.push(m);f.push(new THREE.Vector2(l/
+d,k/c));h.push(m.clone().sub(g).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,g=(d+1)*k+l,n=new THREE.Face3(a,b,g,[h[a].clone(),h[b].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[a].clone(),f[b].clone(),f[g].clone()]),n=new THREE.Face3(b,e,g,[h[b].clone(),h[e].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[b].clone(),f[e].clone(),f[g].clone()]);this.computeFaceNormals()};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;THREE.TorusGeometry.prototype.clone=function(){return new THREE.TorusGeometry(this.parameters.radius,this.parameters.tube,this.parameters.radialSegments,this.parameters.tubularSegments,this.parameters.arc)};
-THREE.TorusKnotGeometry=function(a,b,c,d,e,g,f){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:g,heightScale:f};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;g=g||3;f=f||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 q=n/c*2*e*Math.PI,s=h(q,g,e,a,f),q=h(q+.01,g,e,a,f);l.subVectors(q,s);m.addVectors(q,s);p.crossVectors(l,m);m.crossVectors(p,l);p.normalize();m.normalize();for(q=0;q<d;++q){var t=q/d*2*Math.PI,u=-b*Math.cos(t),t=b*Math.sin(t),x=new THREE.Vector3;x.x=s.x+u*m.x+t*p.x;x.y=s.y+u*m.y+t*p.y;x.z=s.z+u*m.z+t*p.z;k[n][q]=this.vertices.push(x)-1}}for(n=0;n<c;++n)for(q=0;q<d;++q)e=(n+1)%c,g=(q+1)%d,a=k[n][q],b=k[e][q],e=k[e][g],g=k[n][g],f=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),p=new THREE.Vector2(n/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,l,p]),this.faces.push(new THREE.Face3(b,e,g)),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.TorusKnotGeometry=function(a,b,c,d,e,g,f){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:g,heightScale:f};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;g=g||3;f=f||1;for(var k=Array(c),l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=0;m<c;++m){k[m]=
+Array(d);var q=m/c*2*e*Math.PI,s=h(q,g,e,a,f),q=h(q+.01,g,e,a,f);l.subVectors(q,s);n.addVectors(q,s);p.crossVectors(l,n);n.crossVectors(p,l);p.normalize();n.normalize();for(q=0;q<d;++q){var t=q/d*2*Math.PI,u=-b*Math.cos(t),t=b*Math.sin(t),x=new THREE.Vector3;x.x=s.x+u*n.x+t*p.x;x.y=s.y+u*n.y+t*p.y;x.z=s.z+u*n.z+t*p.z;k[m][q]=this.vertices.push(x)-1}}for(m=0;m<c;++m)for(q=0;q<d;++q)e=(m+1)%c,g=(q+1)%d,a=k[m][q],b=k[e][q],e=k[e][g],g=k[m][g],f=new THREE.Vector2(m/c,q/d),l=new THREE.Vector2((m+1)/c,
+q/d),n=new THREE.Vector2((m+1)/c,(q+1)/d),p=new THREE.Vector2(m/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,l,p]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([l.clone(),n,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
 THREE.TorusKnotGeometry.prototype.clone=function(){return new THREE.TorusKnotGeometry(this.parameters.radius,this.parameters.tube,this.parameters.radialSegments,this.parameters.tubularSegments,this.parameters.p,this.parameters.q,this.parameters.heightScale)};
-THREE.TubeGeometry=function(a,b,c,d,e,g){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;g=g||THREE.TubeGeometry.NoTaper;var f=[],h,k,l=b+1,m,p,n,q,s,t=new THREE.Vector3,u,x,v;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);x=u.normals;v=u.binormals;this.tangents=u.tangents;this.normals=x;this.binormals=v;for(u=0;u<l;u++)for(f[u]=[],m=u/(l-1),s=a.getPointAt(m),h=x[u],k=v[u],n=c*g(m),m=0;m<d;m++)p=
-m/d*2*Math.PI,q=-n*Math.cos(p),p=n*Math.sin(p),t.copy(s),t.x+=q*h.x+p*k.x,t.y+=q*h.y+p*k.y,t.z+=q*h.z+p*k.z,f[u][m]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(u=0;u<b;u++)for(m=0;m<d;m++)g=e?(u+1)%b:u+1,l=(m+1)%d,a=f[u][m],c=f[g][m],g=f[g][l],l=f[u][l],t=new THREE.Vector2(u/b,m/d),x=new THREE.Vector2((u+1)/b,m/d),v=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([t,x,h]),this.faces.push(new THREE.Face3(c,
+THREE.TubeGeometry=function(a,b,c,d,e,g){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;g=g||THREE.TubeGeometry.NoTaper;var f=[],h,k,l=b+1,n,p,m,q,s,t=new THREE.Vector3,u,x,v;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);x=u.normals;v=u.binormals;this.tangents=u.tangents;this.normals=x;this.binormals=v;for(u=0;u<l;u++)for(f[u]=[],n=u/(l-1),s=a.getPointAt(n),h=x[u],k=v[u],m=c*g(n),n=0;n<d;n++)p=
+n/d*2*Math.PI,q=-m*Math.cos(p),p=m*Math.sin(p),t.copy(s),t.x+=q*h.x+p*k.x,t.y+=q*h.y+p*k.y,t.z+=q*h.z+p*k.z,f[u][n]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)g=e?(u+1)%b:u+1,l=(n+1)%d,a=f[u][n],c=f[g][n],g=f[g][l],l=f[u][l],t=new THREE.Vector2(u/b,n/d),x=new THREE.Vector2((u+1)/b,n/d),v=new THREE.Vector2((u+1)/b,(n+1)/d),h=new THREE.Vector2(u/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([t,x,h]),this.faces.push(new THREE.Face3(c,
 g,l)),this.faceVertexUvs[0].push([x.clone(),v,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=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,m,p;this.tangents=e;this.normals=g;this.binormals=f;for(l=0;l<b;l++)m=l/(b-1),e[l]=a.getTangentAt(m),e[l].normalize();g[0]=new THREE.Vector3;f[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();g[0].crossVectors(e[0],
+THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,p;this.tangents=e;this.normals=g;this.binormals=f;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();g[0].crossVectors(e[0],
 h);f[0].crossVectors(e[0],g[0]);for(l=1;l<b;l++)g[l]=g[l-1].clone(),f[l]=f[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)),g[l].applyMatrix4(k.makeRotationAxis(h,d))),f[l].crossVectors(e[l],g[l]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),l=1;l<b;l++)g[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),f[l].crossVectors(e[l],g[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 g(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 f(a,
 b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),f=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(f.clone().lerp(h,m/c)),q=c-m,s=0;s<=q;s++)l[m][s]=0===s&&m===c?n:e(n.clone().lerp(p,s/q))}for(m=0;m<c;m++)for(s=0;s<2*(c-m)-1;s++)d=Math.floor(s/2),0===s%2?g(l[m][d+1],l[m+1][d],l[m][d]):g(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 q=a[b[l]],s=a[b[l+1]],t=a[b[l+2]];p[n]=new THREE.Face3(q.index,s.index,t.index,[q.clone(),s.clone(),t.clone()])}for(var u=new THREE.Vector3,l=0,m=p.length;l<m;l++)f(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)),q=Math.min(d,Math.min(a,p)),.9<n&&.1>q&&(.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;
+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,n=a.length;l<n;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],m=l=0,n=b.length;l<n;l+=3,m++){var q=a[b[l]],s=a[b[l+1]],t=a[b[l+2]];p[m]=new THREE.Face3(q.index,s.index,t.index,[q.clone(),s.clone(),t.clone()])}for(var u=new THREE.Vector3,l=0,n=p.length;l<n;l++)f(p[l],d);l=0;for(n=this.faceVertexUvs[0].length;l<
+n;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,p=b[2].x,m=Math.max(d,Math.max(a,p)),q=Math.min(d,Math.min(a,p)),.9<m&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;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.PolyhedronGeometry.prototype.clone=function(){return(new THREE.PolyhedronGeometry(this.parameters.vertices,this.parameters.indices,this.parameters.radius,this.parameters.detail)).copy(this)};THREE.PolyhedronGeometry.prototype.copy=function(a){THREE.Geometry.prototype.copy.call(this,a);return this};
 THREE.DodecahedronGeometry=function(a,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);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b}};THREE.DodecahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype);THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry;THREE.DodecahedronGeometry.prototype.clone=function(){var a=new THREE.DodecahedronGeometry(this.parameters.radius,this.parameters.detail);a.copy(this);return a};
@@ -815,11 +815,11 @@ THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.
 THREE.OctahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype);THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;THREE.OctahedronGeometry.prototype.clone=function(){var a=new THREE.OctahedronGeometry(this.parameters.radius,this.parameters.detail);a.copy(this);return a};
 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.PolyhedronGeometry.prototype);THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
 THREE.TetrahedronGeometry.prototype.clone=function(){var a=new THREE.TetrahedronGeometry(this.parameters.radius,this.parameters.detail);a.copy(this);return a};
-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,g=this.faceVertexUvs[0],f,h,k,l,m=b+1;for(f=0;f<=c;f++)for(l=f/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,n,q,s;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*m+h,d=f*m+h+1,l=(f+1)*m+h+1,k=(f+1)*m+h,p=new THREE.Vector2(h/b,f/c),n=new THREE.Vector2((h+1)/b,f/c),q=new THREE.Vector2((h+1)/b,(f+1)/c),s=new THREE.Vector2(h/b,(f+1)/c),e.push(new THREE.Face3(a,
-d,k)),g.push([p,n,s]),e.push(new THREE.Face3(d,l,k)),g.push([n.clone(),q,s.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 g=a.vertices,f=a.faces,h=0,k=new Uint32Array(6*f.length);a=0;for(var l=f.length;a<l;a++)for(var m=f[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=g[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){g=a.attributes.position;l=a.attributes.index.array;f=a.drawcalls;h=0;0===f.length&&(f=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),m=0,q=f.length;m<q;++m){p=f[m].start;n=f[m].count;e=f[m].index;a=p;for(var s=p+n;a<s;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]=g.getX(h),b[e+1]=g.getY(h),b[e+2]=g.getZ(h)}else for(g=a.attributes.position.array,h=g.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]=g[k],b[e+1]=g[k+1],b[e+2]=g[k+2],h=9*a+(p+1)%3*3,b[e+3]=g[h],b[e+4]=g[h+1],b[e+5]=g[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,g=this.faceVertexUvs[0],f,h,k,l,n=b+1;for(f=0;f<=c;f++)for(l=f/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,m,q,s;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*n+h,d=f*n+h+1,l=(f+1)*n+h+1,k=(f+1)*n+h,p=new THREE.Vector2(h/b,f/c),m=new THREE.Vector2((h+1)/b,f/c),q=new THREE.Vector2((h+1)/b,(f+1)/c),s=new THREE.Vector2(h/b,(f+1)/c),e.push(new THREE.Face3(a,
+d,k)),g.push([p,m,s]),e.push(new THREE.Face3(d,l,k)),g.push([m.clone(),q,s.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 g=a.vertices,f=a.faces,h=0,k=new Uint32Array(6*f.length);a=0;for(var l=f.length;a<l;a++)for(var n=f[a],p=0;3>p;p++){b[0]=n[e[p]];b[1]=n[e[(p+1)%3]];b.sort(d);var m=b.toString();void 0===c[m]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[m]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)h=g[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){g=a.attributes.position;l=a.attributes.index.array;f=a.drawcalls;h=0;0===f.length&&(f=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),n=0,q=f.length;n<q;++n){p=f[n].start;m=f[n].count;e=f[n].index;a=p;for(var s=p+m;a<s;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),m=b.toString(),void 0===c[m]&&(k[2*h]=b[0],k[2*
+h+1]=b[1],c[m]=!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]=g.getX(h),b[e+1]=g.getY(h),b[e+2]=g.getZ(h)}else for(g=a.attributes.position.array,h=g.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]=g[k],b[e+1]=g[k+1],b[e+2]=g[k+2],h=9*a+(p+1)%3*3,b[e+3]=g[h],b[e+4]=g[h+1],b[e+5]=g[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,g,f,h){THREE.Object3D.call(this);void 0===g&&(g=16776960);void 0===e&&(e=1);void 0===f&&(f=.2*e);void 0===h&&(h=.2*f);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:g}));this.line.matrixAutoUpdate=!1;this.add(this.line);
@@ -841,7 +841,7 @@ THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3
 THREE.EdgesHelper=function(a,b,c){b=void 0!==b?b:16777215;THREE.LineSegments.call(this,new THREE.EdgesGeometry(a.geometry,c),new THREE.LineBasicMaterial({color:b}));this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper;
 THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=0;c=this.object.geometry;c instanceof THREE.Geometry?b=c.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");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.FaceNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper;
-THREE.FaceNormalsHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.object.matrixWorld,d=this.geometry.attributes.position,e=this.object.geometry,g=e.vertices,e=e.faces,f=0,h=0,k=e.length;h<k;h++){var l=e[h],m=l.normal;a.copy(g[l.a]).add(g[l.b]).add(g[l.c]).divideScalar(3).applyMatrix4(c);b.copy(m).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a);
+THREE.FaceNormalsHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.object.matrixWorld,d=this.geometry.attributes.position,e=this.object.geometry,g=e.vertices,e=e.faces,f=0,h=0,k=e.length;h<k;h++){var l=e[h],n=l.normal;a.copy(g[l.a]).add(g[l.b]).add(g[l.c]).divideScalar(3).applyMatrix4(c);b.copy(n).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a);
 d.setXYZ(f,a.x,a.y,a.z);f+=1;d.setXYZ(f,b.x,b.y,b.z);f+=1}d.needsUpdate=!0;return this}}();
 THREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924);this.color2=new THREE.Color(8947848);for(var e=-a;e<=a;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var g=0===e?this.color1:this.color2;c.colors.push(g,g,g,g)}THREE.LineSegments.call(this,c,d)};THREE.GridHelper.prototype=Object.create(THREE.LineSegments.prototype);
 THREE.GridHelper.prototype.constructor=THREE.GridHelper;THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a);this.color2.set(b);this.geometry.colorsNeedUpdate=!0};
@@ -858,12 +858,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,g=this.object.geometry;if(g instanceof THREE.Geometry)for(var f=g.vertices,h=g.faces,k=g=0,l=h.length;k<l;k++)for(var m=h[k],p=0,n=m.vertexNormals.length;p<n;p++){var q=m.vertexNormals[p];a.copy(f[m[c[p]]]).applyMatrix4(d);
-b.copy(q).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a);e.setXYZ(g,a.x,a.y,a.z);g+=1;e.setXYZ(g,b.x,b.y,b.z);g+=1}else if(g instanceof THREE.BufferGeometry)for(c=g.attributes.position,f=g.attributes.normal,p=g=0,n=c.count;p<n;p++)a.set(c.getX(p),c.getY(p),c.getZ(p)).applyMatrix4(d),b.set(f.getX(p),f.getY(p),f.getZ(p)),b.applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a),e.setXYZ(g,a.x,a.y,a.z),g+=1,e.setXYZ(g,b.x,b.y,b.z),g+=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,g=this.object.geometry;if(g instanceof THREE.Geometry)for(var f=g.vertices,h=g.faces,k=g=0,l=h.length;k<l;k++)for(var n=h[k],p=0,m=n.vertexNormals.length;p<m;p++){var q=n.vertexNormals[p];a.copy(f[n[c[p]]]).applyMatrix4(d);
+b.copy(q).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a);e.setXYZ(g,a.x,a.y,a.z);g+=1;e.setXYZ(g,b.x,b.y,b.z);g+=1}else if(g instanceof THREE.BufferGeometry)for(c=g.attributes.position,f=g.attributes.normal,p=g=0,m=c.count;p<m;p++)a.set(c.getX(p),c.getY(p),c.getZ(p)).applyMatrix4(d),b.set(f.getX(p),f.getY(p),f.getZ(p)),b.applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a),e.setXYZ(g,a.x,a.y,a.z),g+=1,e.setXYZ(g,b.x,b.y,b.z),g+=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,g=this.geometry.attributes.position,f=this.object.geometry;if(f instanceof THREE.Geometry)for(var h=f.vertices,k=f.faces,l=f=0,m=k.length;l<m;l++)for(var p=k[l],n=0,q=p.vertexTangents.length;n<q;n++){var s=p.vertexTangents[n];b.copy(h[p[a[n]]]).applyMatrix4(e);c.set(s.x,s.y,s.z);c.transformDirection(e).multiplyScalar(this.size).add(b);
-g.setXYZ(f,b.x,b.y,b.z);f+=1;g.setXYZ(f,c.x,c.y,c.z);f+=1}else if(f instanceof THREE.BufferGeometry)for(a=f.attributes.position,h=f.attributes.tangent,n=f=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),g.setXYZ(f,b.x,b.y,b.z),f+=1,g.setXYZ(f,c.x,c.y,c.z),f+=1;g.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,g=this.geometry.attributes.position,f=this.object.geometry;if(f instanceof THREE.Geometry)for(var h=f.vertices,k=f.faces,l=f=0,n=k.length;l<n;l++)for(var p=k[l],m=0,q=p.vertexTangents.length;m<q;m++){var s=p.vertexTangents[m];b.copy(h[p[a[m]]]).applyMatrix4(e);c.set(s.x,s.y,s.z);c.transformDirection(e).multiplyScalar(this.size).add(b);
+g.setXYZ(f,b.x,b.y,b.z);f+=1;g.setXYZ(f,c.x,c.y,c.z);f+=1}else if(f instanceof THREE.BufferGeometry)for(a=f.attributes.position,h=f.attributes.tangent,m=f=0,q=a.count;m<q;m++)b.set(a.getX(m),a.getY(m),a.getZ(m)).applyMatrix4(e),c.set(h.getX(m),h.getY(m),h.getZ(m)),c.transformDirection(e).multiplyScalar(this.size).add(b),g.setXYZ(f,b.x,b.y,b.z),f+=1,g.setXYZ(f,c.x,c.y,c.z),f+=1;g.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)};