Răsfoiți Sursa

Updated builds.

Mr.doob 10 ani în urmă
părinte
comite
22f25c7e12
2 a modificat fișierele cu 277 adăugiri și 362 ștergeri
  1. 66 150
      build/three.js
  2. 211 212
      build/three.min.js

+ 66 - 150
build/three.js

@@ -20167,7 +20167,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 		resetGLState();
 		resetGLState();
 		setDefaultGLState();
 		setDefaultGLState();
 
 
-		objects.clear();
 		properties.clear();
 		properties.clear();
 
 
 	};
 	};
@@ -20906,91 +20905,82 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		if ( object.visible === false ) return;
 		if ( object.visible === false ) return;
 
 
-		if ( object instanceof THREE.Scene || object instanceof THREE.Group ) {
+		if ( object instanceof THREE.Light ) {
 
 
-			// skip
+			lights.push( object );
 
 
-		} else {
-
-			// update Skeleton objects
-			if ( object instanceof THREE.SkinnedMesh ) {
+		} else if ( object instanceof THREE.Sprite ) {
 
 
-				object.skeleton.update();
-
-			}
+			sprites.push( object );
 
 
-			objects.init( object );
+		} else if ( object instanceof THREE.LensFlare ) {
 
 
-			if ( object instanceof THREE.Light ) {
+			lensFlares.push( object );
 
 
-				lights.push( object );
+		} else if ( object instanceof THREE.ImmediateRenderObject ) {
 
 
-			} else if ( object instanceof THREE.Sprite ) {
-
-				sprites.push( object );
-
-			} else if ( object instanceof THREE.LensFlare ) {
-
-				lensFlares.push( object );
-
-			} 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 if ( object instanceof THREE.Mesh || object instanceof THREE.Line || object instanceof THREE.PointCloud ){
 
 
-			} else {
+			if ( object instanceof THREE.SkinnedMesh ) {
 
 
-				var webglObject = objects.objects[ object.id ];
+				object.skeleton.update();
 
 
-				if ( webglObject && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
+			}
 
 
-					var material = object.material;
+			if ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) {
 
 
-					if ( material.visible === true ) {
+				var material = object.material;
 
 
-						if ( material instanceof THREE.MeshFaceMaterial ) {
+				if ( material.visible === true ) {
 
 
-							var materials = material.materials;
+					if ( material instanceof THREE.MeshFaceMaterial ) {
 
 
-							for ( var i = 0, l = materials.length; i < l; i ++ ) {
+						var materials = material.materials;
 
 
-								materials[ i ].program = properties.get( materials[ i ] ).program;
+						for ( var i = 0, l = materials.length; i < l; i ++ ) {
 
 
-							}
+							materials[ i ].program = properties.get( materials[ i ] ).program;
 
 
-						} else {
+						}
 
 
-							material.program = properties.get( material ).program;
+					} else {
 
 
-						}
+						material.program = properties.get( material ).program;
 
 
-						if ( material.transparent ) {
+					}
 
 
-							transparentObjects.push( webglObject );
+					if ( _this.sortObjects === true ) {
 
 
-						} else {
+						_vector3.setFromMatrixPosition( object.matrixWorld );
+						_vector3.applyProjection( _projScreenMatrix );
 
 
-							opaqueObjects.push( webglObject );
+					}
 
 
-						}
+					var renderItem = {
+						id: object.id,
+						object: object,
+						z: _vector3.z
+					};
 
 
-						if ( _this.sortObjects === true ) {
+					if ( material.transparent ) {
 
 
-							_vector3.setFromMatrixPosition( object.matrixWorld );
-							_vector3.applyProjection( _projScreenMatrix );
+						transparentObjects.push( renderItem );
 
 
-							webglObject.z = _vector3.z;
+					} else {
 
 
-						}
+						opaqueObjects.push( renderItem );
 
 
 					}
 					}
 
 
@@ -21016,8 +21006,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 
 		for ( var i = 0, l = renderList.length; i < l; i ++ ) {
 		for ( var i = 0, l = renderList.length; i < l; i ++ ) {
 
 
-			var webglObject = renderList[ i ];
-			var object = webglObject.object;
+			var renderItem = renderList[ i ];
+			var object = renderItem.object;
 			var geometry = objects.update( object );
 			var geometry = objects.update( object );
 
 
 			object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
 			object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
@@ -23815,73 +23805,10 @@ THREE.WebGLGeometries = function ( gl, properties, info ) {
 
 
 THREE.WebGLObjects = function ( gl, properties, info ) {
 THREE.WebGLObjects = function ( gl, properties, info ) {
 
 
-	var objects = {};
-
 	var geometries = new THREE.WebGLGeometries( gl, properties, info );
 	var geometries = new THREE.WebGLGeometries( gl, properties, info );
 
 
 	//
 	//
 
 
-	function onObjectRemoved( event ) {
-
-		var object = event.target;
-
-		object.traverse( function ( child ) {
-
-			child.removeEventListener( 'remove', onObjectRemoved );
-			removeObject( child );
-
-		} );
-
-	}
-
-	function removeObject( object ) {
-
-		if ( object instanceof THREE.Mesh ||
-			 object instanceof THREE.PointCloud ||
-			 object instanceof THREE.Line ) {
-
-			delete objects[ object.id ];
-
-		}
-
-		properties.delete( object );
-
-	}
-
-	//
-
-	this.objects = objects;
-
-	this.init = function ( object ) {
-
-		var objectProperties = properties.get( object );
-
-		if ( objectProperties.__webglInit === undefined ) {
-
-			objectProperties.__webglInit = true;
-
-			object.addEventListener( 'removed', onObjectRemoved );
-
-		}
-
-		if ( objectProperties.__webglActive === undefined ) {
-
-			objectProperties.__webglActive = true;
-
-			if ( object instanceof THREE.Mesh || object instanceof THREE.Line || object instanceof THREE.PointCloud ) {
-
-				objects[ object.id ] = {
-					id: object.id,
-					object: object,
-					z: 0
-				};
-
-			}
-
-		}
-
-	};
-
 	function update( object ) {
 	function update( object ) {
 
 
 		// TODO: Avoid updating twice (when using shadowMap). Maybe add frame counter.
 		// TODO: Avoid updating twice (when using shadowMap). Maybe add frame counter.
@@ -24029,7 +23956,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
 		var index = attributes.index;
 		var index = attributes.index;
 		var position = attributes.position;
 		var position = attributes.position;
 
 
-		console.time( 'wireframe' );
+		// console.time( 'wireframe' );
 
 
 		if ( index !== undefined ) {
 		if ( index !== undefined ) {
 
 
@@ -24064,7 +23991,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
 
 
 		}
 		}
 
 
-		console.timeEnd( 'wireframe' );
+		// console.timeEnd( 'wireframe' );
 
 
 		var TypeArray = position.count > 65535 ? Uint32Array : Uint16Array;
 		var TypeArray = position.count > 65535 ? Uint32Array : Uint16Array;
 		var attribute = new THREE.IndexBufferAttribute( new TypeArray( indices ), 1 );
 		var attribute = new THREE.IndexBufferAttribute( new TypeArray( indices ), 1 );
@@ -24094,12 +24021,6 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
 
 
 	this.update = update;
 	this.update = update;
 
 
-	this.clear = function () {
-
-		objects = {};
-
-	};
-
 };
 };
 
 
 // File:src/renderers/webgl/WebGLProgram.js
 // File:src/renderers/webgl/WebGLProgram.js
@@ -24887,15 +24808,11 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 
 
 			// render regular objects
 			// render regular objects
 
 
-			var webglObject, object, geometry, material;
-
 			for ( var j = 0, jl = _renderList.length; j < jl; j ++ ) {
 			for ( var j = 0, jl = _renderList.length; j < jl; j ++ ) {
 
 
-				webglObject = _renderList[ j ];
-
-				object = webglObject.object;
-				geometry = _objects.update( object );
-				material = object.material;
+				var object = _renderList[ j ];
+				var geometry = _objects.update( object );
+				var material = object.material;
 
 
 				if ( material instanceof THREE.MeshFaceMaterial ) {
 				if ( material instanceof THREE.MeshFaceMaterial ) {
 
 
@@ -24984,16 +24901,18 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
 
 
 		if ( object.visible === false ) return;
 		if ( object.visible === false ) return;
 
 
-		var webglObject = _objects.objects[ object.id ];
+		if ( object instanceof THREE.Mesh || object instanceof THREE.Line || object instanceof THREE.PointCloud ) {
 
 
-		if ( webglObject && object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
+			if ( object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
 
 
-			var material = object.material;
+				var material = object.material;
 
 
-			if ( material !== null && material.visible === true ) {
+				if ( material.visible === true ) {
 
 
-				object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
-				_renderList.push( webglObject );
+					object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
+					_renderList.push( object );
+
+				}
 
 
 			}
 			}
 
 
@@ -26185,8 +26104,8 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
 
 
 			var sprite = sprites[ i ];
 			var sprite = sprites[ i ];
 
 
-			sprite._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, sprite.matrixWorld );
-			sprite.z = - sprite._modelViewMatrix.elements[ 14 ];
+			sprite.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, sprite.matrixWorld );
+			sprite.z = - sprite.modelViewMatrix.elements[ 14 ];
 
 
 		}
 		}
 
 
@@ -26202,7 +26121,7 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
 			var material = sprite.material;
 			var material = sprite.material;
 
 
 			gl.uniform1f( uniforms.alphaTest, material.alphaTest );
 			gl.uniform1f( uniforms.alphaTest, material.alphaTest );
-			gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrix.elements );
+			gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite.modelViewMatrix.elements );
 
 
 			sprite.matrixWorld.decompose( spritePosition, spriteRotation, spriteScale );
 			sprite.matrixWorld.decompose( spritePosition, spriteRotation, spriteScale );
 
 
@@ -35149,9 +35068,6 @@ THREE.FaceNormalsHelper = function ( object, size, hex, linewidth ) {
 	//
 	//
 
 
 	this.matrixAutoUpdate = false;
 	this.matrixAutoUpdate = false;
-
-	this.normalMatrix = new THREE.Matrix3();
-
 	this.update();
 	this.update();
 
 
 };
 };
@@ -35163,12 +35079,13 @@ THREE.FaceNormalsHelper.prototype.update = ( function () {
 
 
 	var v1 = new THREE.Vector3();
 	var v1 = new THREE.Vector3();
 	var v2 = new THREE.Vector3();
 	var v2 = new THREE.Vector3();
+	var normalMatrix = new THREE.Matrix3();
 
 
 	return function update() {
 	return function update() {
 
 
 		this.object.updateMatrixWorld( true );
 		this.object.updateMatrixWorld( true );
 
 
-		this.normalMatrix.getNormalMatrix( this.object.matrixWorld );
+		normalMatrix.getNormalMatrix( this.object.matrixWorld );
 
 
 		var matrixWorld = this.object.matrixWorld;
 		var matrixWorld = this.object.matrixWorld;
 
 
@@ -35196,7 +35113,7 @@ THREE.FaceNormalsHelper.prototype.update = ( function () {
 				.divideScalar( 3 )
 				.divideScalar( 3 )
 				.applyMatrix4( matrixWorld );
 				.applyMatrix4( matrixWorld );
 
 
-			v2.copy( normal ).applyMatrix3( this.normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 );
+			v2.copy( normal ).applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 );
 
 
 			position.setXYZ( idx, v1.x, v1.y, v1.z );
 			position.setXYZ( idx, v1.x, v1.y, v1.z );
 
 
@@ -35613,8 +35530,6 @@ THREE.VertexNormalsHelper = function ( object, size, hex, linewidth ) {
 
 
 	this.matrixAutoUpdate = false;
 	this.matrixAutoUpdate = false;
 
 
-	this.normalMatrix = new THREE.Matrix3();
-
 	this.update();
 	this.update();
 
 
 };
 };
@@ -35626,6 +35541,7 @@ THREE.VertexNormalsHelper.prototype.update = ( function () {
 
 
 	var v1 = new THREE.Vector3();
 	var v1 = new THREE.Vector3();
 	var v2 = new THREE.Vector3();
 	var v2 = new THREE.Vector3();
+	var normalMatrix = new THREE.Matrix3();
 
 
 	return function update() {
 	return function update() {
 
 
@@ -35633,7 +35549,7 @@ THREE.VertexNormalsHelper.prototype.update = ( function () {
 
 
 		this.object.updateMatrixWorld( true );
 		this.object.updateMatrixWorld( true );
 
 
-		this.normalMatrix.getNormalMatrix( this.object.matrixWorld );
+		normalMatrix.getNormalMatrix( this.object.matrixWorld );
 
 
 		var matrixWorld = this.object.matrixWorld;
 		var matrixWorld = this.object.matrixWorld;
 
 
@@ -35663,7 +35579,7 @@ THREE.VertexNormalsHelper.prototype.update = ( function () {
 
 
 					v1.copy( vertex ).applyMatrix4( matrixWorld );
 					v1.copy( vertex ).applyMatrix4( matrixWorld );
 
 
-					v2.copy( normal ).applyMatrix3( this.normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 );
+					v2.copy( normal ).applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 );
 
 
 					position.setXYZ( idx, v1.x, v1.y, v1.z );
 					position.setXYZ( idx, v1.x, v1.y, v1.z );
 
 
@@ -35693,7 +35609,7 @@ THREE.VertexNormalsHelper.prototype.update = ( function () {
 
 
 				v2.set( objNorm.getX( j ), objNorm.getY( j ), objNorm.getZ( j ) );
 				v2.set( objNorm.getX( j ), objNorm.getY( j ), objNorm.getZ( j ) );
 
 
-				v2.applyMatrix3( this.normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 );
+				v2.applyMatrix3( normalMatrix ).normalize().multiplyScalar( this.size ).add( v1 );
 
 
 				position.setXYZ( idx, v1.x, v1.y, v1.z );
 				position.setXYZ( idx, v1.x, v1.y, v1.z );
 
 

+ 211 - 212
build/three.min.js

@@ -99,22 +99,22 @@ a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);f
 b){var c=a.elements,d=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/
 b){var c=a.elements,d=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]=
 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]]}};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.")};
 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]]}};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,m,n,p,l,q,t,r){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]=m;u[10]=n;u[14]=p;u[3]=l;u[7]=q;u[11]=t;u[15]=r;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,k,m,n,p,l,q,s,r){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]=m;u[10]=n;u[14]=p;u[3]=l;u[7]=q;u[11]=s;u[15]=r;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)},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],
 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),
 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,m=c*h,n=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+m*d;b[5]=a-n*d;b[9]=-c*f;b[2]=n-a*d;b[6]=m+k*d;b[10]=g*f}else"YXZ"===a.order?(a=f*h,k=f*e,m=d*h,n=d*e,b[0]=a+n*c,b[4]=m*c-k,b[8]=g*d,b[1]=g*e,b[5]=g*h,b[9]=-c,b[2]=k*c-m,b[6]=n+a*c,b[10]=g*f):"ZXY"===a.order?(a=f*h,k=f*e,m=d*h,n=d*e,b[0]=a-n*c,b[4]=-g*e,b[8]=m+k*c,b[1]=k+m*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,m=c*h,n=c*e,b[0]=f*h,b[4]=m*d-k,b[8]=a*d+n,b[1]=f*e,b[5]=
 e=Math.sin(e);if("XYZ"===a.order){a=g*h;var k=g*e,m=c*h,n=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+m*d;b[5]=a-n*d;b[9]=-c*f;b[2]=n-a*d;b[6]=m+k*d;b[10]=g*f}else"YXZ"===a.order?(a=f*h,k=f*e,m=d*h,n=d*e,b[0]=a+n*c,b[4]=m*c-k,b[8]=g*d,b[1]=g*e,b[5]=g*h,b[9]=-c,b[2]=k*c-m,b[6]=n+a*c,b[10]=g*f):"ZXY"===a.order?(a=f*h,k=f*e,m=d*h,n=d*e,b[0]=a-n*c,b[4]=-g*e,b[8]=m+k*c,b[1]=k+m*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,m=c*h,n=c*e,b[0]=f*h,b[4]=m*d-k,b[8]=a*d+n,b[1]=f*e,b[5]=
 n*d+a,b[9]=k*d-m,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,m=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=m*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+m,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,m=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-m,b[2]=m*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().");
 n*d+a,b[9]=k*d-m,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,m=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=m*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+m,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,m=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-m,b[2]=m*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 m=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]=m-g;b[8]=c+h;b[1]=m+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);
 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 m=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]=m-g;b[8]=c+h;b[1]=m+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,
 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],m=c[1],n=c[5],p=c[9],l=c[13],q=c[2],t=c[6],r=c[10],u=c[14],v=c[3],w=c[7],A=c[11],c=c[15],x=d[0],C=d[4],y=d[8],z=d[12],B=d[1],M=d[5],J=d[9],E=d[13],P=d[2],K=d[6],D=d[10],G=d[14],H=d[3],O=d[7],Q=d[11],d=d[15];e[0]=g*x+f*B+h*P+k*H;e[4]=g*C+f*M+h*K+k*O;e[8]=g*y+f*J+h*D+k*Q;e[12]=g*z+f*E+h*G+k*d;e[1]=m*x+n*B+p*P+l*H;e[5]=m*C+n*M+p*K+l*O;e[9]=m*y+n*J+p*D+l*Q;e[13]=m*z+n*E+p*G+l*d;e[2]=q*x+t*B+r*P+u*H;e[6]=q*C+t*M+r*K+u*O;e[10]=
-q*y+t*J+r*D+u*Q;e[14]=q*z+t*E+r*G+u*d;e[3]=v*x+w*B+A*P+c*H;e[7]=v*C+w*M+A*K+c*O;e[11]=v*y+w*J+A*D+c*Q;e[15]=v*z+w*E+A*G+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]*=
+b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],m=c[1],n=c[5],p=c[9],l=c[13],q=c[2],s=c[6],r=c[10],u=c[14],x=c[3],v=c[7],A=c[11],c=c[15],w=d[0],C=d[4],y=d[8],z=d[12],B=d[1],N=d[5],J=d[9],E=d[13],P=d[2],K=d[6],D=d[10],G=d[14],H=d[3],O=d[7],Q=d[11],d=d[15];e[0]=g*w+f*B+h*P+k*H;e[4]=g*C+f*N+h*K+k*O;e[8]=g*y+f*J+h*D+k*Q;e[12]=g*z+f*E+h*G+k*d;e[1]=m*w+n*B+p*P+l*H;e[5]=m*C+n*N+p*K+l*O;e[9]=m*y+n*J+p*D+l*Q;e[13]=m*z+n*E+p*G+l*d;e[2]=q*w+s*B+r*P+u*H;e[6]=q*C+s*N+r*K+u*O;e[10]=
+q*y+s*J+r*D+u*Q;e[14]=q*z+s*E+r*G+u*d;e[3]=x*w+v*B+A*P+c*H;e[7]=x*C+v*N+A*K+c*O;e[11]=x*y+v*J+A*D+c*Q;e[15]=x*z+v*E+A*G+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.");
 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,
 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],m=a[2],n=a[6],p=a[10],l=a[14];return a[3]*(+e*h*n-d*k*
 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],m=a[2],n=a[6],p=a[10],l=a[14];return a[3]*(+e*h*n-d*k*
 n-e*f*p+c*k*p+d*f*l-c*h*l)+a[7]*(+b*h*l-b*k*p+e*g*p-d*g*l+d*k*m-e*h*m)+a[11]*(+b*k*n-b*f*l-e*g*n+c*g*l+e*f*m-c*k*m)+a[15]*(-d*f*m-b*h*n+b*f*p+d*g*n-c*g*p+c*h*m)},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]=
 n-e*f*p+c*k*p+d*f*l-c*h*l)+a[7]*(+b*h*l-b*k*p+e*g*p-d*g*l+d*k*m-e*h*m)+a[11]*(+b*k*n-b*f*l-e*g*n+c*g*l+e*f*m-c*k*m)+a[15]*(-d*f*m-b*h*n+b*f*p+d*g*n-c*g*p+c*h*m)},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=
 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],m=d[5],n=d[9],p=d[13],l=d[2],q=d[6],t=d[10],r=d[14],u=d[3],v=d[7],w=d[11],d=d[15];c[0]=n*r*v-p*t*v+p*q*w-m*r*w-n*q*d+m*t*d;c[4]=h*t*v-f*r*v-h*q*w+g*r*w+f*q*d-g*t*d;c[8]=f*p*v-h*n*v+h*m*w-g*p*w-f*m*d+g*n*d;c[12]=h*n*q-f*p*q-h*m*t+g*p*t+f*m*r-g*n*r;c[1]=p*t*u-n*r*u-p*l*w+k*r*w+n*l*d-k*t*d;c[5]=f*r*u-h*t*u+h*l*w-e*r*w-f*l*d+e*t*d;c[9]=h*n*u-f*p*u-h*k*w+e*p*w+f*k*d-e*n*d;c[13]=f*p*l-h*n*l+h*k*t-e*p*t-f*k*r+e*n*r;c[2]=m*r*u-p*q*u+p*l*v-k*r*
-v-m*l*d+k*q*d;c[6]=h*q*u-g*r*u-h*l*v+e*r*v+g*l*d-e*q*d;c[10]=g*p*u-h*m*u+h*k*v-e*p*v-g*k*d+e*m*d;c[14]=h*m*l-g*p*l-h*k*q+e*p*q+g*k*r-e*m*r;c[3]=n*q*u-m*t*u-n*l*v+k*t*v+m*l*w-k*q*w;c[7]=g*t*u-f*q*u+f*l*v-e*t*v-g*l*w+e*q*w;c[11]=f*m*u-g*n*u-f*k*v+e*n*v+g*k*w-e*m*w;c[15]=g*n*l-f*m*l+f*k*q-e*n*q-g*k*t+e*m*t;c=e*c[0]+k*c[4]+l*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],m=d[5],n=d[9],p=d[13],l=d[2],q=d[6],s=d[10],r=d[14],u=d[3],x=d[7],v=d[11],d=d[15];c[0]=n*r*x-p*s*x+p*q*v-m*r*v-n*q*d+m*s*d;c[4]=h*s*x-f*r*x-h*q*v+g*r*v+f*q*d-g*s*d;c[8]=f*p*x-h*n*x+h*m*v-g*p*v-f*m*d+g*n*d;c[12]=h*n*q-f*p*q-h*m*s+g*p*s+f*m*r-g*n*r;c[1]=p*s*u-n*r*u-p*l*v+k*r*v+n*l*d-k*s*d;c[5]=f*r*u-h*s*u+h*l*v-e*r*v-f*l*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*l-h*n*l+h*k*s-e*p*s-f*k*r+e*n*r;c[2]=m*r*u-p*q*u+p*l*x-k*r*
+x-m*l*d+k*q*d;c[6]=h*q*u-g*r*u-h*l*x+e*r*x+g*l*d-e*q*d;c[10]=g*p*u-h*m*u+h*k*x-e*p*x-g*k*d+e*m*d;c[14]=h*m*l-g*p*l-h*k*q+e*p*q+g*k*r-e*m*r;c[3]=n*q*u-m*s*u-n*l*x+k*s*x+m*l*v-k*q*v;c[7]=g*s*u-f*q*u+f*l*x-e*s*x-g*l*v+e*q*v;c[11]=f*m*u-g*n*u-f*k*x+e*n*x+g*k*v-e*m*v;c[15]=g*n*l-f*m*l+f*k*q-e*n*q-g*k*s+e*m*s;c=e*c[0]+k*c[4]+l*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.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,
 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,m=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,m*f+c,m*h-d*g,0,k*h-d*f,m*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,
 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,m=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,m*f+c,m*h-d*g,0,k*h-d*f,m*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,
@@ -135,8 +135,8 @@ THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.c
 empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=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));
 empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=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}};
 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}};
 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=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},clone:function(){return(new this.constructor).copy(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],m=c[7],n=c[8],p=c[9],l=c[10],q=c[11],t=c[12],r=c[13],u=c[14],
-c=c[15];b[0].setComponents(g-a,m-f,q-n,c-t).normalize();b[1].setComponents(g+a,m+f,q+n,c+t).normalize();b[2].setComponents(g+d,m+h,q+p,c+r).normalize();b[3].setComponents(g-d,m-h,q-p,c-r).normalize();b[4].setComponents(g-e,m-k,q-l,c-u).normalize();b[5].setComponents(g+e,m+k,q+l,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);
+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},clone:function(){return(new this.constructor).copy(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],m=c[7],n=c[8],p=c[9],l=c[10],q=c[11],s=c[12],r=c[13],u=c[14],
+c=c[15];b[0].setComponents(g-a,m-f,q-n,c-s).normalize();b[1].setComponents(g+a,m+f,q+n,c+s).normalize();b[2].setComponents(g+d,m+h,q+p,c+r).normalize();b[3].setComponents(g-d,m-h,q-p,c-r).normalize();b[4].setComponents(g-e,m-k,q-l,c-u).normalize();b[5].setComponents(g+e,m+k,q+l,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;
 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}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 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}};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,
 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,
@@ -147,9 +147,9 @@ a.dot(this.normal);return this},equals:function(a){return a.normal.equals(this.n
 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+
 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/
 (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}};
 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,m,n,p,l;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;m=this.points[c[0]];n=this.points[c[1]];p=this.points[c[2]];l=this.points[c[3]];h=f*f;k=f*h;d.x=b(m.x,n.x,p.x,l.x,f,h,k);d.y=b(m.y,n.y,p.y,l.y,f,h,k);d.z=b(m.z,n.z,p.z,l.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),
+THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,k,m,n,p,l;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;m=this.points[c[0]];n=this.points[c[1]];p=this.points[c[2]];l=this.points[c[3]];h=f*f;k=f*h;d.x=b(m.x,n.x,p.x,l.x,f,h,k);d.y=b(m.y,n.y,p.y,l.y,f,h,k);d.z=b(m.z,n.z,p.z,l.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,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
+a/c,d=this.getPoint(b),g.copy(d),k+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!==e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],k=new THREE.Vector3,l=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];g=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),
 h.push(k.copy(d).clone());h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
 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 m=d*k-e*e;h=h||new THREE.Vector3;if(0===m)return h.set(-2,-1,-1);m=1/m;k=(k*g-e*f)*m;d=(d*f-e*g)*m;return h.set(1-k-d,d,k)}}();
 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 m=d*k-e*e;h=h||new THREE.Vector3;if(0===m)return h.set(-2,-1,-1);m=1/m;k=(k*g-e*f)*m;d=(d*f-e*g)*m;return h.set(1-k-d,d,k)}}();
 THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();
 THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();
@@ -204,33 +204,33 @@ 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=
 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},rotateX:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationY(b);this.applyMatrix(a);return this}}(),rotateZ:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);
 this.verticesNeedUpdate=!0},rotateX:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationY(b);this.applyMatrix(a);return this}}(),rotateZ:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);
 a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a;return function(b){void 0===a&&(a=new THREE.Object3D);a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),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!==
 a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a;return function(b){void 0===a&&(a=new THREE.Object3D);a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),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,m=void 0!==c.tangent?c.tangent.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);void 0!==m&&(this.hasTangents=!0);for(var n=[],p=[],l=[],q=[],t=c=0,r=0;c<d.length;c+=3,t+=2,r+=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[t],h[t+
-1])),void 0!==k&&l.push(new THREE.Vector2(k[t],k[t+1])),void 0!==m&&q.push(new THREE.Vector4(m[r],m[r+1],m[r+2],m[r+3]));r=function(a,c,d){var e=void 0!==g?[n[a].clone(),n[c].clone(),n[d].clone()]:[],t=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[],e=new THREE.Face3(a,c,d,e,t);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([l[a].clone(),l[c].clone(),l[d].clone()]);void 0!==m&&e.vertexTangents.push(q[a].clone(),
-q[c].clone(),q[d].clone())};if(void 0!==e)if(d=a.groups,0<d.length)for(c=0;c<d.length;c++)for(var t=d[c],u=t.start,v=t.count,t=u,u=u+v;t<u;t+=3)r(e[t],e[t+1],e[t+2]);else for(c=0;c<e.length;c+=3)r(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)r(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();
+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,m=void 0!==c.tangent?c.tangent.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);void 0!==m&&(this.hasTangents=!0);for(var n=[],p=[],l=[],q=[],s=c=0,r=0;c<d.length;c+=3,s+=2,r+=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&&l.push(new THREE.Vector2(k[s],k[s+1])),void 0!==m&&q.push(new THREE.Vector4(m[r],m[r+1],m[r+2],m[r+3]));r=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([l[a].clone(),l[c].clone(),l[d].clone()]);void 0!==m&&e.vertexTangents.push(q[a].clone(),
+q[c].clone(),q[d].clone())};if(void 0!==e)if(d=a.groups,0<d.length)for(c=0;c<d.length;c++)for(var s=d[c],u=s.start,x=s.count,s=u,u=u+x;s<u;s+=3)r(e[s],e[s+1],e[s+2]);else for(c=0;c<e.length;c+=3)r(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)r(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.translate(a.x,a.y,a.z);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);
 this.translate(a.x,a.y,a.z);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),
 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(),
 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,
 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],
 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,m,n,p,l,q,t,r,u,v=[],w=[];c=new THREE.Vector3;var A=new THREE.Vector3,x=new THREE.Vector3,C=new THREE.Vector3,y=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)v[a]=new THREE.Vector3,w[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],m=g[0],n=
-g[1],p=g[2],g=h.x-f.x,l=k.x-f.x,q=h.y-f.y,t=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=n.x-m.x,r=p.x-m.x,n=n.y-m.y,m=p.y-m.y,p=1/(k*m-r*n),c.set((m*g-n*l)*p,(m*q-n*t)*p,(m*h-n*f)*p),A.set((k*l-r*g)*p,(k*t-r*q)*p,(k*f-r*h)*p),v[d].add(c),v[u].add(c),v[e].add(c),w[d].add(A),w[u].add(A),w[e].add(A);A=["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++)y.copy(e.vertexNormals[c]),d=e[A[c]],u=v[d],x.copy(u),x.sub(y.multiplyScalar(y.dot(u))).normalize(),
-C.crossVectors(e.vertexNormals[c],u),d=C.dot(w[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.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);
+e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,g,f,h,k,m,n,p,l,q,s,r,u,x=[],v=[];c=new THREE.Vector3;var A=new THREE.Vector3,w=new THREE.Vector3,C=new THREE.Vector3,y=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],m=g[0],n=
+g[1],p=g[2],g=h.x-f.x,l=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-m.x,r=p.x-m.x,n=n.y-m.y,m=p.y-m.y,p=1/(k*m-r*n),c.set((m*g-n*l)*p,(m*q-n*s)*p,(m*h-n*f)*p),A.set((k*l-r*g)*p,(k*s-r*q)*p,(k*f-r*h)*p),x[d].add(c),x[u].add(c),x[e].add(c),v[d].add(A),v[u].add(A),v[e].add(A);A=["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++)y.copy(e.vertexNormals[c]),d=e[A[c]],u=x[d],w.copy(u),w.sub(y.multiplyScalar(y.dot(u))).normalize(),
+C.crossVectors(e.vertexNormals[c],u),d=C.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,m=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 l=f[n].clone();void 0!==b&&l.applyMatrix4(b);g.push(l)}n=0;for(p=k.length;n<
 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,m=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 l=f[n].clone();void 0!==b&&l.applyMatrix4(b);g.push(l)}n=0;for(p=k.length;n<
-p;n++){var f=k[n],q,t=f.vertexNormals,r=f.vertexColors,l=new THREE.Face3(f.a+e,f.b+e,f.c+e);l.normal.copy(f.normal);void 0!==d&&l.normal.applyMatrix3(d).normalize();b=0;for(g=t.length;b<g;b++)q=t[b].clone(),void 0!==d&&q.applyMatrix3(d).normalize(),l.vertexNormals.push(q);l.color.copy(f.color);b=0;for(g=r.length;b<g;b++)q=r[b],l.vertexColors.push(q.clone());l.materialIndex=f.materialIndex+c;h.push(l)}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());
+p;n++){var f=k[n],q,s=f.vertexNormals,r=f.vertexColors,l=new THREE.Face3(f.a+e,f.b+e,f.c+e);l.normal.copy(f.normal);void 0!==d&&l.normal.applyMatrix3(d).normalize();b=0;for(g=s.length;b<g;b++)q=s[b].clone(),void 0!==d&&q.applyMatrix3(d).normalize(),l.vertexNormals.push(q);l.color.copy(f.color);b=0;for(g=r.length;b<g;b++)q=r[b],l.vertexColors.push(q.clone());l.materialIndex=f.materialIndex+c;h.push(l)}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());
 m.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<
 m.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!==m[b])return m[b];m[b]=k.length/3;k.push(a.x,a.y,
 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!==m[b])return m[b];m[b]=k.length/3;k.push(a.x,a.y,
 a.z);return m[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]=l.length/2;l.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]&&
 a.z);return m[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]=l.length/2;l.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=[],m={},n=[],p={},l=[],q={};for(f=0;f<this.faces.length;f++){var t=this.faces[f],r=void 0!==this.faceVertexUvs[0][f],u=0<t.normal.length(),v=0<t.vertexNormals.length,w=1!==t.color.r||1!==t.color.g||1!==t.color.b,A=0<t.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,r),x=a(x,4,u),x=a(x,5,v),x=a(x,6,w),x=a(x,7,A);h.push(x);h.push(t.a,t.b,t.c);r&&(r=this.faceVertexUvs[0][f],
-h.push(d(r[0]),d(r[1]),d(r[2])));u&&h.push(b(t.normal));v&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));w&&h.push(c(t.color));A&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<n.length&&(e.data.colors=n);0<l.length&&(e.data.uvs=[l]);e.data.faces=h;return e},clone:function(){return(new this.constructor).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());
+(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=[],m={},n=[],p={},l=[],q={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],r=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,A=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,r),w=a(w,4,u),w=a(w,5,x),w=a(w,6,v),w=a(w,7,A);h.push(w);h.push(s.a,s.b,s.c);r&&(r=this.faceVertexUvs[0][f],
+h.push(d(r[0]),d(r[1]),d(r[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));A&&(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<l.length&&(e.data.uvs=[l]);e.data.faces=h;return e},clone:function(){return(new this.constructor).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,m=f.length;k<m;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);
 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,m=f.length;k<m;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.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.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.tangentsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=
 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.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.tangentsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=
 !1};
 !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},
 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,k,m=a.morphTargets,n=m.length;if(0<n){for(var p=[],l=0;l<n;l++)p[l]=[];this.morphTargets.position=p}var q=a.morphNormals,t=q.length;if(0<t){for(var r=[],l=0;l<t;l++)r[l]=[];this.morphTargets.normal=r}for(var u=a.skinIndices,v=a.skinWeights,w=u.length===c.length,A=v.length===c.length,x=l=0;l<b.length;l++,x+=3){var C=b[l];this.vertices.push(c[C.a],c[C.b],c[C.c]);var y=
+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,k,m=a.morphTargets,n=m.length;if(0<n){for(var p=[],l=0;l<n;l++)p[l]=[];this.morphTargets.position=p}var q=a.morphNormals,s=q.length;if(0<s){for(var r=[],l=0;l<s;l++)r[l]=[];this.morphTargets.normal=r}for(var u=a.skinIndices,x=a.skinWeights,v=u.length===c.length,A=x.length===c.length,w=l=0;l<b.length;l++,w+=3){var C=b[l];this.vertices.push(c[C.a],c[C.b],c[C.c]);var y=
 C.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(y=C.normal,this.normals.push(y,y,y));y=C.vertexColors;3===y.length?this.colors.push(y[0],y[1],y[2]):(y=C.color,this.colors.push(y,y,y));!0===e&&(y=d[0][l],void 0!==y?this.uvs.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(y=d[1][l],void 0!==y?this.uvs2.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
 C.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(y=C.normal,this.normals.push(y,y,y));y=C.vertexColors;3===y.length?this.colors.push(y[0],y[1],y[2]):(y=C.color,this.colors.push(y,y,y));!0===e&&(y=d[0][l],void 0!==y?this.uvs.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(y=d[1][l],void 0!==y?this.uvs2.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
-l),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));C.materialIndex!==k&&(k=C.materialIndex,void 0!==h&&(h.count=x-h.start,this.groups.push(h)),h={start:x,materialIndex:k});!0===f&&(y=C.vertexTangents,3===y.length?this.tangents.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",l),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(y=0;y<n;y++){var z=m[y].vertices;p[y].push(z[C.a],z[C.b],z[C.c])}for(y=0;y<
-t;y++)z=q[y].vertexNormals[l],r[y].push(z.a,z.b,z.c);w&&this.skinIndices.push(u[C.a],u[C.b],u[C.c]);A&&this.skinWeights.push(v[C.a],v[C.b],v[C.c])}void 0!==h&&(h.count=x-h.start,this.groups.push(h));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);
+l),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));C.materialIndex!==k&&(k=C.materialIndex,void 0!==h&&(h.count=w-h.start,this.groups.push(h)),h={start:w,materialIndex:k});!0===f&&(y=C.vertexTangents,3===y.length?this.tangents.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",l),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(y=0;y<n;y++){var z=m[y].vertices;p[y].push(z[C.a],z[C.b],z[C.c])}for(y=0;y<
+s;y++)z=q[y].vertexNormals[l],r[y].push(z.a,z.b,z.c);v&&this.skinIndices.push(u[C.a],u[C.b],u[C.c]);A&&this.skinWeights.push(x[C.a],x[C.b],x[C.c])}void 0!==h&&(h.count=w-h.start,this.groups.push(h));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.groups=[];this.boundingSphere=this.boundingBox=null};
 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.groups=[];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}):("index"===a&&!1===b instanceof THREE.IndexBufferAttribute&&(console.warn("THREE.BufferGeometry.addAttribute: Use THREE.IndexBufferAttribute for index attribute."),b=new THREE.IndexBufferAttribute(b.array,
 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}):("index"===a&&!1===b instanceof THREE.IndexBufferAttribute&&(console.warn("THREE.BufferGeometry.addAttribute: Use THREE.IndexBufferAttribute for index attribute."),b=new THREE.IndexBufferAttribute(b.array,
 b.itemSize)),this.attributes[a]=b)},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a]},get drawcalls(){console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups.");return this.groups},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups.");return this.groups},addDrawCall:function(a,b,c){void 0!==c&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup().");
 b.itemSize)),this.attributes[a]=b)},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a]},get drawcalls(){console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups.");return this.groups},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups.");return this.groups},addDrawCall:function(a,b,c){void 0!==c&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup().");
@@ -247,12 +247,12 @@ a.uvs.length),this.addAttribute("uv",(new THREE.BufferAttribute(b,2)).copyVector
 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===
 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;
 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=
 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,b=this.drawcalls;if(a.position){var c=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(c.length),3));else for(var d=a.normal.array,e=0,g=d.length;e<g;e++)d[e]=0;var d=a.normal.array,f,h,k,m=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,l=new THREE.Vector3,q=new THREE.Vector3;if(a.index){var t=a.index.array;0===b.length&&this.addDrawCall(0,t.length);for(var r=0,u=b.length;r<u;++r)for(e=b[r],g=e.start,f=e.count,e=
-g,g+=f;e<g;e+=3)f=3*t[e+0],h=3*t[e+1],k=3*t[e+2],m.fromArray(c,f),n.fromArray(c,h),p.fromArray(c,k),l.subVectors(p,n),q.subVectors(m,n),l.cross(q),d[f]+=l.x,d[f+1]+=l.y,d[f+2]+=l.z,d[h]+=l.x,d[h+1]+=l.y,d[h+2]+=l.z,d[k]+=l.x,d[k+1]+=l.y,d[k+2]+=l.z}else for(e=0,g=c.length;e<g;e+=9)m.fromArray(c,e),n.fromArray(c,e+3),p.fromArray(c,e+6),l.subVectors(p,n),q.subVectors(m,n),l.cross(q),d[e]=l.x,d[e+1]=l.y,d[e+2]=l.z,d[e+3]=l.x,d[e+4]=l.y,d[e+5]=l.z,d[e+6]=l.x,d[e+7]=l.y,d[e+8]=l.z;this.normalizeNormals();
-a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);l.fromArray(d,3*b);q.fromArray(d,3*c);t.fromArray(g,2*a);r.fromArray(g,2*b);u.fromArray(g,2*c);v=l.x-p.x;w=q.x-p.x;A=l.y-p.y;x=q.y-p.y;C=l.z-p.z;y=q.z-p.z;z=r.x-t.x;B=u.x-t.x;M=r.y-t.y;J=u.y-t.y;E=1/(z*J-B*M);P.set((J*v-M*w)*E,(J*A-M*x)*E,(J*C-M*y)*E);K.set((z*w-B*v)*E,(z*x-B*A)*E,(z*y-B*C)*E);k[a].add(P);k[b].add(P);k[c].add(P);m[a].add(K);m[b].add(K);m[c].add(K)}function b(a){F.fromArray(e,3*a);$.copy(F);aa=
-k[a];R.copy(aa);R.sub(F.multiplyScalar(F.dot(aa))).normalize();U.crossVectors($,aa);pa=U.dot(m[a]);ea=0>pa?-1:1;h[4*a]=R.x;h[4*a+1]=R.y;h[4*a+2]=R.z;h[4*a+3]=ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("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=[],m=[],n=0;n<f;n++)k[n]=new THREE.Vector3,m[n]=new THREE.Vector3;var p=new THREE.Vector3,l=new THREE.Vector3,q=new THREE.Vector3,t=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,v,w,A,x,C,y,z,B,M,J,E,P=new THREE.Vector3,K=new THREE.Vector3,D,G,H,O,Q;0===this.drawcalls.length&&this.addDrawCall(0,
-c.length);for(var T=this.drawcalls,f=0,n=T.length;f<n;++f)for(D=T[f],G=D.start,H=D.count,D=G,G+=H;D<G;D+=3)H=c[D+0],O=c[D+1],Q=c[D+2],a(H,O,Q);for(var R=new THREE.Vector3,U=new THREE.Vector3,F=new THREE.Vector3,$=new THREE.Vector3,ea,aa,pa,f=0,n=T.length;f<n;++f)for(D=T[f],G=D.start,H=D.count,D=G,G+=H;D<G;D+=3)H=c[D+0],O=c[D+1],Q=c[D+2],b(H),b(O),b(Q)}},computeOffsets:function(a){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
+this.attributes,b=this.drawcalls;if(a.position){var c=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(c.length),3));else for(var d=a.normal.array,e=0,g=d.length;e<g;e++)d[e]=0;var d=a.normal.array,f,h,k,m=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,l=new THREE.Vector3,q=new THREE.Vector3;if(a.index){var s=a.index.array;0===b.length&&this.addDrawCall(0,s.length);for(var r=0,u=b.length;r<u;++r)for(e=b[r],g=e.start,f=e.count,e=
+g,g+=f;e<g;e+=3)f=3*s[e+0],h=3*s[e+1],k=3*s[e+2],m.fromArray(c,f),n.fromArray(c,h),p.fromArray(c,k),l.subVectors(p,n),q.subVectors(m,n),l.cross(q),d[f]+=l.x,d[f+1]+=l.y,d[f+2]+=l.z,d[h]+=l.x,d[h+1]+=l.y,d[h+2]+=l.z,d[k]+=l.x,d[k+1]+=l.y,d[k+2]+=l.z}else for(e=0,g=c.length;e<g;e+=9)m.fromArray(c,e),n.fromArray(c,e+3),p.fromArray(c,e+6),l.subVectors(p,n),q.subVectors(m,n),l.cross(q),d[e]=l.x,d[e+1]=l.y,d[e+2]=l.z,d[e+3]=l.x,d[e+4]=l.y,d[e+5]=l.z,d[e+6]=l.x,d[e+7]=l.y,d[e+8]=l.z;this.normalizeNormals();
+a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);l.fromArray(d,3*b);q.fromArray(d,3*c);s.fromArray(g,2*a);r.fromArray(g,2*b);u.fromArray(g,2*c);x=l.x-p.x;v=q.x-p.x;A=l.y-p.y;w=q.y-p.y;C=l.z-p.z;y=q.z-p.z;z=r.x-s.x;B=u.x-s.x;N=r.y-s.y;J=u.y-s.y;E=1/(z*J-B*N);P.set((J*x-N*v)*E,(J*A-N*w)*E,(J*C-N*y)*E);K.set((z*v-B*x)*E,(z*w-B*A)*E,(z*y-B*C)*E);k[a].add(P);k[b].add(P);k[c].add(P);m[a].add(K);m[b].add(K);m[c].add(K)}function b(a){F.fromArray(e,3*a);$.copy(F);aa=
+k[a];R.copy(aa);R.sub(F.multiplyScalar(F.dot(aa))).normalize();U.crossVectors($,aa);oa=U.dot(m[a]);ea=0>oa?-1:1;h[4*a]=R.x;h[4*a+1]=R.y;h[4*a+2]=R.z;h[4*a+3]=ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("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=[],m=[],n=0;n<f;n++)k[n]=new THREE.Vector3,m[n]=new THREE.Vector3;var p=new THREE.Vector3,l=new THREE.Vector3,q=new THREE.Vector3,s=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,x,v,A,w,C,y,z,B,N,J,E,P=new THREE.Vector3,K=new THREE.Vector3,D,G,H,O,Q;0===this.drawcalls.length&&this.addDrawCall(0,
+c.length);for(var T=this.drawcalls,f=0,n=T.length;f<n;++f)for(D=T[f],G=D.start,H=D.count,D=G,G+=H;D<G;D+=3)H=c[D+0],O=c[D+1],Q=c[D+2],a(H,O,Q);for(var R=new THREE.Vector3,U=new THREE.Vector3,F=new THREE.Vector3,$=new THREE.Vector3,ea,aa,oa,f=0,n=T.length;f<n;++f)for(D=T[f],G=D.start,H=D.count,D=G,G+=H;D<G;D+=3)H=c[D+0],O=c[D+1],Q=c[D+2],b(H),b(O),b(Q)}},computeOffsets:function(a){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},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},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=
 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},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});
 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 this.constructor).copy(this)},copy:function(a){var b=a.attributes;a=a.drawcalls;for(var c in b)this.addAttribute(c,b[c].clone());b=0;for(c=a.length;b<c;b++){var d=a[b];this.addDrawCall(d.start,d.count)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.BufferGeometry.MaxIndex=65535;
 return a},clone:function(){return(new this.constructor).copy(this)},copy:function(a){var b=a.attributes;a=a.drawcalls;for(var c in b)this.addAttribute(c,b[c].clone());b=0;for(c=a.length;b<c;b++){var d=a[b];this.addDrawCall(d.start,d.count)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.BufferGeometry.MaxIndex=65535;
@@ -286,8 +286,8 @@ THREE.SpotLight.prototype.copy=function(a){THREE.Light.prototype.copy.call(this,
 this.shadowMapWidth=a.shadowMapWidth;this.shadowMapHeight=a.shadowMapHeight;return this};THREE.SpotLight.prototype.toJSON=function(a){a=THREE.Object3D.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();a.object.intensity=this.intensity;a.object.distance=this.distance;a.object.angle=this.angle;a.object.exponent=this.exponent;a.object.decay=this.decay;return a};
 this.shadowMapWidth=a.shadowMapWidth;this.shadowMapHeight=a.shadowMapHeight;return this};THREE.SpotLight.prototype.toJSON=function(a){a=THREE.Object3D.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();a.object.intensity=this.intensity;a.object.distance=this.distance;a.object.angle=this.angle;a.object.exponent=this.exponent;a.object.decay=this.decay;return a};
 THREE.Cache={enabled:!1,files:{},add:function(a,b){!1!==this.enabled&&(this.files[a]=b)},get:function(a){if(!1!==this.enabled)return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};THREE.Loader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Cache={enabled:!1,files:{},add:function(a,b){!1!==this.enabled&&(this.files[a]=b)},get:function(a){if(!1!==this.enabled)return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};THREE.Loader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b,c){for(var d=[],e=0;e<a.length;++e)d[e]=this.createMaterial(a[e],b,c);return d},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(){var a;return function(b,c,d){function e(a){a=Math.log(a)/Math.LN2;return Math.pow(2,
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b,c){for(var d=[],e=0;e<a.length;++e)d[e]=this.createMaterial(a[e],b,c);return d},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(){var a;return function(b,c,d){function e(a){a=Math.log(a)/Math.LN2;return Math.pow(2,
-Math.round(a))}function g(b,g,f,h,k,m,u){var v=c+f,w,A=THREE.Loader.Handlers.get(v);null!==A?w=A.load(v):(w=new THREE.Texture,A=a,A.setCrossOrigin(d),A.load(v,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=e(a.width),c=e(a.height),d=document.createElement("canvas");d.width=b;d.height=c;d.getContext("2d").drawImage(a,0,0,b,c);w.image=d}else w.image=a;w.needsUpdate=!0}));w.sourceFile=f;h&&(w.repeat.set(h[0],h[1]),1!==h[0]&&(w.wrapS=THREE.RepeatWrapping),
-1!==h[1]&&(w.wrapT=THREE.RepeatWrapping));k&&w.offset.set(k[0],k[1]);m&&(f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==f[m[0]]&&(w.wrapS=f[m[0]]),void 0!==f[m[1]]&&(w.wrapT=f[m[1]]));u&&(w.anisotropy=u);b[g]=w}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}void 0===d&&void 0!==this.crossOrigin&&(d=this.crossOrigin);void 0===a&&(a=new THREE.ImageLoader);var h="MeshLambertMaterial",k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,
+Math.round(a))}function g(b,f,g,h,k,m,u){var x=c+g,v,A=THREE.Loader.Handlers.get(x);null!==A?v=A.load(x):(v=new THREE.Texture,A=a,A.setCrossOrigin(d),A.load(x,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=e(a.width),c=e(a.height),d=document.createElement("canvas");d.width=b;d.height=c;d.getContext("2d").drawImage(a,0,0,b,c);v.image=d}else v.image=a;v.needsUpdate=!0}));v.sourceFile=g;h&&(v.repeat.set(h[0],h[1]),1!==h[0]&&(v.wrapS=THREE.RepeatWrapping),
+1!==h[1]&&(v.wrapT=THREE.RepeatWrapping));k&&v.offset.set(k[0],k[1]);m&&(g={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==g[m[0]]&&(v.wrapS=g[m[0]]),void 0!==g[m[1]]&&(v.wrapT=g[m[1]]));u&&(v.anisotropy=u);b[f]=v}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}void 0===d&&void 0!==this.crossOrigin&&(d=this.crossOrigin);void 0===a&&(a=new THREE.ImageLoader);var h="MeshLambertMaterial",k={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,
 wireframe:!1};if(b.shading){var m=b.shading.toLowerCase();"phong"===m?h="MeshPhongMaterial":"basic"===m&&(h="MeshBasicMaterial")}void 0!==b.blending&&void 0!==THREE[b.blending]&&(k.blending=THREE[b.blending]);void 0!==b.transparent&&(k.transparent=b.transparent);void 0!==b.opacity&&1>b.opacity&&(k.transparent=!0);void 0!==b.depthTest&&(k.depthTest=b.depthTest);void 0!==b.depthWrite&&(k.depthWrite=b.depthWrite);void 0!==b.visible&&(k.visible=b.visible);void 0!==b.flipSided&&(k.side=THREE.BackSide);
 wireframe:!1};if(b.shading){var m=b.shading.toLowerCase();"phong"===m?h="MeshPhongMaterial":"basic"===m&&(h="MeshBasicMaterial")}void 0!==b.blending&&void 0!==THREE[b.blending]&&(k.blending=THREE[b.blending]);void 0!==b.transparent&&(k.transparent=b.transparent);void 0!==b.opacity&&1>b.opacity&&(k.transparent=!0);void 0!==b.depthTest&&(k.depthTest=b.depthTest);void 0!==b.depthWrite&&(k.depthWrite=b.depthWrite);void 0!==b.visible&&(k.visible=b.visible);void 0!==b.flipSided&&(k.side=THREE.BackSide);
 void 0!==b.doubleSided&&(k.side=THREE.DoubleSide);void 0!==b.wireframe&&(k.wireframe=b.wireframe);void 0!==b.vertexColors&&("face"===b.vertexColors?k.vertexColors=THREE.FaceColors:b.vertexColors&&(k.vertexColors=THREE.VertexColors));b.colorDiffuse?k.color=f(b.colorDiffuse):b.DbgColor&&(k.color=b.DbgColor);b.colorSpecular&&(k.specular=f(b.colorSpecular));b.colorEmissive&&(k.emissive=f(b.colorEmissive));void 0!==b.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),
 void 0!==b.doubleSided&&(k.side=THREE.DoubleSide);void 0!==b.wireframe&&(k.wireframe=b.wireframe);void 0!==b.vertexColors&&("face"===b.vertexColors?k.vertexColors=THREE.FaceColors:b.vertexColors&&(k.vertexColors=THREE.VertexColors));b.colorDiffuse?k.color=f(b.colorDiffuse):b.DbgColor&&(k.color=b.DbgColor);b.colorSpecular&&(k.specular=f(b.colorSpecular));b.colorEmissive&&(k.emissive=f(b.colorEmissive));void 0!==b.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),
 b.opacity=b.transparency);void 0!==b.opacity&&(k.opacity=b.opacity);b.specularCoef&&(k.shininess=b.specularCoef);b.mapDiffuse&&c&&g(k,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap,b.mapDiffuseAnisotropy);b.mapLight&&c&&g(k,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap,b.mapLightAnisotropy);b.mapAO&&c&&g(k,"aoMap",b.mapAO,b.mapAORepeat,b.mapAOOffset,b.mapAOWrap,b.mapAOAnisotropy);b.mapBump&&c&&g(k,"bumpMap",b.mapBump,b.mapBumpRepeat,b.mapBumpOffset,
 b.opacity=b.transparency);void 0!==b.opacity&&(k.opacity=b.opacity);b.specularCoef&&(k.shininess=b.specularCoef);b.mapDiffuse&&c&&g(k,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap,b.mapDiffuseAnisotropy);b.mapLight&&c&&g(k,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap,b.mapLightAnisotropy);b.mapAO&&c&&g(k,"aoMap",b.mapAO,b.mapAORepeat,b.mapAOOffset,b.mapAOWrap,b.mapAOAnisotropy);b.mapBump&&c&&g(k,"bumpMap",b.mapBump,b.mapBumpRepeat,b.mapBumpOffset,
@@ -298,10 +298,10 @@ 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);
 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};
 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"===
 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,m,n,p,l,q,t,r,u,v,w=a.faces;n=a.vertices;var A=a.normals,x=a.colors,C=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&C++;for(d=0;d<C;d++)c.faceVertexUvs[d]=
-[]}k=0;for(m=n.length;k<m;)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(m=w.length;k<m;)if(b=w[k++],q=b&1,h=b&2,d=b&8,p=b&16,t=b&32,n=b&64,b&=128,q){q=new THREE.Face3;q.a=w[k];q.b=w[k+1];q.c=w[k+3];r=new THREE.Face3;r.a=w[k+1];r.b=w[k+2];r.c=w[k+3];k+=4;h&&(h=w[k++],q.materialIndex=h,r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<C;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)l=w[k++],v=u[2*l],l=u[2*l+1],v=new THREE.Vector2(v,
-l),2!==f&&c.faceVertexUvs[d][h].push(v),0!==f&&c.faceVertexUvs[d][h+1].push(v);p&&(p=3*w[k++],q.normal.set(A[p++],A[p++],A[p]),r.normal.copy(q.normal));if(t)for(d=0;4>d;d++)p=3*w[k++],t=new THREE.Vector3(A[p++],A[p++],A[p]),2!==d&&q.vertexNormals.push(t),0!==d&&r.vertexNormals.push(t);n&&(n=w[k++],n=x[n],q.color.setHex(n),r.color.setHex(n));if(b)for(d=0;4>d;d++)n=w[k++],n=x[n],2!==d&&q.vertexColors.push(new THREE.Color(n)),0!==d&&r.vertexColors.push(new THREE.Color(n));c.faces.push(q);c.faces.push(r)}else{q=
-new THREE.Face3;q.a=w[k++];q.b=w[k++];q.c=w[k++];h&&(h=w[k++],q.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<C;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)l=w[k++],v=u[2*l],l=u[2*l+1],v=new THREE.Vector2(v,l),c.faceVertexUvs[d][h].push(v);p&&(p=3*w[k++],q.normal.set(A[p++],A[p++],A[p]));if(t)for(d=0;3>d;d++)p=3*w[k++],t=new THREE.Vector3(A[p++],A[p++],A[p]),q.vertexNormals.push(t);n&&(n=w[k++],q.color.setHex(x[n]));if(b)for(d=0;3>d;d++)n=w[k++],q.vertexColors.push(new THREE.Color(x[n]));
+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,m,n,p,l,q,s,r,u,x,v=a.faces;n=a.vertices;var A=a.normals,w=a.colors,C=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&C++;for(d=0;d<C;d++)c.faceVertexUvs[d]=
+[]}k=0;for(m=n.length;k<m;)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(m=v.length;k<m;)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];r=new THREE.Face3;r.a=v[k+1];r.b=v[k+2];r.c=v[k+3];k+=4;h&&(h=v[k++],q.materialIndex=h,r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<C;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)l=v[k++],x=u[2*l],l=u[2*l+1],x=new THREE.Vector2(x,
+l),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(A[p++],A[p++],A[p]),r.normal.copy(q.normal));if(s)for(d=0;4>d;d++)p=3*v[k++],s=new THREE.Vector3(A[p++],A[p++],A[p]),2!==d&&q.vertexNormals.push(s),0!==d&&r.vertexNormals.push(s);n&&(n=v[k++],n=w[n],q.color.setHex(n),r.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&&r.vertexColors.push(new THREE.Color(n));c.faces.push(q);c.faces.push(r)}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<C;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)l=v[k++],x=u[2*l],l=u[2*l+1],x=new THREE.Vector2(x,l),c.faceVertexUvs[d][h].push(x);p&&(p=3*v[k++],q.normal.set(A[p++],A[p++],A[p]));if(s)for(d=0;3>d;d++)p=3*v[k++],s=new THREE.Vector3(A[p++],A[p++],A[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.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,m,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=
 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,m,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=
 [],m=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;m.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,m=a.morphColors[d].colors,b=0,h=m.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(m[b],m[b+1],m[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();
 [],m=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;m.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,m=a.morphColors[d].colors,b=0,h=m.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(m[b],m[b+1],m[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();
@@ -379,23 +379,23 @@ THREE.DataTexture=function(a,b,c,d,e,g,f,h,k,m,n){THREE.Texture.call(this,null,g
 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.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.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=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);
 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 m=g.attributes,n=m.position.array;if(void 0!==m.index){var m=m.index.array,p=g.drawcalls;0===p.length&&g.addDrawCall(0,m.length);for(var l=0,q=p.length;l<q;++l)for(var t=p[l],r=t.start,g=r,t=r+t.count;g<t;g++)r=m[g],k.fromArray(n,3*r),f(k,r)}else for(g=0,m=n.length/3;g<m;g++)k.fromArray(n,3*g),f(k,g)}else for(k=g.vertices,g=0,m=k.length;g<m;g++)f(k[g],
+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 m=g.attributes,n=m.position.array;if(void 0!==m.index){var m=m.index.array,p=g.drawcalls;0===p.length&&g.addDrawCall(0,m.length);for(var l=0,q=p.length;l<q;++l)for(var s=p[l],r=s.start,g=r,s=r+s.count;g<s;g++)r=m[g],k.fromArray(n,3*r),f(k,r)}else for(g=0,m=n.length/3;g<m;g++)k.fromArray(n,3*g),f(k,g)}else for(k=g.vertices,g=0,m=k.length;g<m;g++)f(k[g],
 g)}}}();THREE.PointCloud.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(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};
 g)}}}();THREE.PointCloud.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(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.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.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,m=new THREE.Vector3,n=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(f instanceof
 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,m=new THREE.Vector3,n=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(f instanceof
-THREE.BufferGeometry){var l=f.attributes;if(void 0!==l.index){var q=l.index.array,l=l.position.array,t=f.drawcalls;0===t.length&&f.addDrawCall(0,q.length);for(var r=0;r<t.length;r++)for(var f=t[r],u=f.start,v=f.count,f=u;f<u+v-1;f+=p){var w=q[f+1];h.fromArray(l,3*q[f]);k.fromArray(l,3*w);w=b.distanceSqToSegment(h,k,n,m);w>g||(w=b.origin.distanceTo(n),w<d.near||w>d.far||e.push({distance:w,point:m.clone().applyMatrix4(this.matrixWorld),index:f,offsetIndex:r,face:null,faceIndex:null,object:this}))}}else for(l=
-l.position.array,f=0;f<l.length/3-1;f+=p)h.fromArray(l,3*f),k.fromArray(l,3*f+3),w=b.distanceSqToSegment(h,k,n,m),w>g||(w=b.origin.distanceTo(n),w<d.near||w>d.far||e.push({distance:w,point:m.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)w=b.distanceSqToSegment(h[f],h[f+1],n,m),w>g||(w=b.origin.distanceTo(n),w<d.near||w>d.far||e.push({distance:w,point:m.clone().applyMatrix4(this.matrixWorld),
+THREE.BufferGeometry){var l=f.attributes;if(void 0!==l.index){var q=l.index.array,l=l.position.array,s=f.drawcalls;0===s.length&&f.addDrawCall(0,q.length);for(var r=0;r<s.length;r++)for(var f=s[r],u=f.start,x=f.count,f=u;f<u+x-1;f+=p){var v=q[f+1];h.fromArray(l,3*q[f]);k.fromArray(l,3*v);v=b.distanceSqToSegment(h,k,n,m);v>g||(v=b.origin.distanceTo(n),v<d.near||v>d.far||e.push({distance:v,point:m.clone().applyMatrix4(this.matrixWorld),index:f,offsetIndex:r,face:null,faceIndex:null,object:this}))}}else for(l=
+l.position.array,f=0;f<l.length/3-1;f+=p)h.fromArray(l,3*f),k.fromArray(l,3*f+3),v=b.distanceSqToSegment(h,k,n,m),v>g||(v=b.origin.distanceTo(n),v<d.near||v>d.far||e.push({distance:v,point:m.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)v=b.distanceSqToSegment(h[f],h[f+1],n,m),v>g||(v=b.origin.distanceTo(n),v<d.near||v>d.far||e.push({distance:v,point:m.clone().applyMatrix4(this.matrixWorld),
 index:f,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};
 index:f,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(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.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.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.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;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.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.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(m,n){var p=this.geometry,l=this.material;if(void 0!==l&&(null===p.boundingSphere&&p.computeBoundingSphere(),c.copy(p.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==m.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(m.ray).applyMatrix4(a),null===
 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(m,n){var p=this.geometry,l=this.material;if(void 0!==l&&(null===p.boundingSphere&&p.computeBoundingSphere(),c.copy(p.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==m.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(m.ray).applyMatrix4(a),null===
-p.boundingBox||!1!==b.isIntersectionBox(p.boundingBox)))){var q,t,r;if(p instanceof THREE.BufferGeometry)if(q=p.attributes,void 0!==q.index){var u=q.index.array,v=q.position.array,w=p.drawcalls;0===w.length&&p.addDrawCall(0,u.length);for(var p=0,A=w.length;p<A;++p){q=w[p];for(var x=t=q.start,C=t+q.count;x<C;x+=3){q=u[x];t=u[x+1];r=u[x+2];d.fromArray(v,3*q);e.fromArray(v,3*t);g.fromArray(v,3*r);var y=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide);
-if(null!==y){y.applyMatrix4(this.matrixWorld);var z=m.ray.origin.distanceTo(y);z<m.near||z>m.far||n.push({distance:z,point:y,face:new THREE.Face3(q,t,r,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(x/3),object:this})}}}}else for(v=q.position.array,x=0,C=v.length;x<C;x+=9)d.fromArray(v,x),e.fromArray(v,x+3),g.fromArray(v,x+6),y=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide),null!==y&&(y.applyMatrix4(this.matrixWorld),z=m.ray.origin.distanceTo(y),
-z<m.near||z>m.far||(q=x/3,t=q+1,r=q+2,n.push({distance:z,point:y,face:new THREE.Face3(q,t,r,THREE.Triangle.normal(d,e,g)),index:q,object:this})));else if(p instanceof THREE.Geometry)for(u=l instanceof THREE.MeshFaceMaterial,v=!0===u?l.materials:null,w=p.vertices,A=p.faces,x=0,C=A.length;x<C;x++){var B=A[x],y=!0===u?v[B.materialIndex]:l;if(void 0!==y){q=w[B.a];t=w[B.b];r=w[B.c];if(!0===y.morphTargets){var z=p.morphTargets,M=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var J=
-0,E=z.length;J<E;J++){var P=M[J];if(0!==P){var K=z[J].vertices;d.addScaledVector(f.subVectors(K[B.a],q),P);e.addScaledVector(h.subVectors(K[B.b],t),P);g.addScaledVector(k.subVectors(K[B.c],r),P)}}d.add(q);e.add(t);g.add(r);q=d;t=e;r=g}y=y.side===THREE.BackSide?b.intersectTriangle(r,t,q,!0):b.intersectTriangle(q,t,r,y.side!==THREE.DoubleSide);null!==y&&(y.applyMatrix4(this.matrixWorld),z=m.ray.origin.distanceTo(y),z<m.near||z>m.far||n.push({distance:z,point:y,face:B,faceIndex:x,object:this}))}}}}}();
+p.boundingBox||!1!==b.isIntersectionBox(p.boundingBox)))){var q,s,r;if(p instanceof THREE.BufferGeometry)if(q=p.attributes,void 0!==q.index){var u=q.index.array,x=q.position.array,v=p.drawcalls;0===v.length&&p.addDrawCall(0,u.length);for(var p=0,A=v.length;p<A;++p){q=v[p];for(var w=s=q.start,C=s+q.count;w<C;w+=3){q=u[w];s=u[w+1];r=u[w+2];d.fromArray(x,3*q);e.fromArray(x,3*s);g.fromArray(x,3*r);var y=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide);
+if(null!==y){y.applyMatrix4(this.matrixWorld);var z=m.ray.origin.distanceTo(y);z<m.near||z>m.far||n.push({distance:z,point:y,face:new THREE.Face3(q,s,r,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(w/3),object:this})}}}}else for(x=q.position.array,w=0,C=x.length;w<C;w+=9)d.fromArray(x,w),e.fromArray(x,w+3),g.fromArray(x,w+6),y=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide),null!==y&&(y.applyMatrix4(this.matrixWorld),z=m.ray.origin.distanceTo(y),
+z<m.near||z>m.far||(q=w/3,s=q+1,r=q+2,n.push({distance:z,point:y,face:new THREE.Face3(q,s,r,THREE.Triangle.normal(d,e,g)),index:q,object:this})));else if(p instanceof THREE.Geometry)for(u=l instanceof THREE.MeshFaceMaterial,x=!0===u?l.materials:null,v=p.vertices,A=p.faces,w=0,C=A.length;w<C;w++){var B=A[w],y=!0===u?x[B.materialIndex]:l;if(void 0!==y){q=v[B.a];s=v[B.b];r=v[B.c];if(!0===y.morphTargets){var z=p.morphTargets,N=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var J=
+0,E=z.length;J<E;J++){var P=N[J];if(0!==P){var K=z[J].vertices;d.addScaledVector(f.subVectors(K[B.a],q),P);e.addScaledVector(h.subVectors(K[B.b],s),P);g.addScaledVector(k.subVectors(K[B.c],r),P)}}d.add(q);e.add(s);g.add(r);q=d;s=e;r=g}y=y.side===THREE.BackSide?b.intersectTriangle(r,s,q,!0):b.intersectTriangle(q,s,r,y.side!==THREE.DoubleSide);null!==y&&(y.applyMatrix4(this.matrixWorld),z=m.ray.origin.distanceTo(y),z<m.near||z>m.far||n.push({distance:z,point:y,face:B,faceIndex:w,object:this}))}}}}}();
 THREE.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(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.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(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.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
 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.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=THREE.Math.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=THREE.Math.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
@@ -488,90 +488,90 @@ 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,
 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() {",
 "}"].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.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===R&&(a*=d,b*=d,c*=d);s.clearColor(a,b,c,d)}function c(){L.init();s.viewport(Aa,Ga,Ha,Ba);b($.r,$.g,$.b,ea)}function d(){Wa=lb=null;Ia="";Xa=-1;eb=!0;L.reset()}function e(a){a.preventDefault();d();c();ua.clear();Z.clear()}function g(a){a=a.target;a.removeEventListener("dispose",g);a:{var b=Z.get(a);if(a.image&&b.__image__webglTextureCube)s.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;s.deleteTexture(b.__webglTexture)}Z.delete(a)}Ca.textures--}
-function f(a){a=a.target;a.removeEventListener("dispose",f);var b=Z.get(a);if(a&&void 0!==b.__webglTexture){s.deleteTexture(b.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var c=0;6>c;c++)s.deleteFramebuffer(b.__webglFramebuffer[c]),s.deleteRenderbuffer(b.__webglRenderbuffer[c]);else s.deleteFramebuffer(b.__webglFramebuffer),s.deleteRenderbuffer(b.__webglRenderbuffer);Z.delete(a)}Ca.textures--}function h(a){a=a.target;a.removeEventListener("dispose",h);k(a);Z.delete(a)}function k(a){var b=
-Z.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(),s.deleteProgram(b),Ca.programs=c);break}}}}function m(a,b){return b[0]-a[0]}function n(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 l(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ua.init(a),a instanceof THREE.Light)aa.push(a);else if(a instanceof THREE.Sprite)Pa.push(a);else if(a instanceof THREE.LensFlare)Ja.push(a);else if(a instanceof THREE.ImmediateRenderObject){var b=a.material;b.transparent?za.push(a):ma.push(a)}else{var c=ua.objects[a.id];
-if(c&&(!1===a.frustumCulled||!0===Ya.intersectsObject(a))&&(b=a.material,!0===b.visible)){if(b instanceof THREE.MeshFaceMaterial)for(var d=b.materials,e=0,f=d.length;e<f;e++)d[e].program=Z.get(d[e]).program;else b.program=Z.get(b).program;b.transparent?ta.push(c):pa.push(c);!0===ja.sortObjects&&(ka.setFromMatrixPosition(a.matrixWorld),ka.applyProjection(Qa),c.z=ka.z)}}a=a.children;e=0;for(f=a.length;e<f;e++)l(a[e])}}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=ua.update(k);
-k.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,k.matrixWorld);k.normalMatrix.getNormalMatrix(k.modelViewMatrix);void 0===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var m=l.groups,n=f.materials,p=0,q=m.length;p<q;p++){var t=m[p],s=n[t.materialIndex];void 0!==s&&ja.renderBufferDirect(b,c,d,l,s,k,t)}else ja.renderBufferDirect(b,c,d,l,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];k.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,k.matrixWorld);
-k.normalMatrix.getNormalMatrix(k.modelViewMatrix);void 0===e&&(f=k.material);r(f);var l=u(b,c,d,f,k);Ia="";k.render(function(a){ja.renderBufferImmediate(a,l,f)})}}function r(a){a.side!==THREE.DoubleSide?L.enable(s.CULL_FACE):L.disable(s.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 u(a,b,c,d,e){var f,l,m,n;fb=0;var p=Z.get(d);if(d.needsUpdate||!p.program){a:{for(var q=Z.get(d),t=ac[d.type],r=0,u=0,y=0,z=0,B=0,E=b.length;B<E;B++){var D=b[B];D.onlyShadow||!1===D.visible||(D instanceof THREE.DirectionalLight&&r++,D instanceof THREE.PointLight&&u++,D instanceof THREE.SpotLight&&y++,D instanceof THREE.HemisphereLight&&z++)}f=r;l=u;m=
-y;n=z;for(var K,H=0,O=0,Q=b.length;O<Q;O++){var pa=b[O];pa.castShadow&&(pa instanceof THREE.SpotLight&&H++,pa instanceof THREE.DirectionalLight&&H++)}K=H;var P;if(mb&&e&&e.skeleton&&e.skeleton.useVertexTexture)P=1024;else{var R=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),T=Math.floor((R-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(T=Math.min(e.skeleton.bones.length,T),T<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+
-T+" (try OpenGL instead of ANGLE)"));P=T}var U=G;null!==d.precision&&(U=L.getMaxPrecision(d.precision),U!==d.precision&&console.warn("THREE.WebGLRenderer.initMaterial:",d.precision,"not supported, using",U,"instead."));var za={precision:U,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:F,skinning:d.skinning,maxBones:P,useVertexTexture:mb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:ja.maxMorphTargets,maxMorphNormals:ja.maxMorphNormals,maxDirLights:f,maxPointLights:l,maxSpotLights:m,maxHemiLights:n,maxShadows:K,shadowMapEnabled:na.enabled&&
-e.receiveShadow&&0<K,shadowMapType:na.type,shadowMapDebug:na.debug,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},ma=[];t?ma.push(t):(ma.push(d.fragmentShader),ma.push(d.vertexShader));if(void 0!==d.defines)for(var ta in d.defines)ma.push(ta),ma.push(d.defines[ta]);for(ta in za)ma.push(ta),ma.push(za[ta]);var X=ma.join(),aa=!0;if(q.program)if(q.program.code!==X)k(d);else if(void 0!==t)break a;else aa=!1;else d.addEventListener("dispose",
-h);if(t){var Ja=THREE.ShaderLib[t];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(Ja.uniforms),vertexShader:Ja.vertexShader,fragmentShader:Ja.fragmentShader}}else q.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var $,ea=0,ib=va.length;ea<ib;ea++){var Pa=va[ea];if(Pa.code===X){$=Pa;aa&&$.usedTimes++;break}}void 0===$&&(d.__webglShader=q.__webglShader,$=new THREE.WebGLProgram(ja,X,d,za),va.push($),Ca.programs=va.length);
-q.program=$;var ua=$.getAttributes();if(d.morphTargets)for(var la=d.numSupportedMorphTargets=0;la<ja.maxMorphTargets;la++)0<=ua["morphTarget"+la]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(la=d.numSupportedMorphNormals=0;la<ja.maxMorphNormals;la++)0<=ua["morphNormal"+la]&&d.numSupportedMorphNormals++;q.uniformsList=[];var Ia=q.program.getUniforms(),Aa;for(Aa in q.__webglShader.uniforms){var Ga=Ia[Aa];Ga&&q.uniformsList.push([q.__webglShader.uniforms[Aa],Ga])}}d.needsUpdate=!1}var Ha=!1,Ba=
-!1,ya=!1,Za=p.program,ca=Za.getUniforms(),I=p.__webglShader.uniforms;Za.id!==lb&&(s.useProgram(Za.program),lb=Za.id,ya=Ba=Ha=!0);d.id!==Xa&&(-1===Xa&&(ya=!0),Xa=d.id,Ba=!0);if(Ha||a!==Wa)s.uniformMatrix4fv(ca.projectionMatrix,!1,a.projectionMatrix.elements),F&&s.uniform1f(ca.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Wa&&(Wa=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&void 0!==ca.cameraPosition&&(ka.setFromMatrixPosition(a.matrixWorld),s.uniform3f(ca.cameraPosition,
-ka.x,ka.y,ka.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&void 0!==ca.viewMatrix&&s.uniformMatrix4fv(ca.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&void 0!==ca.bindMatrix&&s.uniformMatrix4fv(ca.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&void 0!==ca.bindMatrixInverse&&s.uniformMatrix4fv(ca.bindMatrixInverse,!1,e.bindMatrixInverse.elements),
-mb&&e.skeleton&&e.skeleton.useVertexTexture){if(void 0!==ca.boneTexture){var Qa=w();s.uniform1i(ca.boneTexture,Qa);ja.setTexture(e.skeleton.boneTexture,Qa)}void 0!==ca.boneTextureWidth&&s.uniform1i(ca.boneTextureWidth,e.skeleton.boneTextureWidth);void 0!==ca.boneTextureHeight&&s.uniform1i(ca.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&void 0!==ca.boneGlobalMatrices&&s.uniformMatrix4fv(ca.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(Ba){c&&d.fog&&
-(I.fogColor.value=c.color,c instanceof THREE.Fog?(I.fogNear.value=c.near,I.fogFar.value=c.far):c instanceof THREE.FogExp2&&(I.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(eb){var ya=!0,ba,qa,Y,ob=0,pb=0,qb=0,Ka,Ya,db,Ra,rb,da=Qb,sb=da.directional.colors,tb=da.directional.positions,ub=da.point.colors,vb=da.point.positions,jb=da.point.distances,kb=da.point.decays,wb=da.spot.colors,xb=da.spot.positions,Jb=da.spot.distances,
-yb=da.spot.directions,Kb=da.spot.anglesCos,Lb=da.spot.exponents,Mb=da.spot.decays,zb=da.hemi.skyColors,Ab=da.hemi.groundColors,Bb=da.hemi.positions,$a=0,La=0,wa=0,Sa=0,Cb=0,Db=0,Eb=0,gb=0,ab=0,bb=0,Da=0,Ta=0;ba=0;for(qa=b.length;ba<qa;ba++)Y=b[ba],Y.onlyShadow||(Ka=Y.color,Ra=Y.intensity,rb=Y.distance,Y instanceof THREE.AmbientLight?Y.visible&&(ob+=Ka.r,pb+=Ka.g,qb+=Ka.b):Y instanceof THREE.DirectionalLight?(Cb+=1,Y.visible&&(ga.setFromMatrixPosition(Y.matrixWorld),ka.setFromMatrixPosition(Y.target.matrixWorld),
-ga.sub(ka),ga.normalize(),ab=3*$a,tb[ab+0]=ga.x,tb[ab+1]=ga.y,tb[ab+2]=ga.z,A(sb,ab,Ka,Ra),$a+=1)):Y instanceof THREE.PointLight?(Db+=1,Y.visible&&(bb=3*La,A(ub,bb,Ka,Ra),ka.setFromMatrixPosition(Y.matrixWorld),vb[bb+0]=ka.x,vb[bb+1]=ka.y,vb[bb+2]=ka.z,jb[La]=rb,kb[La]=0===Y.distance?0:Y.decay,La+=1)):Y instanceof THREE.SpotLight?(Eb+=1,Y.visible&&(Da=3*wa,A(wb,Da,Ka,Ra),ga.setFromMatrixPosition(Y.matrixWorld),xb[Da+0]=ga.x,xb[Da+1]=ga.y,xb[Da+2]=ga.z,Jb[wa]=rb,ka.setFromMatrixPosition(Y.target.matrixWorld),
-ga.sub(ka),ga.normalize(),yb[Da+0]=ga.x,yb[Da+1]=ga.y,yb[Da+2]=ga.z,Kb[wa]=Math.cos(Y.angle),Lb[wa]=Y.exponent,Mb[wa]=0===Y.distance?0:Y.decay,wa+=1)):Y instanceof THREE.HemisphereLight&&(gb+=1,Y.visible&&(ga.setFromMatrixPosition(Y.matrixWorld),ga.normalize(),Ta=3*Sa,Bb[Ta+0]=ga.x,Bb[Ta+1]=ga.y,Bb[Ta+2]=ga.z,Ya=Y.color,db=Y.groundColor,A(zb,Ta,Ya,Ra),A(Ab,Ta,db,Ra),Sa+=1)));ba=3*$a;for(qa=Math.max(sb.length,3*Cb);ba<qa;ba++)sb[ba]=0;ba=3*La;for(qa=Math.max(ub.length,3*Db);ba<qa;ba++)ub[ba]=0;ba=
-3*wa;for(qa=Math.max(wb.length,3*Eb);ba<qa;ba++)wb[ba]=0;ba=3*Sa;for(qa=Math.max(zb.length,3*gb);ba<qa;ba++)zb[ba]=0;ba=3*Sa;for(qa=Math.max(Ab.length,3*gb);ba<qa;ba++)Ab[ba]=0;da.directional.length=$a;da.point.length=La;da.spot.length=wa;da.hemi.length=Sa;da.ambient[0]=ob;da.ambient[1]=pb;da.ambient[2]=qb;eb=!1}if(ya){var ia=Qb;I.ambientLightColor.value=ia.ambient;I.directionalLightColor.value=ia.directional.colors;I.directionalLightDirection.value=ia.directional.positions;I.pointLightColor.value=
+THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===R&&(a*=d,b*=d,c*=d);t.clearColor(a,b,c,d)}function c(){L.init();t.viewport(Fa,Ga,Aa,va);b($.r,$.g,$.b,ea)}function d(){Xa=mb=null;Ha="";Ya=-1;fb=!0;L.reset()}function e(a){a.preventDefault();d();c();Z.clear()}function g(a){a=a.target;a.removeEventListener("dispose",g);a:{var b=Z.get(a);if(a.image&&b.__image__webglTextureCube)t.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;t.deleteTexture(b.__webglTexture)}Z.delete(a)}Ba.textures--}
+function f(a){a=a.target;a.removeEventListener("dispose",f);var b=Z.get(a);if(a&&void 0!==b.__webglTexture){t.deleteTexture(b.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var c=0;6>c;c++)t.deleteFramebuffer(b.__webglFramebuffer[c]),t.deleteRenderbuffer(b.__webglRenderbuffer[c]);else t.deleteFramebuffer(b.__webglFramebuffer),t.deleteRenderbuffer(b.__webglRenderbuffer);Z.delete(a)}Ba.textures--}function h(a){a=a.target;a.removeEventListener("dispose",h);k(a);Z.delete(a)}function k(a){var b=
+Z.get(a).program.program;if(void 0!==b){a.program=void 0;a=0;for(var c=ta.length;a!==c;++a){var d=ta[a];if(d.program===b){0===--d.usedTimes&&(c-=1,ta[a]=ta[c],ta.pop(),t.deleteProgram(b),Ba.programs=c);break}}}}function m(a,b){return b[0]-a[0]}function n(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 l(a){if(!1!==a.visible){if(a instanceof THREE.Light)aa.push(a);else if(a instanceof THREE.Sprite)Ra.push(a);else if(a instanceof THREE.LensFlare)Ia.push(a);else if(a instanceof THREE.ImmediateRenderObject){var b=a.material;b.transparent?za.push(a):la.push(a)}else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud)if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),
+!1===a.frustumCulled||!0===Za.intersectsObject(a))if(b=a.material,!0===b.visible){if(b instanceof THREE.MeshFaceMaterial)for(var c=b.materials,d=0,e=c.length;d<e;d++)c[d].program=Z.get(c[d]).program;else b.program=Z.get(b).program;!0===ja.sortObjects&&(ka.setFromMatrixPosition(a.matrixWorld),ka.applyProjection(Ja));d={id:a.id,object:a,z:ka.z};b.transparent?sa.push(d):oa.push(d)}a=a.children;d=0;for(e=a.length;d<e;d++)l(a[d])}}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=wa.update(k);k.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,k.matrixWorld);k.normalMatrix.getNormalMatrix(k.modelViewMatrix);void 0===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var m=l.groups,n=f.materials,p=0,q=m.length;p<q;p++){var s=m[p],t=n[s.materialIndex];void 0!==t&&ja.renderBufferDirect(b,c,d,l,t,k,s)}else ja.renderBufferDirect(b,c,d,l,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];k.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
+k.matrixWorld);k.normalMatrix.getNormalMatrix(k.modelViewMatrix);void 0===e&&(f=k.material);r(f);var l=u(b,c,d,f,k);Ha="";k.render(function(a){ja.renderBufferImmediate(a,l,f)})}}function r(a){a.side!==THREE.DoubleSide?L.enable(t.CULL_FACE):L.disable(t.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 u(a,b,c,d,e){var f,l,m,n;gb=0;var p=Z.get(d);if(d.needsUpdate||!p.program){a:{for(var q=Z.get(d),s=ac[d.type],r=0,u=0,y=0,z=0,B=0,E=b.length;B<E;B++){var D=b[B];D.onlyShadow||!1===D.visible||(D instanceof THREE.DirectionalLight&&r++,D instanceof THREE.PointLight&&u++,D instanceof THREE.SpotLight&&y++,D instanceof THREE.HemisphereLight&&z++)}f=r;l=u;m=
+y;n=z;for(var K,H=0,O=0,Q=b.length;O<Q;O++){var oa=b[O];oa.castShadow&&(oa instanceof THREE.SpotLight&&H++,oa instanceof THREE.DirectionalLight&&H++)}K=H;var P;if(nb&&e&&e.skeleton&&e.skeleton.useVertexTexture)P=1024;else{var R=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),T=Math.floor((R-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(T=Math.min(e.skeleton.bones.length,T),T<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+
+T+" (try OpenGL instead of ANGLE)"));P=T}var U=G;null!==d.precision&&(U=L.getMaxPrecision(d.precision),U!==d.precision&&console.warn("THREE.WebGLRenderer.initMaterial:",d.precision,"not supported, using",U,"instead."));var za={precision:U,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:F,skinning:d.skinning,maxBones:P,useVertexTexture:nb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:ja.maxMorphTargets,maxMorphNormals:ja.maxMorphNormals,maxDirLights:f,maxPointLights:l,maxSpotLights:m,maxHemiLights:n,maxShadows:K,shadowMapEnabled:ma.enabled&&
+e.receiveShadow&&0<K,shadowMapType:ma.type,shadowMapDebug:ma.debug,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},la=[];s?la.push(s):(la.push(d.fragmentShader),la.push(d.vertexShader));if(void 0!==d.defines)for(var sa in d.defines)la.push(sa),la.push(d.defines[sa]);for(sa in za)la.push(sa),la.push(za[sa]);var X=la.join(),aa=!0;if(q.program)if(q.program.code!==X)k(d);else if(void 0!==s)break a;else aa=!1;else d.addEventListener("dispose",
+h);if(s){var Ia=THREE.ShaderLib[s];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(Ia.uniforms),vertexShader:Ia.vertexShader,fragmentShader:Ia.fragmentShader}}else q.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var $,ea=0,jb=ta.length;ea<jb;ea++){var Ra=ta[ea];if(Ra.code===X){$=Ra;aa&&$.usedTimes++;break}}void 0===$&&(d.__webglShader=q.__webglShader,$=new THREE.WebGLProgram(ja,X,d,za),ta.push($),Ba.programs=ta.length);
+q.program=$;var ua=$.getAttributes();if(d.morphTargets)for(var Ka=d.numSupportedMorphTargets=0;Ka<ja.maxMorphTargets;Ka++)0<=ua["morphTarget"+Ka]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(Ka=d.numSupportedMorphNormals=0;Ka<ja.maxMorphNormals;Ka++)0<=ua["morphNormal"+Ka]&&d.numSupportedMorphNormals++;q.uniformsList=[];var Ha=q.program.getUniforms(),wa;for(wa in q.__webglShader.uniforms){var Fa=Ha[wa];Fa&&q.uniformsList.push([q.__webglShader.uniforms[wa],Fa])}}d.needsUpdate=!1}var Ga=!1,Aa=
+!1,va=!1,$a=p.program,ca=$a.getUniforms(),I=p.__webglShader.uniforms;$a.id!==mb&&(t.useProgram($a.program),mb=$a.id,va=Aa=Ga=!0);d.id!==Ya&&(-1===Ya&&(va=!0),Ya=d.id,Aa=!0);if(Ga||a!==Xa)t.uniformMatrix4fv(ca.projectionMatrix,!1,a.projectionMatrix.elements),F&&t.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&&(ka.setFromMatrixPosition(a.matrixWorld),t.uniform3f(ca.cameraPosition,
+ka.x,ka.y,ka.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&void 0!==ca.viewMatrix&&t.uniformMatrix4fv(ca.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&void 0!==ca.bindMatrix&&t.uniformMatrix4fv(ca.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&void 0!==ca.bindMatrixInverse&&t.uniformMatrix4fv(ca.bindMatrixInverse,!1,e.bindMatrixInverse.elements),
+nb&&e.skeleton&&e.skeleton.useVertexTexture){if(void 0!==ca.boneTexture){var Qa=v();t.uniform1i(ca.boneTexture,Qa);ja.setTexture(e.skeleton.boneTexture,Qa)}void 0!==ca.boneTextureWidth&&t.uniform1i(ca.boneTextureWidth,e.skeleton.boneTextureWidth);void 0!==ca.boneTextureHeight&&t.uniform1i(ca.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&void 0!==ca.boneGlobalMatrices&&t.uniformMatrix4fv(ca.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(Aa){c&&d.fog&&
+(I.fogColor.value=c.color,c instanceof THREE.Fog?(I.fogNear.value=c.near,I.fogFar.value=c.far):c instanceof THREE.FogExp2&&(I.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(fb){var va=!0,ba,pa,Y,Ja=0,pb=0,qb=0,La,Za,eb,Sa,rb,da=Qb,sb=da.directional.colors,tb=da.directional.positions,ub=da.point.colors,vb=da.point.positions,kb=da.point.distances,lb=da.point.decays,wb=da.spot.colors,xb=da.spot.positions,Jb=da.spot.distances,
+yb=da.spot.directions,Kb=da.spot.anglesCos,Lb=da.spot.exponents,Mb=da.spot.decays,zb=da.hemi.skyColors,Ab=da.hemi.groundColors,Bb=da.hemi.positions,ab=0,Ma=0,xa=0,Ta=0,Cb=0,Db=0,Eb=0,hb=0,bb=0,cb=0,Ca=0,Ua=0;ba=0;for(pa=b.length;ba<pa;ba++)Y=b[ba],Y.onlyShadow||(La=Y.color,Sa=Y.intensity,rb=Y.distance,Y instanceof THREE.AmbientLight?Y.visible&&(Ja+=La.r,pb+=La.g,qb+=La.b):Y instanceof THREE.DirectionalLight?(Cb+=1,Y.visible&&(ga.setFromMatrixPosition(Y.matrixWorld),ka.setFromMatrixPosition(Y.target.matrixWorld),
+ga.sub(ka),ga.normalize(),bb=3*ab,tb[bb+0]=ga.x,tb[bb+1]=ga.y,tb[bb+2]=ga.z,A(sb,bb,La,Sa),ab+=1)):Y instanceof THREE.PointLight?(Db+=1,Y.visible&&(cb=3*Ma,A(ub,cb,La,Sa),ka.setFromMatrixPosition(Y.matrixWorld),vb[cb+0]=ka.x,vb[cb+1]=ka.y,vb[cb+2]=ka.z,kb[Ma]=rb,lb[Ma]=0===Y.distance?0:Y.decay,Ma+=1)):Y instanceof THREE.SpotLight?(Eb+=1,Y.visible&&(Ca=3*xa,A(wb,Ca,La,Sa),ga.setFromMatrixPosition(Y.matrixWorld),xb[Ca+0]=ga.x,xb[Ca+1]=ga.y,xb[Ca+2]=ga.z,Jb[xa]=rb,ka.setFromMatrixPosition(Y.target.matrixWorld),
+ga.sub(ka),ga.normalize(),yb[Ca+0]=ga.x,yb[Ca+1]=ga.y,yb[Ca+2]=ga.z,Kb[xa]=Math.cos(Y.angle),Lb[xa]=Y.exponent,Mb[xa]=0===Y.distance?0:Y.decay,xa+=1)):Y instanceof THREE.HemisphereLight&&(hb+=1,Y.visible&&(ga.setFromMatrixPosition(Y.matrixWorld),ga.normalize(),Ua=3*Ta,Bb[Ua+0]=ga.x,Bb[Ua+1]=ga.y,Bb[Ua+2]=ga.z,Za=Y.color,eb=Y.groundColor,A(zb,Ua,Za,Sa),A(Ab,Ua,eb,Sa),Ta+=1)));ba=3*ab;for(pa=Math.max(sb.length,3*Cb);ba<pa;ba++)sb[ba]=0;ba=3*Ma;for(pa=Math.max(ub.length,3*Db);ba<pa;ba++)ub[ba]=0;ba=
+3*xa;for(pa=Math.max(wb.length,3*Eb);ba<pa;ba++)wb[ba]=0;ba=3*Ta;for(pa=Math.max(zb.length,3*hb);ba<pa;ba++)zb[ba]=0;ba=3*Ta;for(pa=Math.max(Ab.length,3*hb);ba<pa;ba++)Ab[ba]=0;da.directional.length=ab;da.point.length=Ma;da.spot.length=xa;da.hemi.length=Ta;da.ambient[0]=Ja;da.ambient[1]=pb;da.ambient[2]=qb;fb=!1}if(va){var ia=Qb;I.ambientLightColor.value=ia.ambient;I.directionalLightColor.value=ia.directional.colors;I.directionalLightDirection.value=ia.directional.positions;I.pointLightColor.value=
 ia.point.colors;I.pointLightPosition.value=ia.point.positions;I.pointLightDistance.value=ia.point.distances;I.pointLightDecay.value=ia.point.decays;I.spotLightColor.value=ia.spot.colors;I.spotLightPosition.value=ia.spot.positions;I.spotLightDistance.value=ia.spot.distances;I.spotLightDirection.value=ia.spot.directions;I.spotLightAngleCos.value=ia.spot.anglesCos;I.spotLightExponent.value=ia.spot.exponents;I.spotLightDecay.value=ia.spot.decays;I.hemisphereLightSkyColor.value=ia.hemi.skyColors;I.hemisphereLightGroundColor.value=
 ia.point.colors;I.pointLightPosition.value=ia.point.positions;I.pointLightDistance.value=ia.point.distances;I.pointLightDecay.value=ia.point.decays;I.spotLightColor.value=ia.spot.colors;I.spotLightPosition.value=ia.spot.positions;I.spotLightDistance.value=ia.spot.distances;I.spotLightDirection.value=ia.spot.directions;I.spotLightAngleCos.value=ia.spot.anglesCos;I.spotLightExponent.value=ia.spot.exponents;I.spotLightDecay.value=ia.spot.decays;I.hemisphereLightSkyColor.value=ia.hemi.skyColors;I.hemisphereLightGroundColor.value=
-ia.hemi.groundColors;I.hemisphereLightDirection.value=ia.hemi.positions;v(I,!0)}else v(I,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){I.opacity.value=d.opacity;I.diffuse.value=d.color;I.map.value=d.map;I.specularMap.value=d.specularMap;I.alphaMap.value=d.alphaMap;d.bumpMap&&(I.bumpMap.value=d.bumpMap,I.bumpScale.value=d.bumpScale);d.normalMap&&(I.normalMap.value=d.normalMap,I.normalScale.value.copy(d.normalScale));var xa;
-d.map?xa=d.map:d.specularMap?xa=d.specularMap:d.normalMap?xa=d.normalMap:d.bumpMap?xa=d.bumpMap:d.alphaMap?xa=d.alphaMap:d.emissiveMap&&(xa=d.emissiveMap);if(void 0!==xa){var Rb=xa.offset,Sb=xa.repeat;I.offsetRepeat.value.set(Rb.x,Rb.y,Sb.x,Sb.y)}I.envMap.value=d.envMap;I.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;I.reflectivity.value=d.reflectivity;I.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)I.diffuse.value=d.color,I.opacity.value=
+ia.hemi.groundColors;I.hemisphereLightDirection.value=ia.hemi.positions;x(I,!0)}else x(I,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){I.opacity.value=d.opacity;I.diffuse.value=d.color;I.map.value=d.map;I.specularMap.value=d.specularMap;I.alphaMap.value=d.alphaMap;d.bumpMap&&(I.bumpMap.value=d.bumpMap,I.bumpScale.value=d.bumpScale);d.normalMap&&(I.normalMap.value=d.normalMap,I.normalScale.value.copy(d.normalScale));var ya;
+d.map?ya=d.map:d.specularMap?ya=d.specularMap:d.normalMap?ya=d.normalMap:d.bumpMap?ya=d.bumpMap:d.alphaMap?ya=d.alphaMap:d.emissiveMap&&(ya=d.emissiveMap);if(void 0!==ya){var Rb=ya.offset,Sb=ya.repeat;I.offsetRepeat.value.set(Rb.x,Rb.y,Sb.x,Sb.y)}I.envMap.value=d.envMap;I.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;I.reflectivity.value=d.reflectivity;I.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)I.diffuse.value=d.color,I.opacity.value=
 d.opacity;else if(d instanceof THREE.LineDashedMaterial)I.diffuse.value=d.color,I.opacity.value=d.opacity,I.dashSize.value=d.dashSize,I.totalSize.value=d.dashSize+d.gapSize,I.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(I.psColor.value=d.color,I.opacity.value=d.opacity,I.size.value=d.size,I.scale.value=J.height/2,I.map.value=d.map,null!==d.map){var Tb=d.map.offset,Ub=d.map.repeat;I.offsetRepeat.value.set(Tb.x,Tb.y,Ub.x,Ub.y)}}else d instanceof THREE.MeshPhongMaterial?(I.shininess.value=
 d.opacity;else if(d instanceof THREE.LineDashedMaterial)I.diffuse.value=d.color,I.opacity.value=d.opacity,I.dashSize.value=d.dashSize,I.totalSize.value=d.dashSize+d.gapSize,I.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(I.psColor.value=d.color,I.opacity.value=d.opacity,I.size.value=d.size,I.scale.value=J.height/2,I.map.value=d.map,null!==d.map){var Tb=d.map.offset,Ub=d.map.repeat;I.offsetRepeat.value.set(Tb.x,Tb.y,Ub.x,Ub.y)}}else d instanceof THREE.MeshPhongMaterial?(I.shininess.value=
 d.shininess,I.emissive.value=d.emissive,I.specular.value=d.specular,I.lightMap.value=d.lightMap,I.lightMapIntensity.value=d.lightMapIntensity,I.aoMap.value=d.aoMap,I.aoMapIntensity.value=d.aoMapIntensity,I.emissiveMap.value=d.emissiveMap):d instanceof THREE.MeshLambertMaterial?I.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?(I.aoMap.value=d.aoMap,I.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(I.mNear.value=a.near,I.mFar.value=a.far,I.opacity.value=
 d.shininess,I.emissive.value=d.emissive,I.specular.value=d.specular,I.lightMap.value=d.lightMap,I.lightMapIntensity.value=d.lightMapIntensity,I.aoMap.value=d.aoMap,I.aoMapIntensity.value=d.aoMapIntensity,I.emissiveMap.value=d.emissiveMap):d instanceof THREE.MeshLambertMaterial?I.emissive.value=d.emissive:d instanceof THREE.MeshBasicMaterial?(I.aoMap.value=d.aoMap,I.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshDepthMaterial?(I.mNear.value=a.near,I.mFar.value=a.far,I.opacity.value=
-d.opacity):d instanceof THREE.MeshNormalMaterial&&(I.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&I.shadowMatrix)for(var Ua=0,Fb=0,Nb=b.length;Fb<Nb;Fb++){var Ea=b[Fb];Ea.castShadow&&(Ea instanceof THREE.SpotLight||Ea instanceof THREE.DirectionalLight)&&(I.shadowMap.value[Ua]=Ea.shadowMap,I.shadowMapSize.value[Ua]=Ea.shadowMapSize,I.shadowMatrix.value[Ua]=Ea.shadowMatrix,I.shadowDarkness.value[Ua]=Ea.shadowDarkness,I.shadowBias.value[Ua]=Ea.shadowBias,Ua++)}for(var Gb=p.uniformsList,
-ra,Ma,sa,hb=0,Ob=Gb.length;hb<Ob;hb++){var V=Gb[hb][0];if(!1!==V.needsUpdate){var Vb=V.type,N=V.value,W=Gb[hb][1];switch(Vb){case "1i":s.uniform1i(W,N);break;case "1f":s.uniform1f(W,N);break;case "2f":s.uniform2f(W,N[0],N[1]);break;case "3f":s.uniform3f(W,N[0],N[1],N[2]);break;case "4f":s.uniform4f(W,N[0],N[1],N[2],N[3]);break;case "1iv":s.uniform1iv(W,N);break;case "3iv":s.uniform3iv(W,N);break;case "1fv":s.uniform1fv(W,N);break;case "2fv":s.uniform2fv(W,N);break;case "3fv":s.uniform3fv(W,N);break;
-case "4fv":s.uniform4fv(W,N);break;case "Matrix3fv":s.uniformMatrix3fv(W,!1,N);break;case "Matrix4fv":s.uniformMatrix4fv(W,!1,N);break;case "i":s.uniform1i(W,N);break;case "f":s.uniform1f(W,N);break;case "v2":s.uniform2f(W,N.x,N.y);break;case "v3":s.uniform3f(W,N.x,N.y,N.z);break;case "v4":s.uniform4f(W,N.x,N.y,N.z,N.w);break;case "c":s.uniform3f(W,N.r,N.g,N.b);break;case "iv1":s.uniform1iv(W,N);break;case "iv":s.uniform3iv(W,N);break;case "fv1":s.uniform1fv(W,N);break;case "fv":s.uniform3fv(W,N);
-break;case "v2v":void 0===V._array&&(V._array=new Float32Array(2*N.length));for(var S=0,oa=N.length;S<oa;S++)sa=2*S,V._array[sa+0]=N[S].x,V._array[sa+1]=N[S].y;s.uniform2fv(W,V._array);break;case "v3v":void 0===V._array&&(V._array=new Float32Array(3*N.length));S=0;for(oa=N.length;S<oa;S++)sa=3*S,V._array[sa+0]=N[S].x,V._array[sa+1]=N[S].y,V._array[sa+2]=N[S].z;s.uniform3fv(W,V._array);break;case "v4v":void 0===V._array&&(V._array=new Float32Array(4*N.length));S=0;for(oa=N.length;S<oa;S++)sa=4*S,V._array[sa+
-0]=N[S].x,V._array[sa+1]=N[S].y,V._array[sa+2]=N[S].z,V._array[sa+3]=N[S].w;s.uniform4fv(W,V._array);break;case "m3":s.uniformMatrix3fv(W,!1,N.elements);break;case "m3v":void 0===V._array&&(V._array=new Float32Array(9*N.length));S=0;for(oa=N.length;S<oa;S++)N[S].flattenToArrayOffset(V._array,9*S);s.uniformMatrix3fv(W,!1,V._array);break;case "m4":s.uniformMatrix4fv(W,!1,N.elements);break;case "m4v":void 0===V._array&&(V._array=new Float32Array(16*N.length));S=0;for(oa=N.length;S<oa;S++)N[S].flattenToArrayOffset(V._array,
-16*S);s.uniformMatrix4fv(W,!1,V._array);break;case "t":ra=N;Ma=w();s.uniform1i(W,Ma);if(!ra)continue;if(ra instanceof THREE.CubeTexture||Array.isArray(ra.image)&&6===ra.image.length){var fa=ra,Wb=Ma,Va=Z.get(fa);if(6===fa.image.length)if(0<fa.version&&Va.__version!==fa.version){Va.__image__webglTextureCube||(fa.addEventListener("dispose",g),Va.__image__webglTextureCube=s.createTexture(),Ca.textures++);L.activeTexture(s.TEXTURE0+Wb);L.bindTexture(s.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,
-fa.flipY);for(var Xb=fa instanceof THREE.CompressedTexture,Hb=fa.image[0]instanceof THREE.DataTexture,Na=[],ha=0;6>ha;ha++)Na[ha]=!ja.autoScaleCubemaps||Xb||Hb?Hb?fa.image[ha].image:fa.image[ha]:C(fa.image[ha],bc);var Yb=Na[0],Zb=THREE.Math.isPowerOfTwo(Yb.width)&&THREE.Math.isPowerOfTwo(Yb.height),Fa=M(fa.format),Ib=M(fa.type);x(s.TEXTURE_CUBE_MAP,fa,Zb);for(ha=0;6>ha;ha++)if(Xb)for(var Oa,$b=Na[ha].mipmaps,cb=0,Pb=$b.length;cb<Pb;cb++)Oa=$b[cb],fa.format!==THREE.RGBAFormat&&fa.format!==THREE.RGBFormat?
--1<L.getCompressedTextureFormats().indexOf(Fa)?L.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,cb,Fa,Oa.width,Oa.height,0,Oa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):L.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,cb,Fa,Oa.width,Oa.height,0,Fa,Ib,Oa.data);else Hb?L.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Fa,Na[ha].width,Na[ha].height,0,Fa,Ib,Na[ha].data):L.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Fa,Fa,Ib,
-Na[ha]);fa.generateMipmaps&&Zb&&s.generateMipmap(s.TEXTURE_CUBE_MAP);Va.__version=fa.version;if(fa.onUpdate)fa.onUpdate(fa)}else L.activeTexture(s.TEXTURE0+Wb),L.bindTexture(s.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube)}else if(ra instanceof THREE.WebGLRenderTargetCube){var cc=ra;L.activeTexture(s.TEXTURE0+Ma);L.bindTexture(s.TEXTURE_CUBE_MAP,Z.get(cc).__webglTexture)}else ja.setTexture(ra,Ma);break;case "tv":void 0===V._array&&(V._array=[]);S=0;for(oa=V.value.length;S<oa;S++)V._array[S]=w();s.uniform1iv(W,
-V._array);S=0;for(oa=V.value.length;S<oa;S++)ra=V.value[S],Ma=V._array[S],ra&&ja.setTexture(ra,Ma);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Vb)}}}}s.uniformMatrix4fv(ca.modelViewMatrix,!1,e.modelViewMatrix.elements);ca.normalMatrix&&s.uniformMatrix3fv(ca.normalMatrix,!1,e.normalMatrix.elements);void 0!==ca.modelMatrix&&s.uniformMatrix4fv(ca.modelMatrix,!1,e.matrixWorld.elements);return Za}function v(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=
+d.opacity):d instanceof THREE.MeshNormalMaterial&&(I.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&I.shadowMatrix)for(var Va=0,Fb=0,Nb=b.length;Fb<Nb;Fb++){var Da=b[Fb];Da.castShadow&&(Da instanceof THREE.SpotLight||Da instanceof THREE.DirectionalLight)&&(I.shadowMap.value[Va]=Da.shadowMap,I.shadowMapSize.value[Va]=Da.shadowMapSize,I.shadowMatrix.value[Va]=Da.shadowMatrix,I.shadowDarkness.value[Va]=Da.shadowDarkness,I.shadowBias.value[Va]=Da.shadowBias,Va++)}for(var Gb=p.uniformsList,
+qa,Na,ra,ib=0,Ob=Gb.length;ib<Ob;ib++){var V=Gb[ib][0];if(!1!==V.needsUpdate){var Vb=V.type,M=V.value,W=Gb[ib][1];switch(Vb){case "1i":t.uniform1i(W,M);break;case "1f":t.uniform1f(W,M);break;case "2f":t.uniform2f(W,M[0],M[1]);break;case "3f":t.uniform3f(W,M[0],M[1],M[2]);break;case "4f":t.uniform4f(W,M[0],M[1],M[2],M[3]);break;case "1iv":t.uniform1iv(W,M);break;case "3iv":t.uniform3iv(W,M);break;case "1fv":t.uniform1fv(W,M);break;case "2fv":t.uniform2fv(W,M);break;case "3fv":t.uniform3fv(W,M);break;
+case "4fv":t.uniform4fv(W,M);break;case "Matrix3fv":t.uniformMatrix3fv(W,!1,M);break;case "Matrix4fv":t.uniformMatrix4fv(W,!1,M);break;case "i":t.uniform1i(W,M);break;case "f":t.uniform1f(W,M);break;case "v2":t.uniform2f(W,M.x,M.y);break;case "v3":t.uniform3f(W,M.x,M.y,M.z);break;case "v4":t.uniform4f(W,M.x,M.y,M.z,M.w);break;case "c":t.uniform3f(W,M.r,M.g,M.b);break;case "iv1":t.uniform1iv(W,M);break;case "iv":t.uniform3iv(W,M);break;case "fv1":t.uniform1fv(W,M);break;case "fv":t.uniform3fv(W,M);
+break;case "v2v":void 0===V._array&&(V._array=new Float32Array(2*M.length));for(var S=0,na=M.length;S<na;S++)ra=2*S,V._array[ra+0]=M[S].x,V._array[ra+1]=M[S].y;t.uniform2fv(W,V._array);break;case "v3v":void 0===V._array&&(V._array=new Float32Array(3*M.length));S=0;for(na=M.length;S<na;S++)ra=3*S,V._array[ra+0]=M[S].x,V._array[ra+1]=M[S].y,V._array[ra+2]=M[S].z;t.uniform3fv(W,V._array);break;case "v4v":void 0===V._array&&(V._array=new Float32Array(4*M.length));S=0;for(na=M.length;S<na;S++)ra=4*S,V._array[ra+
+0]=M[S].x,V._array[ra+1]=M[S].y,V._array[ra+2]=M[S].z,V._array[ra+3]=M[S].w;t.uniform4fv(W,V._array);break;case "m3":t.uniformMatrix3fv(W,!1,M.elements);break;case "m3v":void 0===V._array&&(V._array=new Float32Array(9*M.length));S=0;for(na=M.length;S<na;S++)M[S].flattenToArrayOffset(V._array,9*S);t.uniformMatrix3fv(W,!1,V._array);break;case "m4":t.uniformMatrix4fv(W,!1,M.elements);break;case "m4v":void 0===V._array&&(V._array=new Float32Array(16*M.length));S=0;for(na=M.length;S<na;S++)M[S].flattenToArrayOffset(V._array,
+16*S);t.uniformMatrix4fv(W,!1,V._array);break;case "t":qa=M;Na=v();t.uniform1i(W,Na);if(!qa)continue;if(qa instanceof THREE.CubeTexture||Array.isArray(qa.image)&&6===qa.image.length){var fa=qa,Wb=Na,Wa=Z.get(fa);if(6===fa.image.length)if(0<fa.version&&Wa.__version!==fa.version){Wa.__image__webglTextureCube||(fa.addEventListener("dispose",g),Wa.__image__webglTextureCube=t.createTexture(),Ba.textures++);L.activeTexture(t.TEXTURE0+Wb);L.bindTexture(t.TEXTURE_CUBE_MAP,Wa.__image__webglTextureCube);t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,
+fa.flipY);for(var Xb=fa instanceof THREE.CompressedTexture,Hb=fa.image[0]instanceof THREE.DataTexture,Oa=[],ha=0;6>ha;ha++)Oa[ha]=!ja.autoScaleCubemaps||Xb||Hb?Hb?fa.image[ha].image:fa.image[ha]:C(fa.image[ha],bc);var Yb=Oa[0],Zb=THREE.Math.isPowerOfTwo(Yb.width)&&THREE.Math.isPowerOfTwo(Yb.height),Ea=N(fa.format),Ib=N(fa.type);w(t.TEXTURE_CUBE_MAP,fa,Zb);for(ha=0;6>ha;ha++)if(Xb)for(var Pa,$b=Oa[ha].mipmaps,db=0,Pb=$b.length;db<Pb;db++)Pa=$b[db],fa.format!==THREE.RGBAFormat&&fa.format!==THREE.RGBFormat?
+-1<L.getCompressedTextureFormats().indexOf(Ea)?L.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ha,db,Ea,Pa.width,Pa.height,0,Pa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):L.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ha,db,Ea,Pa.width,Pa.height,0,Ea,Ib,Pa.data);else Hb?L.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Ea,Oa[ha].width,Oa[ha].height,0,Ea,Ib,Oa[ha].data):L.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Ea,Ea,Ib,
+Oa[ha]);fa.generateMipmaps&&Zb&&t.generateMipmap(t.TEXTURE_CUBE_MAP);Wa.__version=fa.version;if(fa.onUpdate)fa.onUpdate(fa)}else L.activeTexture(t.TEXTURE0+Wb),L.bindTexture(t.TEXTURE_CUBE_MAP,Wa.__image__webglTextureCube)}else if(qa instanceof THREE.WebGLRenderTargetCube){var cc=qa;L.activeTexture(t.TEXTURE0+Na);L.bindTexture(t.TEXTURE_CUBE_MAP,Z.get(cc).__webglTexture)}else ja.setTexture(qa,Na);break;case "tv":void 0===V._array&&(V._array=[]);S=0;for(na=V.value.length;S<na;S++)V._array[S]=v();t.uniform1iv(W,
+V._array);S=0;for(na=V.value.length;S<na;S++)qa=V.value[S],Na=V._array[S],qa&&ja.setTexture(qa,Na);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Vb)}}}}t.uniformMatrix4fv(ca.modelViewMatrix,!1,e.modelViewMatrix.elements);ca.normalMatrix&&t.uniformMatrix3fv(ca.normalMatrix,!1,e.normalMatrix.elements);void 0!==ca.modelMatrix&&t.uniformMatrix4fv(ca.modelMatrix,!1,e.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;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 w(){var a=fb;a>=db&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+db);fb+=1;return a}function A(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function x(a,b,c){c?(s.texParameteri(a,s.TEXTURE_WRAP_S,M(b.wrapS)),s.texParameteri(a,s.TEXTURE_WRAP_T,M(b.wrapT)),s.texParameteri(a,s.TEXTURE_MAG_FILTER,M(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,M(b.minFilter))):(s.texParameteri(a,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(a,s.TEXTURE_WRAP_T,
-s.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),s.texParameteri(a,s.TEXTURE_MAG_FILTER,B(b.magFilter)),s.texParameteri(a,s.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=X.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||Z.get(b).__currentAnisotropy)&&(s.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,ja.getMaxAnisotropy())),Z.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 y(a,b,c){s.bindFramebuffer(s.FRAMEBUFFER,a);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,c,Z.get(b).__webglTexture,0)}function z(a,b){s.bindRenderbuffer(s.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,
-s.DEPTH_ATTACHMENT,s.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)):s.renderbufferStorage(s.RENDERBUFFER,s.RGBA4,b.width,b.height)}function B(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?s.NEAREST:s.LINEAR}function M(a){var b;if(a===THREE.RepeatWrapping)return s.REPEAT;if(a===THREE.ClampToEdgeWrapping)return s.CLAMP_TO_EDGE;
-if(a===THREE.MirroredRepeatWrapping)return s.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return s.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return s.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return s.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return s.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return s.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return s.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return s.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return s.UNSIGNED_SHORT_4_4_4_4;
-if(a===THREE.UnsignedShort5551Type)return s.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return s.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return s.BYTE;if(a===THREE.ShortType)return s.SHORT;if(a===THREE.UnsignedShortType)return s.UNSIGNED_SHORT;if(a===THREE.IntType)return s.INT;if(a===THREE.UnsignedIntType)return s.UNSIGNED_INT;if(a===THREE.FloatType)return s.FLOAT;b=X.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return s.ALPHA;
-if(a===THREE.RGBFormat)return s.RGB;if(a===THREE.RGBAFormat)return s.RGBA;if(a===THREE.LuminanceFormat)return s.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return s.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return s.FUNC_ADD;if(a===THREE.SubtractEquation)return s.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return s.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return s.ZERO;if(a===THREE.OneFactor)return s.ONE;if(a===THREE.SrcColorFactor)return s.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return s.ONE_MINUS_SRC_COLOR;
-if(a===THREE.SrcAlphaFactor)return s.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return s.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return s.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return s.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return s.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return s.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return s.SRC_ALPHA_SATURATE;b=X.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;
+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 A(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?(t.texParameteri(a,t.TEXTURE_WRAP_S,N(b.wrapS)),t.texParameteri(a,t.TEXTURE_WRAP_T,N(b.wrapT)),t.texParameteri(a,t.TEXTURE_MAG_FILTER,N(b.magFilter)),t.texParameteri(a,t.TEXTURE_MIN_FILTER,N(b.minFilter))):(t.texParameteri(a,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(a,t.TEXTURE_WRAP_T,
+t.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+" )"),t.texParameteri(a,t.TEXTURE_MAG_FILTER,B(b.magFilter)),t.texParameteri(a,t.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=X.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||Z.get(b).__currentAnisotropy)&&(t.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,ja.getMaxAnisotropy())),Z.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 y(a,b,c){t.bindFramebuffer(t.FRAMEBUFFER,a);t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,c,Z.get(b).__webglTexture,0)}function z(a,b){t.bindRenderbuffer(t.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,b.width,b.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,
+t.DEPTH_ATTACHMENT,t.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,b.width,b.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,a)):t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,b.width,b.height)}function B(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?t.NEAREST:t.LINEAR}function N(a){var b;if(a===THREE.RepeatWrapping)return t.REPEAT;if(a===THREE.ClampToEdgeWrapping)return t.CLAMP_TO_EDGE;
+if(a===THREE.MirroredRepeatWrapping)return t.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return t.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return t.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return t.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return t.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return t.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return t.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return t.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return t.UNSIGNED_SHORT_4_4_4_4;
+if(a===THREE.UnsignedShort5551Type)return t.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return t.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return t.BYTE;if(a===THREE.ShortType)return t.SHORT;if(a===THREE.UnsignedShortType)return t.UNSIGNED_SHORT;if(a===THREE.IntType)return t.INT;if(a===THREE.UnsignedIntType)return t.UNSIGNED_INT;if(a===THREE.FloatType)return t.FLOAT;b=X.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return t.ALPHA;
+if(a===THREE.RGBFormat)return t.RGB;if(a===THREE.RGBAFormat)return t.RGBA;if(a===THREE.LuminanceFormat)return t.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return t.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return t.FUNC_ADD;if(a===THREE.SubtractEquation)return t.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return t.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return t.ZERO;if(a===THREE.OneFactor)return t.ONE;if(a===THREE.SrcColorFactor)return t.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return t.ONE_MINUS_SRC_COLOR;
+if(a===THREE.SrcAlphaFactor)return t.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return t.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return t.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return t.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return t.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return t.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return t.SRC_ALPHA_SATURATE;b=X.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=X.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_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=X.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=X.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 J=void 0!==a.canvas?a.canvas:document.createElement("canvas"),E=void 0!==a.context?a.context:null,P=J.width,K=J.height,D=1,G=void 0!==a.precision?a.precision:"highp",H=void 0!==a.alpha?a.alpha:!1,O=void 0!==a.depth?a.depth:!0,
 if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=X.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 J=void 0!==a.canvas?a.canvas:document.createElement("canvas"),E=void 0!==a.context?a.context:null,P=J.width,K=J.height,D=1,G=void 0!==a.precision?a.precision:"highp",H=void 0!==a.alpha?a.alpha:!1,O=void 0!==a.depth?a.depth:!0,
-Q=void 0!==a.stencil?a.stencil:!0,T=void 0!==a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,U=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,F=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,$=new THREE.Color(0),ea=0,aa=[],pa=[],ta=[],ma=[],za=[],ib=new Float32Array(8),Pa=[],Ja=[];this.domElement=J;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 ja=this,va=[],lb=null,ya=null,Xa=-1,Ia="",Wa=null,fb=0,Aa=0,Ga=0,Ha=J.width,Ba=J.height,jb=0,kb=0,Ya=new THREE.Frustum,Qa=new THREE.Matrix4,ka=new THREE.Vector3,ga=new THREE.Vector3,eb=!0,Qb={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},la={calls:0,vertices:0,faces:0,points:0};this.info={render:la,memory:Ca,programs:va};var s;try{a={alpha:H,depth:O,stencil:Q,antialias:T,premultipliedAlpha:R,preserveDrawingBuffer:U};s=E||J.getContext("webgl",a)||J.getContext("experimental-webgl",a);if(null===s){if(null!==J.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";
-}J.addEventListener("webglcontextlost",e,!1)}catch(Jb){console.error("THREE.WebGLRenderer: "+Jb)}var X=new THREE.WebGLExtensions(s);X.get("OES_texture_float");X.get("OES_texture_float_linear");X.get("OES_texture_half_float");X.get("OES_texture_half_float_linear");X.get("OES_standard_derivatives");X.get("ANGLE_instanced_arrays");X.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);F&&X.get("EXT_frag_depth");var L=new THREE.WebGLState(s,X,M),Z=new THREE.WebGLProperties,ua=new THREE.WebGLObjects(s,
-Z,this.info),Kb=new THREE.WebGLBufferRenderer(s,X,la),Lb=new THREE.WebGLIndexedBufferRenderer(s,X,la);c();this.context=s;this.extensions=X;this.state=L;var na=new THREE.WebGLShadowMap(this,aa,ua);this.shadowMap=na;var db=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),E=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Mb=s.getParameter(s.MAX_TEXTURE_SIZE),bc=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),nb=0<E,mb=nb&&X.get("OES_texture_float"),Nb=X.get("ANGLE_instanced_arrays"),E=L.getMaxPrecision(G);E!==
-G&&(console.warn("THREE.WebGLRenderer:",G,"not supported, using",E,"instead."),G=E);var Ob=new THREE.SpritePlugin(this,Pa),Pb=new THREE.LensFlarePlugin(this,Ja);this.getContext=function(){return s};this.getContextAttributes=function(){return s.getContextAttributes()};this.forceContextLoss=function(){X.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return nb};this.supportsInstancedArrays=function(){return Nb};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==
-a)return a;var b=X.get("EXT_texture_filter_anisotropic");return a=null!==b?s.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return G};this.getPixelRatio=function(){return D};this.setPixelRatio=function(a){void 0!==a&&(D=a)};this.getSize=function(){return{width:P,height:K}};this.setSize=function(a,b,c){P=a;K=b;J.width=a*D;J.height=b*D;!1!==c&&(J.style.width=a+"px",J.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Aa=a*D;Ga=b*D;Ha=
-c*D;Ba=d*D;s.viewport(Aa,Ga,Ha,Ba)};this.setScissor=function(a,b,c,d){s.scissor(a*D,b*D,c*D,d*D)};this.enableScissorTest=function(a){L.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|=s.COLOR_BUFFER_BIT;if(void 0===b||b)d|=s.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=
-s.STENCIL_BUFFER_BIT;s.clear(d)};this.clearColor=function(){s.clear(s.COLOR_BUFFER_BIT)};this.clearDepth=function(){s.clear(s.DEPTH_BUFFER_BIT)};this.clearStencil=function(){s.clear(s.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){J.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){L.initAttributes();var d=Z.get(a);a.hasPositions&&!d.position&&(d.position=s.createBuffer());
-a.hasNormals&&!d.normal&&(d.normal=s.createBuffer());a.hasUvs&&!d.uv&&(d.uv=s.createBuffer());a.hasColors&&!d.color&&(d.color=s.createBuffer());b=b.getAttributes();a.hasPositions&&(s.bindBuffer(s.ARRAY_BUFFER,d.position),s.bufferData(s.ARRAY_BUFFER,a.positionArray,s.DYNAMIC_DRAW),L.enableAttribute(b.position),s.vertexAttribPointer(b.position,3,s.FLOAT,!1,0,0));if(a.hasNormals){s.bindBuffer(s.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==c.type&&c.shading===THREE.FlatShading)for(var e=0,f=3*a.count;e<
-f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}s.bufferData(s.ARRAY_BUFFER,a.normalArray,s.DYNAMIC_DRAW);L.enableAttribute(b.normal);s.vertexAttribPointer(b.normal,3,s.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(s.bindBuffer(s.ARRAY_BUFFER,d.uv),s.bufferData(s.ARRAY_BUFFER,a.uvArray,s.DYNAMIC_DRAW),L.enableAttribute(b.uv),s.vertexAttribPointer(b.uv,2,s.FLOAT,!1,0,0));
-a.hasColors&&c.vertexColors!==THREE.NoColors&&(s.bindBuffer(s.ARRAY_BUFFER,d.color),s.bufferData(s.ARRAY_BUFFER,a.colorArray,s.DYNAMIC_DRAW),L.enableAttribute(b.color),s.vertexAttribPointer(b.color,3,s.FLOAT,!1,0,0));L.disableUnusedAttributes();s.drawArrays(s.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f,g){if(!1!==e.visible){r(e);var h=u(a,b,c,e,f),k=!1;a=d.id+"_"+h.id+"_"+e.wireframe;a!==Ia&&(Ia=a,k=!0);a=f.morphTargetInfluences;if(void 0!==a){b=[];c=0;for(k=a.length;c<
-k;c++){var l=a[c];b.push([l,c])}b.sort(m);8<b.length&&(b.length=8);var n=d.morphAttributes;c=0;for(k=b.length;c<k;c++)l=b[c],ib[c]=l[0],0!==l[0]?(a=l[1],!0===e.morphTargets&&d.addAttribute("morphTarget"+c,n.position[a]),!0===e.morphNormals&&d.addAttribute("morphNormal"+c,n.normal[a])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=h.getUniforms();null!==a.morphTargetInfluences&&s.uniform1fv(a.morphTargetInfluences,ib);k=!0}a=d.attributes.index;
-c=d.attributes.position;!0===e.wireframe&&(a=ua.getWireframeAttribute(d));void 0!==a?(b=Lb,b.setIndex(a)):b=Kb;if(k){a:{var k=void 0,p;if(d instanceof THREE.InstancedBufferGeometry&&(p=X.get("ANGLE_instanced_arrays"),null===p)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===k&&(k=0);L.initAttributes();var l=d.attributes,h=h.getAttributes(),n=e.defaultAttributeValues,q;
-for(q in h){var t=h[q];if(0<=t){var v=l[q];if(void 0!==v){L.enableAttribute(t);var w=v.itemSize,x=ua.getAttributeBuffer(v);if(v instanceof THREE.InterleavedBufferAttribute){var y=v.data,A=y.stride,v=v.offset;s.bindBuffer(s.ARRAY_BUFFER,x);s.vertexAttribPointer(t,w,s.FLOAT,!1,A*y.array.BYTES_PER_ELEMENT,(k*A+v)*y.array.BYTES_PER_ELEMENT);if(y instanceof THREE.InstancedInterleavedBuffer){if(null===p){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");
-break a}p.vertexAttribDivisorANGLE(t,y.meshPerAttribute);void 0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute*y.count)}}else if(s.bindBuffer(s.ARRAY_BUFFER,x),s.vertexAttribPointer(t,w,s.FLOAT,!1,0,k*w*4),v instanceof THREE.InstancedBufferAttribute){if(null===p){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");break a}p.vertexAttribDivisorANGLE(t,v.meshPerAttribute);void 0===
-d.maxInstancedCount&&(d.maxInstancedCount=v.meshPerAttribute*v.count)}}else if(void 0!==n&&(w=n[q],void 0!==w))switch(w.length){case 2:s.vertexAttrib2fv(t,w);break;case 3:s.vertexAttrib3fv(t,w);break;case 4:s.vertexAttrib4fv(t,w);break;default:s.vertexAttrib1fv(t,w)}}}L.disableUnusedAttributes()}void 0!==a&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,ua.getAttributeBuffer(a))}void 0===g&&(g={start:0,count:void 0!==a?a.array.length:c instanceof THREE.InterleavedBufferAttribute?c.data.array.length/3:c.array.length/
-3});f instanceof THREE.Mesh?(!0===e.wireframe?(L.setLineWidth(e.wireframeLinewidth*D),b.setMode(s.LINES)):b.setMode(s.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&0<d.maxInstancedCount?b.renderInstances(d):c instanceof THREE.InterleavedBufferAttribute?b.render(0,c.data.count):b.render(g.start,g.count)):f instanceof THREE.Line?(d=e.linewidth,void 0===d&&(d=1),L.setLineWidth(d*D),f instanceof THREE.LineSegments?b.setMode(s.LINES):b.setMode(s.LINE_STRIP),b.render(g.start,g.count)):f instanceof
-THREE.PointCloud&&(b.setMode(s.POINTS),b.render(g.start,g.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;Ia="";Xa=-1;Wa=null;eb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Qa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ya.setFromMatrix(Qa);aa.length=0;pa.length=0;ta.length=
-0;ma.length=0;za.length=0;Pa.length=0;Ja.length=0;l(a);!0===ja.sortObjects&&(pa.sort(n),ta.sort(p));na.render(a,b);la.calls=0;la.vertices=0;la.faces=0;la.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,q(pa,b,aa,e,d),q(ta,b,aa,e,d),t(ma,b,aa,e,d),t(za,b,aa,e,d)):(L.setBlending(THREE.NoBlending),q(pa,b,aa,e),t(ma,b,aa,e),q(ta,b,aa,e),t(za,b,aa,e));Ob.render(a,b);Pb.render(a,b,jb,
-kb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(L.bindTexture(s.TEXTURE_CUBE_MAP,Z.get(c).__webglTexture),s.generateMipmap(s.TEXTURE_CUBE_MAP),L.bindTexture(s.TEXTURE_CUBE_MAP,null)):(L.bindTexture(s.TEXTURE_2D,Z.get(c).__webglTexture),s.generateMipmap(s.TEXTURE_2D),L.bindTexture(s.TEXTURE_2D,null)));L.setDepthTest(!0);L.setDepthWrite(!0);L.setColorWrite(!0)}};var ac={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(s.CULL_FACE):(b===THREE.FrontFaceDirectionCW?s.frontFace(s.CW):s.frontFace(s.CCW),a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),L.enable(s.CULL_FACE))};this.setTexture=function(a,b){var c=Z.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=s.createTexture(),Ca.textures++);L.activeTexture(s.TEXTURE0+b);L.bindTexture(s.TEXTURE_2D,c.__webglTexture);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,
-a.flipY);s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);s.pixelStorei(s.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=C(a.image,Mb);var e=a.image,d=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),f=M(a.format),h=M(a.type);x(s.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(s.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}else L.texImage2D(s.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<L.getCompressedTextureFormats().indexOf(f)?L.compressedTexImage2D(s.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(s.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(s.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}else L.texImage2D(s.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else L.activeTexture(s.TEXTURE0+b),L.bindTexture(s.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===Z.get(a).__webglFramebuffer){var c=Z.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&
-(a.stencilBuffer=!0);a.addEventListener("dispose",f);c.__webglTexture=s.createTexture();Ca.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),e=M(a.format),g=M(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];L.bindTexture(s.TEXTURE_CUBE_MAP,c.__webglTexture);x(s.TEXTURE_CUBE_MAP,a,d);for(var h=0;6>h;h++)c.__webglFramebuffer[h]=s.createFramebuffer(),c.__webglRenderbuffer[h]=s.createRenderbuffer(),L.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,
-a.height,0,e,g,null),y(c.__webglFramebuffer[h],a,s.TEXTURE_CUBE_MAP_POSITIVE_X+h),z(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=s.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:s.createRenderbuffer(),L.bindTexture(s.TEXTURE_2D,c.__webglTexture),x(s.TEXTURE_2D,a,d),L.texImage2D(s.TEXTURE_2D,0,e,a.width,a.height,0,e,g,null),y(c.__webglFramebuffer,a,s.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&
-!a.stencilBuffer?s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):z(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);b?L.bindTexture(s.TEXTURE_CUBE_MAP,null):L.bindTexture(s.TEXTURE_2D,null);s.bindRenderbuffer(s.RENDERBUFFER,null);s.bindFramebuffer(s.FRAMEBUFFER,null)}a?(c=Z.get(a),b=b?
-c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ha,a=Ba,d=Aa,e=Ga);b!==ya&&(s.bindFramebuffer(s.FRAMEBUFFER,b),s.viewport(d,e,c,a),ya=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(Z.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");
-else{var g=!1;Z.get(a).__webglFramebuffer!==ya&&(s.bindFramebuffer(s.FRAMEBUFFER,Z.get(a).__webglFramebuffer),g=!0);s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE?s.readPixels(b,c,d,e,s.RGBA,s.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&s.bindFramebuffer(s.FRAMEBUFFER,ya)}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");
+Q=void 0!==a.stencil?a.stencil:!0,T=void 0!==a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,U=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,F=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,$=new THREE.Color(0),ea=0,aa=[],oa=[],sa=[],la=[],za=[],jb=new Float32Array(8),Ra=[],Ia=[];this.domElement=J;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 ja=this,ta=[],mb=null,Qa=null,Ya=-1,Ha="",Xa=null,gb=0,Fa=0,Ga=0,Aa=J.width,va=J.height,kb=0,lb=0,Za=new THREE.Frustum,Ja=new THREE.Matrix4,ka=new THREE.Vector3,ga=new THREE.Vector3,fb=!0,Qb={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:[]}},Ba={programs:0,geometries:0,textures:0},ua={calls:0,vertices:0,faces:0,points:0};this.info={render:ua,memory:Ba,programs:ta};var t;try{a={alpha:H,depth:O,stencil:Q,antialias:T,premultipliedAlpha:R,preserveDrawingBuffer:U};t=E||J.getContext("webgl",a)||J.getContext("experimental-webgl",a);if(null===t){if(null!==J.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";
+}J.addEventListener("webglcontextlost",e,!1)}catch(Jb){console.error("THREE.WebGLRenderer: "+Jb)}var X=new THREE.WebGLExtensions(t);X.get("OES_texture_float");X.get("OES_texture_float_linear");X.get("OES_texture_half_float");X.get("OES_texture_half_float_linear");X.get("OES_standard_derivatives");X.get("ANGLE_instanced_arrays");X.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);F&&X.get("EXT_frag_depth");var L=new THREE.WebGLState(t,X,N),Z=new THREE.WebGLProperties,wa=new THREE.WebGLObjects(t,
+Z,this.info),Kb=new THREE.WebGLBufferRenderer(t,X,ua),Lb=new THREE.WebGLIndexedBufferRenderer(t,X,ua);c();this.context=t;this.extensions=X;this.state=L;var ma=new THREE.WebGLShadowMap(this,aa,wa);this.shadowMap=ma;var eb=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),E=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Mb=t.getParameter(t.MAX_TEXTURE_SIZE),bc=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),ob=0<E,nb=ob&&X.get("OES_texture_float"),Nb=X.get("ANGLE_instanced_arrays"),E=L.getMaxPrecision(G);E!==
+G&&(console.warn("THREE.WebGLRenderer:",G,"not supported, using",E,"instead."),G=E);var Ob=new THREE.SpritePlugin(this,Ra),Pb=new THREE.LensFlarePlugin(this,Ia);this.getContext=function(){return t};this.getContextAttributes=function(){return t.getContextAttributes()};this.forceContextLoss=function(){X.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return ob};this.supportsInstancedArrays=function(){return Nb};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==
+a)return a;var b=X.get("EXT_texture_filter_anisotropic");return a=null!==b?t.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return G};this.getPixelRatio=function(){return D};this.setPixelRatio=function(a){void 0!==a&&(D=a)};this.getSize=function(){return{width:P,height:K}};this.setSize=function(a,b,c){P=a;K=b;J.width=a*D;J.height=b*D;!1!==c&&(J.style.width=a+"px",J.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Fa=a*D;Ga=b*D;Aa=
+c*D;va=d*D;t.viewport(Fa,Ga,Aa,va)};this.setScissor=function(a,b,c,d){t.scissor(a*D,b*D,c*D,d*D)};this.enableScissorTest=function(a){L.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|=t.COLOR_BUFFER_BIT;if(void 0===b||b)d|=t.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=
+t.STENCIL_BUFFER_BIT;t.clear(d)};this.clearColor=function(){t.clear(t.COLOR_BUFFER_BIT)};this.clearDepth=function(){t.clear(t.DEPTH_BUFFER_BIT)};this.clearStencil=function(){t.clear(t.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){J.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){L.initAttributes();var d=Z.get(a);a.hasPositions&&!d.position&&(d.position=t.createBuffer());
+a.hasNormals&&!d.normal&&(d.normal=t.createBuffer());a.hasUvs&&!d.uv&&(d.uv=t.createBuffer());a.hasColors&&!d.color&&(d.color=t.createBuffer());b=b.getAttributes();a.hasPositions&&(t.bindBuffer(t.ARRAY_BUFFER,d.position),t.bufferData(t.ARRAY_BUFFER,a.positionArray,t.DYNAMIC_DRAW),L.enableAttribute(b.position),t.vertexAttribPointer(b.position,3,t.FLOAT,!1,0,0));if(a.hasNormals){t.bindBuffer(t.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==c.type&&c.shading===THREE.FlatShading)for(var e=0,f=3*a.count;e<
+f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}t.bufferData(t.ARRAY_BUFFER,a.normalArray,t.DYNAMIC_DRAW);L.enableAttribute(b.normal);t.vertexAttribPointer(b.normal,3,t.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(t.bindBuffer(t.ARRAY_BUFFER,d.uv),t.bufferData(t.ARRAY_BUFFER,a.uvArray,t.DYNAMIC_DRAW),L.enableAttribute(b.uv),t.vertexAttribPointer(b.uv,2,t.FLOAT,!1,0,0));
+a.hasColors&&c.vertexColors!==THREE.NoColors&&(t.bindBuffer(t.ARRAY_BUFFER,d.color),t.bufferData(t.ARRAY_BUFFER,a.colorArray,t.DYNAMIC_DRAW),L.enableAttribute(b.color),t.vertexAttribPointer(b.color,3,t.FLOAT,!1,0,0));L.disableUnusedAttributes();t.drawArrays(t.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f,g){if(!1!==e.visible){r(e);var h=u(a,b,c,e,f),k=!1;a=d.id+"_"+h.id+"_"+e.wireframe;a!==Ha&&(Ha=a,k=!0);a=f.morphTargetInfluences;if(void 0!==a){b=[];c=0;for(k=a.length;c<
+k;c++){var l=a[c];b.push([l,c])}b.sort(m);8<b.length&&(b.length=8);var n=d.morphAttributes;c=0;for(k=b.length;c<k;c++)l=b[c],jb[c]=l[0],0!==l[0]?(a=l[1],!0===e.morphTargets&&d.addAttribute("morphTarget"+c,n.position[a]),!0===e.morphNormals&&d.addAttribute("morphNormal"+c,n.normal[a])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=h.getUniforms();null!==a.morphTargetInfluences&&t.uniform1fv(a.morphTargetInfluences,jb);k=!0}a=d.attributes.index;
+c=d.attributes.position;!0===e.wireframe&&(a=wa.getWireframeAttribute(d));void 0!==a?(b=Lb,b.setIndex(a)):b=Kb;if(k){a:{var k=void 0,q;if(d instanceof THREE.InstancedBufferGeometry&&(q=X.get("ANGLE_instanced_arrays"),null===q)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===k&&(k=0);L.initAttributes();var l=d.attributes,h=h.getAttributes(),n=e.defaultAttributeValues,p;
+for(p in h){var s=h[p];if(0<=s){var v=l[p];if(void 0!==v){L.enableAttribute(s);var w=v.itemSize,x=wa.getAttributeBuffer(v);if(v instanceof THREE.InterleavedBufferAttribute){var y=v.data,A=y.stride,v=v.offset;t.bindBuffer(t.ARRAY_BUFFER,x);t.vertexAttribPointer(s,w,t.FLOAT,!1,A*y.array.BYTES_PER_ELEMENT,(k*A+v)*y.array.BYTES_PER_ELEMENT);if(y instanceof THREE.InstancedInterleavedBuffer){if(null===q){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");
+break a}q.vertexAttribDivisorANGLE(s,y.meshPerAttribute);void 0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute*y.count)}}else if(t.bindBuffer(t.ARRAY_BUFFER,x),t.vertexAttribPointer(s,w,t.FLOAT,!1,0,k*w*4),v instanceof THREE.InstancedBufferAttribute){if(null===q){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");break a}q.vertexAttribDivisorANGLE(s,v.meshPerAttribute);void 0===
+d.maxInstancedCount&&(d.maxInstancedCount=v.meshPerAttribute*v.count)}}else if(void 0!==n&&(w=n[p],void 0!==w))switch(w.length){case 2:t.vertexAttrib2fv(s,w);break;case 3:t.vertexAttrib3fv(s,w);break;case 4:t.vertexAttrib4fv(s,w);break;default:t.vertexAttrib1fv(s,w)}}}L.disableUnusedAttributes()}void 0!==a&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,wa.getAttributeBuffer(a))}void 0===g&&(g={start:0,count:void 0!==a?a.array.length:c instanceof THREE.InterleavedBufferAttribute?c.data.array.length/3:c.array.length/
+3});f instanceof THREE.Mesh?(!0===e.wireframe?(L.setLineWidth(e.wireframeLinewidth*D),b.setMode(t.LINES)):b.setMode(t.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&0<d.maxInstancedCount?b.renderInstances(d):c instanceof THREE.InterleavedBufferAttribute?b.render(0,c.data.count):b.render(g.start,g.count)):f instanceof THREE.Line?(d=e.linewidth,void 0===d&&(d=1),L.setLineWidth(d*D),f instanceof THREE.LineSegments?b.setMode(t.LINES):b.setMode(t.LINE_STRIP),b.render(g.start,g.count)):f instanceof
+THREE.PointCloud&&(b.setMode(t.POINTS),b.render(g.start,g.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;Ha="";Ya=-1;Xa=null;fb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Ja.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Za.setFromMatrix(Ja);aa.length=0;oa.length=0;sa.length=
+0;la.length=0;za.length=0;Ra.length=0;Ia.length=0;l(a);!0===ja.sortObjects&&(oa.sort(n),sa.sort(p));ma.render(a,b);ua.calls=0;ua.vertices=0;ua.faces=0;ua.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,q(oa,b,aa,e,d),q(sa,b,aa,e,d),s(la,b,aa,e,d),s(za,b,aa,e,d)):(L.setBlending(THREE.NoBlending),q(oa,b,aa,e),s(la,b,aa,e),q(sa,b,aa,e),s(za,b,aa,e));Ob.render(a,b);Pb.render(a,b,kb,
+lb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(L.bindTexture(t.TEXTURE_CUBE_MAP,Z.get(c).__webglTexture),t.generateMipmap(t.TEXTURE_CUBE_MAP),L.bindTexture(t.TEXTURE_CUBE_MAP,null)):(L.bindTexture(t.TEXTURE_2D,Z.get(c).__webglTexture),t.generateMipmap(t.TEXTURE_2D),L.bindTexture(t.TEXTURE_2D,null)));L.setDepthTest(!0);L.setDepthWrite(!0);L.setColorWrite(!0)}};var ac={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(t.CULL_FACE):(b===THREE.FrontFaceDirectionCW?t.frontFace(t.CW):t.frontFace(t.CCW),a===THREE.CullFaceBack?t.cullFace(t.BACK):a===THREE.CullFaceFront?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK),L.enable(t.CULL_FACE))};this.setTexture=function(a,b){var c=Z.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=t.createTexture(),Ba.textures++);L.activeTexture(t.TEXTURE0+b);L.bindTexture(t.TEXTURE_2D,c.__webglTexture);t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,
+a.flipY);t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);t.pixelStorei(t.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=C(a.image,Mb);var e=a.image,d=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),f=N(a.format),h=N(a.type);w(t.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(t.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}else L.texImage2D(t.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<L.getCompressedTextureFormats().indexOf(f)?L.compressedTexImage2D(t.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(t.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(t.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}else L.texImage2D(t.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&t.generateMipmap(t.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else L.activeTexture(t.TEXTURE0+b),L.bindTexture(t.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===Z.get(a).__webglFramebuffer){var c=Z.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&
+(a.stencilBuffer=!0);a.addEventListener("dispose",f);c.__webglTexture=t.createTexture();Ba.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),e=N(a.format),g=N(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=[];L.bindTexture(t.TEXTURE_CUBE_MAP,c.__webglTexture);w(t.TEXTURE_CUBE_MAP,a,d);for(var h=0;6>h;h++)c.__webglFramebuffer[h]=t.createFramebuffer(),c.__webglRenderbuffer[h]=t.createRenderbuffer(),L.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,
+a.height,0,e,g,null),y(c.__webglFramebuffer[h],a,t.TEXTURE_CUBE_MAP_POSITIVE_X+h),z(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&t.generateMipmap(t.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=t.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:t.createRenderbuffer(),L.bindTexture(t.TEXTURE_2D,c.__webglTexture),w(t.TEXTURE_2D,a,d),L.texImage2D(t.TEXTURE_2D,0,e,a.width,a.height,0,e,g,null),y(c.__webglFramebuffer,a,t.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&
+!a.stencilBuffer?t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,c.__webglRenderbuffer):z(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&t.generateMipmap(t.TEXTURE_2D);b?L.bindTexture(t.TEXTURE_CUBE_MAP,null):L.bindTexture(t.TEXTURE_2D,null);t.bindRenderbuffer(t.RENDERBUFFER,null);t.bindFramebuffer(t.FRAMEBUFFER,null)}a?(c=Z.get(a),b=b?
+c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Aa,a=va,d=Fa,e=Ga);b!==Qa&&(t.bindFramebuffer(t.FRAMEBUFFER,b),t.viewport(d,e,c,a),Qa=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(Z.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");
+else{var g=!1;Z.get(a).__webglFramebuffer!==Qa&&(t.bindFramebuffer(t.FRAMEBUFFER,Z.get(a).__webglFramebuffer),g=!0);t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE?t.readPixels(b,c,d,e,t.RGBA,t.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&t.bindFramebuffer(t.FRAMEBUFFER,Qa)}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");
 return X.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return X.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return X.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");
 return X.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return X.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return X.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");
 return X.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return X.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return X.get("EXT_blend_minmax")};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
 return X.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return X.get("WEBGL_compressed_texture_pvrtc")};this.supportsBlendMinMax=function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return X.get("EXT_blend_minmax")};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}}})};
+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 ma.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ma.enabled=
+a}},shadowMapType:{get:function(){return ma.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");ma.type=a}},shadowMapCullFace:{get:function(){return ma.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ma.cullFace=a}},shadowMapDebug:{get:function(){return ma.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ma.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,
 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};
 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()},clone:function(){return(new this.constructor).copy(this)},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=
 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()},clone:function(){return(new this.constructor).copy(this)},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=
@@ -585,77 +585,76 @@ THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c]
 break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}};
 break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}};
 THREE.WebGLGeometries=function(a,b,c){function d(a){a=a.target;var h=g[a.id].attributes,k;for(k in h)e(h[k]);a.removeEventListener("dispose",d);delete g[a.id];k=b.get(a);k.wireframe&&e(k.wireframe);c.memory.geometries--}function e(c){var d;d=c instanceof THREE.InterleavedBufferAttribute?b.get(c.data).__webglBuffer:b.get(c).__webglBuffer;void 0!==d&&(a.deleteBuffer(d),c instanceof THREE.InterleavedBufferAttribute?b.delete(c.data):b.delete(c))}var g={};this.get=function(a){var b=a.geometry;if(void 0!==
 THREE.WebGLGeometries=function(a,b,c){function d(a){a=a.target;var h=g[a.id].attributes,k;for(k in h)e(h[k]);a.removeEventListener("dispose",d);delete g[a.id];k=b.get(a);k.wireframe&&e(k.wireframe);c.memory.geometries--}function e(c){var d;d=c instanceof THREE.InterleavedBufferAttribute?b.get(c.data).__webglBuffer:b.get(c).__webglBuffer;void 0!==d&&(a.deleteBuffer(d),c instanceof THREE.InterleavedBufferAttribute?b.delete(c.data):b.delete(c))}var g={};this.get=function(a){var b=a.geometry;if(void 0!==
 g[b.id])return g[b.id];b.addEventListener("dispose",d);var e;b instanceof THREE.BufferGeometry?e=b:b instanceof THREE.Geometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new THREE.BufferGeometry).setFromObject(a)),e=b._bufferGeometry);g[b.id]=e;c.memory.geometries++;return e}};
 g[b.id])return g[b.id];b.addEventListener("dispose",d);var e;b instanceof THREE.BufferGeometry?e=b:b instanceof THREE.Geometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new THREE.BufferGeometry).setFromObject(a)),e=b._bufferGeometry);g[b.id]=e;c.memory.geometries++;return e}};
-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 f[a.id];b.delete(a)})}function e(c){var d;d=c instanceof THREE.IndexBufferAttribute?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER;c=c instanceof THREE.InterleavedBufferAttribute?c.data:c;var e=b.get(c);if(void 0===e.__webglBuffer){e.__webglBuffer=a.createBuffer();a.bindBuffer(d,e.__webglBuffer);var f=a.STATIC_DRAW;
-if(c instanceof THREE.DynamicBufferAttribute||c instanceof THREE.InstancedBufferAttribute&&!0===c.dynamic||c instanceof THREE.InterleavedBuffer&&!0===c.dynamic)f=a.DYNAMIC_DRAW;a.bufferData(d,c.array,f);e.version=c.version}else e.version!==c.version&&(a.bindBuffer(d,e.__webglBuffer),void 0===c.updateRange||-1===c.updateRange.count?a.bufferSubData(d,0,c.array):0===c.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(d,c.updateRange.offset*c.array.BYTES_PER_ELEMENT,c.array.subarray(c.updateRange.offset,c.updateRange.offset+c.updateRange.count)),c.updateRange.count=0),e.version=c.version)}function g(a,b,c){b=b<c?b+"_"+c:c+"_"+b;if(a.hasOwnProperty(b))return!1;a[b]=1;return!0}var f={},h=new THREE.WebGLGeometries(a,b,c);this.objects=f;this.init=function(a){var c=b.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a.addEventListener("removed",d));void 0===c.__webglActive&&(c.__webglActive=!0,a instanceof
-THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud)&&(f[a.id]={id:a.id,object:a,z:0})};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.getWireframeAttribute=function(a){var c=b.get(a);if(void 0!==c.wireframe)return c.wireframe;var d=[];a=a.attributes;var f=a.index;a=a.position;console.time("wireframe");if(void 0!==f)for(var h={},f=f.array,q=0,t=f.length;q<t;q+=3){var r=f[q+0],u=f[q+1],
-v=f[q+2];g(h,r,u)&&d.push(r,u);g(h,u,v)&&d.push(u,v);g(h,v,r)&&d.push(v,r)}else for(f=a.array,q=0,t=f.length/3-1;q<t;q+=3)r=q+0,u=q+1,v=q+2,d.push(r,u,u,v,v,r);console.timeEnd("wireframe");d=new THREE.IndexBufferAttribute(new (65535<a.count?Uint32Array:Uint16Array)(d),1);e(d);return c.wireframe=d};this.update=function(a){var b=h.get(a);a.geometry instanceof THREE.Geometry&&b.updateFromObject(a);a=b.attributes;for(var c in a)e(a[c]);a=b.morphAttributes;for(c in a)for(var d=a[c],f=0,g=d.length;f<g;f++)e(d[f]);
-return b};this.clear=function(){f={}}};
-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,m=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 l="ENVMAP_TYPE_CUBE",q="ENVMAP_MODE_REFLECTION",t="ENVMAP_BLENDING_MULTIPLY";
-if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:l="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:l="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:l="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:t="ENVMAP_BLENDING_MULTIPLY";
-break;case THREE.MixOperation:t="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:t="ENVMAP_BLENDING_ADD"}}var r=0<d.gammaFactor?d.gammaFactor:1,u=a(k),v=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 "+r,"#define MAX_DIR_LIGHTS "+
+THREE.WebGLObjects=function(a,b,c){function d(c){var d;d=c instanceof THREE.IndexBufferAttribute?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER;c=c instanceof THREE.InterleavedBufferAttribute?c.data:c;var e=b.get(c);if(void 0===e.__webglBuffer){e.__webglBuffer=a.createBuffer();a.bindBuffer(d,e.__webglBuffer);var g=a.STATIC_DRAW;if(c instanceof THREE.DynamicBufferAttribute||c instanceof THREE.InstancedBufferAttribute&&!0===c.dynamic||c instanceof THREE.InterleavedBuffer&&!0===c.dynamic)g=a.DYNAMIC_DRAW;a.bufferData(d,
+c.array,g);e.version=c.version}else e.version!==c.version&&(a.bindBuffer(d,e.__webglBuffer),void 0===c.updateRange||-1===c.updateRange.count?a.bufferSubData(d,0,c.array):0===c.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(d,c.updateRange.offset*c.array.BYTES_PER_ELEMENT,c.array.subarray(c.updateRange.offset,c.updateRange.offset+
+c.updateRange.count)),c.updateRange.count=0),e.version=c.version)}function e(a,b,c){b=b<c?b+"_"+c:c+"_"+b;if(a.hasOwnProperty(b))return!1;a[b]=1;return!0}var g=new THREE.WebGLGeometries(a,b,c);this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.getWireframeAttribute=function(a){var c=b.get(a);if(void 0!==c.wireframe)return c.wireframe;var g=[];a=a.attributes;var m=a.index;a=a.position;if(void 0!==m)for(var n=
+{},m=m.array,p=0,l=m.length;p<l;p+=3){var q=m[p+0],s=m[p+1],r=m[p+2];e(n,q,s)&&g.push(q,s);e(n,s,r)&&g.push(s,r);e(n,r,q)&&g.push(r,q)}else for(m=a.array,p=0,l=m.length/3-1;p<l;p+=3)q=p+0,s=p+1,r=p+2,g.push(q,s,s,r,r,q);g=new THREE.IndexBufferAttribute(new (65535<a.count?Uint32Array:Uint16Array)(g),1);d(g);return c.wireframe=g};this.update=function(a){var b=g.get(a);a.geometry instanceof THREE.Geometry&&b.updateFromObject(a);a=b.attributes;for(var c in a)d(a[c]);a=b.morphAttributes;for(c in a)for(var e=
+a[c],n=0,p=e.length;n<p;n++)d(e[n]);return b}};
+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,m=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 l="ENVMAP_TYPE_CUBE",q="ENVMAP_MODE_REFLECTION",s="ENVMAP_BLENDING_MULTIPLY";
+if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:l="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:l="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:l="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 r=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 "+r,"#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.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.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",
 "",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",
 "#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":"",f.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : 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,
 "\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":"",f.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : 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 "+r,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 "+l:"",f.envMap?"#define "+q:"",f.envMap?"#define "+t:"",f.lightMap?"#define USE_LIGHTMAP":
+"#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 "+r,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 "+l:"",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?
 "",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"));n=d+n;m=THREE.WebGLShader(h,h.VERTEX_SHADER,k+m);n=THREE.WebGLShader(h,h.FRAGMENT_SHADER,n);h.attachShader(v,m);h.attachShader(v,n);void 0!==g.index0AttributeName?h.bindAttribLocation(v,0,g.index0AttributeName):!0===f.morphTargets&&h.bindAttribLocation(v,
-0,"position");h.linkProgram(v);f=h.getProgramInfoLog(v);p=h.getShaderInfoLog(m);l=h.getShaderInfoLog(n);t=q=!0;if(!1===h.getProgramParameter(v,h.LINK_STATUS))q=!1,console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(v,h.VALIDATE_STATUS),"gl.getProgramInfoLog",f,p,l);else if(""!==f)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f);else if(""===p||""===l)t=!1;t&&(this.diagnostics={runnable:q,material:g,programLog:f,vertexShader:{log:p,
-prefix:k},fragmentShader:{log:l,prefix:d}});h.deleteShader(m);h.deleteShader(n);var w;this.getUniforms=function(){if(void 0===w){for(var a={},b=h.getProgramParameter(v,h.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=h.getActiveUniform(v,c).name,e=h.getUniformLocation(v,d),f=d.lastIndexOf("[0]");-1!==f&&f===d.length-3&&(a[d.substr(0,f)]=e);a[d]=e}w=a}return w};var A;this.getAttributes=function(){if(void 0===A){for(var a={},b=h.getProgramParameter(v,h.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=h.getActiveAttrib(v,
-c).name;a[d]=h.getAttribLocation(v,d)}A=a}return A};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.id=c++;this.code=e;this.usedTimes=1;this.program=v;this.vertexShader=m;this.fragmentShader=n;return this}}();
+"#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"));n=d+n;m=THREE.WebGLShader(h,h.VERTEX_SHADER,k+m);n=THREE.WebGLShader(h,h.FRAGMENT_SHADER,n);h.attachShader(x,m);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(m);l=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,l);else if(""!==f)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f);else if(""===p||""===l)s=!1;s&&(this.diagnostics={runnable:q,material:g,programLog:f,vertexShader:{log:p,
+prefix:k},fragmentShader:{log:l,prefix:d}});h.deleteShader(m);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 A;this.getAttributes=function(){if(void 0===A){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)}A=a}return A};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.id=c++;this.code=e;this.usedTimes=1;this.program=x;this.vertexShader=m;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.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.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){var c=a.geometry,c=void 0!==c.morphTargets&&0<c.morphTargets.length&&b.morphTargets,d=a instanceof THREE.SkinnedMesh&&b.skinning,c=a.customDepthMaterial?a.customDepthMaterial:d?c?u:r:c?t:q;c.visible=b.visible;c.wireframe=b.wireframe;c.wireframeLinewidth=b.wireframeLinewidth;return c}function e(a,b){if(!1!==a.visible){var d=c.objects[a.id];if(d&&a.castShadow&&(!1===a.frustumCulled||!0===h.intersectsObject(a))){var f=a.material;null!==f&&!0===f.visible&&
-(a.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),n.push(d))}for(var d=a.children,f=0,g=d.length;f<g;f++)e(d[f],b)}}var g=a.context,f=a.state,h=new THREE.Frustum,k=new THREE.Matrix4;new THREE.Vector3;new THREE.Vector3;var m=new THREE.Vector3,n=[],p=THREE.ShaderLib.depthRGBA,l=THREE.UniformsUtils.clone(p.uniforms),q=new THREE.ShaderMaterial({uniforms:l,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}),t=new THREE.ShaderMaterial({uniforms:l,vertexShader:p.vertexShader,
-fragmentShader:p.fragmentShader,morphTargets:!0}),r=new THREE.ShaderMaterial({uniforms:l,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,skinning:!0}),u=new THREE.ShaderMaterial({uniforms:l,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,morphTargets:!0,skinning:!0});q._shadowPass=!0;t._shadowPass=!0;r._shadowPass=!0;u._shadowPass=!0;var v=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=
-function(l,q){if(!1!==v.enabled&&(!1!==v.autoUpdate||!1!==v.needsUpdate)){g.clearColor(1,1,1,1);f.disable(g.BLEND);f.enable(g.CULL_FACE);g.frontFace(g.CCW);v.cullFace===THREE.CullFaceFront?g.cullFace(g.FRONT):g.cullFace(g.BACK);f.setDepthTest(!0);for(var p=0,t=b.length;p<t;p++){var r=b[p];if(r.castShadow){if(!r.shadowMap){var u=THREE.LinearFilter;v.type===THREE.PCFSoftShadowMap&&(u=THREE.NearestFilter);r.shadowMap=new THREE.WebGLRenderTarget(r.shadowMapWidth,r.shadowMapHeight,{minFilter:u,magFilter:u,
-format:THREE.RGBAFormat});r.shadowMapSize=new THREE.Vector2(r.shadowMapWidth,r.shadowMapHeight);r.shadowMatrix=new THREE.Matrix4}if(!r.shadowCamera){if(r instanceof THREE.SpotLight)r.shadowCamera=new THREE.PerspectiveCamera(r.shadowCameraFov,r.shadowMapWidth/r.shadowMapHeight,r.shadowCameraNear,r.shadowCameraFar);else if(r instanceof THREE.DirectionalLight)r.shadowCamera=new THREE.OrthographicCamera(r.shadowCameraLeft,r.shadowCameraRight,r.shadowCameraTop,r.shadowCameraBottom,r.shadowCameraNear,r.shadowCameraFar);
-else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",r);continue}l.add(r.shadowCamera);!0===l.autoUpdate&&l.updateMatrixWorld()}r.shadowCameraVisible&&!r.cameraHelper&&(r.cameraHelper=new THREE.CameraHelper(r.shadowCamera),l.add(r.cameraHelper));var B=r.shadowMap,M=r.shadowMatrix,u=r.shadowCamera;u.position.setFromMatrixPosition(r.matrixWorld);m.setFromMatrixPosition(r.target.matrixWorld);u.lookAt(m);u.updateMatrixWorld();u.matrixWorldInverse.getInverse(u.matrixWorld);r.cameraHelper&&
-(r.cameraHelper.visible=r.shadowCameraVisible);r.shadowCameraVisible&&r.cameraHelper.update();M.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);M.multiply(u.projectionMatrix);M.multiply(u.matrixWorldInverse);k.multiplyMatrices(u.projectionMatrix,u.matrixWorldInverse);h.setFromMatrix(k);a.setRenderTarget(B);a.clear();n.length=0;e(l,u);for(var J,E,r=0,B=n.length;r<B;r++)if(M=n[r],M=M.object,J=c.update(M),E=M.material,E instanceof THREE.MeshFaceMaterial){var P=J.groups;E=E.materials;r=0;for(B=P.length;r<
-B;r++){var K=P[r],D=E[K.materialIndex];void 0!==D&&a.renderBufferDirect(u,b,null,J,d(M,D),M,K)}}else a.renderBufferDirect(u,b,null,J,d(M,E),M)}}p=a.getClearColor();t=a.getClearAlpha();g.clearColor(p.r,p.g,p.b,t);f.enable(g.BLEND);v.cullFace===THREE.CullFaceFront&&g.cullFace(g.BACK);a.resetGLState();v.needsUpdate=!1}}};
-THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),g=new Uint8Array(16),f={},h=null,k=null,m=null,n=null,p=null,l=null,q=null,t=null,r=null,u=null,v=null,w=null,A=null,x=null,C=null,y=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),z=void 0,B={};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){var c=a.geometry,c=void 0!==c.morphTargets&&0<c.morphTargets.length&&b.morphTargets,d=a instanceof THREE.SkinnedMesh&&b.skinning,c=a.customDepthMaterial?a.customDepthMaterial:d?c?u:r:c?s:q;c.visible=b.visible;c.wireframe=b.wireframe;c.wireframeLinewidth=b.wireframeLinewidth;return c}function e(a,b){if(!1!==a.visible){(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud)&&a.castShadow&&(!1===a.frustumCulled||!0===h.intersectsObject(a))&&
+!0===a.material.visible&&(a.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),n.push(a));for(var c=a.children,d=0,f=c.length;d<f;d++)e(c[d],b)}}var g=a.context,f=a.state,h=new THREE.Frustum,k=new THREE.Matrix4;new THREE.Vector3;new THREE.Vector3;var m=new THREE.Vector3,n=[],p=THREE.ShaderLib.depthRGBA,l=THREE.UniformsUtils.clone(p.uniforms),q=new THREE.ShaderMaterial({uniforms:l,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}),s=new THREE.ShaderMaterial({uniforms:l,
+vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,morphTargets:!0}),r=new THREE.ShaderMaterial({uniforms:l,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,skinning:!0}),u=new THREE.ShaderMaterial({uniforms:l,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,morphTargets:!0,skinning:!0});q._shadowPass=!0;s._shadowPass=!0;r._shadowPass=!0;u._shadowPass=!0;var x=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;
+this.render=function(l,q){if(!1!==x.enabled&&(!1!==x.autoUpdate||!1!==x.needsUpdate)){g.clearColor(1,1,1,1);f.disable(g.BLEND);f.enable(g.CULL_FACE);g.frontFace(g.CCW);x.cullFace===THREE.CullFaceFront?g.cullFace(g.FRONT):g.cullFace(g.BACK);f.setDepthTest(!0);for(var p=0,s=b.length;p<s;p++){var r=b[p];if(r.castShadow){if(!r.shadowMap){var u=THREE.LinearFilter;x.type===THREE.PCFSoftShadowMap&&(u=THREE.NearestFilter);r.shadowMap=new THREE.WebGLRenderTarget(r.shadowMapWidth,r.shadowMapHeight,{minFilter:u,
+magFilter:u,format:THREE.RGBAFormat});r.shadowMapSize=new THREE.Vector2(r.shadowMapWidth,r.shadowMapHeight);r.shadowMatrix=new THREE.Matrix4}if(!r.shadowCamera){if(r instanceof THREE.SpotLight)r.shadowCamera=new THREE.PerspectiveCamera(r.shadowCameraFov,r.shadowMapWidth/r.shadowMapHeight,r.shadowCameraNear,r.shadowCameraFar);else if(r instanceof THREE.DirectionalLight)r.shadowCamera=new THREE.OrthographicCamera(r.shadowCameraLeft,r.shadowCameraRight,r.shadowCameraTop,r.shadowCameraBottom,r.shadowCameraNear,
+r.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",r);continue}l.add(r.shadowCamera);!0===l.autoUpdate&&l.updateMatrixWorld()}r.shadowCameraVisible&&!r.cameraHelper&&(r.cameraHelper=new THREE.CameraHelper(r.shadowCamera),l.add(r.cameraHelper));var B=r.shadowMap,N=r.shadowMatrix,u=r.shadowCamera;u.position.setFromMatrixPosition(r.matrixWorld);m.setFromMatrixPosition(r.target.matrixWorld);u.lookAt(m);u.updateMatrixWorld();u.matrixWorldInverse.getInverse(u.matrixWorld);
+r.cameraHelper&&(r.cameraHelper.visible=r.shadowCameraVisible);r.shadowCameraVisible&&r.cameraHelper.update();N.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);N.multiply(u.projectionMatrix);N.multiply(u.matrixWorldInverse);k.multiplyMatrices(u.projectionMatrix,u.matrixWorldInverse);h.setFromMatrix(k);a.setRenderTarget(B);a.clear();n.length=0;e(l,u);r=0;for(B=n.length;r<B;r++){var N=n[r],J=c.update(N),E=N.material;if(E instanceof THREE.MeshFaceMaterial)for(var P=J.groups,E=E.materials,r=0,B=P.length;r<
+B;r++){var K=P[r],D=E[K.materialIndex];void 0!==D&&a.renderBufferDirect(u,b,null,J,d(N,D),N,K)}else a.renderBufferDirect(u,b,null,J,d(N,E),N)}}}p=a.getClearColor();s=a.getClearAlpha();g.clearColor(p.r,p.g,p.b,s);f.enable(g.BLEND);x.cullFace===THREE.CullFaceFront&&g.cullFace(g.BACK);a.resetGLState();x.needsUpdate=!1}}};
+THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),g=new Uint8Array(16),f={},h=null,k=null,m=null,n=null,p=null,l=null,q=null,s=null,r=null,u=null,x=null,v=null,A=null,w=null,C=null,y=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),z=void 0,B={};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=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(b){e[b]=1;0===g[b]&&(a.enableVertexAttribArray(b),g[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=g.length;b<c;b++)g[b]!==e[b]&&(a.disableVertexAttribArray(b),g[b]=0)};this.enable=function(b){!0!==f[b]&&(a.enable(b),f[b]=!0)};this.disable=function(b){!1!==f[b]&&(a.disable(b),f[b]=!1)};this.getCompressedTextureFormats=function(){if(null===h&&(h=[],b.get("WEBGL_compressed_texture_pvrtc")||
 a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(b){e[b]=1;0===g[b]&&(a.enableVertexAttribArray(b),g[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=g.length;b<c;b++)g[b]!==e[b]&&(a.disableVertexAttribArray(b),g[b]=0)};this.enable=function(b){!0!==f[b]&&(a.enable(b),f[b]=!0)};this.disable=function(b){!1!==f[b]&&(a.disable(b),f[b]=!1)};this.getCompressedTextureFormats=function(){if(null===h&&(h=[],b.get("WEBGL_compressed_texture_pvrtc")||
 b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)h.push(c[d]);return h};this.getMaxPrecision=function(b){if("highp"===b){if(0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision)return"highp";b="mediump"}return"mediump"===b&&0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision?
 b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)h.push(c[d]);return h};this.getMaxPrecision=function(b){if("highp"===b){if(0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision)return"highp";b="mediump"}return"mediump"===b&&0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision?
 "mediump":"lowp"};this.setBlending=function(b,d,e,f,g,h,r){b!==k&&(b===THREE.NoBlending?this.disable(a.BLEND):b===THREE.AdditiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):b===THREE.SubtractiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):b===THREE.MultiplyBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):b===THREE.CustomBlending?this.enable(a.BLEND):(this.enable(a.BLEND),
 "mediump":"lowp"};this.setBlending=function(b,d,e,f,g,h,r){b!==k&&(b===THREE.NoBlending?this.disable(a.BLEND):b===THREE.AdditiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):b===THREE.SubtractiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):b===THREE.MultiplyBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):b===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)),k=b);if(b===THREE.CustomBlending){g=g||d;h=h||e;r=r||f;if(d!==m||g!==l)a.blendEquationSeparate(c(d),c(g)),m=d,l=g;if(e!==n||f!==p||h!==q||r!==t)a.blendFuncSeparate(c(e),c(f),c(h),c(r)),n=e,p=f,q=h,t=r}else t=q=l=p=n=m=null};this.setDepthFunc=function(b){if(r!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);
+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)),k=b);if(b===THREE.CustomBlending){g=g||d;h=h||e;r=r||f;if(d!==m||g!==l)a.blendEquationSeparate(c(d),c(g)),m=d,l=g;if(e!==n||f!==p||h!==q||r!==s)a.blendFuncSeparate(c(e),c(f),c(h),c(r)),n=e,p=f,q=h,s=r}else s=q=l=p=n=m=null};this.setDepthFunc=function(b){if(r!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);
 break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);r=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){u!==
 break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);r=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){u!==
-b&&(a.depthMask(b),u=b)};this.setColorWrite=function(b){v!==b&&(a.colorMask(b,b,b,b),v=b)};this.setFlipSided=function(b){w!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),w=b)};this.setLineWidth=function(b){b!==A&&(a.lineWidth(b),A=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||x===c&&C===d||(a.polygonOffset(c,d),x=c,C=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=
+b&&(a.depthMask(b),u=b)};this.setColorWrite=function(b){x!==b&&(a.colorMask(b,b,b,b),x=b)};this.setFlipSided=function(b){v!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),v=b)};this.setLineWidth=function(b){b!==A&&(a.lineWidth(b),A=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||w===c&&C===d||(a.polygonOffset(c,d),w=c,C=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+y-1);z!==b&&(a.activeTexture(b),z=b)};this.bindTexture=function(b,c){void 0===z&&d.activeTexture();var e=B[z];void 0===e&&(e={type:void 0,texture:void 0},B[z]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};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=
 function(b){void 0===b&&(b=a.TEXTURE0+y-1);z!==b&&(a.activeTexture(b),z=b)};this.bindTexture=function(b,c){void 0===z&&d.activeTexture();var e=B[z];void 0===e&&(e={type:void 0,texture:void 0},B[z]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};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<g.length;b++)1===g[b]&&(a.disableVertexAttribArray(b),g[b]=0);f={};w=v=u=k=h=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,m,n,p,l=a.context,q=a.state,t,r,u,v,w,A;this.render=function(x,C,y,z){if(0!==b.length){x=new THREE.Vector3;var B=z/y,M=.5*y,J=.5*z,E=16/z,P=new THREE.Vector2(E*B,E),K=new THREE.Vector3(1,1,0),D=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]),G=new Uint16Array([0,1,2,0,2,3]);t=l.createBuffer();r=l.createBuffer();l.bindBuffer(l.ARRAY_BUFFER,t);l.bufferData(l.ARRAY_BUFFER,E,l.STATIC_DRAW);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
-r);l.bufferData(l.ELEMENT_ARRAY_BUFFER,G,l.STATIC_DRAW);w=l.createTexture();A=l.createTexture();q.bindTexture(l.TEXTURE_2D,w);l.texImage2D(l.TEXTURE_2D,0,l.RGB,16,16,0,l.RGB,l.UNSIGNED_BYTE,null);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST);q.bindTexture(l.TEXTURE_2D,A);l.texImage2D(l.TEXTURE_2D,0,
-l.RGBA,16,16,0,l.RGBA,l.UNSIGNED_BYTE,null);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST);var E=(v=0<l.getParameter(l.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}",
+0;b<g.length;b++)1===g[b]&&(a.disableVertexAttribArray(b),g[b]=0);f={};v=x=u=k=h=null}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,m,n,p,l=a.context,q=a.state,s,r,u,x,v,A;this.render=function(w,C,y,z){if(0!==b.length){w=new THREE.Vector3;var B=z/y,N=.5*y,J=.5*z,E=16/z,P=new THREE.Vector2(E*B,E),K=new THREE.Vector3(1,1,0),D=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]),G=new Uint16Array([0,1,2,0,2,3]);s=l.createBuffer();r=l.createBuffer();l.bindBuffer(l.ARRAY_BUFFER,s);l.bufferData(l.ARRAY_BUFFER,E,l.STATIC_DRAW);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
+r);l.bufferData(l.ELEMENT_ARRAY_BUFFER,G,l.STATIC_DRAW);v=l.createTexture();A=l.createTexture();q.bindTexture(l.TEXTURE_2D,v);l.texImage2D(l.TEXTURE_2D,0,l.RGB,16,16,0,l.RGB,l.UNSIGNED_BYTE,null);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST);q.bindTexture(l.TEXTURE_2D,A);l.texImage2D(l.TEXTURE_2D,0,
+l.RGBA,16,16,0,l.RGBA,l.UNSIGNED_BYTE,null);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST);l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST);var E=(x=0<l.getParameter(l.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:"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}"},
 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}"},
 G=l.createProgram(),H=l.createShader(l.FRAGMENT_SHADER),O=l.createShader(l.VERTEX_SHADER),Q="precision "+a.getPrecision()+" float;\n";l.shaderSource(H,Q+E.fragmentShader);l.shaderSource(O,Q+E.vertexShader);l.compileShader(H);l.compileShader(O);l.attachShader(G,H);l.attachShader(G,O);l.linkProgram(G);u=G;n=l.getAttribLocation(u,"position");p=l.getAttribLocation(u,"uv");c=l.getUniformLocation(u,"renderType");d=l.getUniformLocation(u,"map");e=l.getUniformLocation(u,"occlusionMap");g=l.getUniformLocation(u,
 G=l.createProgram(),H=l.createShader(l.FRAGMENT_SHADER),O=l.createShader(l.VERTEX_SHADER),Q="precision "+a.getPrecision()+" float;\n";l.shaderSource(H,Q+E.fragmentShader);l.shaderSource(O,Q+E.vertexShader);l.compileShader(H);l.compileShader(O);l.attachShader(G,H);l.attachShader(G,O);l.linkProgram(G);u=G;n=l.getAttribLocation(u,"position");p=l.getAttribLocation(u,"uv");c=l.getUniformLocation(u,"renderType");d=l.getUniformLocation(u,"map");e=l.getUniformLocation(u,"occlusionMap");g=l.getUniformLocation(u,
-"opacity");f=l.getUniformLocation(u,"color");h=l.getUniformLocation(u,"scale");k=l.getUniformLocation(u,"rotation");m=l.getUniformLocation(u,"screenPosition")}l.useProgram(u);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();l.uniform1i(e,0);l.uniform1i(d,1);l.bindBuffer(l.ARRAY_BUFFER,t);l.vertexAttribPointer(n,2,l.FLOAT,!1,16,0);l.vertexAttribPointer(p,2,l.FLOAT,!1,16,8);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,r);q.disable(l.CULL_FACE);l.depthMask(!1);G=0;for(H=
-b.length;G<H;G++)if(E=16/z,P.set(E*B,E),O=b[G],x.set(O.matrixWorld.elements[12],O.matrixWorld.elements[13],O.matrixWorld.elements[14]),x.applyMatrix4(C.matrixWorldInverse),x.applyProjection(C.projectionMatrix),K.copy(x),D.x=K.x*M+M,D.y=K.y*J+J,v||0<D.x&&D.x<y&&0<D.y&&D.y<z){q.activeTexture(l.TEXTURE0);q.bindTexture(l.TEXTURE_2D,null);q.activeTexture(l.TEXTURE1);q.bindTexture(l.TEXTURE_2D,w);l.copyTexImage2D(l.TEXTURE_2D,0,l.RGB,D.x-8,D.y-8,16,16,0);l.uniform1i(c,0);l.uniform2f(h,P.x,P.y);l.uniform3f(m,
-K.x,K.y,K.z);q.disable(l.BLEND);q.enable(l.DEPTH_TEST);l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0);q.activeTexture(l.TEXTURE0);q.bindTexture(l.TEXTURE_2D,A);l.copyTexImage2D(l.TEXTURE_2D,0,l.RGBA,D.x-8,D.y-8,16,16,0);l.uniform1i(c,1);q.disable(l.DEPTH_TEST);q.activeTexture(l.TEXTURE1);q.bindTexture(l.TEXTURE_2D,w);l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0);O.positionScreen.copy(K);O.customUpdateCallback?O.customUpdateCallback(O):O.updateLensFlares();l.uniform1i(c,2);q.enable(l.BLEND);for(var Q=
+"opacity");f=l.getUniformLocation(u,"color");h=l.getUniformLocation(u,"scale");k=l.getUniformLocation(u,"rotation");m=l.getUniformLocation(u,"screenPosition")}l.useProgram(u);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();l.uniform1i(e,0);l.uniform1i(d,1);l.bindBuffer(l.ARRAY_BUFFER,s);l.vertexAttribPointer(n,2,l.FLOAT,!1,16,0);l.vertexAttribPointer(p,2,l.FLOAT,!1,16,8);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,r);q.disable(l.CULL_FACE);l.depthMask(!1);G=0;for(H=
+b.length;G<H;G++)if(E=16/z,P.set(E*B,E),O=b[G],w.set(O.matrixWorld.elements[12],O.matrixWorld.elements[13],O.matrixWorld.elements[14]),w.applyMatrix4(C.matrixWorldInverse),w.applyProjection(C.projectionMatrix),K.copy(w),D.x=K.x*N+N,D.y=K.y*J+J,x||0<D.x&&D.x<y&&0<D.y&&D.y<z){q.activeTexture(l.TEXTURE0);q.bindTexture(l.TEXTURE_2D,null);q.activeTexture(l.TEXTURE1);q.bindTexture(l.TEXTURE_2D,v);l.copyTexImage2D(l.TEXTURE_2D,0,l.RGB,D.x-8,D.y-8,16,16,0);l.uniform1i(c,0);l.uniform2f(h,P.x,P.y);l.uniform3f(m,
+K.x,K.y,K.z);q.disable(l.BLEND);q.enable(l.DEPTH_TEST);l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0);q.activeTexture(l.TEXTURE0);q.bindTexture(l.TEXTURE_2D,A);l.copyTexImage2D(l.TEXTURE_2D,0,l.RGBA,D.x-8,D.y-8,16,16,0);l.uniform1i(c,1);q.disable(l.DEPTH_TEST);q.activeTexture(l.TEXTURE1);q.bindTexture(l.TEXTURE_2D,v);l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0);O.positionScreen.copy(K);O.customUpdateCallback?O.customUpdateCallback(O):O.updateLensFlares();l.uniform1i(c,2);q.enable(l.BLEND);for(var Q=
 0,T=O.lensFlares.length;Q<T;Q++){var R=O.lensFlares[Q];.001<R.opacity&&.001<R.scale&&(K.x=R.x,K.y=R.y,K.z=R.z,E=R.size*R.scale/z,P.x=E*B,P.y=E,l.uniform3f(m,K.x,K.y,K.z),l.uniform2f(h,P.x,P.y),l.uniform1f(k,R.rotation),l.uniform1f(g,R.opacity),l.uniform3f(f,R.color.r,R.color.g,R.color.b),q.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),a.setTexture(R.texture,1),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0))}}q.enable(l.CULL_FACE);q.enable(l.DEPTH_TEST);l.depthMask(!0);a.resetGLState()}}};
 0,T=O.lensFlares.length;Q<T;Q++){var R=O.lensFlares[Q];.001<R.opacity&&.001<R.scale&&(K.x=R.x,K.y=R.y,K.z=R.z,E=R.size*R.scale/z,P.x=E*B,P.y=E,l.uniform3f(m,K.x,K.y,K.z),l.uniform2f(h,P.x,P.y),l.uniform1f(k,R.rotation),l.uniform1f(g,R.opacity),l.uniform3f(f,R.color.r,R.color.g,R.color.b),q.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),a.setTexture(R.texture,1),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0))}}q.enable(l.CULL_FACE);q.enable(l.DEPTH_TEST);l.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,m,n,p,l,q,t,r,u,v,w;function A(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,C=a.state,y,z,B,M,J=new THREE.Vector3,E=new THREE.Quaternion,P=new THREE.Vector3;this.render=function(K,D){if(0!==b.length){if(void 0===B){var G=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),H=new Uint16Array([0,1,2,0,2,3]);y=x.createBuffer();z=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,y);x.bufferData(x.ARRAY_BUFFER,G,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
-z);x.bufferData(x.ELEMENT_ARRAY_BUFFER,H,x.STATIC_DRAW);var G=x.createProgram(),H=x.createShader(x.VERTEX_SHADER),O=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(H,["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"));
-x.shaderSource(O,["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"));
-x.compileShader(H);x.compileShader(O);x.attachShader(G,H);x.attachShader(G,O);x.linkProgram(G);B=G;v=x.getAttribLocation(B,"position");w=x.getAttribLocation(B,"uv");c=x.getUniformLocation(B,"uvOffset");d=x.getUniformLocation(B,"uvScale");e=x.getUniformLocation(B,"rotation");g=x.getUniformLocation(B,"scale");f=x.getUniformLocation(B,"color");h=x.getUniformLocation(B,"map");k=x.getUniformLocation(B,"opacity");m=x.getUniformLocation(B,"modelViewMatrix");n=x.getUniformLocation(B,"projectionMatrix");p=
-x.getUniformLocation(B,"fogType");l=x.getUniformLocation(B,"fogDensity");q=x.getUniformLocation(B,"fogNear");t=x.getUniformLocation(B,"fogFar");r=x.getUniformLocation(B,"fogColor");u=x.getUniformLocation(B,"alphaTest");G=document.createElement("canvas");G.width=8;G.height=8;H=G.getContext("2d");H.fillStyle="white";H.fillRect(0,0,8,8);M=new THREE.Texture(G);M.needsUpdate=!0}x.useProgram(B);C.initAttributes();C.enableAttribute(v);C.enableAttribute(w);C.disableUnusedAttributes();C.disable(x.CULL_FACE);
-C.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,y);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(w,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z);x.uniformMatrix4fv(n,!1,D.projectionMatrix.elements);C.activeTexture(x.TEXTURE0);x.uniform1i(h,0);H=G=0;(O=K.fog)?(x.uniform3f(r,O.color.r,O.color.g,O.color.b),O instanceof THREE.Fog?(x.uniform1f(q,O.near),x.uniform1f(t,O.far),x.uniform1i(p,1),H=G=1):O instanceof THREE.FogExp2&&(x.uniform1f(l,O.density),x.uniform1i(p,2),H=G=2)):
-(x.uniform1i(p,0),H=G=0);for(var O=0,Q=b.length;O<Q;O++){var T=b[O];T._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,T.matrixWorld);T.z=-T._modelViewMatrix.elements[14]}b.sort(A);for(var R=[],O=0,Q=b.length;O<Q;O++){var T=b[O],U=T.material;x.uniform1f(u,U.alphaTest);x.uniformMatrix4fv(m,!1,T._modelViewMatrix.elements);T.matrixWorld.decompose(J,E,P);R[0]=P.x;R[1]=P.y;T=0;K.fog&&U.fog&&(T=H);G!==T&&(x.uniform1i(p,T),G=T);null!==U.map?(x.uniform2f(c,U.map.offset.x,U.map.offset.y),x.uniform2f(d,
-U.map.repeat.x,U.map.repeat.y)):(x.uniform2f(c,0,0),x.uniform2f(d,1,1));x.uniform1f(k,U.opacity);x.uniform3f(f,U.color.r,U.color.g,U.color.b);x.uniform1f(e,U.rotation);x.uniform2fv(g,R);C.setBlending(U.blending,U.blendEquation,U.blendSrc,U.blendDst);C.setDepthTest(U.depthTest);C.setDepthWrite(U.depthWrite);U.map&&U.map.image&&U.map.image.width?a.setTexture(U.map,0):a.setTexture(M,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}C.enable(x.CULL_FACE);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,m,n,p,l,q,s,r,u,x,v;function A(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,C=a.state,y,z,B,N,J=new THREE.Vector3,E=new THREE.Quaternion,P=new THREE.Vector3;this.render=function(K,D){if(0!==b.length){if(void 0===B){var G=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),H=new Uint16Array([0,1,2,0,2,3]);y=w.createBuffer();z=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,y);w.bufferData(w.ARRAY_BUFFER,G,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
+z);w.bufferData(w.ELEMENT_ARRAY_BUFFER,H,w.STATIC_DRAW);var G=w.createProgram(),H=w.createShader(w.VERTEX_SHADER),O=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(H,["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(O,["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(H);w.compileShader(O);w.attachShader(G,H);w.attachShader(G,O);w.linkProgram(G);B=G;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");m=w.getUniformLocation(B,"modelViewMatrix");n=w.getUniformLocation(B,"projectionMatrix");p=
+w.getUniformLocation(B,"fogType");l=w.getUniformLocation(B,"fogDensity");q=w.getUniformLocation(B,"fogNear");s=w.getUniformLocation(B,"fogFar");r=w.getUniformLocation(B,"fogColor");u=w.getUniformLocation(B,"alphaTest");G=document.createElement("canvas");G.width=8;G.height=8;H=G.getContext("2d");H.fillStyle="white";H.fillRect(0,0,8,8);N=new THREE.Texture(G);N.needsUpdate=!0}w.useProgram(B);C.initAttributes();C.enableAttribute(x);C.enableAttribute(v);C.disableUnusedAttributes();C.disable(w.CULL_FACE);
+C.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,y);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,z);w.uniformMatrix4fv(n,!1,D.projectionMatrix.elements);C.activeTexture(w.TEXTURE0);w.uniform1i(h,0);H=G=0;(O=K.fog)?(w.uniform3f(r,O.color.r,O.color.g,O.color.b),O instanceof THREE.Fog?(w.uniform1f(q,O.near),w.uniform1f(s,O.far),w.uniform1i(p,1),H=G=1):O instanceof THREE.FogExp2&&(w.uniform1f(l,O.density),w.uniform1i(p,2),H=G=2)):
+(w.uniform1i(p,0),H=G=0);for(var O=0,Q=b.length;O<Q;O++){var T=b[O];T.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,T.matrixWorld);T.z=-T.modelViewMatrix.elements[14]}b.sort(A);for(var R=[],O=0,Q=b.length;O<Q;O++){var T=b[O],U=T.material;w.uniform1f(u,U.alphaTest);w.uniformMatrix4fv(m,!1,T.modelViewMatrix.elements);T.matrixWorld.decompose(J,E,P);R[0]=P.x;R[1]=P.y;T=0;K.fog&&U.fog&&(T=H);G!==T&&(w.uniform1i(p,T),G=T);null!==U.map?(w.uniform2f(c,U.map.offset.x,U.map.offset.y),w.uniform2f(d,
+U.map.repeat.x,U.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(k,U.opacity);w.uniform3f(f,U.color.r,U.color.g,U.color.b);w.uniform1f(e,U.rotation);w.uniform2fv(g,R);C.setBlending(U.blending,U.blendEquation,U.blendSrc,U.blendDst);C.setDepthTest(U.depthTest);C.setDepthWrite(U.depthWrite);U.map&&U.map.image&&U.map.image.width?a.setTexture(U.map,0):a.setTexture(N,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}C.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.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,
 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");
 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),m=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var l=0>p-1?0:p-1,q=p+1>e-1?e-1:p+1,t=0>n-1?0:n-1,r=n+1>d-1?d-1:n+1,u=[],v=[0,0,h[4*(p*d+n)]/255*b];u.push([-1,0,h[4*(p*d+t)]/255*b]);u.push([-1,-1,h[4*(l*d+t)]/255*b]);u.push([0,-1,h[4*(l*d+n)]/255*b]);u.push([1,-1,h[4*(l*d+r)]/255*b]);u.push([1,0,h[4*(p*d+r)]/255*b]);u.push([1,1,h[4*(q*d+r)]/255*b]);u.push([0,1,h[4*(q*d+n)]/255*
-b]);u.push([-1,1,h[4*(q*d+t)]/255*b]);l=[];t=u.length;for(q=0;q<t;q++){var r=u[q],w=u[(q+1)%t],r=[r[0]-v[0],r[1]-v[1],r[2]-v[2]],w=[w[0]-v[0],w[1]-v[1],w[2]-v[2]];l.push(c([r[1]*w[2]-r[2]*w[1],r[2]*w[0]-r[0]*w[2],r[0]*w[1]-r[1]*w[0]]))}u=[0,0,0];for(q=0;q<l.length;q++)u[0]+=l[q][0],u[1]+=l[q][1],u[2]+=l[q][2];u[0]/=l.length;u[1]/=l.length;u[2]/=l.length;v=4*(p*d+n);m[v]=(u[0]+1)/2*255|0;m[v+1]=(u[1]+1)/2*255|0;m[v+2]=255*u[2]|0;m[v+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),m=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var l=0>p-1?0:p-1,q=p+1>e-1?e-1:p+1,s=0>n-1?0:n-1,r=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*(l*d+s)]/255*b]);u.push([0,-1,h[4*(l*d+n)]/255*b]);u.push([1,-1,h[4*(l*d+r)]/255*b]);u.push([1,0,h[4*(p*d+r)]/255*b]);u.push([1,1,h[4*(q*d+r)]/255*b]);u.push([0,1,h[4*(q*d+n)]/255*
+b]);u.push([-1,1,h[4*(q*d+s)]/255*b]);l=[];s=u.length;for(q=0;q<s;q++){var r=u[q],v=u[(q+1)%s],r=[r[0]-x[0],r[1]-x[1],r[2]-x[2]],v=[v[0]-x[0],v[1]-x[1],v[2]-x[2]];l.push(c([r[1]*v[2]-r[2]*v[1],r[2]*v[0]-r[0]*v[2],r[0]*v[1]-r[1]*v[0]]))}u=[0,0,0];for(q=0;q<l.length;q++)u[0]+=l[q][0],u[1]+=l[q][1],u[2]+=l[q][2];u[0]/=l.length;u[1]/=l.length;u[2]/=l.length;x=4*(p*d+n);m[x]=(u[0]+1)/2*255|0;m[x+1]=(u[1]+1)/2*255|0;m[x+2]=255*u[2]|0;m[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}};
 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.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]=
 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,m,n,p,l,q,t,r,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),m=b.length,a=0;a<m;)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;t=b[a++]*c;e.quadraticCurveTo(q,t,k,n);if(f=g[g.length-1])for(p=f.x,l=f.y,f=1,h=this.divisions;f<=h;f++){var w=f/h;THREE.Shape.Utils.b2(w,p,q,k);THREE.Shape.Utils.b2(w,l,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,q=b[a++]*c+d,t=b[a++]*c,r=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,t,r,u,k,n),f=g[g.length-1])for(p=f.x,l=f.y,f=1,h=this.divisions;f<=h;f++)w=f/h,THREE.Shape.Utils.b3(w,p,q,r,k),THREE.Shape.Utils.b3(w,
-l,t,u,n)}return{offset:v.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,m,n,p,l,q,s,r,u,x=b.glyphs[a]||b.glyphs["?"];if(x){if(x.o)for(b=x._cachedOutline||(x._cachedOutline=x.o.split(" ")),m=b.length,a=0;a<m;)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,l=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,l,s,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,q=b[a++]*c+d,s=b[a++]*c,r=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,s,r,u,k,n),f=g[g.length-1])for(p=f.x,l=f.y,f=1,h=this.divisions;f<=h;f++)v=f/h,THREE.Shape.Utils.b3(v,p,q,r,k),THREE.Shape.Utils.b3(v,
+l,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};
 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,m,n;if(0<b(a))for(m=0;m<e;m++)f[m]=m;else for(m=0;m<e;m++)f[m]=e-1-m;var p=2*e;for(m=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=m;e<=k&&(k=0);m=k+1;e<=m&&(m=0);n=m+1;e<=n&&(n=0);var l;a:{var q=l=void 0,t=void 0,r=void 0,
-u=void 0,v=void 0,w=void 0,A=void 0,x=void 0,q=a[f[k]].x,t=a[f[k]].y,r=a[f[m]].x,u=a[f[m]].y,v=a[f[n]].x,w=a[f[n]].y;if(1E-10>(r-q)*(w-t)-(u-t)*(v-q))l=!1;else{var C=void 0,y=void 0,z=void 0,B=void 0,M=void 0,J=void 0,E=void 0,P=void 0,K=void 0,D=void 0,K=P=E=x=A=void 0,C=v-r,y=w-u,z=q-v,B=t-w,M=r-q,J=u-t;for(l=0;l<e;l++)if(A=a[f[l]].x,x=a[f[l]].y,!(A===q&&x===t||A===r&&x===u||A===v&&x===w)&&(E=A-q,P=x-t,K=A-r,D=x-u,A-=v,x-=w,K=C*D-y*K,E=M*P-J*E,P=z*x-B*A,-1E-10<=K&&-1E-10<=P&&-1E-10<=E)){l=!1;break a}l=
+(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,m,n;if(0<b(a))for(m=0;m<e;m++)f[m]=m;else for(m=0;m<e;m++)f[m]=e-1-m;var p=2*e;for(m=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=m;e<=k&&(k=0);m=k+1;e<=m&&(m=0);n=m+1;e<=n&&(n=0);var l;a:{var q=l=void 0,s=void 0,r=void 0,
+u=void 0,x=void 0,v=void 0,A=void 0,w=void 0,q=a[f[k]].x,s=a[f[k]].y,r=a[f[m]].x,u=a[f[m]].y,x=a[f[n]].x,v=a[f[n]].y;if(1E-10>(r-q)*(v-s)-(u-s)*(x-q))l=!1;else{var C=void 0,y=void 0,z=void 0,B=void 0,N=void 0,J=void 0,E=void 0,P=void 0,K=void 0,D=void 0,K=P=E=w=A=void 0,C=x-r,y=v-u,z=q-x,B=s-v,N=r-q,J=u-s;for(l=0;l<e;l++)if(A=a[f[l]].x,w=a[f[l]].y,!(A===q&&w===s||A===r&&w===u||A===x&&w===v)&&(E=A-q,P=w-s,K=A-r,D=w-u,A-=x,w-=v,K=C*D-y*K,E=N*P-J*E,P=z*w-B*A,-1E-10<=K&&-1E-10<=P&&-1E-10<=E)){l=!1;break a}l=
 !0}}if(l){g.push([a[f[k]],a[f[m]],a[f[n]]]);h.push([f[k],f[m],f[n]]);k=m;for(n=m+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);
 !0}}if(l){g.push([a[f[k]],a[f[m]],a[f[n]]]);h.push([f[k],f[m],f[n]]);k=m;for(n=m+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=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.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};
@@ -685,21 +684,21 @@ 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.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,h){var k=this.actions[this.actions.length-1].args;this.absellipse(a+k[k.length-2],b+k[k.length-1],c,d,e,g,f,h)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,g,f,h){var k=[a,b,c,d,e,g,f,h||0];a=new THREE.EllipseCurve(a,b,c,d,e,g,f,h);this.curves.push(a);a=a.getPoint(1);k.push(a.x);k.push(a.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:k})};
 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,h){var k=this.actions[this.actions.length-1].args;this.absellipse(a+k[k.length-2],b+k[k.length-1],c,d,e,g,f,h)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,g,f,h){var k=[a,b,c,d,e,g,f,h||0];a=new THREE.EllipseCurve(a,b,c,d,e,g,f,h);this.curves.push(a);a=a.getPoint(1);k.push(a.x);k.push(a.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:k})};
 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.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,m,n,p,l,q,t,r;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];l=g[1];0<c.length?(f=c[c.length-1],q=f.x,t=f.y):(f=this.actions[d-
-1].args,q=f[f.length-2],t=f[f.length-1]);for(g=1;g<=a;g++)r=g/a,f=THREE.Shape.Utils.b2(r,q,p,h),r=THREE.Shape.Utils.b2(r,t,l,k),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];p=g[0];l=g[1];m=g[2];n=g[3];0<c.length?(f=c[c.length-1],q=f.x,t=f.y):(f=this.actions[d-1].args,q=f[f.length-2],t=f[f.length-1]);for(g=1;g<=a;g++)r=g/a,f=THREE.Shape.Utils.b3(r,q,p,m,h),r=THREE.Shape.Utils.b3(r,t,l,n,k),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.CSPLINE_THRU:f=
-this.actions[d-1].args;r=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;r=r.concat(g[0]);r=new THREE.SplineCurve(r);for(g=1;g<=f;g++)c.push(r.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];l=g[2];m=g[3];f=g[4];p=!!g[5];q=f-m;t=2*a;for(g=1;g<=t;g++)r=g/t,p||(r=1-r),r=m+r*q,f=h+l*Math.cos(r),r=k+l*Math.sin(r),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.ELLIPSE:h=g[0];k=g[1];l=g[2];n=g[3];m=g[4];f=g[5];p=!!g[6];var u=g[7];q=f-m;t=2*a;var v,w;0!==u&&
-(v=Math.cos(u),w=Math.sin(u));for(g=1;g<=t;g++){r=g/t;p||(r=1-r);r=m+r*q;f=h+l*Math.cos(r);r=k+n*Math.sin(r);if(0!==u){var A=f;f=(A-h)*v-(r-k)*w+h;r=(A-h)*w+(r-k)*v+k}c.push(new THREE.Vector2(f,r))}}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,m,n,p,l,q,s,r;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];l=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++)r=g/a,f=THREE.Shape.Utils.b2(r,q,p,h),r=THREE.Shape.Utils.b2(r,s,l,k),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];p=g[0];l=g[1];m=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++)r=g/a,f=THREE.Shape.Utils.b3(r,q,p,m,h),r=THREE.Shape.Utils.b3(r,s,l,n,k),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.CSPLINE_THRU:f=
+this.actions[d-1].args;r=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;r=r.concat(g[0]);r=new THREE.SplineCurve(r);for(g=1;g<=f;g++)c.push(r.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];l=g[2];m=g[3];f=g[4];p=!!g[5];q=f-m;s=2*a;for(g=1;g<=s;g++)r=g/s,p||(r=1-r),r=m+r*q,f=h+l*Math.cos(r),r=k+l*Math.sin(r),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.ELLIPSE:h=g[0];k=g[1];l=g[2];n=g[3];m=g[4];f=g[5];p=!!g[6];var u=g[7];q=f-m;s=2*a;var x,v;0!==u&&
+(x=Math.cos(u),v=Math.sin(u));for(g=1;g<=s;g++){r=g/s;p||(r=1-r);r=m+r*q;f=h+l*Math.cos(r);r=k+n*Math.sin(r);if(0!==u){var A=f;f=(A-h)*x-(r-k)*v+h;r=(A-h)*v+(r-k)*x+k}c.push(new THREE.Vector2(f,r))}}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&&
 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 m=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),
 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 m=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),
-m=a?!m:m;h=[];var n=[],p=[],l=0,q;n[l]=void 0;p[l]=[];var t,r;t=0;for(r=e.length;t<r;t++)f=e[t],q=f.getPoints(),g=THREE.Shape.Utils.isClockWise(q),(g=a?!g:g)?(!m&&n[l]&&l++,n[l]={s:new THREE.Shape,p:q},n[l].s.actions=f.actions,n[l].s.curves=f.curves,m&&l++,p[l]=[]):p[l].push({h:f,p:q[0]});if(!n[0])return c(e);if(1<n.length){t=!1;r=[];f=0;for(e=n.length;f<e;f++)h[f]=[];f=0;for(e=n.length;f<e;f++)for(g=p[f],m=0;m<g.length;m++){l=g[m];q=!0;for(var u=0;u<n.length;u++)d(l.p,n[u].p)&&(f!==u&&r.push({froms:f,
-tos:u,hole:m}),q?(q=!1,h[u].push(l)):t=!0);q&&h[f].push(l)}0<r.length&&(t||(p=h))}t=0;for(r=n.length;t<r;t++)for(h=n[t].s,k.push(h),f=p[t],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)};
+m=a?!m:m;h=[];var n=[],p=[],l=0,q;n[l]=void 0;p[l]=[];var s,r;s=0;for(r=e.length;s<r;s++)f=e[s],q=f.getPoints(),g=THREE.Shape.Utils.isClockWise(q),(g=a?!g:g)?(!m&&n[l]&&l++,n[l]={s:new THREE.Shape,p:q},n[l].s.actions=f.actions,n[l].s.curves=f.curves,m&&l++,p[l]=[]):p[l].push({h:f,p:q[0]});if(!n[0])return c(e);if(1<n.length){s=!1;r=[];f=0;for(e=n.length;f<e;f++)h[f]=[];f=0;for(e=n.length;f<e;f++)for(g=p[f],m=0;m<g.length;m++){l=g[m];q=!0;for(var u=0;u<n.length;u++)d(l.p,n[u].p)&&(f!==u&&r.push({froms:f,
+tos:u,hole:m}),q?(q=!1,h[u].push(l)):s=!0);q&&h[f].push(l)}0<r.length&&(s||(p=h))}s=0;for(r=n.length;s<r;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.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.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,m=e.y-d.y,n=a.x-d.x,p=a.y-d.y,z=h*k-g*m,B=h*n-g*p;if(1E-10<Math.abs(z)){if(0<z){if(0>B||B>z)return[];k=m*n-k*p;if(0>k||k>z)return[]}else{if(0<B||B<z)return[];k=m*n-k*p;if(0<k||k<z)return[]}if(0===k)return!f||0!==B&&B!==z?[a]:[];if(k===z)return!f||0!==B&&B!==z?[b]:[];if(0===
 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,m=e.y-d.y,n=a.x-d.x,p=a.y-d.y,z=h*k-g*m,B=h*n-g*p;if(1E-10<Math.abs(z)){if(0<z){if(0>B||B>z)return[];k=m*n-k*p;if(0>k||k>z)return[]}else{if(0<B||B<z)return[];k=m*n-k*p;if(0<k||k<z)return[]}if(0===k)return!f||0!==B&&B!==z?[a]:[];if(k===z)return!f||0!==B&&B!==z?[b]:[];if(0===
 B)return[d];if(B===z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==B||m*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===m;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,z=d.x,m=e,d=e.x):(b=e,z=e.x,m=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,z=d.y,m=e,d=e.y):(b=e,z=e.y,m=d,d=d.y));return k<=z?a<z?[]:a===z?f?[]:[b]:a<=d?[b,h]:[b,m]:k>d?[]:
 B)return[d];if(B===z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==B||m*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===m;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,z=d.x,m=e,d=e.x):(b=e,z=e.x,m=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,z=d.y,m=e,d=e.y):(b=e,z=e.y,m=d,d=d.y));return k<=z?a<z?[]:a===z?f?[]:[b]:a<=d?[b,h]:[b,m]:k>d?[]:
 k===d?f?[]:[g]:a<=d?[g,h]:[g,m]}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,m,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++)m=h[g].x+":"+h[g].y,void 0!==n[m]&&console.warn("THREE.Shape: Duplicate point",m),n[m]=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=
 k===d?f?[]:[g]:a<=d?[g,h]:[g,m]}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,m,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++)m=h[g].x+":"+h[g].y,void 0!==n[m]&&console.warn("THREE.Shape: Duplicate point",m),n[m]=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<m.length;e++)for(f=b[m[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,m=[],n,p,y,z,B,M=[],J,E,P,K=0;for(n=b.length;K<n;K++)m.push(K);J=0;for(var D=2*
-m.length;0<m.length;){D--;if(0>D){console.log("Infinite Loop! Holes left:"+m.length+", Probably Hole outside Shape!");break}for(p=J;p<h.length;p++){y=h[p];n=-1;for(K=0;K<m.length;K++)if(z=m[K],B=y.x+":"+y.y+":"+z,void 0===M[B]){k=b[z];for(E=0;E<k.length;E++)if(z=k[E],c(p,E)&&!f(y,z)&&!g(y,z)){n=E;m.splice(K,1);J=h.slice(0,p+1);z=h.slice(p);E=k.slice(n);P=k.slice(0,n+1);h=J.concat(E).concat(P).concat(z);J=p;break}if(0<=n)break;M[B]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(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<m.length;e++)for(f=b[m[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,m=[],n,p,y,z,B,N=[],J,E,P,K=0;for(n=b.length;K<n;K++)m.push(K);J=0;for(var D=2*
+m.length;0<m.length;){D--;if(0>D){console.log("Infinite Loop! Holes left:"+m.length+", Probably Hole outside Shape!");break}for(p=J;p<h.length;p++){y=h[p];n=-1;for(K=0;K<m.length;K++)if(z=m[K],B=y.x+":"+y.y+":"+z,void 0===N[B]){k=b[z];for(E=0;E<k.length;E++)if(z=k[E],c(p,E)&&!f(y,z)&&!g(y,z)){n=E;m.splice(K,1);J=h.slice(0,p+1);z=h.slice(p);E=k.slice(n);P=k.slice(0,n+1);h=J.concat(E).concat(P).concat(z);J=p;break}if(0<=n)break;N[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++)m=k[h].x+":"+k[h].y,m=n[m],void 0!==m&&(k[h]=m);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-
 !1);g=0;for(f=p.length;g<f;g++)for(k=p[g],h=0;3>h;h++)m=k[h].x+":"+k[h].y,m=n[m],void 0!==m&&(k[h]=m);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)};
 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.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;
@@ -725,12 +724,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};
 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}});
 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!==
 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,l,q,t,r;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]];t=a[c[2]];r=a[c[3]];c=e*e;l=e*c;d[0]=g(p[0],q[0],t[0],r[0],e,c,l);d[1]=g(p[1],q[1],t[1],r[1],e,c,l);d[2]=g(p[2],q[2],t[2],r[2],e,c,l);return d},g=function(a,b,c,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,l,q,s,r;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]];r=a[c[3]];c=e*e;l=e*c;d[0]=g(p[0],q[0],s[0],r[0],e,c,l);d[1]=g(p[1],q[1],s[1],r[1],e,c,l);d[2]=g(p[2],q[2],s[2],r[2],e,c,l);return d},g=function(a,b,c,d,
 e,g,l){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*l+(-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],m=k.animationCache.animations[this.data.name],n=k.animationCache.blending,p=0;3>p;p++){var l=this.keyTypes[p],
 e,g,l){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*l+(-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],m=k.animationCache.animations[this.data.name],n=k.animationCache.blending,p=0;3>p;p++){var l=this.keyTypes[p],
-q=m.prevKey[l],t=m.nextKey[l];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&q.time>=this.currentTime){q=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(l,f,1);t.time<this.currentTime&&t.index>q.index;)q=t,t=this.getNextKeyWith(l,f,t.index+1);m.prevKey[l]=q;m.nextKey[l]=t}var r=(this.currentTime-q.time)/(t.time-q.time),u=q[l],v=t[l];0>r&&(r=0);1<r&&(r=1);if("pos"===l)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*r,c.y=u[1]+(v[1]-u[1])*r,
-c.z=u[2]+(v[2]-u[2])*r,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]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,r=.33*r+.33,t=e(a,r),q=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,l=k.position,l.x+=(t[0]-l.x)*q,l.y+=(t[1]-
-l.y)*q,l.z+=(t[2]-l.z)*q,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(r=e(a,1.01*r),b.set(r[0],r[1],r[2]),b.sub(l),b.y=0,b.normalize(),r=Math.atan2(b.x,b.z),k.rotation.set(0,r,0))}else"rot"===l?(THREE.Quaternion.slerp(u,v,d,r),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"===l&&(c.x=u[0]+(v[0]-u[0])*r,c.y=
-u[1]+(v[1]-u[1])*r,c.z=u[2]+(v[2]-u[2])*r,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=
+q=m.prevKey[l],s=m.nextKey[l];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(l,f,1);s.time<this.currentTime&&s.index>q.index;)q=s,s=this.getNextKeyWith(l,f,s.index+1);m.prevKey[l]=q;m.nextKey[l]=s}var r=(this.currentTime-q.time)/(s.time-q.time),u=q[l],x=s[l];0>r&&(r=0);1<r&&(r=1);if("pos"===l)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(x[0]-u[0])*r,c.y=u[1]+(x[1]-u[1])*r,
+c.z=u[2]+(x[2]-u[2])*r,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,r=.33*r+.33,s=e(a,r),q=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,l=k.position,l.x+=(s[0]-l.x)*q,l.y+=(s[1]-
+l.y)*q,l.z+=(s[2]-l.z)*q,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(r=e(a,1.01*r),b.set(r[0],r[1],r[2]),b.sub(l),b.y=0,b.normalize(),r=Math.atan2(b.x,b.z),k.rotation.set(0,r,0))}else"rot"===l?(THREE.Quaternion.slerp(u,x,d,r),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"===l&&(c.x=u[0]+(x[0]-u[0])*r,c.y=
+u[1]+(x[1]-u[1])*r,c.z=u[2]+(x[2]-u[2])*r,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]}};
 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();
 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}}};
 d.matrixWorldNeedsUpdate=!0}}};
@@ -741,8 +740,8 @@ 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=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]=
 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}}};
 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,r){var u,v=h.widthSegments,w=h.heightSegments,A=e/2,x=f/2,C=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",w=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var y=v+1,z=w+1,B=e/v,M=f/w,J=new THREE.Vector3;J[u]=0<g?1:-1;for(e=0;e<z;e++)for(f=0;f<y;f++){var E=new THREE.Vector3;E[a]=(f*B-A)*c;E[b]=(e*M-x)*d;E[u]=g;h.vertices.push(E)}for(e=
-0;e<w;e++)for(f=0;f<v;f++)x=f+y*e,a=f+y*(e+1),b=f+1+y*(e+1),c=f+1+y*e,d=new THREE.Vector2(f/v,1-e/w),g=new THREE.Vector2(f/v,1-(e+1)/w),u=new THREE.Vector2((f+1)/v,1-(e+1)/w),A=new THREE.Vector2((f+1)/v,1-e/w),x=new THREE.Face3(x+C,a+C,c+C),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=r,h.faces.push(x),h.faceVertexUvs[0].push([d,g,A]),x=new THREE.Face3(a+C,b+C,c+C),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=r,h.faces.push(x),
+THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,r){var u,x=h.widthSegments,v=h.heightSegments,A=e/2,w=f/2,C=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 y=x+1,z=v+1,B=e/x,N=f/v,J=new THREE.Vector3;J[u]=0<g?1:-1;for(e=0;e<z;e++)for(f=0;f<y;f++){var E=new THREE.Vector3;E[a]=(f*B-A)*c;E[b]=(e*N-w)*d;E[u]=g;h.vertices.push(E)}for(e=
+0;e<v;e++)for(f=0;f<x;f++)w=f+y*e,a=f+y*(e+1),b=f+1+y*(e+1),c=f+1+y*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),A=new THREE.Vector2((f+1)/x,1-e/v),w=new THREE.Face3(w+C,a+C,c+C),w.normal.copy(J),w.vertexNormals.push(J.clone(),J.clone(),J.clone()),w.materialIndex=r,h.faces.push(w),h.faceVertexUvs[0].push([d,g,A]),w=new THREE.Face3(a+C,b+C,c+C),w.normal.copy(J),w.vertexNormals.push(J.clone(),J.clone(),J.clone()),w.materialIndex=r,h.faces.push(w),
 h.faceVertexUvs[0].push([g.clone(),u,A.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);
 h.faceVertexUvs[0].push([g.clone(),u,A.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.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,
 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,
@@ -751,42 +750,42 @@ THREE.CircleGeometry.prototype.clone=function(){return new THREE.CircleGeometry(
 THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,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,m=2;h<=b;h++,k+=3,m+=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[m]=(g[k]/a+1)/2;e[m+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,m=2;h<=b;h++,k+=3,m+=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[m]=(g[k]/a+1)/2;e[m+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.IndexBufferAttribute(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;
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.IndexBufferAttribute(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.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,m,n,p=[],l=[];for(n=0;n<=e;n++){var q=[],t=[],r=n/e,u=r*(b-a)+a;for(m=0;m<=d;m++){var v=m/d,w=new THREE.Vector3;w.x=u*Math.sin(v*h+
-f);w.y=-r*c+k;w.z=u*Math.cos(v*h+f);this.vertices.push(w);q.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-r))}p.push(q);l.push(t)}c=(b-a)/c;for(m=0;m<d;m++)for(0!==a?(f=this.vertices[p[0][m]].clone(),h=this.vertices[p[0][m+1]].clone()):(f=this.vertices[p[1][m]].clone(),h=this.vertices[p[1][m+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][m],t=p[n+1][m],r=p[n+1][m+1],u=p[n][m+1],v=f.clone(),w=f.clone(),
-A=h.clone(),x=h.clone(),C=l[n][m].clone(),y=l[n+1][m].clone(),z=l[n+1][m+1].clone(),B=l[n][m+1].clone();this.faces.push(new THREE.Face3(q,t,u,[v,w,x]));this.faceVertexUvs[0].push([C,y,B]);this.faces.push(new THREE.Face3(t,r,u,[w.clone(),A,x.clone()]));this.faceVertexUvs[0].push([y.clone(),z,B.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),m=0;m<d;m++)q=p[0][m],t=p[0][m+1],r=this.vertices.length-1,v=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),A=new THREE.Vector3(0,
-1,0),C=l[0][m].clone(),y=l[0][m+1].clone(),z=new THREE.Vector2(y.x,0),this.faces.push(new THREE.Face3(q,t,r,[v,w,A],void 0,1)),this.faceVertexUvs[0].push([C,y,z]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),m=0;m<d;m++)q=p[e][m+1],t=p[e][m],r=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),A=new THREE.Vector3(0,-1,0),C=l[e][m+1].clone(),y=l[e][m].clone(),z=new THREE.Vector2(y.x,1),this.faces.push(new THREE.Face3(q,t,r,[v,w,A],void 0,2)),this.faceVertexUvs[0].push([C,
+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,m,n,p=[],l=[];for(n=0;n<=e;n++){var q=[],s=[],r=n/e,u=r*(b-a)+a;for(m=0;m<=d;m++){var x=m/d,v=new THREE.Vector3;v.x=u*Math.sin(x*h+
+f);v.y=-r*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-r))}p.push(q);l.push(s)}c=(b-a)/c;for(m=0;m<d;m++)for(0!==a?(f=this.vertices[p[0][m]].clone(),h=this.vertices[p[0][m+1]].clone()):(f=this.vertices[p[1][m]].clone(),h=this.vertices[p[1][m+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][m],s=p[n+1][m],r=p[n+1][m+1],u=p[n][m+1],x=f.clone(),v=f.clone(),
+A=h.clone(),w=h.clone(),C=l[n][m].clone(),y=l[n+1][m].clone(),z=l[n+1][m+1].clone(),B=l[n][m+1].clone();this.faces.push(new THREE.Face3(q,s,u,[x,v,w]));this.faceVertexUvs[0].push([C,y,B]);this.faces.push(new THREE.Face3(s,r,u,[v.clone(),A,w.clone()]));this.faceVertexUvs[0].push([y.clone(),z,B.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),m=0;m<d;m++)q=p[0][m],s=p[0][m+1],r=this.vertices.length-1,x=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),A=new THREE.Vector3(0,
+1,0),C=l[0][m].clone(),y=l[0][m+1].clone(),z=new THREE.Vector2(y.x,0),this.faces.push(new THREE.Face3(q,s,r,[x,v,A],void 0,1)),this.faceVertexUvs[0].push([C,y,z]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),m=0;m<d;m++)q=p[e][m+1],s=p[e][m],r=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),A=new THREE.Vector3(0,-1,0),C=l[e][m+1].clone(),y=l[e][m].clone(),z=new THREE.Vector2(y.x,1),this.faces.push(new THREE.Face3(q,s,r,[x,v,A],void 0,2)),this.faceVertexUvs[0].push([C,
 y,z]);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)};
 y,z]);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 m=0,n=h.length;m<n;m++)for(var p=h[m],l=0;3>l;l++){d[0]=p[f[l]];d[1]=p[f[(l+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:m,
 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 m=0,n=h.length;m<n;m++)for(var p=h[m],l=0;3>l;l++){d[0]=p[f[l]];d[1]=p[f[(l+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:m,
 face2:void 0}:e[q].face2=m}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;
 face2:void 0}:e[q].face2=m}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=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=
 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(F=a.length;0<=--F;){c=F;d=F-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+J,g=g+J,l=l+J,h=h+J;M.faces.push(new THREE.Face3(k,g,h));M.faces.push(new THREE.Face3(g,l,h));k=v.generateSideWallUV(M,k,g,l,h);M.faceVertexUvs[0].push([k[0],k[1],k[3]]);M.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function g(a,b,c){M.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=J;b+=J;c+=J;M.faces.push(new THREE.Face3(a,b,c));a=v.generateTopUV(M,a,b,c);M.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,m=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,l=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,
-r,u=!1,v=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,A,x,C;t&&(r=t.getSpacedPoints(q),u=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,!1),A=new THREE.Vector3,x=new THREE.Vector3,C=new THREE.Vector3);p||(m=k=n=0);var y,z,B,M=this,J=this.vertices.length,t=a.extractPoints(l),l=t.shape,E=t.holes;if(t=!THREE.Shape.Utils.isClockWise(l)){l=l.reverse();z=0;for(B=E.length;z<B;z++)y=E[z],THREE.Shape.Utils.isClockWise(y)&&(E[z]=y.reverse());t=
-!1}var P=THREE.Shape.Utils.triangulateShape(l,E),K=l;z=0;for(B=E.length;z<B;z++)y=E[z],l=l.concat(y);var D,G,H,O,Q,T=l.length,R,U=P.length,t=[],F=0;H=K.length;D=H-1;for(G=F+1;F<H;F++,D++,G++)D===H&&(D=0),G===H&&(G=0),t[F]=d(K[F],K[D],K[G]);var $=[],ea,aa=t.concat();z=0;for(B=E.length;z<B;z++){y=E[z];ea=[];F=0;H=y.length;D=H-1;for(G=F+1;F<H;F++,D++,G++)D===H&&(D=0),G===H&&(G=0),ea[F]=d(y[F],y[D],y[G]);$.push(ea);aa=aa.concat(ea)}for(D=0;D<n;D++){H=D/n;O=k*(1-H);G=m*Math.sin(H*Math.PI/2);F=0;for(H=
-K.length;F<H;F++)Q=c(K[F],t[F],G),g(Q.x,Q.y,-O);z=0;for(B=E.length;z<B;z++)for(y=E[z],ea=$[z],F=0,H=y.length;F<H;F++)Q=c(y[F],ea[F],G),g(Q.x,Q.y,-O)}G=m;for(F=0;F<T;F++)Q=p?c(l[F],aa[F],G):l[F],u?(x.copy(w.normals[0]).multiplyScalar(Q.x),A.copy(w.binormals[0]).multiplyScalar(Q.y),C.copy(r[0]).add(x).add(A),g(C.x,C.y,C.z)):g(Q.x,Q.y,0);for(H=1;H<=q;H++)for(F=0;F<T;F++)Q=p?c(l[F],aa[F],G):l[F],u?(x.copy(w.normals[H]).multiplyScalar(Q.x),A.copy(w.binormals[H]).multiplyScalar(Q.y),C.copy(r[H]).add(x).add(A),
-g(C.x,C.y,C.z)):g(Q.x,Q.y,h/q*H);for(D=n-1;0<=D;D--){H=D/n;O=k*(1-H);G=m*Math.sin(H*Math.PI/2);F=0;for(H=K.length;F<H;F++)Q=c(K[F],t[F],G),g(Q.x,Q.y,h+O);z=0;for(B=E.length;z<B;z++)for(y=E[z],ea=$[z],F=0,H=y.length;F<H;F++)Q=c(y[F],ea[F],G),u?g(Q.x,Q.y+r[q-1].y,r[q-1].x+O):g(Q.x,Q.y,h+O)}(function(){if(p){var a;a=0*T;for(F=0;F<U;F++)R=P[F],f(R[2]+a,R[1]+a,R[0]+a);a=q+2*n;a*=T;for(F=0;F<U;F++)R=P[F],f(R[0]+a,R[1]+a,R[2]+a)}else{for(F=0;F<U;F++)R=P[F],f(R[2],R[1],R[0]);for(F=0;F<U;F++)R=P[F],f(R[0]+
+!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(F=a.length;0<=--F;){c=F;d=F-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+J,g=g+J,l=l+J,h=h+J;N.faces.push(new THREE.Face3(k,g,h));N.faces.push(new THREE.Face3(g,l,h));k=x.generateSideWallUV(N,k,g,l,h);N.faceVertexUvs[0].push([k[0],k[1],k[3]]);N.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function g(a,b,c){N.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=J;b+=J;c+=J;N.faces.push(new THREE.Face3(a,b,c));a=x.generateTopUV(N,a,b,c);N.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,m=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,l=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,s=b.extrudePath,
+r,u=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,A,w,C;s&&(r=s.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,q,!1),A=new THREE.Vector3,w=new THREE.Vector3,C=new THREE.Vector3);p||(m=k=n=0);var y,z,B,N=this,J=this.vertices.length,s=a.extractPoints(l),l=s.shape,E=s.holes;if(s=!THREE.Shape.Utils.isClockWise(l)){l=l.reverse();z=0;for(B=E.length;z<B;z++)y=E[z],THREE.Shape.Utils.isClockWise(y)&&(E[z]=y.reverse());s=
+!1}var P=THREE.Shape.Utils.triangulateShape(l,E),K=l;z=0;for(B=E.length;z<B;z++)y=E[z],l=l.concat(y);var D,G,H,O,Q,T=l.length,R,U=P.length,s=[],F=0;H=K.length;D=H-1;for(G=F+1;F<H;F++,D++,G++)D===H&&(D=0),G===H&&(G=0),s[F]=d(K[F],K[D],K[G]);var $=[],ea,aa=s.concat();z=0;for(B=E.length;z<B;z++){y=E[z];ea=[];F=0;H=y.length;D=H-1;for(G=F+1;F<H;F++,D++,G++)D===H&&(D=0),G===H&&(G=0),ea[F]=d(y[F],y[D],y[G]);$.push(ea);aa=aa.concat(ea)}for(D=0;D<n;D++){H=D/n;O=k*(1-H);G=m*Math.sin(H*Math.PI/2);F=0;for(H=
+K.length;F<H;F++)Q=c(K[F],s[F],G),g(Q.x,Q.y,-O);z=0;for(B=E.length;z<B;z++)for(y=E[z],ea=$[z],F=0,H=y.length;F<H;F++)Q=c(y[F],ea[F],G),g(Q.x,Q.y,-O)}G=m;for(F=0;F<T;F++)Q=p?c(l[F],aa[F],G):l[F],u?(w.copy(v.normals[0]).multiplyScalar(Q.x),A.copy(v.binormals[0]).multiplyScalar(Q.y),C.copy(r[0]).add(w).add(A),g(C.x,C.y,C.z)):g(Q.x,Q.y,0);for(H=1;H<=q;H++)for(F=0;F<T;F++)Q=p?c(l[F],aa[F],G):l[F],u?(w.copy(v.normals[H]).multiplyScalar(Q.x),A.copy(v.binormals[H]).multiplyScalar(Q.y),C.copy(r[H]).add(w).add(A),
+g(C.x,C.y,C.z)):g(Q.x,Q.y,h/q*H);for(D=n-1;0<=D;D--){H=D/n;O=k*(1-H);G=m*Math.sin(H*Math.PI/2);F=0;for(H=K.length;F<H;F++)Q=c(K[F],s[F],G),g(Q.x,Q.y,h+O);z=0;for(B=E.length;z<B;z++)for(y=E[z],ea=$[z],F=0,H=y.length;F<H;F++)Q=c(y[F],ea[F],G),u?g(Q.x,Q.y+r[q-1].y,r[q-1].x+O):g(Q.x,Q.y,h+O)}(function(){if(p){var a;a=0*T;for(F=0;F<U;F++)R=P[F],f(R[2]+a,R[1]+a,R[0]+a);a=q+2*n;a*=T;for(F=0;F<U;F++)R=P[F],f(R[0]+a,R[1]+a,R[2]+a)}else{for(F=0;F<U;F++)R=P[F],f(R[2],R[1],R[0]);for(F=0;F<U;F++)R=P[F],f(R[0]+
 T*q,R[1]+T*q,R[2]+T*q)}})();(function(){var a=0;e(K,a);a+=K.length;z=0;for(B=E.length;z<B;z++)y=E[z],e(y,a),a+=y.length})()};
 T*q,R[1]+T*q,R[2]+T*q)}})();(function(){var a=0;e(K,a);a+=K.length;z=0;for(B=E.length;z<B;z++)y=E[z],e(y,a),a+=y.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,
 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};
 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,m=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=m.length;e<g;e++)f=m[e],THREE.Shape.Utils.isClockWise(f)&&(m[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,m);e=0;for(g=m.length;e<g;e++)f=m[e],
 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,m=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=m.length;e<g;e++)f=m[e],THREE.Shape.Utils.isClockWise(f)&&(m[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,m);e=0;for(g=m.length;e<g;e++)f=m[e],
 k=k.concat(f);m=k.length;g=n.length;for(e=0;e<m;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)m=n[e],k=m[0]+h,f=m[1]+h,m=m[2]+h,this.faces.push(new THREE.Face3(k,f,m,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,f,m))};
 k=k.concat(f);m=k.length;g=n.length;for(e=0;e<m;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)m=n[e],k=m[0]+h,f=m[1]+h,m=m[2]+h,this.faces.push(new THREE.Face3(k,f,m,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,f,m))};
-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,m=Math.cos(k),n=Math.sin(k),k=0,p=a.length;k<p;k++){var l=a[k],q=new THREE.Vector3;q.x=m*l.x-n*l.y;q.y=n*l.x+m*l.y;q.z=l.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 m=n+1+c,n=n+1,l=f*g,q=k*e,t=
-l+g,r=q+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(l,q),new THREE.Vector2(t,q),new THREE.Vector2(l,r)]);this.faces.push(new THREE.Face3(d,m,n));this.faceVertexUvs[0].push([new THREE.Vector2(t,q),new THREE.Vector2(t,r),new THREE.Vector2(l,r)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,m=Math.cos(k),n=Math.sin(k),k=0,p=a.length;k<p;k++){var l=a[k],q=new THREE.Vector3;q.x=m*l.x-n*l.y;q.y=n*l.x+m*l.y;q.z=l.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 m=n+1+c,n=n+1,l=f*g,q=k*e,s=
+l+g,r=q+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(l,q),new THREE.Vector2(s,q),new THREE.Vector2(l,r)]);this.faces.push(new THREE.Face3(d,m,n));this.faceVertexUvs[0].push([new THREE.Vector2(s,q),new THREE.Vector2(s,r),new THREE.Vector2(l,r)])}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=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.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,m=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var n=new Float32Array(f*h*2),p=0,l=0,q=0;q<h;q++)for(var t=q*m-g,r=0;r<f;r++)b[p]=r*k-e,b[p+1]=-t,a[p+2]=1,n[l]=r/c,n[l+1]=1-q/d,p+=3,l+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
+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,m=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var n=new Float32Array(f*h*2),p=0,l=0,q=0;q<h;q++)for(var s=q*m-g,r=0;r<f;r++)b[p]=r*k-e,b[p+1]=-s,a[p+2]=1,n[l]=r/c,n[l+1]=1-q/d,p+=3,l+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
 d*6);for(q=0;q<d;q++)for(r=0;r<c;r++)g=r+f*(q+1),h=r+1+f*(q+1),k=r+1+f*q,e[p]=r+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.IndexBufferAttribute(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);
 d*6);for(q=0;q<d;q++)for(r=0;r<c;r++)g=r+f*(q+1),h=r+1+f*(q+1),k=r+1+f*q,e[p]=r+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.IndexBufferAttribute(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.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,m=(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,
 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,m=(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+=m}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,m=p+c+1,n=p+c+2,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].clone(),h[n].clone()]),g=p,m=p+c+2,n=p+1,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
 (n.y/b+1)/2))}k+=m}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,m=p+c+1,n=p+c+2,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].clone(),h[n].clone()]),g=p,m=p+c+2,n=p+1,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].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.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,m=[],n=[];for(k=0;k<=c;k++){var p=
 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,m=[],n=[];for(k=0;k<=c;k++){var p=
-[],l=[];for(h=0;h<=b;h++){var q=h/b,t=k/c,r=new THREE.Vector3;r.x=-a*Math.cos(d+q*e)*Math.sin(g+t*f);r.y=a*Math.cos(g+t*f);r.z=a*Math.sin(d+q*e)*Math.sin(g+t*f);this.vertices.push(r);p.push(this.vertices.length-1);l.push(new THREE.Vector2(q,1-t))}m.push(p);n.push(l)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=m[k][h+1];e=m[k][h];g=m[k+1][h];f=m[k+1][h+1];var p=this.vertices[d].clone().normalize(),l=this.vertices[e].clone().normalize(),q=this.vertices[g].clone().normalize(),t=this.vertices[f].clone().normalize(),
-r=n[k][h+1].clone(),u=n[k][h].clone(),v=n[k+1][h].clone(),w=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(r.x=(r.x+u.x)/2,this.faces.push(new THREE.Face3(d,g,f,[p,q,t])),this.faceVertexUvs[0].push([r,v,w])):Math.abs(this.vertices[g].y)===a?(v.x=(v.x+w.x)/2,this.faces.push(new THREE.Face3(d,e,g,[p,l,q])),this.faceVertexUvs[0].push([r,u,v])):(this.faces.push(new THREE.Face3(d,e,f,[p,l,t])),this.faceVertexUvs[0].push([r,u,w]),this.faces.push(new THREE.Face3(e,g,f,[l.clone(),q,t.clone()])),this.faceVertexUvs[0].push([u.clone(),
-v,w.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)};
+[],l=[];for(h=0;h<=b;h++){var q=h/b,s=k/c,r=new THREE.Vector3;r.x=-a*Math.cos(d+q*e)*Math.sin(g+s*f);r.y=a*Math.cos(g+s*f);r.z=a*Math.sin(d+q*e)*Math.sin(g+s*f);this.vertices.push(r);p.push(this.vertices.length-1);l.push(new THREE.Vector2(q,1-s))}m.push(p);n.push(l)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=m[k][h+1];e=m[k][h];g=m[k+1][h];f=m[k+1][h+1];var p=this.vertices[d].clone().normalize(),l=this.vertices[e].clone().normalize(),q=this.vertices[g].clone().normalize(),s=this.vertices[f].clone().normalize(),
+r=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?(r.x=(r.x+u.x)/2,this.faces.push(new THREE.Face3(d,g,f,[p,q,s])),this.faceVertexUvs[0].push([r,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,l,q])),this.faceVertexUvs[0].push([r,u,x])):(this.faces.push(new THREE.Face3(d,e,f,[p,l,s])),this.faceVertexUvs[0].push([r,u,v]),this.faces.push(new THREE.Face3(e,g,f,[l.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),m=new THREE.BufferAttribute(new Float32Array(3*k),3),n=new THREE.BufferAttribute(new Float32Array(3*
 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),m=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,l=[],q=new THREE.Vector3,t=0;t<=c;t++){for(var r=[],u=t/c,v=0;v<=b;v++){var w=v/b,A=-a*Math.cos(d+w*e)*Math.sin(g+u*f),x=a*Math.cos(g+u*f),C=a*Math.sin(d+w*e)*Math.sin(g+u*f);q.set(A,x,C).normalize();m.setXYZ(p,A,x,C);n.setXYZ(p,q.x,q.y,q.z);k.setXY(p,w,1-u);r.push(p);p++}l.push(r)}d=[];for(t=0;t<c;t++)for(v=0;v<b;v++)e=l[t][v+1],f=l[t][v],p=l[t+1][v],q=l[t+1][v+1],(0!==t||0<g)&&d.push(e,f,q),(t!==c-1||h<Math.PI)&&d.push(f,p,q);this.addAttribute("index",
+k),3),k=new THREE.BufferAttribute(new Float32Array(2*k),2),p=0,l=[],q=new THREE.Vector3,s=0;s<=c;s++){for(var r=[],u=s/c,x=0;x<=b;x++){var v=x/b,A=-a*Math.cos(d+v*e)*Math.sin(g+u*f),w=a*Math.cos(g+u*f),C=a*Math.sin(d+v*e)*Math.sin(g+u*f);q.set(A,w,C).normalize();m.setXYZ(p,A,w,C);n.setXYZ(p,q.x,q.y,q.z);k.setXY(p,v,1-u);r.push(p);p++}l.push(r)}d=[];for(s=0;s<c;s++)for(x=0;x<b;x++)e=l[s][x+1],f=l[s][x],p=l[s+1][x],q=l[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.IndexBufferAttribute(new Uint16Array(d),1));this.addAttribute("position",m);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;
 new THREE.IndexBufferAttribute(new Uint16Array(d),1));this.addAttribute("position",m);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.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.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;
@@ -794,17 +793,17 @@ THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="Tor
 d,k/c));h.push(l.clone().sub(g).normalize())}for(k=1;k<=c;k++)for(m=1;m<=d;m++)a=(d+1)*k+m-1,b=(d+1)*(k-1)+m-1,e=(d+1)*(k-1)+m,g=(d+1)*k+m,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()};
 d,k/c));h.push(l.clone().sub(g).normalize())}for(k=1;k<=c;k++)for(m=1;m<=d;m++)a=(d+1)*k+m-1,b=(d+1)*(k-1)+m-1,e=(d+1)*(k-1)+m,g=(d+1)*k+m,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.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),m=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,l=0;l<c;++l){k[l]=
 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),m=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,l=0;l<c;++l){k[l]=
-Array(d);var q=l/c*2*e*Math.PI,t=h(q,g,e,a,f),q=h(q+.01,g,e,a,f);m.subVectors(q,t);n.addVectors(q,t);p.crossVectors(m,n);n.crossVectors(p,m);p.normalize();n.normalize();for(q=0;q<d;++q){var r=q/d*2*Math.PI,u=-b*Math.cos(r),r=b*Math.sin(r),v=new THREE.Vector3;v.x=t.x+u*n.x+r*p.x;v.y=t.y+u*n.y+r*p.y;v.z=t.z+u*n.z+r*p.z;k[l][q]=this.vertices.push(v)-1}}for(l=0;l<c;++l)for(q=0;q<d;++q)e=(l+1)%c,g=(q+1)%d,a=k[l][q],b=k[e][q],e=k[e][g],g=k[l][g],f=new THREE.Vector2(l/c,q/d),m=new THREE.Vector2((l+1)/c,
+Array(d);var q=l/c*2*e*Math.PI,s=h(q,g,e,a,f),q=h(q+.01,g,e,a,f);m.subVectors(q,s);n.addVectors(q,s);p.crossVectors(m,n);n.crossVectors(p,m);p.normalize();n.normalize();for(q=0;q<d;++q){var r=q/d*2*Math.PI,u=-b*Math.cos(r),r=b*Math.sin(r),x=new THREE.Vector3;x.x=s.x+u*n.x+r*p.x;x.y=s.y+u*n.y+r*p.y;x.z=s.z+u*n.z+r*p.z;k[l][q]=this.vertices.push(x)-1}}for(l=0;l<c;++l)for(q=0;q<d;++q)e=(l+1)%c,g=(q+1)%d,a=k[l][q],b=k[e][q],e=k[e][g],g=k[l][g],f=new THREE.Vector2(l/c,q/d),m=new THREE.Vector2((l+1)/c,
 q/d),n=new THREE.Vector2((l+1)/c,(q+1)/d),p=new THREE.Vector2(l/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,m,p]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([m.clone(),n,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
 q/d),n=new THREE.Vector2((l+1)/c,(q+1)/d),p=new THREE.Vector2(l/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,m,p]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([m.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.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,m=b+1,n,p,l,q,t,r=new THREE.Vector3,u,v,w;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);v=u.normals;w=u.binormals;this.tangents=u.tangents;this.normals=v;this.binormals=w;for(u=0;u<m;u++)for(f[u]=[],n=u/(m-1),t=a.getPointAt(n),h=v[u],k=w[u],l=c*g(n),n=0;n<d;n++)p=
-n/d*2*Math.PI,q=-l*Math.cos(p),p=l*Math.sin(p),r.copy(t),r.x+=q*h.x+p*k.x,r.y+=q*h.y+p*k.y,r.z+=q*h.z+p*k.z,f[u][n]=this.vertices.push(new THREE.Vector3(r.x,r.y,r.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)g=e?(u+1)%b:u+1,m=(n+1)%d,a=f[u][n],c=f[g][n],g=f[g][m],m=f[u][m],r=new THREE.Vector2(u/b,n/d),v=new THREE.Vector2((u+1)/b,n/d),w=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,m)),this.faceVertexUvs[0].push([r,v,h]),this.faces.push(new THREE.Face3(c,
-g,m)),this.faceVertexUvs[0].push([v.clone(),w,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=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,m=b+1,n,p,l,q,s,r=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<m;u++)for(f[u]=[],n=u/(m-1),s=a.getPointAt(n),h=x[u],k=v[u],l=c*g(n),n=0;n<d;n++)p=
+n/d*2*Math.PI,q=-l*Math.cos(p),p=l*Math.sin(p),r.copy(s),r.x+=q*h.x+p*k.x,r.y+=q*h.y+p*k.y,r.z+=q*h.z+p*k.z,f[u][n]=this.vertices.push(new THREE.Vector3(r.x,r.y,r.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)g=e?(u+1)%b:u+1,m=(n+1)%d,a=f[u][n],c=f[g][n],g=f[g][m],m=f[u][m],r=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,m)),this.faceVertexUvs[0].push([r,x,h]),this.faces.push(new THREE.Face3(c,
+g,m)),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 m,n,p;this.tangents=e;this.normals=g;this.binormals=f;for(m=0;m<b;m++)n=m/(b-1),e[m]=a.getTangentAt(n),e[m].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;m=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);m<=a&&(a=m,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],
 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 m,n,p;this.tangents=e;this.normals=g;this.binormals=f;for(m=0;m<b;m++)n=m/(b-1),e[m]=a.getTangentAt(n),e[m].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;m=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);m<=a&&(a=m,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(m=1;m<b;m++)g[m]=g[m-1].clone(),f[m]=f[m-1].clone(),h.crossVectors(e[m-1],e[m]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[m-1].dot(e[m]),-1,1)),g[m].applyMatrix4(k.makeRotationAxis(h,d))),f[m].crossVectors(e[m],g[m]);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),m=1;m<b;m++)g[m].applyMatrix4(k.makeRotationAxis(e[m],d*m)),f[m].crossVectors(e[m],g[m])};
 h);f[0].crossVectors(e[0],g[0]);for(m=1;m<b;m++)g[m]=g[m-1].clone(),f[m]=f[m-1].clone(),h.crossVectors(e[m-1],e[m]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[m-1].dot(e[m]),-1,1)),g[m].applyMatrix4(k.makeRotationAxis(h,d))),f[m].crossVectors(e[m],g[m]);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),m=1;m<b;m++)g[m].applyMatrix4(k.makeRotationAxis(e[m],d*m)),f[m].crossVectors(e[m],g[m])};
 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,d){d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()],void 0,d);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,
 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,d){d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()],void 0,d);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=a.materialIndex,n=0;n<=c;n++){l[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(f.clone().lerp(h,n/c)),r=c-n,t=0;t<=r;t++)l[n][t]=0===t&&n===c?p:e(p.clone().lerp(q,t/r))}for(n=0;n<c;n++)for(t=0;t<2*(c-n)-1;t++)d=Math.floor(t/2),0===t%2?g(l[n][d+1],l[n+1][d],l[n][d],m):g(l[n][d+1],l[n+1][d+1],l[n+1][d],m)}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,m=0,n=a.length;m<n;m+=3)e(new THREE.Vector3(a[m],a[m+1],a[m+2]));a=this.vertices;for(var p=[],l=m=0,n=b.length;m<n;m+=3,l++){var q=a[b[m]],t=a[b[m+1]],r=a[b[m+2]];p[l]=new THREE.Face3(q.index,t.index,r.index,[q.clone(),t.clone(),r.clone()],void 0,l)}for(var u=new THREE.Vector3,m=0,n=p.length;m<n;m++)f(p[m],d);m=0;for(n=this.faceVertexUvs[0].length;m<
+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=a.materialIndex,n=0;n<=c;n++){l[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(f.clone().lerp(h,n/c)),r=c-n,s=0;s<=r;s++)l[n][s]=0===s&&n===c?p:e(p.clone().lerp(q,s/r))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0===s%2?g(l[n][d+1],l[n+1][d],l[n][d],m):g(l[n][d+1],l[n+1][d+1],l[n+1][d],m)}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,m=0,n=a.length;m<n;m+=3)e(new THREE.Vector3(a[m],a[m+1],a[m+2]));a=this.vertices;for(var p=[],l=m=0,n=b.length;m<n;m+=3,l++){var q=a[b[m]],s=a[b[m+1]],r=a[b[m+2]];p[l]=new THREE.Face3(q.index,s.index,r.index,[q.clone(),s.clone(),r.clone()],void 0,l)}for(var u=new THREE.Vector3,m=0,n=p.length;m<n;m++)f(p[m],d);m=0;for(n=this.faceVertexUvs[0].length;m<
 n;m++)b=this.faceVertexUvs[0][m],d=b[0].x,a=b[1].x,p=b[2].x,l=Math.max(d,Math.max(a,p)),q=Math.min(d,Math.min(a,p)),.9<l&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));m=0;for(n=this.vertices.length;m<n;m++)this.vertices[m].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;
 n;m++)b=this.faceVertexUvs[0][m],d=b[0].x,a=b[1].x,p=b[2].x,l=Math.max(d,Math.max(a,p)),q=Math.min(d,Math.min(a,p)),.9<l&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));m=0;for(n=this.vertices.length;m<n;m++)this.vertices[m].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.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,
 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,
@@ -814,8 +813,8 @@ 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.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=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.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,m,n=b+1;for(f=0;f<=c;f++)for(m=f/c,h=0;h<=b;h++)k=h/b,k=a(k,m),d.push(k);var p,l,q,t;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*n+h,d=f*n+h+1,m=(f+1)*n+h+1,k=(f+1)*n+h,p=new THREE.Vector2(h/b,f/c),l=new THREE.Vector2((h+1)/b,f/c),q=new THREE.Vector2((h+1)/b,(f+1)/c),t=new THREE.Vector2(h/b,(f+1)/c),e.push(new THREE.Face3(a,
-d,k)),g.push([p,l,t]),e.push(new THREE.Face3(d,m,k)),g.push([l.clone(),q,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
+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,m,n=b+1;for(f=0;f<=c;f++)for(m=f/c,h=0;h<=b;h++)k=h/b,k=a(k,m),d.push(k);var p,l,q,s;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*n+h,d=f*n+h+1,m=(f+1)*n+h+1,k=(f+1)*n+h,p=new THREE.Vector2(h/b,f/c),l=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,l,s]),e.push(new THREE.Face3(d,m,k)),g.push([l.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 m=f.length;a<m;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 l=b.toString();void 0===c[l]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[l]=!0,h++)}b=new Float32Array(6*h);a=0;for(m=h;a<m;a++)for(p=0;2>p;p++)c=g[k[2*a+p]],h=6*a+3*p,b[h+0]=c.x,b[h+1]=c.y,
 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 m=f.length;a<m;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 l=b.toString();void 0===c[l]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[l]=!0,h++)}b=new Float32Array(6*h);a=0;for(m=h;a<m;a++)for(p=0;2>p;p++)c=g[k[2*a+p]],h=6*a+3*p,b[h+0]=c.x,b[h+1]=c.y,
 b[h+2]=c.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;m=a.attributes.index.array;e=a.drawcalls;h=0;0===e.length&&a.addDrawCall(0,m.length);k=new Uint32Array(2*m.length);f=0;for(n=e.length;f<n;++f){a=e[f];p=a.start;l=a.count;a=p;for(var q=p+l;a<q;a+=3)for(p=0;3>p;p++)b[0]=m[a+p],b[1]=m[a+(p+1)%3],b.sort(d),l=b.toString(),void 0===c[l]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[l]=!0,h++)}b=new Float32Array(6*
 b[h+2]=c.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;m=a.attributes.index.array;e=a.drawcalls;h=0;0===e.length&&a.addDrawCall(0,m.length);k=new Uint32Array(2*m.length);f=0;for(n=e.length;f<n;++f){a=e[f];p=a.start;l=a.count;a=p;for(var q=p+l;a<q;a+=3)for(p=0;3>p;p++)b[0]=m[a+p],b[1]=m[a+(p+1)%3],b.sort(d),l=b.toString(),void 0===c[l]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[l]=!0,h++)}b=new Float32Array(6*
 h);a=0;for(m=h;a<m;a++)for(p=0;2>p;p++)h=6*a+3*p,c=k[2*a+p],b[h+0]=g.getX(c),b[h+1]=g.getY(c),b[h+2]=g.getZ(c)}else for(g=a.attributes.position.array,h=g.length/3,k=h/3,b=new Float32Array(6*h),a=0,m=k;a<m;a++)for(p=0;3>p;p++)h=18*a+6*p,k=9*a+3*p,b[h+0]=g[k],b[h+1]=g[k+1],b[h+2]=g[k+2],c=9*a+(p+1)%3*3,b[h+3]=g[c],b[h+4]=g[c+1],b[h+5]=g[c+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
 h);a=0;for(m=h;a<m;a++)for(p=0;2>p;p++)h=6*a+3*p,c=k[2*a+p],b[h+0]=g.getX(c),b[h+1]=g.getY(c),b[h+2]=g.getZ(c)}else for(g=a.attributes.position.array,h=g.length/3,k=h/3,b=new Float32Array(6*h),a=0,m=k;a<m;a++)for(p=0;3>p;p++)h=18*a+6*p,k=9*a+3*p,b[h+0]=g[k],b[h+1]=g[k+1],b[h+2]=g[k+2],c=9*a+(p+1)%3*3,b[h+3]=g[c],b[h+4]=g[c+1],b[h+5]=g[c+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
@@ -839,9 +838,9 @@ THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geomet
 THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();
 THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();
 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.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=
 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 m=e[h],n=m.normal;a.copy(g[m.a]).add(g[m.b]).add(g[m.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}}();
+!1;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,c=new THREE.Matrix3;return function(){this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);for(var d=this.object.matrixWorld,e=this.geometry.attributes.position,g=this.object.geometry,f=g.vertices,g=g.faces,h=0,k=0,m=g.length;k<m;k++){var n=g[k],p=n.normal;a.copy(f[n.a]).add(f[n.b]).add(f[n.c]).divideScalar(3).applyMatrix4(d);b.copy(p).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);
+e.setXYZ(h,a.x,a.y,a.z);h+=1;e.setXYZ(h,b.x,b.y,b.z);h+=1}e.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=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};
 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};
 THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.rotateX(-Math.PI/2);for(var d=0;8>d;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(c,d);this.add(this.lightSphere);this.update()};
 THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.rotateX(-Math.PI/2);for(var d=0;8>d;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(c,d);this.add(this.lightSphere);this.update()};
@@ -854,13 +853,13 @@ this.matrixAutoUpdate=!1;this.update()};THREE.SkeletonHelper.prototype=Object.cr
 THREE.SkeletonHelper.prototype.update=function(){for(var a=this.geometry,b=(new THREE.Matrix4).getInverse(this.root.matrixWorld),c=new THREE.Matrix4,d=0,e=0;e<this.bones.length;e++){var g=this.bones[e];g.parent instanceof THREE.Bone&&(c.multiplyMatrices(b,g.matrixWorld),a.vertices[d].setFromMatrixPosition(c),c.multiplyMatrices(b,g.parent.matrixWorld),a.vertices[d+1].setFromMatrixPosition(c),d+=2)}a.verticesNeedUpdate=!0;a.computeBoundingSphere()};
 THREE.SkeletonHelper.prototype.update=function(){for(var a=this.geometry,b=(new THREE.Matrix4).getInverse(this.root.matrixWorld),c=new THREE.Matrix4,d=0,e=0;e<this.bones.length;e++){var g=this.bones[e];g.parent instanceof THREE.Bone&&(c.multiplyMatrices(b,g.matrixWorld),a.vertices[d].setFromMatrixPosition(c),c.multiplyMatrices(b,g.parent.matrixWorld),a.vertices[d+1].setFromMatrixPosition(c),d+=2)}a.verticesNeedUpdate=!0;a.computeBoundingSphere()};
 THREE.SpotLightHelper=function(a){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.translate(0,-.5,0);a.rotateX(-Math.PI/2);var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper;
 THREE.SpotLightHelper=function(a){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.translate(0,-.5,0);a.rotateX(-Math.PI/2);var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper;
 THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};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.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};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=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.update()};
 THREE.VertexNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper;
 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,m=h.length;k<m;k++)for(var n=h[k],p=0,l=n.vertexNormals.length;p<l;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,l=c.count;p<l;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.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Matrix3;return function(){var d=["a","b","c"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);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,m=f=0,n=k.length;m<n;m++)for(var p=k[m],l=0,q=p.vertexNormals.length;l<q;l++){var s=p.vertexNormals[l];a.copy(h[p[d[l]]]).applyMatrix4(e);
+b.copy(s).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);g.setXYZ(f,a.x,a.y,a.z);f+=1;g.setXYZ(f,b.x,b.y,b.z);f+=1}else if(f instanceof THREE.BufferGeometry)for(d=f.attributes.position,h=f.attributes.normal,l=f=0,q=d.count;l<q;l++)a.set(d.getX(l),d.getY(l),d.getZ(l)).applyMatrix4(e),b.set(h.getX(l),h.getY(l),h.getZ(l)),b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a),g.setXYZ(f,a.x,a.y,a.z),f+=1,g.setXYZ(f,b.x,b.y,b.z),f+=1;g.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=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,m=f=0,n=k.length;m<n;m++)for(var p=k[m],l=0,q=p.vertexTangents.length;l<q;l++){var t=p.vertexTangents[l];b.copy(h[p[a[l]]]).applyMatrix4(e);c.set(t.x,t.y,t.z);c.transformDirection(e).multiplyScalar(this.size).add(b);
+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,m=f=0,n=k.length;m<n;m++)for(var p=k[m],l=0,q=p.vertexTangents.length;l<q;l++){var s=p.vertexTangents[l];b.copy(h[p[a[l]]]).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,l=f=0,q=a.count;l<q;l++)b.set(a.getX(l),a.getY(l),a.getZ(l)).applyMatrix4(e),c.set(h.getX(l),h.getY(l),h.getZ(l)),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}}();
 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,l=f=0,q=a.count;l<q;l++)b.set(a.getX(l),a.getY(l),a.getZ(l)).applyMatrix4(e),c.set(h.getX(l),h.getY(l),h.getZ(l)),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.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.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;