Browse Source

Updated builds.

Mr.doob 10 years ago
parent
commit
22325256ad
2 changed files with 377 additions and 502 deletions
  1. 91 216
      build/three.js
  2. 286 286
      build/three.min.js

+ 91 - 216
build/three.js

@@ -8279,7 +8279,6 @@ THREE.BufferAttribute = function ( array, itemSize ) {
 	this.array = array;
 	this.itemSize = itemSize;
 
-	this.enabled = true;
 	this.needsUpdate = false;
 
 };
@@ -9967,7 +9966,7 @@ THREE.DynamicGeometry.prototype = {
 
 	computeVertexNormals: function () {
 
-		console.warn( 'THREE.DynamicGeometry: computeVertexNormals	() is not a method of this type of geometry.' );
+		console.warn( 'THREE.DynamicGeometry: computeVertexNormals() is not a method of this type of geometry.' );
 		return this;
 
 	},
@@ -10054,7 +10053,8 @@ THREE.BufferGeometry = function () {
 	this.type = 'BufferGeometry';
 
 	this.attributes = {};
-	this.attributesKeys = [];
+
+	this.morphAttributes = [];
 
 	this.drawcalls = [];
 	this.offsets = this.drawcalls; // backwards compatibility
@@ -10081,7 +10081,6 @@ THREE.BufferGeometry.prototype = {
 		}
 
 		this.attributes[ name ] = attribute;
-		this.attributesKeys = Object.keys( this.attributes );
 
 	},
 
@@ -10230,8 +10229,6 @@ THREE.BufferGeometry.prototype = {
 
 				}
 
-				this.morphsInfluences = new THREE.Float32Attribute( object.morphTargetInfluences, 1 ).copyArray( object.morphTargetInfluences );
-
 				// positions
 
 				var morphTargets = geometry.morphTargets;
@@ -10243,9 +10240,8 @@ THREE.BufferGeometry.prototype = {
 						var morphTarget = morphTargets[ i ];
 
 						var attribute = new THREE.Float32Attribute( morphTarget.vertices.length * 3, 3 );
-						attribute.enabled = false;
 
-						this.addAttribute( 'position_' + i, attribute.copyVector3sArray( morphTarget.vertices ) );
+						this.morphAttributes.push( attribute.copyVector3sArray( morphTarget.vertices ) );
 
 					}
 
@@ -10508,14 +10504,26 @@ THREE.BufferGeometry.prototype = {
 		var positions = new Float32Array( geometry.vertices.length * 3 );
 		this.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ).copyVector3sArray( geometry.vertices ) );
 
-		var normals = new Float32Array( geometry.normals.length * 3 );
-		this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ).copyVector3sArray( geometry.normals ) );
+		if ( geometry.normals.length > 0 ) {
+
+			var normals = new Float32Array( geometry.normals.length * 3 );
+			this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ).copyVector3sArray( geometry.normals ) );
+
+		}
+
+		if ( geometry.colors.length > 0 ) {
+
+			var colors = new Float32Array( geometry.colors.length * 3 );
+			this.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ).copyVector3sArray( geometry.colors ) );
+
+		}
+
+		if ( geometry.uvs.length > 0 ) {
 
-		var colors = new Float32Array( geometry.colors.length * 3 );
-		this.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ).copyVector3sArray( geometry.colors ) );
+			var uvs = new Float32Array( geometry.uvs.length * 2 );
+			this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ).copyVector2sArray( geometry.uvs ) );
 
-		var uvs = new Float32Array( geometry.uvs.length * 2 );
-		this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ).copyVector2sArray( geometry.uvs ) );
+		}
 
 		this.computeBoundingSphere();
 
@@ -17944,9 +17952,7 @@ THREE.UniformsLib = {
 		"envMap" : { type: "t", value: null },
 		"flipEnvMap" : { type: "f", value: - 1 },
 		"reflectivity" : { type: "f", value: 1.0 },
-		"refractionRatio" : { type: "f", value: 0.98 },
-
-		"morphTargetInfluences" : { type: "f", value: 0 }
+		"refractionRatio" : { type: "f", value: 0.98 }
 
 	},
 
@@ -19758,18 +19764,15 @@ THREE.WebGLRenderer = function ( parameters ) {
 		}
 
 		var geometryAttributes = geometry.attributes;
-
 		var programAttributes = program.attributes;
-		var programAttributesKeys = program.attributesKeys;
 
-		for ( var i = 0, l = programAttributesKeys.length; i < l; i ++ ) {
+		for ( var name in programAttributes ) {
 
-			var key = programAttributesKeys[ i ];
-			var programAttribute = programAttributes[ key ];
+			var programAttribute = programAttributes[ name ];
 
 			if ( programAttribute >= 0 ) {
 
-				var geometryAttribute = geometryAttributes[ key ];
+				var geometryAttribute = geometryAttributes[ name ];
 
 				if ( geometryAttribute !== undefined ) {
 
@@ -19832,15 +19835,15 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				} else if ( material.defaultAttributeValues !== undefined ) {
 
-					if ( material.defaultAttributeValues[ key ] !== undefined ) {
+					if ( material.defaultAttributeValues[ name ] !== undefined ) {
 
-						if ( material.defaultAttributeValues[ key ].length === 2 ) {
+						if ( material.defaultAttributeValues[ name ].length === 2 ) {
 
-							_gl.vertexAttrib2fv( programAttribute, material.defaultAttributeValues[ key ] );
+							_gl.vertexAttrib2fv( programAttribute, material.defaultAttributeValues[ name ] );
 
-						} else if ( material.defaultAttributeValues[ key ].length === 3 ) {
+						} else if ( material.defaultAttributeValues[ name ].length === 3 ) {
 
-							_gl.vertexAttrib3fv( programAttribute, material.defaultAttributeValues[ key ] );
+							_gl.vertexAttrib3fv( programAttribute, material.defaultAttributeValues[ name ] );
 
 						}
 
@@ -20314,174 +20317,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	}
 
-	function setupMorphTargets( material, geometryGroup, object ) {
-
-		// set base
-
-		var attributes = material.program.attributes;
-
-		if ( object.morphTargetBase !== - 1 && attributes.position >= 0 ) {
-
-			_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ object.morphTargetBase ] );
-
-			state.enableAttribute( attributes.position );
-
-			_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
-
-		} else if ( attributes.position >= 0 ) {
-
-			_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglVertexBuffer );
-
-			state.enableAttribute( attributes.position );
-
-			_gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 );
-
-		}
-
-		if ( object.morphTargetForcedOrder.length ) {
-
-			// set forced order
-
-			var m = 0;
-			var order = object.morphTargetForcedOrder;
-			var influences = object.morphTargetInfluences;
-
-			var attribute;
-
-			while ( m < material.numSupportedMorphTargets && m < order.length ) {
-
-				attribute = attributes[ 'morphTarget' + m ];
-
-				if ( attribute >= 0 ) {
-
-					_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ order[ m ] ] );
-
-					state.enableAttribute( attribute );
-
-					_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
-
-				}
-
-				attribute = attributes[ 'morphNormal' + m ];
-
-				if ( attribute >= 0 && material.morphNormals ) {
-
-					_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphNormalsBuffers[ order[ m ] ] );
-
-					state.enableAttribute( attribute );
-
-					_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
-
-				}
-
-				object.__webglMorphTargetInfluences[ m ] = influences[ order[ m ] ];
-
-				m ++;
-
-			}
-
-		} else {
-
-			// find the most influencing
-
-			var activeInfluenceIndices = [];
-			var influences = object.morphTargetInfluences;
-			var morphTargets = object.geometry.morphTargets;
-
-			if ( influences.length > morphTargets.length ) {
-
-				console.warn( 'THREE.WebGLRenderer: Influences array is bigger than morphTargets array.' );
-				influences.length = morphTargets.length;
-
-			}
-
-			for ( var i = 0, il = influences.length; i < il; i ++ ) {
-
-				var influence = influences[ i ];
-
-				activeInfluenceIndices.push( [ influence, i ] );
-
-			}
-
-			if ( activeInfluenceIndices.length > material.numSupportedMorphTargets ) {
-
-				activeInfluenceIndices.sort( numericalSort );
-				activeInfluenceIndices.length = material.numSupportedMorphTargets;
-
-			} else if ( activeInfluenceIndices.length > material.numSupportedMorphNormals ) {
-
-				activeInfluenceIndices.sort( numericalSort );
-
-			} else if ( activeInfluenceIndices.length === 0 ) {
-
-				activeInfluenceIndices.push( [ 0, 0 ] );
-
-			}
-
-			var attribute;
-
-			for ( var m = 0, ml = material.numSupportedMorphTargets; m < ml; m ++ ) {
-
-				if ( activeInfluenceIndices[ m ] ) {
-
-					var influenceIndex = activeInfluenceIndices[ m ][ 1 ];
-
-					attribute = attributes[ 'morphTarget' + m ];
-
-					if ( attribute >= 0 ) {
-
-						_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ influenceIndex ] );
-
-						state.enableAttribute( attribute );
-
-						_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
-
-					}
-
-					attribute = attributes[ 'morphNormal' + m ];
-
-					if ( attribute >= 0 && material.morphNormals ) {
-
-						_gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphNormalsBuffers[ influenceIndex ] );
-
-						state.enableAttribute( attribute );
-
-						_gl.vertexAttribPointer( attribute, 3, _gl.FLOAT, false, 0, 0 );
-
-					}
-
-					object.__webglMorphTargetInfluences[ m ] = influences[ influenceIndex ];
-
-				} else {
-
-					/*
-					_gl.vertexAttribPointer( attributes[ "morphTarget" + m ], 3, _gl.FLOAT, false, 0, 0 );
-
-					if ( material.morphNormals ) {
-
-						_gl.vertexAttribPointer( attributes[ "morphNormal" + m ], 3, _gl.FLOAT, false, 0, 0 );
-
-					}
-					*/
-
-					object.__webglMorphTargetInfluences[ m ] = 0;
-
-				}
-
-			}
-
-		}
-
-		// load updated influences uniform
-
-		if ( material.program.uniforms.morphTargetInfluences !== null ) {
-
-			_gl.uniform1fv( material.program.uniforms.morphTargetInfluences, object.__webglMorphTargetInfluences );
-
-		}
-
-	}
-
 	// Sorting
 
 	function painterSortStable ( a, b ) {
@@ -21102,18 +20937,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		}
 
-		/*
-		if ( material.morphTargets ) {
-
-			if ( ! object.__webglMorphTargetInfluences ) {
-
-				object.__webglMorphTargetInfluences = new Float32Array( _this.maxMorphTargets );
-
-			}
-
-		}
-		*/
-
 		var refreshProgram = false;
 		var refreshMaterial = false;
 		var refreshLights = false;
@@ -23286,6 +23109,8 @@ THREE.WebGLObjects = function ( gl, info ) {
 	var objects = {};
 	var objectsImmediate = [];
 
+	var morphInfluences = new Float32Array( 8 );
+
 	var geometries = new THREE.WebGLGeometries( gl, info );
 
 	//
@@ -23386,6 +23211,12 @@ THREE.WebGLObjects = function ( gl, info ) {
 
 	};
 
+	function numericalSort ( a, b ) {
+
+		return b[ 0 ] - a[ 0 ];
+
+	}
+
 	function updateObject( object ) {
 
 		var geometry = geometries.get( object );
@@ -23396,21 +23227,66 @@ THREE.WebGLObjects = function ( gl, info ) {
 
 		}
 
+		// morph targets
+
+		if ( object.morphTargetInfluences !== undefined ) {
+
+			var activeInfluences = [];
+			var morphTargetInfluences = object.morphTargetInfluences;
+
+			for ( var i = 0, l = morphTargetInfluences.length; i < l; i ++ ) {
+
+				var influence = morphTargetInfluences[ i ];
+				activeInfluences.push( [ influence, i ] );
+
+			}
+
+			activeInfluences.sort( numericalSort );
+
+			if ( activeInfluences.length > 8 ) {
+
+				activeInfluences.length = 8;
+
+			}
+
+			for ( var i = 0, l = activeInfluences.length; i < l; i ++ ) {
+
+				morphInfluences[ i ] = activeInfluences[ i ][ 0 ];
+
+				var attribute = geometry.morphAttributes[ activeInfluences[ i ][ 1 ] ];
+				geometry.addAttribute( 'morphTarget' + i, attribute );
+
+			}
+
+			var material = object.material;
+
+			if ( material.program !== undefined ) {
+
+				if ( material.program.uniforms.morphTargetInfluences !== null ) {
+
+					gl.uniform1fv( material.program.uniforms.morphTargetInfluences, morphInfluences );
+
+				}
+
+			} else {
+
+				console.warn( 'TOFIX: material.program is undefined' );
+
+			}
+
+		}
+
 		//
 
 		if ( geometry instanceof THREE.BufferGeometry ) {
 
 			var attributes = geometry.attributes;
-			var attributesKeys = geometry.attributesKeys;
-
-			for ( var i = 0, l = attributesKeys.length; i < l; i ++ ) {
 
-				var key = attributesKeys[ i ];
-				var attribute = attributes[ key ];
+			for ( var name in attributes ) {
 
-				if ( attribute.enabled === false ) continue;
+				var attribute = attributes[ name ];
 
-				var bufferType = ( key === 'index' ) ? gl.ELEMENT_ARRAY_BUFFER : gl.ARRAY_BUFFER;
+				var bufferType = ( name === 'index' ) ? gl.ELEMENT_ARRAY_BUFFER : gl.ARRAY_BUFFER;
 
 				var data = ( attribute instanceof THREE.InterleavedBufferAttribute ) ? attribute.data : attribute;
 
@@ -23946,7 +23822,6 @@ THREE.WebGLProgram = ( function () {
 		}
 
 		this.attributes = cacheAttributeLocations( gl, program, identifiers );
-		this.attributesKeys = Object.keys( this.attributes );
 
 		//
 

+ 286 - 286
build/three.min.js

@@ -67,8 +67,8 @@ Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return
 fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];this.w=a.array[b+3];return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};
 THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ";
 THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x=
-a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],l=e[9],m=e[2],p=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,
-k)):(this._y=Math.atan2(-m,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-m,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=
+a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],l=e[9],n=e[2],p=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-l,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,
+k)):(this._y=Math.atan2(-n,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-n,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(n,-1,1)),.99999>Math.abs(n)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-l,k),this._y=Math.atan2(-n,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=
 Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(p,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-l,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeRotationFromQuaternion(b);this.setFromRotationMatrix(a,c,d);return this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,
 b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?
 a.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3};
@@ -94,22 +94,22 @@ void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.
 this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},
 transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];
 a[8]=b[8];return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}};THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,m,p,n,r,t,s){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=f;u[9]=g;u[13]=h;u[2]=k;u[6]=l;u[10]=m;u[14]=p;u[3]=n;u[7]=r;u[11]=t;u[15]=s;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,k,l,n,p,m,s,t,q){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=f;u[9]=g;u[13]=h;u[2]=k;u[6]=l;u[10]=n;u[14]=p;u[3]=m;u[7]=s;u[11]=t;u[15]=q;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
 copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){var d=this.elements;a.set(d[0],d[1],d[2]);b.set(d[4],d[5],d[6]);c.set(d[8],d[9],d[10]);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],
 b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=
-f*h;var k=f*e,l=c*h,m=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-m*d;b[9]=-c*g;b[2]=m-a*d;b[6]=l+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,l=d*h,m=d*e,b[0]=a+m*c,b[4]=l*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=m+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,m=d*e,b[0]=a-m*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=m-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,l=c*h,m=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+m,b[1]=g*e,b[5]=m*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*
-g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,l=c*g,m=c*d,b[0]=g*h,b[4]=m-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-m*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,m=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=m*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
-makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,m=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(m+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+m);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,f){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var g=this.elements;c.subVectors(d,
+f*h;var k=f*e,l=c*h,n=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+l*d;b[5]=a-n*d;b[9]=-c*g;b[2]=n-a*d;b[6]=l+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a+n*c,b[4]=l*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-l,b[6]=n+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,n=d*e,b[0]=a-n*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=n-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,l=c*h,n=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+n,b[1]=g*e,b[5]=n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*
+g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,n=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=f*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
+makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(n+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,f){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var g=this.elements;c.subVectors(d,
 e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,
-d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],m=c[5],p=c[9],n=c[13],r=c[2],t=c[6],s=c[10],u=c[14],v=c[3],w=c[7],z=c[11],c=c[15],y=d[0],D=d[4],E=d[8],x=d[12],F=d[1],I=d[5],C=d[9],G=d[13],Q=d[2],K=d[6],A=d[10],H=d[14],B=d[3],T=d[7],O=d[11],d=d[15];e[0]=f*y+g*F+h*Q+k*B;e[4]=f*D+g*I+h*K+k*T;e[8]=f*E+g*C+h*A+k*O;e[12]=f*x+g*G+h*H+k*d;e[1]=l*y+m*F+p*Q+n*B;e[5]=l*D+m*I+p*K+n*T;e[9]=l*E+m*C+p*A+n*O;e[13]=l*x+m*G+p*H+n*d;e[2]=r*y+t*F+s*Q+u*B;e[6]=r*D+t*I+s*K+u*T;e[10]=r*E+t*C+s*A+u*O;e[14]=
-r*x+t*G+s*H+u*d;e[3]=v*y+w*F+z*Q+c*B;e[7]=v*D+w*I+z*K+c*T;e[11]=v*E+w*C+z*A+c*O;e[15]=v*x+w*G+z*H+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
+d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],n=c[5],p=c[9],m=c[13],s=c[2],t=c[6],q=c[10],u=c[14],v=c[3],w=c[7],z=c[11],c=c[15],y=d[0],D=d[4],E=d[8],x=d[12],F=d[1],I=d[5],C=d[9],G=d[13],Q=d[2],K=d[6],A=d[10],H=d[14],B=d[3],T=d[7],O=d[11],d=d[15];e[0]=f*y+g*F+h*Q+k*B;e[4]=f*D+g*I+h*K+k*T;e[8]=f*E+g*C+h*A+k*O;e[12]=f*x+g*G+h*H+k*d;e[1]=l*y+n*F+p*Q+m*B;e[5]=l*D+n*I+p*K+m*T;e[9]=l*E+n*C+p*A+m*O;e[13]=l*x+n*G+p*H+m*d;e[2]=s*y+t*F+q*Q+u*B;e[6]=s*D+t*I+q*K+u*T;e[10]=s*E+t*C+q*A+u*O;e[14]=
+s*x+t*G+q*H+u*d;e[3]=v*y+w*F+z*Q+c*B;e[7]=v*D+w*I+z*K+c*T;e[11]=v*E+w*C+z*A+c*O;e[15]=v*x+w*G+z*H+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
 a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
-a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],m=a[6],p=a[10],n=a[14];return a[3]*(+e*h*m-d*k*
-m-e*g*p+c*k*p+d*g*n-c*h*n)+a[7]*(+b*h*n-b*k*p+e*f*p-d*f*n+d*k*l-e*h*l)+a[11]*(+b*k*m-b*g*n-e*f*m+c*f*n+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*m+b*g*p+d*f*m-c*f*p+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=
+a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*k*
+n-e*g*p+c*k*p+d*g*m-c*h*m)+a[7]*(+b*h*m-b*k*p+e*f*p-d*f*m+d*k*l-e*h*l)+a[11]*(+b*k*n-b*g*m-e*f*n+c*f*m+e*g*l-c*k*l)+a[15]*(-d*g*l-b*h*n+b*g*p+d*f*n-c*f*p+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=
 c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a;return function(){void 0===a&&(a=new THREE.Vector3);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=
-this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],m=d[9],p=d[13],n=d[2],r=d[6],t=d[10],s=d[14],u=d[3],v=d[7],w=d[11],d=d[15];c[0]=m*s*v-p*t*v+p*r*w-l*s*w-m*r*d+l*t*d;c[4]=h*t*v-g*s*v-h*r*w+f*s*w+g*r*d-f*t*d;c[8]=g*p*v-h*m*v+h*l*w-f*p*w-g*l*d+f*m*d;c[12]=h*m*r-g*p*r-h*l*t+f*p*t+g*l*s-f*m*s;c[1]=p*t*u-m*s*u-p*n*w+k*s*w+m*n*d-k*t*d;c[5]=g*s*u-h*t*u+h*n*w-e*s*w-g*n*d+e*t*d;c[9]=h*m*u-g*p*u-h*k*w+e*p*w+g*k*d-e*m*d;c[13]=g*p*n-h*m*n+h*k*t-e*p*t-g*k*s+e*m*s;c[2]=l*s*u-p*r*u+p*n*v-k*s*
-v-l*n*d+k*r*d;c[6]=h*r*u-f*s*u-h*n*v+e*s*v+f*n*d-e*r*d;c[10]=f*p*u-h*l*u+h*k*v-e*p*v-f*k*d+e*l*d;c[14]=h*l*n-f*p*n-h*k*r+e*p*r+f*k*s-e*l*s;c[3]=m*r*u-l*t*u-m*n*v+k*t*v+l*n*w-k*r*w;c[7]=f*t*u-g*r*u+g*n*v-e*t*v-f*n*w+e*r*w;c[11]=g*l*u-f*m*u-g*k*v+e*m*v+f*k*w-e*l*w;c[15]=f*m*n-g*l*n+g*k*r-e*m*r-f*k*t+e*l*t;c=e*c[0]+k*c[4]+n*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
+this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],k=d[1],l=d[5],n=d[9],p=d[13],m=d[2],s=d[6],t=d[10],q=d[14],u=d[3],v=d[7],w=d[11],d=d[15];c[0]=n*q*v-p*t*v+p*s*w-l*q*w-n*s*d+l*t*d;c[4]=h*t*v-g*q*v-h*s*w+f*q*w+g*s*d-f*t*d;c[8]=g*p*v-h*n*v+h*l*w-f*p*w-g*l*d+f*n*d;c[12]=h*n*s-g*p*s-h*l*t+f*p*t+g*l*q-f*n*q;c[1]=p*t*u-n*q*u-p*m*w+k*q*w+n*m*d-k*t*d;c[5]=g*q*u-h*t*u+h*m*w-e*q*w-g*m*d+e*t*d;c[9]=h*n*u-g*p*u-h*k*w+e*p*w+g*k*d-e*n*d;c[13]=g*p*m-h*n*m+h*k*t-e*p*t-g*k*q+e*n*q;c[2]=l*q*u-p*s*u+p*m*v-k*q*
+v-l*m*d+k*s*d;c[6]=h*s*u-f*q*u-h*m*v+e*q*v+f*m*d-e*s*d;c[10]=f*p*u-h*l*u+h*k*v-e*p*v-f*k*d+e*l*d;c[14]=h*l*m-f*p*m-h*k*s+e*p*s+f*k*q-e*l*q;c[3]=n*s*u-l*t*u-n*m*v+k*t*v+l*m*w-k*s*w;c[7]=f*t*u-g*s*u+g*m*v-e*t*v-f*m*w+e*s*w;c[11]=g*l*u-f*n*u-g*k*v+e*n*v+f*k*w-e*l*w;c[15]=f*n*m-g*l*m+g*k*s-e*n*s-f*k*t+e*l*t;c=e*c[0]+k*c[4]+m*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
 this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=
 this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,
 0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,k=e*f,l=e*g;this.set(k*f+c,k*g-d*h,k*h+d*g,0,k*g+d*h,l*g+c,l*h-d*f,0,k*h-d*g,l*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,
@@ -119,8 +119,8 @@ a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function
 THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);
 var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);
-b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),l=c.dot(this.direction),m=-c.dot(b),p=c.lengthSq(),n=Math.abs(1-k*k),r;0<n?(d=k*m-l,e=k*l-m,r=h*n,0<=d?e>=-r?e<=r?(h=1/n,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*m)+p):(e=h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+p):(e=-h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+p):e<=-r?(d=Math.max(0,-(-k*h+l)),e=0<d?-h:Math.min(Math.max(-h,-m),h),k=-d*d+e*(e+2*m)+p):e<=r?(d=0,e=Math.min(Math.max(-h,-m),h),k=e*(e+
-2*m)+p):(d=Math.max(0,-(k*h+l)),e=0<d?h:Math.min(Math.max(-h,-m),h),k=-d*d+e*(e+2*m)+p)):(e=0<k?-h:h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*m)+p);f&&f.copy(this.direction).multiplyScalar(d).add(this.origin);g&&g.copy(b).multiplyScalar(e).add(a);return k}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;
+b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),l=c.dot(this.direction),n=-c.dot(b),p=c.lengthSq(),m=Math.abs(1-k*k),s;0<m?(d=k*n-l,e=k*l-n,s=h*m,0<=d?e>=-s?e<=s?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*l)+e*(k*d+e+2*n)+p):(e=h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p):(e=-h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p):e<=-s?(d=Math.max(0,-(-k*h+l)),e=0<d?-h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+p):e<=s?(d=0,e=Math.min(Math.max(-h,-n),h),k=e*(e+
+2*n)+p):(d=Math.max(0,-(k*h+l)),e=0<d?h:Math.min(Math.max(-h,-n),h),k=-d*d+e*(e+2*n)+p)):(e=0<k?-h:h,d=Math.max(0,-(k*e+l)),k=-d*d+e*(e+2*n)+p);f&&f.copy(this.direction).multiplyScalar(d).add(this.origin);g&&g.copy(b).multiplyScalar(e).add(a);return k}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;
 if(e>f)return null;f=Math.sqrt(f-e);e=d-f;d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},
 isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(f<d||d!==d)d=f;0<=g?(e=(a.min.z-h.z)*g,g*=a.max.z-h.z):(e=(a.max.z-h.z)*
 g,g*=a.min.z-h.z);if(c>g||e>d)return null;if(e>c||c!==c)c=e;if(g<d||d!==d)d=g;return 0>d?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0<f){if(h)return null;h=1}else if(0>f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a));
@@ -129,8 +129,8 @@ THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.c
 this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);
 return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};
 THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],m=c[8],p=c[9],n=c[10],r=c[11],t=c[12],s=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,l-g,r-m,c-t).normalize();b[1].setComponents(f+
-a,l+g,r+m,c+t).normalize();b[2].setComponents(f+d,l+h,r+p,c+s).normalize();b[3].setComponents(f-d,l-h,r-p,c-s).normalize();b[4].setComponents(f-e,l-k,r-n,c-u).normalize();b[5].setComponents(f+e,l+k,r+n,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],l=c[7],n=c[8],p=c[9],m=c[10],s=c[11],t=c[12],q=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,l-g,s-n,c-t).normalize();b[1].setComponents(f+
+a,l+g,s+n,c+t).normalize();b[2].setComponents(f+d,l+h,s+p,c+q).normalize();b[3].setComponents(f-d,l-h,s-p,c-q).normalize();b[4].setComponents(f-e,l-k,s-m,c-u).normalize();b[5].setComponents(f+e,l+k,s+m,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
 c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var g=f.distanceToPoint(a),f=f.distanceToPoint(b);if(0>g&&0>f)return!1}return!0}}(),
 containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
@@ -141,8 +141,8 @@ a.constant===this.constant},clone:function(){return(new THREE.Plane).copy(this)}
 THREE.Math={generateUUID:function(){var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8===e||13===e||18===e||23===e?b[e]="-":14===e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19===e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,
 c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=
 180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nextPowerOfTwo:function(a){a--;a|=a>>1;a|=a>>2;a|=a>>4;a|=a>>8;a|=a>>16;a++;return a}};
-THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,m,p,n;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+
-2;l=this.points[c[0]];m=this.points[c[1]];p=this.points[c[2]];n=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,m.x,p.x,n.x,g,h,k);d.y=b(l.y,m.y,p.y,n.y,g,h,k);d.z=b(l.z,m.z,p.z,n.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
+THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,l,n,p,m;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;f=Math.floor(e);g=e-f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>this.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+
+2;l=this.points[c[0]];n=this.points[c[1]];p=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(l.x,n.x,p.x,m.x,g,h,k);d.y=b(l.y,n.y,p.y,m.y,g,h,k);d.z=b(l.z,n.z,p.z,m.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=
 a/c,d=this.getPoint(b),g.copy(d),k+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!==e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],k=new THREE.Vector3,l=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];g=Math.ceil(a*c/l.total);e=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<g-1;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),
 h.push(k.copy(d).clone());h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
 THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e);b.subVectors(f,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);f=a.dot(c);var k=b.dot(b);g=b.dot(c);var l=d*k-e*e;h=h||new THREE.Vector3;if(0===l)return h.set(-2,-1,-1);l=1/l;k=(k*f-e*g)*l;d=(d*g-e*f)*l;return h.set(1-k-d,d,k)}}();
@@ -174,7 +174,7 @@ for(var e=0;e<this.children.length;e++)d.children.push(this.children[e].toJSON(a
 a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.renderOrder=this.renderOrder;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};
 THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Face3=function(a,b,c,d,e){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=Array.isArray(d)?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=Array.isArray(e)?e:[];this.vertexTangents=[]};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);for(var b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}};
-THREE.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.BufferAttribute=function(a,b){this.array=a;this.itemSize=b;this.enabled=!0;this.needsUpdate=!1};
+THREE.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.BufferAttribute=function(a,b){this.array=a;this.itemSize=b;this.needsUpdate=!1};
 THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){console.warn("THREE.BufferAttribute: .length has been renamed to .count.");return this.count},get count(){return this.array.length/this.itemSize},copyAt:function(a,b,c){a*=this.itemSize;c*=b.itemSize;for(var d=0,e=this.itemSize;d<e;d++)this.array[a+d]=b.array[c+d];return this},copyArray:function(a){this.array.set(a);return this},copyColorsArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===
 f&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",d),f=new THREE.Color);b[c++]=f.r;b[c++]=f.g;b[c++]=f.b}return this},copyFacesArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];b[c++]=f.a;b[c++]=f.b;b[c++]=f.c}return this},copyVector2sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",d),f=new THREE.Vector2);b[c++]=f.x;b[c++]=
 f.y}return this},copyVector3sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",d),f=new THREE.Vector3);b[c++]=f.x;b[c++]=f.y;b[c++]=f.z}return this},copyVector4sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",d),f=new THREE.Vector4);b[c++]=f.x;b[c++]=f.y;b[c++]=
@@ -193,62 +193,61 @@ setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data.array[a+0]=b
 THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=
 this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=this.hasTangents=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;e<f;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=
-this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=[],l=[],m=c=0;c<d.length;c+=3,m+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==f&&k.push(new THREE.Vector3(f[c],f[c+1],f[c+2])),void 0!==g&&b.colors.push(new THREE.Color(g[c],g[c+1],g[c+2])),void 0!==h&&l.push(new THREE.Vector2(h[m],
-h[m+1]));var p=function(a,c,d){var e=void 0!==f?[k[a].clone(),k[c].clone(),k[d].clone()]:[],n=void 0!==g?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,n));void 0!==h&&b.faceVertexUvs[0].push([l[a].clone(),l[c].clone(),l[d].clone()])};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var m=d[c],n=m.start,r=m.count,t=m.index,m=n,n=n+r;m<n;m+=3)p(t+e[m],t+e[m+1],t+e[m+2]);else for(c=0;c<e.length;c+=3)p(e[c],e[c+1],e[c+2]);else for(c=
+this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=[],l=[],n=c=0;c<d.length;c+=3,n+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==f&&k.push(new THREE.Vector3(f[c],f[c+1],f[c+2])),void 0!==g&&b.colors.push(new THREE.Color(g[c],g[c+1],g[c+2])),void 0!==h&&l.push(new THREE.Vector2(h[n],
+h[n+1]));var p=function(a,c,d){var e=void 0!==f?[k[a].clone(),k[c].clone(),k[d].clone()]:[],m=void 0!==g?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,m));void 0!==h&&b.faceVertexUvs[0].push([l[a].clone(),l[c].clone(),l[d].clone()])};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var n=d[c],m=n.start,s=n.count,t=n.index,n=m,m=m+s;n<m;n+=3)p(t+e[n],t+e[n+1],t+e[n+2]);else for(c=0;c<e.length;c+=3)p(e[c],e[c+1],e[c+2]);else for(c=
 0;c<d.length/3;c+=3)p(c,c+1,c+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],f=this.vertices[e.a],
 g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g);b.subVectors(f,g);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,k=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=
 0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=
 e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=
 this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<
-d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,m,p,n,r,t,s,u,v=[],w=[];c=new THREE.Vector3;var z=new THREE.Vector3,y=new THREE.Vector3,D=new THREE.Vector3,E=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],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],
-l=f[0],m=f[1],p=f[2],f=h.x-g.x,n=k.x-g.x,r=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=m.x-l.x,s=p.x-l.x,m=m.y-l.y,l=p.y-l.y,p=1/(k*l-s*m),c.set((l*f-m*n)*p,(l*r-m*t)*p,(l*h-m*g)*p),z.set((k*n-s*f)*p,(k*t-s*r)*p,(k*g-s*h)*p),v[d].add(c),v[u].add(c),v[e].add(c),w[d].add(z),w[u].add(z),w[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)E.copy(e.vertexNormals[c]),d=e[z[c]],u=v[d],y.copy(u),y.sub(E.multiplyScalar(E.dot(u))).normalize(),
+d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,n,p,m,s,t,q,u,v=[],w=[];c=new THREE.Vector3;var z=new THREE.Vector3,y=new THREE.Vector3,D=new THREE.Vector3,E=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],f=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,g=this.vertices[d],h=this.vertices[u],k=this.vertices[e],
+l=f[0],n=f[1],p=f[2],f=h.x-g.x,m=k.x-g.x,s=h.y-g.y,t=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=n.x-l.x,q=p.x-l.x,n=n.y-l.y,l=p.y-l.y,p=1/(k*l-q*n),c.set((l*f-n*m)*p,(l*s-n*t)*p,(l*h-n*g)*p),z.set((k*m-q*f)*p,(k*t-q*s)*p,(k*g-q*h)*p),v[d].add(c),v[u].add(c),v[e].add(c),w[d].add(z),w[u].add(z),w[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)E.copy(e.vertexNormals[c]),d=e[z[c]],u=v[d],y.copy(u),y.sub(E.multiplyScalar(E.dot(u))).normalize(),
 D.crossVectors(e.vertexNormals[c],u),d=D.dot(w[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(y.x,y.y,y.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);
-this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var c,d=this.vertices.length,e=this.vertices,f=a.vertices,g=this.faces,h=a.faces,k=this.faceVertexUvs[0],l=a.faceVertexUvs[0];void 0!==b&&(c=(new THREE.Matrix3).getNormalMatrix(b));for(var m=0,p=f.length;m<p;m++){var n=f[m].clone();void 0!==b&&n.applyMatrix4(b);e.push(n)}m=0;for(p=h.length;m<p;m++){var r=
-h[m],t,s=r.vertexNormals,u=r.vertexColors,n=new THREE.Face3(r.a+d,r.b+d,r.c+d);n.normal.copy(r.normal);void 0!==c&&n.normal.applyMatrix3(c).normalize();e=0;for(f=s.length;e<f;e++)t=s[e].clone(),void 0!==c&&t.applyMatrix3(c).normalize(),n.vertexNormals.push(t);n.color.copy(r.color);e=0;for(f=u.length;e<f;e++)r=u[e],n.vertexColors.push(r.clone());g.push(n)}m=0;for(p=l.length;m<p;m++)if(c=l[m],d=[],void 0!==c){e=0;for(f=c.length;e<f;e++)d.push(c[e].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof
+this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var c,d=this.vertices.length,e=this.vertices,f=a.vertices,g=this.faces,h=a.faces,k=this.faceVertexUvs[0],l=a.faceVertexUvs[0];void 0!==b&&(c=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,p=f.length;n<p;n++){var m=f[n].clone();void 0!==b&&m.applyMatrix4(b);e.push(m)}n=0;for(p=h.length;n<p;n++){var s=
+h[n],t,q=s.vertexNormals,u=s.vertexColors,m=new THREE.Face3(s.a+d,s.b+d,s.c+d);m.normal.copy(s.normal);void 0!==c&&m.normal.applyMatrix3(c).normalize();e=0;for(f=q.length;e<f;e++)t=q[e].clone(),void 0!==c&&t.applyMatrix3(c).normalize(),m.vertexNormals.push(t);m.color.copy(s.color);e=0;for(f=u.length;e<f;e++)s=u[e],m.vertexColors.push(s.clone());g.push(m)}n=0;for(p=l.length;n<p;n++)if(c=l[n],d=[],void 0!==c){e=0;for(f=c.length;e<f;e++)d.push(c[e].clone());k.push(d)}}},mergeMesh:function(a){!1===a instanceof
 THREE.Mesh?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],
 e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]===e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,a.z);return l[b]}function c(a){var b=
-a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=m.length;m.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==r[b])return r[b];r[b]=n.length/2;n.push(a.x,a.y);return r[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<
-this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],l={},m=[],p={},n=[],r={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],s=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),v=0<t.vertexNormals.length,w=1!==t.color.r||1!==t.color.g||1!==t.color.b,z=0<t.vertexColors.length,y=0,y=a(y,0,0),y=a(y,1,!1),y=a(y,2,!1),y=a(y,3,s),y=a(y,4,u),y=a(y,5,v),y=a(y,6,w),y=a(y,7,z);h.push(y);h.push(t.a,t.b,t.c);s&&(s=this.faceVertexUvs[0][g],h.push(d(s[0]),d(s[1]),d(s[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));z&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<m.length&&(e.data.colors=m);0<n.length&&(e.data.uvs=[n]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());c=0;for(d=this.faceVertexUvs.length;c<
+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!==s[b])return s[b];s[b]=m.length/2;m.push(a.x,a.y);return s[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<
+this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}var h=[],k=[],l={},n=[],p={},m=[],s={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],q=void 0!==this.faceVertexUvs[0][g],u=0<t.normal.length(),v=0<t.vertexNormals.length,w=1!==t.color.r||1!==t.color.g||1!==t.color.b,z=0<t.vertexColors.length,y=0,y=a(y,0,0),y=a(y,1,!1),y=a(y,2,!1),y=a(y,3,q),y=a(y,4,u),y=a(y,5,v),y=a(y,6,w),y=a(y,7,z);h.push(y);h.push(t.a,t.b,t.c);q&&(q=this.faceVertexUvs[0][g],h.push(d(q[0]),d(q[1]),d(q[2])));
+u&&h.push(b(t.normal));v&&(u=t.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));w&&h.push(c(t.color));z&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=k;0<n.length&&(e.data.colors=n);0<m.length&&(e.data.uvs=[m]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());c=0;for(d=this.faceVertexUvs.length;c<
 d;c++){b=this.faceVertexUvs[c];void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],h=[],k=0,l=g.length;k<l;k++)h.push(g[k].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
 THREE.DynamicGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DynamicGeometry";this.vertices=[];this.colors=[];this.normals=[];this.colors=[];this.uvs=[];this.faces=[];this.boundingSphere=this.boundingBox=null;this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1};
-THREE.DynamicGeometry.prototype={constructor:THREE.DynamicGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DynamicGeometry: computeFaceNormals() is not a method of this type of geometry.");return this},computeVertexNormals:function(){console.warn("THREE.DynamicGeometry: computeVertexNormals\t() is not a method of this type of geometry.");return this},fromGeometry:function(a){this.vertices=
-a.vertices;for(var b=this.faces=a.faces,c=a.faceVertexUvs[0],d=0,e=b.length;d<e;d++){for(var f=b[d],g=[f.a,f.b,f.c],h=f.vertexNormals,f=f.vertexColors,k=c[d],l=0,m=h.length;l<m;l++)this.normals[g[l]]=h[l];l=0;for(m=f.length;l<m;l++)this.colors[g[l]]=f[l];void 0===k&&(console.warn("THREE.DynamicGeometry.fromGeometry(): Missing vertexUVs",d),k=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2]);l=0;for(m=k.length;l<m;l++)this.uvs[g[l]]=k[l]}a.morphTargets&&(this.morphTargets=a.morphTargets.slice(0));
+THREE.DynamicGeometry.prototype={constructor:THREE.DynamicGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DynamicGeometry: computeFaceNormals() is not a method of this type of geometry.");return this},computeVertexNormals:function(){console.warn("THREE.DynamicGeometry: computeVertexNormals() is not a method of this type of geometry.");return this},fromGeometry:function(a){this.vertices=
+a.vertices;for(var b=this.faces=a.faces,c=a.faceVertexUvs[0],d=0,e=b.length;d<e;d++){for(var f=b[d],g=[f.a,f.b,f.c],h=f.vertexNormals,f=f.vertexColors,k=c[d],l=0,n=h.length;l<n;l++)this.normals[g[l]]=h[l];l=0;for(n=f.length;l<n;l++)this.colors[g[l]]=f[l];void 0===k&&(console.warn("THREE.DynamicGeometry.fromGeometry(): Missing vertexUVs",d),k=[new THREE.Vector2,new THREE.Vector2,new THREE.Vector2]);l=0;for(n=k.length;l<n;l++)this.uvs[g[l]]=k[l]}a.morphTargets&&(this.morphTargets=a.morphTargets.slice(0));
 a.morphColors&&(this.morphColors=a.morphColors.slice(0));a.morphNormals&&(this.morphNormals=a.morphNormals.slice(0));a.skinIndices&&(this.skinIndices=a.skinIndices.slice(0));a.skinWeights&&(this.skinWeights=a.skinWeights.slice(0));return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DynamicGeometry.prototype);
-THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.attributesKeys=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
-THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,
-index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},copy:function(a){var b=a.attributes;a=a.offsets;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.offsets.push({start:d.start,index:d.index,count:d.count})}return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},setFromObject:function(a){console.log("THREE.BufferGeometry.setFromObject(). Converting",a,this);var b=a.geometry,c=a.material;if(a instanceof THREE.PointCloud||a instanceof THREE.Line)c=new THREE.Float32Attribute(3*b.vertices.length,3),a=new THREE.Float32Attribute(3*b.colors.length,
-3),this.addAttribute("position",c.copyVector3sArray(b.vertices)),this.addAttribute("color",a.copyColorsArray(b.colors)),this.computeBoundingSphere();else if(a instanceof THREE.Mesh){if(a instanceof THREE.SkinnedMesh){b instanceof THREE.Geometry&&(console.log("THREE.BufferGeometry.setFromObject(): Converted THREE.Geometry to THREE.DynamicGeometry as required for THREE.SkinnedMesh.",b),b=(new THREE.DynamicGeometry).fromGeometry(b));var d=new THREE.Float32Attribute(4*b.skinIndices.length,4),e=new THREE.Float32Attribute(4*
-b.skinWeights.length,4);this.addAttribute("skinIndex",d.copyVector4sArray(b.skinIndices));this.addAttribute("skinWeight",e.copyVector4sArray(b.skinWeights))}if(void 0!==a.morphTargetInfluences&&(b instanceof THREE.Geometry&&(console.log("THREE.BufferGeometry.setFromObject(): Converted THREE.Geometry to THREE.DynamicGeometry as required for MorphTargets.",b),b=(new THREE.DynamicGeometry).fromGeometry(b)),this.morphsInfluences=(new THREE.Float32Attribute(a.morphTargetInfluences,1)).copyArray(a.morphTargetInfluences),
-a=b.morphTargets,0<a.length))for(d=0,e=a.length;d<e;d++){var f=a[d],g=new THREE.Float32Attribute(3*f.vertices.length,3);g.enabled=!1;this.addAttribute("position_"+d,g.copyVector3sArray(f.vertices))}b instanceof THREE.DynamicGeometry?this.fromDynamicGeometry(b):b instanceof THREE.Geometry&&this.fromGeometry(b,c)}return this},updateFromObject:function(a){a=a.geometry;if(!0===a.verticesNeedUpdate){var b=this.attributes.position;void 0!==b&&(b.copyVector3sArray(a.vertices),b.needsUpdate=!0);a.verticesNeedUpdate=
-!1}!0===a.colorsNeedUpdate&&(b=this.attributes.color,void 0!==b&&(b.copyColorsArray(a.colors),b.needsUpdate=!0),a.colorsNeedUpdate=!1)},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=e[0]&&0<e[0].length,h=e[1]&&0<e[1].length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var l=new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(l,3));if(f!==THREE.NoColors){var m=
-new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(m,3))}if(!0===g){var p=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(p,2))}if(!0===h){var n=new Float32Array(6*d.length);this.addAttribute("uv2",new THREE.BufferAttribute(n,2))}for(var r=0,t=0,s=0;r<d.length;r++,t+=6,s+=9){var u=d[r],v=c[u.a],w=c[u.b],z=c[u.c];k[s]=v.x;k[s+1]=v.y;k[s+2]=v.z;k[s+3]=w.x;k[s+4]=w.y;k[s+5]=w.z;k[s+6]=z.x;k[s+7]=z.y;k[s+8]=z.z;z=u.vertexNormals;3===z.length?
-(v=z[0],w=z[1],z=z[2],l[s]=v.x,l[s+1]=v.y,l[s+2]=v.z,l[s+3]=w.x,l[s+4]=w.y,l[s+5]=w.z,l[s+6]=z.x,l[s+7]=z.y,l[s+8]=z.z):(v=u.normal,l[s]=v.x,l[s+1]=v.y,l[s+2]=v.z,l[s+3]=v.x,l[s+4]=v.y,l[s+5]=v.z,l[s+6]=v.x,l[s+7]=v.y,l[s+8]=v.z);f===THREE.FaceColors?(u=u.color,m[s]=u.r,m[s+1]=u.g,m[s+2]=u.b,m[s+3]=u.r,m[s+4]=u.g,m[s+5]=u.b,m[s+6]=u.r,m[s+7]=u.g,m[s+8]=u.b):f===THREE.VertexColors&&(v=u.vertexColors[0],w=u.vertexColors[1],u=u.vertexColors[2],m[s]=v.r,m[s+1]=v.g,m[s+2]=v.b,m[s+3]=w.r,m[s+4]=w.g,m[s+
-5]=w.b,m[s+6]=u.r,m[s+7]=u.g,m[s+8]=u.b);!0===g&&(w=e[0][r],void 0!==w?(u=w[0],v=w[1],w=w[2],p[t]=u.x,p[t+1]=u.y,p[t+2]=v.x,p[t+3]=v.y,p[t+4]=w.x,p[t+5]=w.y):console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv",r));!0===h&&(w=e[1][r],void 0!==w?(u=w[0],v=w[1],w=w[2],n[t]=u.x,n[t+1]=u.y,n[t+2]=v.x,n[t+3]=v.y,n[t+4]=w.x,n[t+5]=w.y):console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv2",r))}this.computeBoundingSphere();return this},fromDynamicGeometry:function(a){var b=
-new Uint16Array(3*a.faces.length);this.addAttribute("index",(new THREE.BufferAttribute(b,1)).copyFacesArray(a.faces));b=new Float32Array(3*a.vertices.length);this.addAttribute("position",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.vertices));b=new Float32Array(3*a.normals.length);this.addAttribute("normal",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.normals));b=new Float32Array(3*a.colors.length);this.addAttribute("color",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.colors));
-b=new Float32Array(2*a.uvs.length);this.addAttribute("uv",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs));this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,
-0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,
-e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;
-if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;if(a.index)for(var r=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,count:r.length,index:0}],s=0,u=t.length;s<u;++s){e=t[s].start;f=t[s].count;for(var v=t[s].index,d=e,e=e+f;d<e;d+=3)f=3*(v+r[d]),
-g=3*(v+r[d+1]),h=3*(v+r[d+2]),k.fromArray(b,f),l.fromArray(b,g),m.fromArray(b,h),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),m.fromArray(b,d+6),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=
-!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);n.fromArray(d,3*b);r.fromArray(d,3*c);t.fromArray(f,2*a);s.fromArray(f,2*b);u.fromArray(f,2*c);v=n.x-p.x;w=r.x-p.x;z=n.y-p.y;y=r.y-p.y;D=n.z-p.z;E=r.z-p.z;x=s.x-t.x;F=u.x-t.x;I=s.y-t.y;C=u.y-t.y;G=1/(x*C-F*I);Q.set((C*v-I*w)*G,(C*z-I*y)*G,(C*D-I*E)*G);K.set((x*w-F*v)*G,(x*y-F*z)*G,(x*E-F*D)*G);k[a].add(Q);k[b].add(Q);k[c].add(Q);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){na.fromArray(e,3*a);da.copy(na);ja=k[a];J.copy(ja);
-J.sub(na.multiplyScalar(na.dot(ja))).normalize();L.crossVectors(da,ja);ua=L.dot(l[a]);ka=0>ua?-1:1;h[4*a]=J.x;h[4*a+1]=J.y;h[4*a+2]=J.z;h[4*a+3]=ka}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,
-f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],m=0;m<g;m++)k[m]=new THREE.Vector3,l[m]=new THREE.Vector3;var p=new THREE.Vector3,n=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,v,w,z,y,D,E,x,F,I,C,G,Q=new THREE.Vector3,K=new THREE.Vector3,A,H,B,T,O;0===this.drawcalls.length&&this.addDrawCall(0,
-c.length,0);var R=this.drawcalls,m=0;for(H=R.length;m<H;++m){A=R[m].start;B=R[m].count;var P=R[m].index,g=A;for(A+=B;g<A;g+=3)B=P+c[g],T=P+c[g+1],O=P+c[g+2],a(B,T,O)}var J=new THREE.Vector3,L=new THREE.Vector3,na=new THREE.Vector3,da=new THREE.Vector3,ka,ja,ua,m=0;for(H=R.length;m<H;++m)for(A=R[m].start,B=R[m].count,P=R[m].index,g=A,A+=B;g<A;g+=3)B=P+c[g],T=P+c[g+1],O=P+c[g+2],b(B),b(T),b(O)}},computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,
-c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,m=0,p=new Int32Array(6),n=new Int32Array(c.length),r=new Int32Array(c.length),t=0;t<c.length;t++)n[t]=-1,r[t]=-1;for(c=0;c<d;c++){for(var s=m=0;3>s;s++)t=b[3*c+s],-1===n[t]?(p[2*s]=t,p[2*s+1]=-1,m++):n[t]<k.index?(p[2*s]=t,p[2*s+1]=-1,l++):(p[2*s]=t,p[2*s+1]=n[t]);if(g+m>k.index+a)for(k={start:f,count:0,index:g},
-h.push(k),m=0;6>m;m+=2)s=p[m+1],-1<s&&s<k.index&&(p[m+1]=-1);for(m=0;6>m;m+=2)t=p[m],s=p[m+1],-1===s&&(s=g++),n[t]=s,r[s]=t,e[f++]=s-k.index,k.count++}this.reorderBuffers(e,r,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],
-g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!==e)for(var h=this.attributes[e].array,
-k=this.attributes[e].itemSize,l=d[e],m=0;m<k;m++)l[f*k+m]=h[g*k+m]}this.attributes.index.array=a;for(e in this.attributes)"index"!==e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data=
-{attributes:{}};var b=this.attributes,d=this.offsets,e=this.boundingSphere;for(c in b){var f=b[c],g=Array.prototype.slice.call(f.array);a.data.attributes[c]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<d.length&&(a.data.offsets=JSON.parse(JSON.stringify(d)));null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<
-c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.BufferGeometry.MaxIndex=65535;THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
-THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c,d){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0,instances:d})};
+THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
+THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=
+this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},copy:function(a){var b=a.attributes;a=a.offsets;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.offsets.push({start:d.start,index:d.index,
+count:d.count})}return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},setFromObject:function(a){console.log("THREE.BufferGeometry.setFromObject(). Converting",a,this);var b=a.geometry,c=a.material;if(a instanceof THREE.PointCloud||a instanceof THREE.Line)c=new THREE.Float32Attribute(3*b.vertices.length,3),a=new THREE.Float32Attribute(3*b.colors.length,3),this.addAttribute("position",c.copyVector3sArray(b.vertices)),
+this.addAttribute("color",a.copyColorsArray(b.colors)),this.computeBoundingSphere();else if(a instanceof THREE.Mesh){if(a instanceof THREE.SkinnedMesh){b instanceof THREE.Geometry&&(console.log("THREE.BufferGeometry.setFromObject(): Converted THREE.Geometry to THREE.DynamicGeometry as required for THREE.SkinnedMesh.",b),b=(new THREE.DynamicGeometry).fromGeometry(b));var d=new THREE.Float32Attribute(4*b.skinIndices.length,4),e=new THREE.Float32Attribute(4*b.skinWeights.length,4);this.addAttribute("skinIndex",
+d.copyVector4sArray(b.skinIndices));this.addAttribute("skinWeight",e.copyVector4sArray(b.skinWeights))}if(void 0!==a.morphTargetInfluences&&(b instanceof THREE.Geometry&&(console.log("THREE.BufferGeometry.setFromObject(): Converted THREE.Geometry to THREE.DynamicGeometry as required for MorphTargets.",b),b=(new THREE.DynamicGeometry).fromGeometry(b)),a=b.morphTargets,0<a.length))for(d=0,e=a.length;d<e;d++){var f=a[d],g=new THREE.Float32Attribute(3*f.vertices.length,3);this.morphAttributes.push(g.copyVector3sArray(f.vertices))}b instanceof
+THREE.DynamicGeometry?this.fromDynamicGeometry(b):b instanceof THREE.Geometry&&this.fromGeometry(b,c)}return this},updateFromObject:function(a){a=a.geometry;if(!0===a.verticesNeedUpdate){var b=this.attributes.position;void 0!==b&&(b.copyVector3sArray(a.vertices),b.needsUpdate=!0);a.verticesNeedUpdate=!1}!0===a.colorsNeedUpdate&&(b=this.attributes.color,void 0!==b&&(b.copyColorsArray(a.colors),b.needsUpdate=!0),a.colorsNeedUpdate=!1)},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=
+a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=e[0]&&0<e[0].length,h=e[1]&&0<e[1].length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var l=new Float32Array(9*d.length);this.addAttribute("normal",new THREE.BufferAttribute(l,3));if(f!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===g){var p=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(p,2))}if(!0===
+h){var m=new Float32Array(6*d.length);this.addAttribute("uv2",new THREE.BufferAttribute(m,2))}for(var s=0,t=0,q=0;s<d.length;s++,t+=6,q+=9){var u=d[s],v=c[u.a],w=c[u.b],z=c[u.c];k[q]=v.x;k[q+1]=v.y;k[q+2]=v.z;k[q+3]=w.x;k[q+4]=w.y;k[q+5]=w.z;k[q+6]=z.x;k[q+7]=z.y;k[q+8]=z.z;z=u.vertexNormals;3===z.length?(v=z[0],w=z[1],z=z[2],l[q]=v.x,l[q+1]=v.y,l[q+2]=v.z,l[q+3]=w.x,l[q+4]=w.y,l[q+5]=w.z,l[q+6]=z.x,l[q+7]=z.y,l[q+8]=z.z):(v=u.normal,l[q]=v.x,l[q+1]=v.y,l[q+2]=v.z,l[q+3]=v.x,l[q+4]=v.y,l[q+5]=v.z,
+l[q+6]=v.x,l[q+7]=v.y,l[q+8]=v.z);f===THREE.FaceColors?(u=u.color,n[q]=u.r,n[q+1]=u.g,n[q+2]=u.b,n[q+3]=u.r,n[q+4]=u.g,n[q+5]=u.b,n[q+6]=u.r,n[q+7]=u.g,n[q+8]=u.b):f===THREE.VertexColors&&(v=u.vertexColors[0],w=u.vertexColors[1],u=u.vertexColors[2],n[q]=v.r,n[q+1]=v.g,n[q+2]=v.b,n[q+3]=w.r,n[q+4]=w.g,n[q+5]=w.b,n[q+6]=u.r,n[q+7]=u.g,n[q+8]=u.b);!0===g&&(w=e[0][s],void 0!==w?(u=w[0],v=w[1],w=w[2],p[t]=u.x,p[t+1]=u.y,p[t+2]=v.x,p[t+3]=v.y,p[t+4]=w.x,p[t+5]=w.y):console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv",
+s));!0===h&&(w=e[1][s],void 0!==w?(u=w[0],v=w[1],w=w[2],m[t]=u.x,m[t+1]=u.y,m[t+2]=v.x,m[t+3]=v.y,m[t+4]=w.x,m[t+5]=w.y):console.warn("THREE.BufferGeometry.fromGeometry(): Undefined vertexUv2",s))}this.computeBoundingSphere();return this},fromDynamicGeometry:function(a){var b=new Uint16Array(3*a.faces.length);this.addAttribute("index",(new THREE.BufferAttribute(b,1)).copyFacesArray(a.faces));b=new Float32Array(3*a.vertices.length);this.addAttribute("position",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.vertices));
+0<a.normals.length&&(b=new Float32Array(3*a.normals.length),this.addAttribute("normal",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.normals)));0<a.colors.length&&(b=new Float32Array(3*a.colors.length),this.addAttribute("color",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute("uv",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs)));this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=
+new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
+this)}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.fromArray(c,e),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
+this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,f,g,h,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var s=a.index.array,t=0<this.offsets.length?this.offsets:[{start:0,
+count:s.length,index:0}],q=0,u=t.length;q<u;++q){e=t[q].start;f=t[q].count;for(var v=t[q].index,d=e,e=e+f;d<e;d+=3)f=3*(v+s[d]),g=3*(v+s[d+1]),h=3*(v+s[d+2]),k.fromArray(b,f),l.fromArray(b,g),n.fromArray(b,h),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),n.fromArray(b,d+6),p.subVectors(n,l),m.subVectors(k,l),p.cross(m),c[d]=p.x,
+c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);s.fromArray(d,3*c);t.fromArray(f,2*a);q.fromArray(f,2*b);u.fromArray(f,2*c);v=m.x-p.x;w=s.x-p.x;z=m.y-p.y;y=s.y-p.y;D=m.z-p.z;E=s.z-p.z;x=q.x-t.x;F=u.x-t.x;I=q.y-t.y;C=u.y-t.y;G=1/(x*C-F*I);Q.set((C*v-I*w)*G,(C*z-I*y)*G,(C*D-I*E)*G);K.set((x*w-F*v)*G,(x*y-F*z)*G,(x*E-F*D)*G);k[a].add(Q);
+k[b].add(Q);k[c].add(Q);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){na.fromArray(e,3*a);da.copy(na);ja=k[a];J.copy(ja);J.sub(na.multiplyScalar(na.dot(ja))).normalize();L.crossVectors(da,ja);ua=L.dot(l[a]);ka=0>ua?-1:1;h[4*a]=J.x;h[4*a+1]=J.y;h[4*a+2]=J.z;h[4*a+3]=ka}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
+else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector2,q=new THREE.Vector2,u=new THREE.Vector2,v,w,z,y,D,E,
+x,F,I,C,G,Q=new THREE.Vector3,K=new THREE.Vector3,A,H,B,T,O;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var R=this.drawcalls,n=0;for(H=R.length;n<H;++n){A=R[n].start;B=R[n].count;var P=R[n].index,g=A;for(A+=B;g<A;g+=3)B=P+c[g],T=P+c[g+1],O=P+c[g+2],a(B,T,O)}var J=new THREE.Vector3,L=new THREE.Vector3,na=new THREE.Vector3,da=new THREE.Vector3,ka,ja,ua,n=0;for(H=R.length;n<H;++n)for(A=R[n].start,B=R[n].count,P=R[n].index,g=A,A+=B;g<A;g+=3)B=P+c[g],T=P+c[g+1],O=P+c[g+2],b(B),b(T),b(O)}},
+computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,p=new Int32Array(6),m=new Int32Array(c.length),s=new Int32Array(c.length),t=0;t<c.length;t++)m[t]=-1,s[t]=-1;for(c=0;c<d;c++){for(var q=n=0;3>q;q++)t=b[3*c+q],-1===m[t]?(p[2*q]=t,p[2*q+1]=-1,n++):
+m[t]<k.index?(p[2*q]=t,p[2*q+1]=-1,l++):(p[2*q]=t,p[2*q+1]=m[t]);if(g+n>k.index+a)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)q=p[n+1],-1<q&&q<k.index&&(p[n+1]=-1);for(n=0;6>n;n+=2)t=p[n],q=p[n+1],-1===q&&(q=g++),m[t]=q,s[q]=t,e[f++]=q-k.index,k.count++}this.reorderBuffers(e,s,g);return this.drawcalls=this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===
+b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;h<g.length;h++,f++)e[f]=g[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
+c));for(var f=0;f<c;f++){var g=b[f];for(e in this.attributes)if("index"!==e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],n=0;n<k;n++)l[f*k+n]=h[g*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!==e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);
+if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var b=this.attributes,d=this.offsets,e=this.boundingSphere;for(c in b){var f=b[c],g=Array.prototype.slice.call(f.array);a.data.attributes[c]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}0<d.length&&(a.data.offsets=JSON.parse(JSON.stringify(d)));null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){var a=new THREE.BufferGeometry,
+b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.BufferGeometry.MaxIndex=65535;
+THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c,d){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0,instances:d})};
 THREE.InstancedBufferGeometry.prototype.clone=function(){var a=new THREE.InstancedBufferGeometry,b;for(b in this.attributes)a.addAttribute(b,this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count,instances:d.instances})}return a};THREE.EventDispatcher.prototype.apply(THREE.InstancedBufferGeometry.prototype);
 THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();
 THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
 THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1);f.lookAt(new THREE.Vector3(0,1,0));this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new THREE.Vector3(0,-1,0));
-this.add(g);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){void 0===this.parent&&this.updateMatrixWorld();var c=this.renderTarget,n=c.generateMipmaps;c.generateMipmaps=
-!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=n;c.activeCubeFace=5;a.render(b,k,c);a.setRenderTarget(null)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.CubeCamera.prototype.constructor=THREE.CubeCamera;
+this.add(g);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){void 0===this.parent&&this.updateMatrixWorld();var c=this.renderTarget,m=c.generateMipmaps;c.generateMipmaps=
+!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=m;c.activeCubeFace=5;a.render(b,k,c);a.setRenderTarget(null)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.CubeCamera.prototype.constructor=THREE.CubeCamera;
 THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.type="OrthographicCamera";this.zoom=1;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;
 THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var a=(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(c-a,c+a,d+b,d-b,this.near,this.far)};
 THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.zoom=this.zoom;a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;a.projectionMatrix.copy(this.projectionMatrix);return a};
@@ -274,8 +273,8 @@ a.shadowDarkness=this.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shad
 THREE.Cache={files:{},add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}};THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.imageLoader=new THREE.ImageLoader;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+
 "%"):b+((a.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=this.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function d(a,
-d,e,g,h,k,s){var u=b+e,v,w=THREE.Loader.Handlers.get(u);null!==w?v=w.load(u):(v=new THREE.Texture,w=f.imageLoader,w.crossOrigin=f.crossOrigin,w.load(u,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);v.image=e}else v.image=a;v.needsUpdate=!0}));v.sourceFile=e;g&&(v.repeat.set(g[0],g[1]),1!==g[0]&&(v.wrapS=THREE.RepeatWrapping),
-1!==g[1]&&(v.wrapT=THREE.RepeatWrapping));h&&v.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(v.wrapS=e[k[0]]),void 0!==e[k[1]]&&(v.wrapT=e[k[1]]));s&&(v.anisotropy=s);a[d]=v}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
+d,e,g,h,k,q){var u=b+e,v,w=THREE.Loader.Handlers.get(u);null!==w?v=w.load(u):(v=new THREE.Texture,w=f.imageLoader,w.crossOrigin=f.crossOrigin,w.load(u,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);v.image=e}else v.image=a;v.needsUpdate=!0}));v.sourceFile=e;g&&(v.repeat.set(g[0],g[1]),1!==g[0]&&(v.wrapS=THREE.RepeatWrapping),
+1!==g[1]&&(v.wrapT=THREE.RepeatWrapping));h&&v.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(v.wrapS=e[k[0]]),void 0!==e[k[1]]&&(v.wrapT=e[k[1]]));q&&(v.anisotropy=q);a[d]=v}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":
 "basic"===k&&(g="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]);void 0!==a.transparent&&(h.transparent=a.transparent);void 0!==a.opacity&&1>a.opacity&&(h.transparent=!0);void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);
 void 0!==a.vertexColors&&("face"===a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorEmissive&&(h.emissive=e(a.colorEmissive));void 0!==a.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),a.opacity=a.transparency);void 0!==a.opacity&&(h.opacity=a.opacity);a.specularCoef&&(h.shininess=
 a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapAO&&b&&d(h,"aoMap",a.mapAO,a.mapAORepeat,a.mapAOOffset,a.mapAOWrap,a.mapAOAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,
@@ -287,13 +286,13 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),k=h.metadata;if(void 0!==k){if("object"===k.type){console.error("THREE.JSONLoader: "+b+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===k.type){console.error("THREE.JSONLoader: "+b+" seems to be a Scene. Use THREE.SceneLoader instead.");return}}h=
 a.parse(h,d);c(h.geometry,h.materials)}else console.error("THREE.JSONLoader: "+b+" seems to be unreachable or the file is empty.");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load "+b+" ("+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,m,p,n,r,t,s,u,v,w=a.faces;m=a.vertices;var z=a.normals,y=a.colors,D=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&D++;for(d=0;d<D;d++)c.faceVertexUvs[d]=[]}k=0;for(l=m.length;k<l;)d=new THREE.Vector3,d.x=m[k++]*b,d.y=m[k++]*b,d.z=m[k++]*b,c.vertices.push(d);k=0;for(l=w.length;k<l;)if(b=w[k++],r=b&1,h=b&2,d=b&8,p=b&16,t=b&32,m=b&64,b&=128,r){r=new THREE.Face3;
-r.a=w[k];r.b=w[k+1];r.c=w[k+3];s=new THREE.Face3;s.a=w[k+1];s.b=w[k+2];s.c=w[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<D;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)n=w[k++],v=u[2*n],n=u[2*n+1],v=new THREE.Vector2(v,n),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);p&&(p=3*w[k++],r.normal.set(z[p++],z[p++],z[p]),s.normal.copy(r.normal));if(t)for(d=0;4>d;d++)p=3*w[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),2!==d&&r.vertexNormals.push(t),
-0!==d&&s.vertexNormals.push(t);m&&(m=w[k++],m=y[m],r.color.setHex(m),s.color.setHex(m));if(b)for(d=0;4>d;d++)m=w[k++],m=y[m],2!==d&&r.vertexColors.push(new THREE.Color(m)),0!==d&&s.vertexColors.push(new THREE.Color(m));c.faces.push(r);c.faces.push(s)}else{r=new THREE.Face3;r.a=w[k++];r.b=w[k++];r.c=w[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<D;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)n=w[k++],v=u[2*n],n=u[2*n+1],v=new THREE.Vector2(v,n),c.faceVertexUvs[d][h].push(v);p&&(p=3*w[k++],
-r.normal.set(z[p++],z[p++],z[p]));if(t)for(d=0;3>d;d++)p=3*w[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),r.vertexNormals.push(t);m&&(m=w[k++],r.color.setHex(y[m]));if(b)for(d=0;3>d;d++)m=w[k++],r.vertexColors.push(new THREE.Color(y[m]));c.faces.push(r)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,n,p,m,s,t,q,u,v,w=a.faces;n=a.vertices;var z=a.normals,y=a.colors,D=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&D++;for(d=0;d<D;d++)c.faceVertexUvs[d]=[]}k=0;for(l=n.length;k<l;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(l=w.length;k<l;)if(b=w[k++],s=b&1,h=b&2,d=b&8,p=b&16,t=b&32,n=b&64,b&=128,s){s=new THREE.Face3;
+s.a=w[k];s.b=w[k+1];s.c=w[k+3];q=new THREE.Face3;q.a=w[k+1];q.b=w[k+2];q.c=w[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<D;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)m=w[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);p&&(p=3*w[k++],s.normal.set(z[p++],z[p++],z[p]),q.normal.copy(s.normal));if(t)for(d=0;4>d;d++)p=3*w[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),2!==d&&s.vertexNormals.push(t),
+0!==d&&q.vertexNormals.push(t);n&&(n=w[k++],n=y[n],s.color.setHex(n),q.color.setHex(n));if(b)for(d=0;4>d;d++)n=w[k++],n=y[n],2!==d&&s.vertexColors.push(new THREE.Color(n)),0!==d&&q.vertexColors.push(new THREE.Color(n));c.faces.push(s);c.faces.push(q)}else{s=new THREE.Face3;s.a=w[k++];s.b=w[k++];s.c=w[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<D;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)m=w[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);p&&(p=3*w[k++],
+s.normal.set(z[p++],z[p++],z[p]));if(t)for(d=0;3>d;d++)p=3*w[k++],t=new THREE.Vector3(z[p++],z[p++],z[p]),s.vertexNormals.push(t);n&&(n=w[k++],s.color.setHex(y[n]));if(b)for(d=0;3>d;d++)n=w[k++],s.vertexColors.push(new THREE.Color(y[n]));c.faces.push(s)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?
 a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("THREE.JSONLoader: When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+
-") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,m;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,m=a.morphTargets[d].vertices,h=0,k=m.length;h<k;h+=3){var p=new THREE.Vector3;p.x=m[h]*b;p.y=m[h+1]*b;p.z=m[h+2]*b;l.push(p)}}if(void 0!==a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]=
-{},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)m=new THREE.Color(16755200),m.setRGB(l[b],l[b+1],l[b+2]),k.push(m)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};
+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,n;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var p=new THREE.Vector3;p.x=n[h]*b;p.y=n[h+1]*b;p.z=n[h+2]*b;l.push(p)}}if(void 0!==a.morphColors)for(d=0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]=
+{},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(l[b],l[b+1],l[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};
 THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin);f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.data.attributes,d;for(d in c){var e=c[d],f=new self[e.type](e.array);b.addAttribute(d,new THREE.BufferAttribute(f,e.itemSize))}c=a.data.offsets;void 0!==c&&(b.offsets=JSON.parse(JSON.stringify(c)));
 a=a.data.boundingSphere;void 0!==a&&(c=new THREE.Vector3,void 0!==a.center&&c.fromArray(a.center),b.boundingSphere=new THREE.Sphere(c,a.radius));return b}};THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
@@ -359,29 +358,29 @@ THREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this
 this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;a.unpackAlignment=this.unpackAlignment;return a},toJSON:function(a){if(void 0!==a.textures[this.uuid])return a.textures[this.uuid];var b={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy};
 if(void 0!==this.image){var c=this.image;void 0===c.uuid&&(c.uuid=THREE.Math.generateUUID());if(void 0===a.images[this.image.uuid]){var d=document.createElement("canvas");d.width=c.width;d.height=c.height;d.getContext("2d").drawImage(c,0,0,c.width,c.height);d=2048<c.width||2048<c.height?d.toDataURL("image/jpeg",.6):d.toDataURL("image/png");a.images[this.image.uuid]={uuid:this.image.uuid,url:d}}b.image=c.uuid}return a.textures[this.uuid]=b},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};
 THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CubeTexture=function(a,b,c,d,e,f,g,h,k){b=void 0!==b?b:THREE.CubeReflectionMapping;THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.images=a};THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CubeTexture.prototype.constructor=THREE.CubeTexture;THREE.CubeTexture.clone=function(a){void 0===a&&(a=new THREE.CubeTexture);THREE.Texture.prototype.clone.call(this,a);a.images=this.images;return a};
-THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,m){THREE.Texture.call(this,null,f,g,h,k,l,d,e,m);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture;THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};
-THREE.DataTexture=function(a,b,c,d,e,f,g,h,k,l,m){THREE.Texture.call(this,null,f,g,h,k,l,d,e,m);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture;THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};
-THREE.VideoTexture=function(a,b,c,d,e,f,g,h,k){THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.generateMipmaps=!1;var l=this,m=function(){requestAnimationFrame(m);a.readyState===a.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)};m()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);
+THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,n){THREE.Texture.call(this,null,f,g,h,k,l,d,e,n);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture;THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};
+THREE.DataTexture=function(a,b,c,d,e,f,g,h,k,l,n){THREE.Texture.call(this,null,f,g,h,k,l,d,e,n);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture;THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};
+THREE.VideoTexture=function(a,b,c,d,e,f,g,h,k){THREE.Texture.call(this,a,b,c,d,e,f,g,h,k);this.generateMipmaps=!1;var l=this,n=function(){requestAnimationFrame(n);a.readyState===a.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)};n()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Group.prototype.constructor=THREE.Group;THREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.type="PointCloud";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()})};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);THREE.PointCloud.prototype.constructor=THREE.PointCloud;
 THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,f=e.geometry,g=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===f.boundingBox||!1!==b.isIntersectionBox(f.boundingBox)){var h=g/((this.scale.x+this.scale.y+this.scale.z)/3),k=new THREE.Vector3,g=function(a,f){var g=b.distanceToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var l=c.ray.origin.distanceTo(k);
-d.push({distance:l,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,m=l.position.array;if(void 0!==l.index){var l=l.index.array,p=f.offsets;0===p.length&&(p=[{start:0,count:l.length,index:0}]);for(var n=0,r=p.length;n<r;++n)for(var t=p[n].start,s=p[n].index,f=t,t=t+p[n].count;f<t;f++){var u=s+l[f];k.fromArray(m,3*u);g(k,u)}}else for(l=m.length/3,f=0;f<l;f++)k.set(m[3*f],m[3*f+1],m[3*f+2]),g(k,f)}else for(k=this.geometry.vertices,
+d.push({distance:l,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var l=f.attributes,n=l.position.array;if(void 0!==l.index){var l=l.index.array,p=f.offsets;0===p.length&&(p=[{start:0,count:l.length,index:0}]);for(var m=0,s=p.length;m<s;++m)for(var t=p[m].start,q=p[m].index,f=t,t=t+p[m].count;f<t;f++){var u=q+l[f];k.fromArray(n,3*u);g(k,u)}}else for(l=n.length/3,f=0;f<l;f++)k.set(n[3*f],n[3*f+1],n[3*f+2]),g(k,f)}else for(k=this.geometry.vertices,
 f=0;f<k.length;f++)g(k[f],f)}}}();THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};
 THREE.PointCloud.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};
 THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};THREE.Line=function(a,b,c){1===c&&console.error("THREE.Line: THREE.LinePieces mode has been removed. Use THREE.LineSegments instead.");THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()})};THREE.Line.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Line.prototype.constructor=THREE.Line;
-THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(g instanceof
-THREE.BufferGeometry){var n=g.attributes;if(void 0!==n.index){var r=n.index.array,n=n.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:r.length,index:0}]);for(var s=0;s<t.length;s++)for(var u=t[s].start,v=t[s].count,w=t[s].index,g=u;g<u+v-1;g+=p){var z=w+r[g+1];h.fromArray(n,3*(w+r[g]));k.fromArray(n,3*z);z=b.distanceSqToSegment(h,k,m,l);z>f||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:s,face:null,faceIndex:null,
-object:this}))}}else for(n=n.position.array,g=0;g<n.length/3-1;g+=p)h.fromArray(n,3*g),k.fromArray(n,3*g+3),z=b.distanceSqToSegment(h,k,m,l),z>f||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;g<k-1;g+=p)z=b.distanceSqToSegment(h[g],h[g+1],m,l),z>f||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),
+THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(g instanceof
+THREE.BufferGeometry){var m=g.attributes;if(void 0!==m.index){var s=m.index.array,m=m.position.array,t=g.offsets;0===t.length&&(t=[{start:0,count:s.length,index:0}]);for(var q=0;q<t.length;q++)for(var u=t[q].start,v=t[q].count,w=t[q].index,g=u;g<u+v-1;g+=p){var z=w+s[g+1];h.fromArray(m,3*(w+s[g]));k.fromArray(m,3*z);z=b.distanceSqToSegment(h,k,n,l);z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:q,face:null,faceIndex:null,
+object:this}))}}else for(m=m.position.array,g=0;g<m.length/3-1;g+=p)h.fromArray(m,3*g),k.fromArray(m,3*g+3),z=b.distanceSqToSegment(h,k,n,l),z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;g<k-1;g+=p)z=b.distanceSqToSegment(h[g],h[g+1],n,l),z>f||(z=b.origin.distanceTo(n),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),
 index:g,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE[this.type](this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};
 THREE.Line.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};
 THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototype.constructor=THREE.Mesh;
 THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
 THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var l=
-this.material;if(void 0!==l){var m=k.attributes,p,n,r=g.precision;if(void 0!==m.index){var t=m.index.array,s=m.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:t.length,index:0}]);for(var v=0,w=u.length;v<w;++v)for(var m=u[v].start,z=u[v].index,k=m,y=m+u[v].count;k<y;k+=3){m=z+t[k];p=z+t[k+1];n=z+t[k+2];d.fromArray(s,3*m);e.fromArray(s,3*p);f.fromArray(s,3*n);var D=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==D){D.applyMatrix4(this.matrixWorld);
-var E=g.ray.origin.distanceTo(D);E<r||E<g.near||E>g.far||h.push({distance:E,point:D,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(s=m.position.array,t=k=0,y=s.length;k<y;k+=3,t+=9)m=k,p=k+1,n=k+2,d.fromArray(s,t),e.fromArray(s,t+3),f.fromArray(s,t+6),D=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==D&&(D.applyMatrix4(this.matrixWorld),E=g.ray.origin.distanceTo(D),E<r||E<g.near||E>
-g.far||h.push({distance:E,point:D,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,s=!0===t?this.material.materials:null,r=g.precision,u=k.vertices,v=0,w=k.faces.length;v<w;v++)if(z=k.faces[v],l=!0===t?s[z.materialIndex]:this.material,void 0!==l){m=u[z.a];p=u[z.b];n=u[z.c];if(!0===l.morphTargets){D=k.morphTargets;E=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
-0,0);for(var y=0,x=D.length;y<x;y++){var F=E[y];if(0!==F){var I=D[y].vertices;d.x+=(I[z.a].x-m.x)*F;d.y+=(I[z.a].y-m.y)*F;d.z+=(I[z.a].z-m.z)*F;e.x+=(I[z.b].x-p.x)*F;e.y+=(I[z.b].y-p.y)*F;e.z+=(I[z.b].z-p.z)*F;f.x+=(I[z.c].x-n.x)*F;f.y+=(I[z.c].y-n.y)*F;f.z+=(I[z.c].z-n.z)*F}}d.add(m);e.add(p);f.add(n);m=d;p=e;n=f}D=l.side===THREE.BackSide?b.intersectTriangle(n,p,m,!0):b.intersectTriangle(m,p,n,l.side!==THREE.DoubleSide);null!==D&&(D.applyMatrix4(this.matrixWorld),E=g.ray.origin.distanceTo(D),E<r||
+this.material;if(void 0!==l){var n=k.attributes,p,m,s=g.precision;if(void 0!==n.index){var t=n.index.array,q=n.position.array,u=k.offsets;0===u.length&&(u=[{start:0,count:t.length,index:0}]);for(var v=0,w=u.length;v<w;++v)for(var n=u[v].start,z=u[v].index,k=n,y=n+u[v].count;k<y;k+=3){n=z+t[k];p=z+t[k+1];m=z+t[k+2];d.fromArray(q,3*n);e.fromArray(q,3*p);f.fromArray(q,3*m);var D=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide);if(null!==D){D.applyMatrix4(this.matrixWorld);
+var E=g.ray.origin.distanceTo(D);E<s||E<g.near||E>g.far||h.push({distance:E,point:D,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(q=n.position.array,t=k=0,y=q.length;k<y;k+=3,t+=9)n=k,p=k+1,m=k+2,d.fromArray(q,t),e.fromArray(q,t+3),f.fromArray(q,t+6),D=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==D&&(D.applyMatrix4(this.matrixWorld),E=g.ray.origin.distanceTo(D),E<s||E<g.near||E>
+g.far||h.push({distance:E,point:D,face:new THREE.Face3(n,p,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(t=this.material instanceof THREE.MeshFaceMaterial,q=!0===t?this.material.materials:null,s=g.precision,u=k.vertices,v=0,w=k.faces.length;v<w;v++)if(z=k.faces[v],l=!0===t?q[z.materialIndex]:this.material,void 0!==l){n=u[z.a];p=u[z.b];m=u[z.c];if(!0===l.morphTargets){D=k.morphTargets;E=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);f.set(0,
+0,0);for(var y=0,x=D.length;y<x;y++){var F=E[y];if(0!==F){var I=D[y].vertices;d.x+=(I[z.a].x-n.x)*F;d.y+=(I[z.a].y-n.y)*F;d.z+=(I[z.a].z-n.z)*F;e.x+=(I[z.b].x-p.x)*F;e.y+=(I[z.b].y-p.y)*F;e.z+=(I[z.b].z-p.z)*F;f.x+=(I[z.c].x-m.x)*F;f.y+=(I[z.c].y-m.y)*F;f.z+=(I[z.c].z-m.z)*F}}d.add(n);e.add(p);f.add(m);n=d;p=e;m=f}D=l.side===THREE.BackSide?b.intersectTriangle(m,p,n,!0):b.intersectTriangle(n,p,m,l.side!==THREE.DoubleSide);null!==D&&(D.applyMatrix4(this.matrixWorld),E=g.ray.origin.distanceTo(D),E<s||
 E<g.near||E>g.far||h.push({distance:E,point:D,face:z,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};
 THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Bone.prototype.constructor=THREE.Bone;
@@ -441,9 +440,9 @@ THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SP
 THREE.ShaderChunk.uv2_pars_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\n#endif";THREE.ShaderChunk.uv2_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvUv2 = uv2;\n\n#endif";THREE.ShaderChunk.uv_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif";THREE.ShaderChunk.uv_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n";
 THREE.ShaderChunk.uv_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif";THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#elif defined( USE_MORPHTARGETS )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif\n";
 THREE.UniformsUtils={merge:function(a){for(var b={},c=0;c<a.length;c++){var d=this.clone(a[c]),e;for(e in d)b[e]=d[e]}return b},clone:function(a){var b={},c;for(c in a){b[c]={};for(var d in a[c]){var e=a[c][d];e instanceof THREE.Color||e instanceof THREE.Vector2||e instanceof THREE.Vector3||e instanceof THREE.Vector4||e instanceof THREE.Matrix3||e instanceof THREE.Matrix4||e instanceof THREE.Texture?b[c][d]=e.clone():Array.isArray(e)?b[c][d]=e.slice():b[c][d]=e}}return b}};
-THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98},morphTargetInfluences:{type:"f",value:0}},aomap:{aoMap:{type:"t",value:null},aoMapIntensity:{type:"f",value:1}},lightmap:{lightMap:{type:"t",
-value:null},lightMapIntensity:{type:"f",value:1}},bump:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},fog:{fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",
-value:[]},hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},pointLightDecay:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]},spotLightDecay:{type:"fv1",
+THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98}},aomap:{aoMap:{type:"t",value:null},aoMapIntensity:{type:"f",value:1}},lightmap:{lightMap:{type:"t",value:null},lightMapIntensity:{type:"f",
+value:1}},bump:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},fog:{fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",value:[]},
+hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},pointLightDecay:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]},spotLightDecay:{type:"fv1",
 value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:[]},shadowMapSize:{type:"v2v",value:[]},shadowBias:{type:"fv1",value:[]},shadowDarkness:{type:"fv1",
 value:[]},shadowMatrix:{type:"m4v",value:[]}}};
 THREE.ShaderLib={basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.shadowmap]),vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.uv_pars_vertex,THREE.ShaderChunk.uv2_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.uv_vertex,
@@ -473,94 +472,94 @@ normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNorma
 "void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",
 THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,
 "vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};
-THREE.WebGLRenderer=function(a){function b(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=W.get("ANGLE_instanced_arrays"),null===e)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var f=c.attributes,g=b.attributes;b=b.attributesKeys;for(var h=0,k=b.length;h<k;h++){var l=b[h],n=g[l];if(0<=n){var m=f[l];if(void 0!==m)if(l=m.itemSize,S.enableAttribute(n),m instanceof
-THREE.InterleavedBufferAttribute){var p=m.data,r=p.stride,s=m.offset;q.bindBuffer(q.ARRAY_BUFFER,m.data.buffer);q.vertexAttribPointer(n,l,q.FLOAT,!1,r*p.array.BYTES_PER_ELEMENT,(d*r+s)*p.array.BYTES_PER_ELEMENT);if(p instanceof THREE.InstancedInterleavedBuffer){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(n,p.meshPerAttribute);void 0===
-c.maxInstancedCount&&(c.maxInstancedCount=p.array.length/p.stride*p.meshPerAttribute)}}else{if(q.bindBuffer(q.ARRAY_BUFFER,m.buffer),q.vertexAttribPointer(n,l,q.FLOAT,!1,0,d*l*4),m instanceof THREE.InstancedBufferAttribute){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(n,m.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=
-m.array.length/m.itemSize*m.meshPerAttribute)}}else void 0!==a.defaultAttributeValues&&void 0!==a.defaultAttributeValues[l]&&(2===a.defaultAttributeValues[l].length?q.vertexAttrib2fv(n,a.defaultAttributeValues[l]):3===a.defaultAttributeValues[l].length&&q.vertexAttrib3fv(n,a.defaultAttributeValues[l]))}}S.disableUnusedAttributes()}function c(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-
-b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function d(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ha.init(a),a instanceof THREE.Light)B.push(a);else if(a instanceof THREE.Sprite)R.push(a);else if(a instanceof THREE.LensFlare)P.push(a);else{var b=ha.objects[a.id];!b||!1!==
-a.frustumCulled&&!0!==Ha.intersectsObject(a)||(a.material.transparent?O.push(b):T.push(b),!0===J.sortObjects&&(ia.setFromMatrixPosition(a.matrixWorld),ia.applyProjection(za),b.z=ia.z))}for(var b=0,c=a.children.length;b<c;b++)e(a.children[b])}}function f(a,b,c,d,e){for(var f,g=0,k=a.length;g<k;g++){var l=a[g].object;f=l;f._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,f.matrixWorld);f._normalMatrix.getNormalMatrix(f._modelViewMatrix);if(e)f=e;else{f=l.material;if(!f)continue;h(f)}J.setMaterialFaces(f);
-J.renderBufferDirect(b,c,d,f,l)}}function g(a,b,c,d,e,f){for(var g,k=0,l=a.length;k<l;k++){g=a[k];var n=g.object;if(n.visible){if(f)g=f;else{g=g[b];if(!g)continue;h(g)}J.renderImmediateObject(c,d,e,g,n)}}}function h(a){!0===a.transparent?S.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):S.setBlending(THREE.NoBlending);S.setDepthFunc(a.depthFunc);S.setDepthTest(a.depthTest);S.setDepthWrite(a.depthWrite);S.setColorWrite(a.colorWrite);
-S.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function k(a,b,c,d,e){var f,g,h,k;Va=0;if(d.needsUpdate){a:{for(var s=Sb[d.type],t=0,w=0,y=0,z=0,x=0,I=b.length;x<I;x++){var D=b[x];D.onlyShadow||!1===D.visible||(D instanceof THREE.DirectionalLight&&t++,D instanceof THREE.PointLight&&w++,D instanceof THREE.SpotLight&&y++,D instanceof THREE.HemisphereLight&&z++)}f=t;g=w;h=y;k=z;for(var A,C=0,F=0,G=b.length;F<G;F++){var B=b[F];B.castShadow&&(B instanceof THREE.SpotLight&&
-C++,B instanceof THREE.DirectionalLight&&!B.shadowCascade&&C++)}A=C;var H;if(bb&&e&&e.skeleton&&e.skeleton.useVertexTexture)H=1024;else{var O=q.getParameter(q.MAX_VERTEX_UNIFORM_VECTORS),Q=Math.floor((O-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(Q=Math.min(e.skeleton.bones.length,Q),Q<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+Q+" (try OpenGL instead of ANGLE)"));H=Q}var ja={precision:E,supportsVertexTextures:cb,
-map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,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:K,skinning:d.skinning,maxBones:H,useVertexTexture:bb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,
-morphNormals:d.morphNormals,maxMorphTargets:J.maxMorphTargets,maxMorphNormals:J.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:A,shadowMapEnabled:ga.enabled&&e.receiveShadow&&0<A,shadowMapType:ga.type,shadowMapDebug:ga.debug,shadowMapCascade:ga.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},R=[];s?R.push(s):(R.push(d.fragmentShader),R.push(d.vertexShader));if(void 0!==d.defines)for(var P in d.defines)R.push(P),
-R.push(d.defines[P]);for(P in ja)R.push(P),R.push(ja[P]);var T=R.join();if(!d.program)d.addEventListener("dispose",Eb);else if(d.program.code!==T)Fb(d);else if(void 0!==s)break a;else if(d.__webglShader.uniforms===d.uniforms)break a;if(s){var W=THREE.ShaderLib[s];d.__webglShader={uniforms:THREE.UniformsUtils.clone(W.uniforms),vertexShader:W.vertexShader,fragmentShader:W.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var ma,
-ya=0,Ga=L.length;ya<Ga;ya++){var Fa=L[ya];if(Fa.code===T){ma=Fa;ma.usedTimes++;break}}void 0===ma&&(ma=new THREE.WebGLProgram(J,T,d,ja),L.push(ma),J.info.memory.programs=L.length);d.program=ma;var Ta=ma.attributes;if(d.morphTargets)for(var ra=d.numSupportedMorphTargets=0;ra<J.maxMorphTargets;ra++)0<=Ta["morphTarget"+ra]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(ra=d.numSupportedMorphNormals=0;ra<J.maxMorphNormals;ra++)0<=Ta["morphNormal"+ra]&&d.numSupportedMorphNormals++;d.uniformsList=
-[];for(var da in d.__webglShader.uniforms){var ha=d.program.uniforms[da];ha&&d.uniformsList.push([d.__webglShader.uniforms[da],ha])}}d.needsUpdate=!1}var Ha=!1,za=!1,Wa=!1,Na=d.program,$=Na.uniforms,M=d.__webglShader.uniforms;Na.id!==na&&(q.useProgram(Na.program),na=Na.id,Wa=za=Ha=!0);d.id!==ka&&(-1===ka&&(Wa=!0),ka=d.id,za=!0);if(Ha||a!==ua)q.uniformMatrix4fv($.projectionMatrix,!1,a.projectionMatrix.elements),K&&q.uniform1f($.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==ua&&(ua=a),(d instanceof
-THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==$.cameraPosition&&(ia.setFromMatrixPosition(a.matrixWorld),q.uniform3f($.cameraPosition,ia.x,ia.y,ia.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==$.viewMatrix&&q.uniformMatrix4fv($.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==$.bindMatrix&&q.uniformMatrix4fv($.bindMatrix,
-!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==$.bindMatrixInverse&&q.uniformMatrix4fv($.bindMatrixInverse,!1,e.bindMatrixInverse.elements),bb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==$.boneTexture){var Ma=m();q.uniform1i($.boneTexture,Ma);J.setTexture(e.skeleton.boneTexture,Ma)}null!==$.boneTextureWidth&&q.uniform1i($.boneTextureWidth,e.skeleton.boneTextureWidth);null!==$.boneTextureHeight&&q.uniform1i($.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&
-null!==$.boneGlobalMatrices&&q.uniformMatrix4fv($.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(za){c&&d.fog&&(M.fogColor.value=c.color,c instanceof THREE.Fog?(M.fogNear.value=c.near,M.fogFar.value=c.far):c instanceof THREE.FogExp2&&(M.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Xa){var Wa=!0,Z,oa,Y,db=0,eb=0,fb=0,Aa,Sa,Ua,Ia,gb,aa=Gb,hb=aa.directional.colors,ib=aa.directional.positions,jb=aa.point.colors,kb=aa.point.positions,
-$a=aa.point.distances,ab=aa.point.decays,lb=aa.spot.colors,mb=aa.spot.positions,zb=aa.spot.distances,nb=aa.spot.directions,Ab=aa.spot.anglesCos,Bb=aa.spot.exponents,Cb=aa.spot.decays,ob=aa.hemi.skyColors,pb=aa.hemi.groundColors,qb=aa.hemi.positions,Oa=0,Ba=0,sa=0,Ja=0,rb=0,sb=0,tb=0,Ya=0,Pa=0,Qa=0,va=0,Ka=0;Z=0;for(oa=b.length;Z<oa;Z++)Y=b[Z],Y.onlyShadow||(Aa=Y.color,Ia=Y.intensity,gb=Y.distance,Y instanceof THREE.AmbientLight?Y.visible&&(db+=Aa.r,eb+=Aa.g,fb+=Aa.b):Y instanceof THREE.DirectionalLight?
-(rb+=1,Y.visible&&(ca.setFromMatrixPosition(Y.matrixWorld),ia.setFromMatrixPosition(Y.target.matrixWorld),ca.sub(ia),ca.normalize(),Pa=3*Oa,ib[Pa+0]=ca.x,ib[Pa+1]=ca.y,ib[Pa+2]=ca.z,p(hb,Pa,Aa,Ia),Oa+=1)):Y instanceof THREE.PointLight?(sb+=1,Y.visible&&(Qa=3*Ba,p(jb,Qa,Aa,Ia),ia.setFromMatrixPosition(Y.matrixWorld),kb[Qa+0]=ia.x,kb[Qa+1]=ia.y,kb[Qa+2]=ia.z,$a[Ba]=gb,ab[Ba]=0===Y.distance?0:Y.decay,Ba+=1)):Y instanceof THREE.SpotLight?(tb+=1,Y.visible&&(va=3*sa,p(lb,va,Aa,Ia),ca.setFromMatrixPosition(Y.matrixWorld),
-mb[va+0]=ca.x,mb[va+1]=ca.y,mb[va+2]=ca.z,zb[sa]=gb,ia.setFromMatrixPosition(Y.target.matrixWorld),ca.sub(ia),ca.normalize(),nb[va+0]=ca.x,nb[va+1]=ca.y,nb[va+2]=ca.z,Ab[sa]=Math.cos(Y.angle),Bb[sa]=Y.exponent,Cb[sa]=0===Y.distance?0:Y.decay,sa+=1)):Y instanceof THREE.HemisphereLight&&(Ya+=1,Y.visible&&(ca.setFromMatrixPosition(Y.matrixWorld),ca.normalize(),Ka=3*Ja,qb[Ka+0]=ca.x,qb[Ka+1]=ca.y,qb[Ka+2]=ca.z,Sa=Y.color,Ua=Y.groundColor,p(ob,Ka,Sa,Ia),p(pb,Ka,Ua,Ia),Ja+=1)));Z=3*Oa;for(oa=Math.max(hb.length,
-3*rb);Z<oa;Z++)hb[Z]=0;Z=3*Ba;for(oa=Math.max(jb.length,3*sb);Z<oa;Z++)jb[Z]=0;Z=3*sa;for(oa=Math.max(lb.length,3*tb);Z<oa;Z++)lb[Z]=0;Z=3*Ja;for(oa=Math.max(ob.length,3*Ya);Z<oa;Z++)ob[Z]=0;Z=3*Ja;for(oa=Math.max(pb.length,3*Ya);Z<oa;Z++)pb[Z]=0;aa.directional.length=Oa;aa.point.length=Ba;aa.spot.length=sa;aa.hemi.length=Ja;aa.ambient[0]=db;aa.ambient[1]=eb;aa.ambient[2]=fb;Xa=!1}if(Wa){var fa=Gb;M.ambientLightColor.value=fa.ambient;M.directionalLightColor.value=fa.directional.colors;M.directionalLightDirection.value=
-fa.directional.positions;M.pointLightColor.value=fa.point.colors;M.pointLightPosition.value=fa.point.positions;M.pointLightDistance.value=fa.point.distances;M.pointLightDecay.value=fa.point.decays;M.spotLightColor.value=fa.spot.colors;M.spotLightPosition.value=fa.spot.positions;M.spotLightDistance.value=fa.spot.distances;M.spotLightDirection.value=fa.spot.directions;M.spotLightAngleCos.value=fa.spot.anglesCos;M.spotLightExponent.value=fa.spot.exponents;M.spotLightDecay.value=fa.spot.decays;M.hemisphereLightSkyColor.value=
-fa.hemi.skyColors;M.hemisphereLightGroundColor.value=fa.hemi.groundColors;M.hemisphereLightDirection.value=fa.hemi.positions;l(M,!0)}else l(M,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){M.opacity.value=d.opacity;M.diffuse.value=d.color;M.map.value=d.map;M.specularMap.value=d.specularMap;M.alphaMap.value=d.alphaMap;d.bumpMap&&(M.bumpMap.value=d.bumpMap,M.bumpScale.value=d.bumpScale);d.normalMap&&(M.normalMap.value=d.normalMap,
-M.normalScale.value.copy(d.normalScale));var wa;d.map?wa=d.map:d.specularMap?wa=d.specularMap:d.normalMap?wa=d.normalMap:d.bumpMap?wa=d.bumpMap:d.alphaMap&&(wa=d.alphaMap);if(void 0!==wa){var Hb=wa.offset,Ib=wa.repeat;M.offsetRepeat.value.set(Hb.x,Hb.y,Ib.x,Ib.y)}M.envMap.value=d.envMap;M.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;M.reflectivity.value=d.reflectivity;M.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)M.diffuse.value=d.color,
-M.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)M.diffuse.value=d.color,M.opacity.value=d.opacity,M.dashSize.value=d.dashSize,M.totalSize.value=d.dashSize+d.gapSize,M.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(M.psColor.value=d.color,M.opacity.value=d.opacity,M.size.value=d.size,M.scale.value=v.height/2,M.map.value=d.map,null!==d.map){var Jb=d.map.offset,Kb=d.map.repeat;M.offsetRepeat.value.set(Jb.x,Jb.y,Kb.x,Kb.y)}}else d instanceof THREE.MeshPhongMaterial?
-(M.shininess.value=d.shininess,M.emissive.value=d.emissive,M.specular.value=d.specular,M.lightMap.value=d.lightMap,M.lightMapIntensity.value=d.lightMapIntensity,M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshLambertMaterial?M.emissive.value=d.emissive:d instanceof THREE.MeshDepthMaterial?(M.mNear.value=a.near,M.mFar.value=a.far,M.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(M.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&M.shadowMatrix)for(var La=
-0,ub=0,Db=b.length;ub<Db;ub++){var ta=b[ub];ta.castShadow&&(ta instanceof THREE.SpotLight||ta instanceof THREE.DirectionalLight&&!ta.shadowCascade)&&(M.shadowMap.value[La]=ta.shadowMap,M.shadowMapSize.value[La]=ta.shadowMapSize,M.shadowMatrix.value[La]=ta.shadowMatrix,M.shadowDarkness.value[La]=ta.shadowDarkness,M.shadowBias.value[La]=ta.shadowBias,La++)}for(var vb=d.uniformsList,pa,Ca,qa,Za=0,Tb=vb.length;Za<Tb;Za++){var V=vb[Za][0];if(!1!==V.needsUpdate){var Lb=V.type,N=V.value,X=vb[Za][1];switch(Lb){case "1i":q.uniform1i(X,
-N);break;case "1f":q.uniform1f(X,N);break;case "2f":q.uniform2f(X,N[0],N[1]);break;case "3f":q.uniform3f(X,N[0],N[1],N[2]);break;case "4f":q.uniform4f(X,N[0],N[1],N[2],N[3]);break;case "1iv":q.uniform1iv(X,N);break;case "3iv":q.uniform3iv(X,N);break;case "1fv":q.uniform1fv(X,N);break;case "2fv":q.uniform2fv(X,N);break;case "3fv":q.uniform3fv(X,N);break;case "4fv":q.uniform4fv(X,N);break;case "Matrix3fv":q.uniformMatrix3fv(X,!1,N);break;case "Matrix4fv":q.uniformMatrix4fv(X,!1,N);break;case "i":q.uniform1i(X,
-N);break;case "f":q.uniform1f(X,N);break;case "v2":q.uniform2f(X,N.x,N.y);break;case "v3":q.uniform3f(X,N.x,N.y,N.z);break;case "v4":q.uniform4f(X,N.x,N.y,N.z,N.w);break;case "c":q.uniform3f(X,N.r,N.g,N.b);break;case "iv1":q.uniform1iv(X,N);break;case "iv":q.uniform3iv(X,N);break;case "fv1":q.uniform1fv(X,N);break;case "fv":q.uniform3fv(X,N);break;case "v2v":void 0===V._array&&(V._array=new Float32Array(2*N.length));for(var U=0,la=N.length;U<la;U++)qa=2*U,V._array[qa+0]=N[U].x,V._array[qa+1]=N[U].y;
-q.uniform2fv(X,V._array);break;case "v3v":void 0===V._array&&(V._array=new Float32Array(3*N.length));U=0;for(la=N.length;U<la;U++)qa=3*U,V._array[qa+0]=N[U].x,V._array[qa+1]=N[U].y,V._array[qa+2]=N[U].z;q.uniform3fv(X,V._array);break;case "v4v":void 0===V._array&&(V._array=new Float32Array(4*N.length));U=0;for(la=N.length;U<la;U++)qa=4*U,V._array[qa+0]=N[U].x,V._array[qa+1]=N[U].y,V._array[qa+2]=N[U].z,V._array[qa+3]=N[U].w;q.uniform4fv(X,V._array);break;case "m3":q.uniformMatrix3fv(X,!1,N.elements);
-break;case "m3v":void 0===V._array&&(V._array=new Float32Array(9*N.length));U=0;for(la=N.length;U<la;U++)N[U].flattenToArrayOffset(V._array,9*U);q.uniformMatrix3fv(X,!1,V._array);break;case "m4":q.uniformMatrix4fv(X,!1,N.elements);break;case "m4v":void 0===V._array&&(V._array=new Float32Array(16*N.length));U=0;for(la=N.length;U<la;U++)N[U].flattenToArrayOffset(V._array,16*U);q.uniformMatrix4fv(X,!1,V._array);break;case "t":pa=N;Ca=m();q.uniform1i(X,Ca);if(!pa)continue;if(pa instanceof THREE.CubeTexture||
-Array.isArray(pa.image)&&6===pa.image.length){var ba=pa,Mb=Ca;if(6===ba.image.length)if(ba.needsUpdate){ba.image.__webglTextureCube||(ba.addEventListener("dispose",wb),ba.image.__webglTextureCube=q.createTexture(),J.info.memory.textures++);S.activeTexture(q.TEXTURE0+Mb);S.bindTexture(q.TEXTURE_CUBE_MAP,ba.image.__webglTextureCube);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,ba.flipY);for(var Nb=ba instanceof THREE.CompressedTexture,xb=ba.image[0]instanceof THREE.DataTexture,Da=[],ea=0;6>ea;ea++)Da[ea]=!J.autoScaleCubemaps||
-Nb||xb?xb?ba.image[ea].image:ba.image[ea]:r(ba.image[ea],Ub);var Ob=Da[0],Pb=THREE.Math.isPowerOfTwo(Ob.width)&&THREE.Math.isPowerOfTwo(Ob.height),xa=u(ba.format),yb=u(ba.type);n(q.TEXTURE_CUBE_MAP,ba,Pb);for(ea=0;6>ea;ea++)if(Nb)for(var Ea,Qb=Da[ea].mipmaps,Ra=0,Vb=Qb.length;Ra<Vb;Ra++)Ea=Qb[Ra],ba.format!==THREE.RGBAFormat&&ba.format!==THREE.RGBFormat?-1<Rb().indexOf(xa)?q.compressedTexImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ea,Ra,xa,Ea.width,Ea.height,0,Ea.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):
-q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ea,Ra,xa,Ea.width,Ea.height,0,xa,yb,Ea.data);else xb?q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ea,0,xa,Da[ea].width,Da[ea].height,0,xa,yb,Da[ea].data):q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+ea,0,xa,xa,yb,Da[ea]);ba.generateMipmaps&&Pb&&q.generateMipmap(q.TEXTURE_CUBE_MAP);ba.needsUpdate=!1;if(ba.onUpdate)ba.onUpdate(ba)}else S.activeTexture(q.TEXTURE0+Mb),S.bindTexture(q.TEXTURE_CUBE_MAP,ba.image.__webglTextureCube)}else if(pa instanceof THREE.WebGLRenderTargetCube){var Wb=
-pa;S.activeTexture(q.TEXTURE0+Ca);S.bindTexture(q.TEXTURE_CUBE_MAP,Wb.__webglTexture)}else J.setTexture(pa,Ca);break;case "tv":void 0===V._array&&(V._array=[]);U=0;for(la=V.value.length;U<la;U++)V._array[U]=m();q.uniform1iv(X,V._array);U=0;for(la=V.value.length;U<la;U++)pa=V.value[U],Ca=V._array[U],pa&&J.setTexture(pa,Ca);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Lb)}}}}q.uniformMatrix4fv($.modelViewMatrix,!1,e._modelViewMatrix.elements);$.normalMatrix&&q.uniformMatrix3fv($.normalMatrix,
-!1,e._normalMatrix.elements);null!==$.modelMatrix&&q.uniformMatrix4fv($.modelMatrix,!1,e.matrixWorld.elements);return Na}function l(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=
-b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function m(){var a=Va;a>=Sa&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Sa);Va+=1;return a}function p(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function n(a,b,c){c?(q.texParameteri(a,q.TEXTURE_WRAP_S,u(b.wrapS)),q.texParameteri(a,
-q.TEXTURE_WRAP_T,u(b.wrapT)),q.texParameteri(a,q.TEXTURE_MAG_FILTER,u(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,u(b.minFilter))):(q.texParameteri(a,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(a,q.TEXTURE_WRAP_T,q.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+" )"),q.texParameteri(a,q.TEXTURE_MAG_FILTER,
-s(b.magFilter)),q.texParameteri(a,q.TEXTURE_MIN_FILTER,s(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=W.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__currentAnisotropy)&&(q.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,
-J.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}function r(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 t(a,b){q.bindRenderbuffer(q.RENDERBUFFER,a);b.depthBuffer&&
-!b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_COMPONENT16,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(q.renderbufferStorage(q.RENDERBUFFER,q.DEPTH_STENCIL,b.width,b.height),q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a)):q.renderbufferStorage(q.RENDERBUFFER,q.RGBA4,b.width,b.height)}function s(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||
-a===THREE.NearestMipMapLinearFilter?q.NEAREST:q.LINEAR}function u(a){var b;if(a===THREE.RepeatWrapping)return q.REPEAT;if(a===THREE.ClampToEdgeWrapping)return q.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return q.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return q.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return q.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return q.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return q.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return q.LINEAR_MIPMAP_NEAREST;
-if(a===THREE.LinearMipMapLinearFilter)return q.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return q.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return q.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return q.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return q.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return q.BYTE;if(a===THREE.ShortType)return q.SHORT;if(a===THREE.UnsignedShortType)return q.UNSIGNED_SHORT;if(a===THREE.IntType)return q.INT;if(a===THREE.UnsignedIntType)return q.UNSIGNED_INT;
-if(a===THREE.FloatType)return q.FLOAT;b=W.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return q.ALPHA;if(a===THREE.RGBFormat)return q.RGB;if(a===THREE.RGBAFormat)return q.RGBA;if(a===THREE.LuminanceFormat)return q.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return q.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return q.FUNC_ADD;if(a===THREE.SubtractEquation)return q.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return q.FUNC_REVERSE_SUBTRACT;
-if(a===THREE.ZeroFactor)return q.ZERO;if(a===THREE.OneFactor)return q.ONE;if(a===THREE.SrcColorFactor)return q.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return q.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return q.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return q.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return q.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return q.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return q.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return q.ONE_MINUS_DST_COLOR;
-if(a===THREE.SrcAlphaSaturateFactor)return q.SRC_ALPHA_SATURATE;b=W.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=W.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
+THREE.WebGLRenderer=function(a){function b(a,b,c,d){var e;if(c instanceof THREE.InstancedBufferGeometry&&(e=W.get("ANGLE_instanced_arrays"),null===e)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}var f=c.attributes;b=b.attributes;for(var g in b){var h=b[g];if(0<=h){var k=f[g];if(void 0!==k){var l=k.itemSize;S.enableAttribute(h);if(k instanceof THREE.InterleavedBufferAttribute){var m=
+k.data,n=m.stride,p=k.offset;r.bindBuffer(r.ARRAY_BUFFER,k.data.buffer);r.vertexAttribPointer(h,l,r.FLOAT,!1,n*m.array.BYTES_PER_ELEMENT,(d*n+p)*m.array.BYTES_PER_ELEMENT);if(m instanceof THREE.InstancedInterleavedBuffer){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,m.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=
+m.array.length/m.stride*m.meshPerAttribute)}}else if(r.bindBuffer(r.ARRAY_BUFFER,k.buffer),r.vertexAttribPointer(h,l,r.FLOAT,!1,0,d*l*4),k instanceof THREE.InstancedBufferAttribute){if(null===e){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");return}e.vertexAttribDivisorANGLE(h,k.meshPerAttribute);void 0===c.maxInstancedCount&&(c.maxInstancedCount=k.array.length/k.itemSize*k.meshPerAttribute)}}else void 0!==
+a.defaultAttributeValues&&void 0!==a.defaultAttributeValues[g]&&(2===a.defaultAttributeValues[g].length?r.vertexAttrib2fv(h,a.defaultAttributeValues[g]):3===a.defaultAttributeValues[g].length&&r.vertexAttrib3fv(h,a.defaultAttributeValues[g]))}}S.disableUnusedAttributes()}function c(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function d(a,
+b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function e(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ha.init(a),a instanceof THREE.Light)B.push(a);else if(a instanceof THREE.Sprite)R.push(a);else if(a instanceof THREE.LensFlare)P.push(a);else{var b=ha.objects[a.id];!b||!1!==a.frustumCulled&&!0!==Ha.intersectsObject(a)||(a.material.transparent?
+O.push(b):T.push(b),!0===J.sortObjects&&(ia.setFromMatrixPosition(a.matrixWorld),ia.applyProjection(za),b.z=ia.z))}for(var b=0,c=a.children.length;b<c;b++)e(a.children[b])}}function f(a,b,c,d,e){for(var f,g=0,k=a.length;g<k;g++){var l=a[g].object;f=l;f._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,f.matrixWorld);f._normalMatrix.getNormalMatrix(f._modelViewMatrix);if(e)f=e;else{f=l.material;if(!f)continue;h(f)}J.setMaterialFaces(f);J.renderBufferDirect(b,c,d,f,l)}}function g(a,b,c,d,e,f){for(var g,
+k=0,l=a.length;k<l;k++){g=a[k];var m=g.object;if(m.visible){if(f)g=f;else{g=g[b];if(!g)continue;h(g)}J.renderImmediateObject(c,d,e,g,m)}}}function h(a){!0===a.transparent?S.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):S.setBlending(THREE.NoBlending);S.setDepthFunc(a.depthFunc);S.setDepthTest(a.depthTest);S.setDepthWrite(a.depthWrite);S.setColorWrite(a.colorWrite);S.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}
+function k(a,b,c,d,e){var f,g,h,k;Va=0;if(d.needsUpdate){a:{for(var q=Sb[d.type],t=0,w=0,y=0,z=0,x=0,I=b.length;x<I;x++){var D=b[x];D.onlyShadow||!1===D.visible||(D instanceof THREE.DirectionalLight&&t++,D instanceof THREE.PointLight&&w++,D instanceof THREE.SpotLight&&y++,D instanceof THREE.HemisphereLight&&z++)}f=t;g=w;h=y;k=z;for(var A,C=0,F=0,G=b.length;F<G;F++){var B=b[F];B.castShadow&&(B instanceof THREE.SpotLight&&C++,B instanceof THREE.DirectionalLight&&!B.shadowCascade&&C++)}A=C;var H;if(bb&&
+e&&e.skeleton&&e.skeleton.useVertexTexture)H=1024;else{var O=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),Q=Math.floor((O-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(Q=Math.min(e.skeleton.bones.length,Q),Q<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+Q+" (try OpenGL instead of ANGLE)"));H=Q}var ja={precision:E,supportsVertexTextures:cb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,
+aoMap:!!d.aoMap,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:K,skinning:d.skinning,maxBones:H,useVertexTexture:bb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:J.maxMorphTargets,maxMorphNormals:J.maxMorphNormals,
+maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:A,shadowMapEnabled:ga.enabled&&e.receiveShadow&&0<A,shadowMapType:ga.type,shadowMapDebug:ga.debug,shadowMapCascade:ga.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},R=[];q?R.push(q):(R.push(d.fragmentShader),R.push(d.vertexShader));if(void 0!==d.defines)for(var P in d.defines)R.push(P),R.push(d.defines[P]);for(P in ja)R.push(P),R.push(ja[P]);var T=R.join();
+if(!d.program)d.addEventListener("dispose",Eb);else if(d.program.code!==T)Fb(d);else if(void 0!==q)break a;else if(d.__webglShader.uniforms===d.uniforms)break a;if(q){var W=THREE.ShaderLib[q];d.__webglShader={uniforms:THREE.UniformsUtils.clone(W.uniforms),vertexShader:W.vertexShader,fragmentShader:W.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var ma,ya=0,Ga=L.length;ya<Ga;ya++){var Fa=L[ya];if(Fa.code===T){ma=Fa;ma.usedTimes++;
+break}}void 0===ma&&(ma=new THREE.WebGLProgram(J,T,d,ja),L.push(ma),J.info.memory.programs=L.length);d.program=ma;var Ta=ma.attributes;if(d.morphTargets)for(var ra=d.numSupportedMorphTargets=0;ra<J.maxMorphTargets;ra++)0<=Ta["morphTarget"+ra]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(ra=d.numSupportedMorphNormals=0;ra<J.maxMorphNormals;ra++)0<=Ta["morphNormal"+ra]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var da in d.__webglShader.uniforms){var ha=d.program.uniforms[da];ha&&d.uniformsList.push([d.__webglShader.uniforms[da],
+ha])}}d.needsUpdate=!1}var Ha=!1,za=!1,Wa=!1,Na=d.program,$=Na.uniforms,M=d.__webglShader.uniforms;Na.id!==na&&(r.useProgram(Na.program),na=Na.id,Wa=za=Ha=!0);d.id!==ka&&(-1===ka&&(Wa=!0),ka=d.id,za=!0);if(Ha||a!==ua)r.uniformMatrix4fv($.projectionMatrix,!1,a.projectionMatrix.elements),K&&r.uniform1f($.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==ua&&(ua=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==$.cameraPosition&&(ia.setFromMatrixPosition(a.matrixWorld),
+r.uniform3f($.cameraPosition,ia.x,ia.y,ia.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==$.viewMatrix&&r.uniformMatrix4fv($.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==$.bindMatrix&&r.uniformMatrix4fv($.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==$.bindMatrixInverse&&r.uniformMatrix4fv($.bindMatrixInverse,!1,e.bindMatrixInverse.elements),
+bb&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==$.boneTexture){var Ma=n();r.uniform1i($.boneTexture,Ma);J.setTexture(e.skeleton.boneTexture,Ma)}null!==$.boneTextureWidth&&r.uniform1i($.boneTextureWidth,e.skeleton.boneTextureWidth);null!==$.boneTextureHeight&&r.uniform1i($.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==$.boneGlobalMatrices&&r.uniformMatrix4fv($.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(za){c&&d.fog&&(M.fogColor.value=
+c.color,c instanceof THREE.Fog?(M.fogNear.value=c.near,M.fogFar.value=c.far):c instanceof THREE.FogExp2&&(M.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Xa){var Wa=!0,Z,oa,Y,db=0,eb=0,fb=0,Aa,Sa,Ua,Ia,gb,aa=Gb,hb=aa.directional.colors,ib=aa.directional.positions,jb=aa.point.colors,kb=aa.point.positions,$a=aa.point.distances,ab=aa.point.decays,lb=aa.spot.colors,mb=aa.spot.positions,zb=aa.spot.distances,nb=aa.spot.directions,
+Ab=aa.spot.anglesCos,Bb=aa.spot.exponents,Cb=aa.spot.decays,ob=aa.hemi.skyColors,pb=aa.hemi.groundColors,qb=aa.hemi.positions,Oa=0,Ba=0,sa=0,Ja=0,rb=0,sb=0,tb=0,Ya=0,Pa=0,Qa=0,va=0,Ka=0;Z=0;for(oa=b.length;Z<oa;Z++)Y=b[Z],Y.onlyShadow||(Aa=Y.color,Ia=Y.intensity,gb=Y.distance,Y instanceof THREE.AmbientLight?Y.visible&&(db+=Aa.r,eb+=Aa.g,fb+=Aa.b):Y instanceof THREE.DirectionalLight?(rb+=1,Y.visible&&(ca.setFromMatrixPosition(Y.matrixWorld),ia.setFromMatrixPosition(Y.target.matrixWorld),ca.sub(ia),
+ca.normalize(),Pa=3*Oa,ib[Pa+0]=ca.x,ib[Pa+1]=ca.y,ib[Pa+2]=ca.z,p(hb,Pa,Aa,Ia),Oa+=1)):Y instanceof THREE.PointLight?(sb+=1,Y.visible&&(Qa=3*Ba,p(jb,Qa,Aa,Ia),ia.setFromMatrixPosition(Y.matrixWorld),kb[Qa+0]=ia.x,kb[Qa+1]=ia.y,kb[Qa+2]=ia.z,$a[Ba]=gb,ab[Ba]=0===Y.distance?0:Y.decay,Ba+=1)):Y instanceof THREE.SpotLight?(tb+=1,Y.visible&&(va=3*sa,p(lb,va,Aa,Ia),ca.setFromMatrixPosition(Y.matrixWorld),mb[va+0]=ca.x,mb[va+1]=ca.y,mb[va+2]=ca.z,zb[sa]=gb,ia.setFromMatrixPosition(Y.target.matrixWorld),
+ca.sub(ia),ca.normalize(),nb[va+0]=ca.x,nb[va+1]=ca.y,nb[va+2]=ca.z,Ab[sa]=Math.cos(Y.angle),Bb[sa]=Y.exponent,Cb[sa]=0===Y.distance?0:Y.decay,sa+=1)):Y instanceof THREE.HemisphereLight&&(Ya+=1,Y.visible&&(ca.setFromMatrixPosition(Y.matrixWorld),ca.normalize(),Ka=3*Ja,qb[Ka+0]=ca.x,qb[Ka+1]=ca.y,qb[Ka+2]=ca.z,Sa=Y.color,Ua=Y.groundColor,p(ob,Ka,Sa,Ia),p(pb,Ka,Ua,Ia),Ja+=1)));Z=3*Oa;for(oa=Math.max(hb.length,3*rb);Z<oa;Z++)hb[Z]=0;Z=3*Ba;for(oa=Math.max(jb.length,3*sb);Z<oa;Z++)jb[Z]=0;Z=3*sa;for(oa=
+Math.max(lb.length,3*tb);Z<oa;Z++)lb[Z]=0;Z=3*Ja;for(oa=Math.max(ob.length,3*Ya);Z<oa;Z++)ob[Z]=0;Z=3*Ja;for(oa=Math.max(pb.length,3*Ya);Z<oa;Z++)pb[Z]=0;aa.directional.length=Oa;aa.point.length=Ba;aa.spot.length=sa;aa.hemi.length=Ja;aa.ambient[0]=db;aa.ambient[1]=eb;aa.ambient[2]=fb;Xa=!1}if(Wa){var fa=Gb;M.ambientLightColor.value=fa.ambient;M.directionalLightColor.value=fa.directional.colors;M.directionalLightDirection.value=fa.directional.positions;M.pointLightColor.value=fa.point.colors;M.pointLightPosition.value=
+fa.point.positions;M.pointLightDistance.value=fa.point.distances;M.pointLightDecay.value=fa.point.decays;M.spotLightColor.value=fa.spot.colors;M.spotLightPosition.value=fa.spot.positions;M.spotLightDistance.value=fa.spot.distances;M.spotLightDirection.value=fa.spot.directions;M.spotLightAngleCos.value=fa.spot.anglesCos;M.spotLightExponent.value=fa.spot.exponents;M.spotLightDecay.value=fa.spot.decays;M.hemisphereLightSkyColor.value=fa.hemi.skyColors;M.hemisphereLightGroundColor.value=fa.hemi.groundColors;
+M.hemisphereLightDirection.value=fa.hemi.positions;l(M,!0)}else l(M,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){M.opacity.value=d.opacity;M.diffuse.value=d.color;M.map.value=d.map;M.specularMap.value=d.specularMap;M.alphaMap.value=d.alphaMap;d.bumpMap&&(M.bumpMap.value=d.bumpMap,M.bumpScale.value=d.bumpScale);d.normalMap&&(M.normalMap.value=d.normalMap,M.normalScale.value.copy(d.normalScale));var wa;d.map?wa=d.map:d.specularMap?
+wa=d.specularMap:d.normalMap?wa=d.normalMap:d.bumpMap?wa=d.bumpMap:d.alphaMap&&(wa=d.alphaMap);if(void 0!==wa){var Hb=wa.offset,Ib=wa.repeat;M.offsetRepeat.value.set(Hb.x,Hb.y,Ib.x,Ib.y)}M.envMap.value=d.envMap;M.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;M.reflectivity.value=d.reflectivity;M.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)M.diffuse.value=d.color,M.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)M.diffuse.value=
+d.color,M.opacity.value=d.opacity,M.dashSize.value=d.dashSize,M.totalSize.value=d.dashSize+d.gapSize,M.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(M.psColor.value=d.color,M.opacity.value=d.opacity,M.size.value=d.size,M.scale.value=v.height/2,M.map.value=d.map,null!==d.map){var Jb=d.map.offset,Kb=d.map.repeat;M.offsetRepeat.value.set(Jb.x,Jb.y,Kb.x,Kb.y)}}else d instanceof THREE.MeshPhongMaterial?(M.shininess.value=d.shininess,M.emissive.value=d.emissive,M.specular.value=
+d.specular,M.lightMap.value=d.lightMap,M.lightMapIntensity.value=d.lightMapIntensity,M.aoMap.value=d.aoMap,M.aoMapIntensity.value=d.aoMapIntensity):d instanceof THREE.MeshLambertMaterial?M.emissive.value=d.emissive:d instanceof THREE.MeshDepthMaterial?(M.mNear.value=a.near,M.mFar.value=a.far,M.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(M.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&M.shadowMatrix)for(var La=0,ub=0,Db=b.length;ub<Db;ub++){var ta=b[ub];ta.castShadow&&
+(ta instanceof THREE.SpotLight||ta instanceof THREE.DirectionalLight&&!ta.shadowCascade)&&(M.shadowMap.value[La]=ta.shadowMap,M.shadowMapSize.value[La]=ta.shadowMapSize,M.shadowMatrix.value[La]=ta.shadowMatrix,M.shadowDarkness.value[La]=ta.shadowDarkness,M.shadowBias.value[La]=ta.shadowBias,La++)}for(var vb=d.uniformsList,pa,Ca,qa,Za=0,Tb=vb.length;Za<Tb;Za++){var V=vb[Za][0];if(!1!==V.needsUpdate){var Lb=V.type,N=V.value,X=vb[Za][1];switch(Lb){case "1i":r.uniform1i(X,N);break;case "1f":r.uniform1f(X,
+N);break;case "2f":r.uniform2f(X,N[0],N[1]);break;case "3f":r.uniform3f(X,N[0],N[1],N[2]);break;case "4f":r.uniform4f(X,N[0],N[1],N[2],N[3]);break;case "1iv":r.uniform1iv(X,N);break;case "3iv":r.uniform3iv(X,N);break;case "1fv":r.uniform1fv(X,N);break;case "2fv":r.uniform2fv(X,N);break;case "3fv":r.uniform3fv(X,N);break;case "4fv":r.uniform4fv(X,N);break;case "Matrix3fv":r.uniformMatrix3fv(X,!1,N);break;case "Matrix4fv":r.uniformMatrix4fv(X,!1,N);break;case "i":r.uniform1i(X,N);break;case "f":r.uniform1f(X,
+N);break;case "v2":r.uniform2f(X,N.x,N.y);break;case "v3":r.uniform3f(X,N.x,N.y,N.z);break;case "v4":r.uniform4f(X,N.x,N.y,N.z,N.w);break;case "c":r.uniform3f(X,N.r,N.g,N.b);break;case "iv1":r.uniform1iv(X,N);break;case "iv":r.uniform3iv(X,N);break;case "fv1":r.uniform1fv(X,N);break;case "fv":r.uniform3fv(X,N);break;case "v2v":void 0===V._array&&(V._array=new Float32Array(2*N.length));for(var U=0,la=N.length;U<la;U++)qa=2*U,V._array[qa+0]=N[U].x,V._array[qa+1]=N[U].y;r.uniform2fv(X,V._array);break;
+case "v3v":void 0===V._array&&(V._array=new Float32Array(3*N.length));U=0;for(la=N.length;U<la;U++)qa=3*U,V._array[qa+0]=N[U].x,V._array[qa+1]=N[U].y,V._array[qa+2]=N[U].z;r.uniform3fv(X,V._array);break;case "v4v":void 0===V._array&&(V._array=new Float32Array(4*N.length));U=0;for(la=N.length;U<la;U++)qa=4*U,V._array[qa+0]=N[U].x,V._array[qa+1]=N[U].y,V._array[qa+2]=N[U].z,V._array[qa+3]=N[U].w;r.uniform4fv(X,V._array);break;case "m3":r.uniformMatrix3fv(X,!1,N.elements);break;case "m3v":void 0===V._array&&
+(V._array=new Float32Array(9*N.length));U=0;for(la=N.length;U<la;U++)N[U].flattenToArrayOffset(V._array,9*U);r.uniformMatrix3fv(X,!1,V._array);break;case "m4":r.uniformMatrix4fv(X,!1,N.elements);break;case "m4v":void 0===V._array&&(V._array=new Float32Array(16*N.length));U=0;for(la=N.length;U<la;U++)N[U].flattenToArrayOffset(V._array,16*U);r.uniformMatrix4fv(X,!1,V._array);break;case "t":pa=N;Ca=n();r.uniform1i(X,Ca);if(!pa)continue;if(pa instanceof THREE.CubeTexture||Array.isArray(pa.image)&&6===
+pa.image.length){var ba=pa,Mb=Ca;if(6===ba.image.length)if(ba.needsUpdate){ba.image.__webglTextureCube||(ba.addEventListener("dispose",wb),ba.image.__webglTextureCube=r.createTexture(),J.info.memory.textures++);S.activeTexture(r.TEXTURE0+Mb);S.bindTexture(r.TEXTURE_CUBE_MAP,ba.image.__webglTextureCube);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,ba.flipY);for(var Nb=ba instanceof THREE.CompressedTexture,xb=ba.image[0]instanceof THREE.DataTexture,Da=[],ea=0;6>ea;ea++)Da[ea]=!J.autoScaleCubemaps||Nb||xb?xb?
+ba.image[ea].image:ba.image[ea]:s(ba.image[ea],Ub);var Ob=Da[0],Pb=THREE.Math.isPowerOfTwo(Ob.width)&&THREE.Math.isPowerOfTwo(Ob.height),xa=u(ba.format),yb=u(ba.type);m(r.TEXTURE_CUBE_MAP,ba,Pb);for(ea=0;6>ea;ea++)if(Nb)for(var Ea,Qb=Da[ea].mipmaps,Ra=0,Vb=Qb.length;Ra<Vb;Ra++)Ea=Qb[Ra],ba.format!==THREE.RGBAFormat&&ba.format!==THREE.RGBFormat?-1<Rb().indexOf(xa)?r.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ea,Ra,xa,Ea.width,Ea.height,0,Ea.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):
+r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ea,Ra,xa,Ea.width,Ea.height,0,xa,yb,Ea.data);else xb?r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ea,0,xa,Da[ea].width,Da[ea].height,0,xa,yb,Da[ea].data):r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ea,0,xa,xa,yb,Da[ea]);ba.generateMipmaps&&Pb&&r.generateMipmap(r.TEXTURE_CUBE_MAP);ba.needsUpdate=!1;if(ba.onUpdate)ba.onUpdate(ba)}else S.activeTexture(r.TEXTURE0+Mb),S.bindTexture(r.TEXTURE_CUBE_MAP,ba.image.__webglTextureCube)}else if(pa instanceof THREE.WebGLRenderTargetCube){var Wb=
+pa;S.activeTexture(r.TEXTURE0+Ca);S.bindTexture(r.TEXTURE_CUBE_MAP,Wb.__webglTexture)}else J.setTexture(pa,Ca);break;case "tv":void 0===V._array&&(V._array=[]);U=0;for(la=V.value.length;U<la;U++)V._array[U]=n();r.uniform1iv(X,V._array);U=0;for(la=V.value.length;U<la;U++)pa=V.value[U],Ca=V._array[U],pa&&J.setTexture(pa,Ca);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Lb)}}}}r.uniformMatrix4fv($.modelViewMatrix,!1,e._modelViewMatrix.elements);$.normalMatrix&&r.uniformMatrix3fv($.normalMatrix,
+!1,e._normalMatrix.elements);null!==$.modelMatrix&&r.uniformMatrix4fv($.modelMatrix,!1,e.matrixWorld.elements);return Na}function l(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=
+b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function n(){var a=Va;a>=Sa&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Sa);Va+=1;return a}function p(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function m(a,b,c){c?(r.texParameteri(a,r.TEXTURE_WRAP_S,u(b.wrapS)),r.texParameteri(a,
+r.TEXTURE_WRAP_T,u(b.wrapT)),r.texParameteri(a,r.TEXTURE_MAG_FILTER,u(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,u(b.minFilter))):(r.texParameteri(a,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(a,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),r.texParameteri(a,r.TEXTURE_MAG_FILTER,
+q(b.magFilter)),r.texParameteri(a,r.TEXTURE_MIN_FILTER,q(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=W.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||b.__currentAnisotropy)&&(r.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,
+J.getMaxAnisotropy())),b.__currentAnisotropy=b.anisotropy)}function s(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 t(a,b){r.bindRenderbuffer(r.RENDERBUFFER,a);b.depthBuffer&&
+!b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,b.width,b.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)):r.renderbufferStorage(r.RENDERBUFFER,r.RGBA4,b.width,b.height)}function q(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||
+a===THREE.NearestMipMapLinearFilter?r.NEAREST:r.LINEAR}function u(a){var b;if(a===THREE.RepeatWrapping)return r.REPEAT;if(a===THREE.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return r.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return r.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;
+if(a===THREE.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return r.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return r.BYTE;if(a===THREE.ShortType)return r.SHORT;if(a===THREE.UnsignedShortType)return r.UNSIGNED_SHORT;if(a===THREE.IntType)return r.INT;if(a===THREE.UnsignedIntType)return r.UNSIGNED_INT;
+if(a===THREE.FloatType)return r.FLOAT;b=W.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return r.ALPHA;if(a===THREE.RGBFormat)return r.RGB;if(a===THREE.RGBAFormat)return r.RGBA;if(a===THREE.LuminanceFormat)return r.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return r.FUNC_ADD;if(a===THREE.SubtractEquation)return r.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;
+if(a===THREE.ZeroFactor)return r.ZERO;if(a===THREE.OneFactor)return r.ONE;if(a===THREE.SrcColorFactor)return r.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return r.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return r.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return r.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;
+if(a===THREE.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;b=W.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=W.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
 if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=W.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var v=void 0!==a.canvas?a.canvas:document.createElement("canvas"),w=void 0!==
 a.context?a.context:null,z=v.width,y=v.height,D=1,E=void 0!==a.precision?a.precision:"highp",x=void 0!==a.alpha?a.alpha:!1,F=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,C=void 0!==a.antialias?a.antialias:!1,G=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Q=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,K=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,A=new THREE.Color(0),H=0,B=[],T=[],O=[],R=[],P=[];this.domElement=v;this.context=null;this.sortObjects=
 this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var J=this,L=[],na=null,da=null,ka=-1,ja="",ua=null,Va=0,ma=0,Ga=0,Fa=v.width,ya=v.height,Ta=0,ra=0,Ha=new THREE.Frustum,za=new THREE.Matrix4,ia=new THREE.Vector3,ca=new THREE.Vector3,Xa=!0,Gb=
-{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:[]}},q;try{a={alpha:x,depth:F,stencil:I,antialias:C,premultipliedAlpha:G,preserveDrawingBuffer:Q};q=w||v.getContext("webgl",a)||v.getContext("experimental-webgl",a);if(null===q){if(null!==v.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";
-throw"Error creating WebGL context.";}v.addEventListener("webglcontextlost",function(a){a.preventDefault();Ua();$a();ha.objects={}},!1)}catch(zb){console.error("THREE.WebGLRenderer: "+zb)}var S=new THREE.WebGLState(q,u);void 0===q.getShaderPrecisionFormat&&(q.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var W=new THREE.WebGLExtensions(q),ha=new THREE.WebGLObjects(q,this.info);W.get("OES_texture_float");W.get("OES_texture_float_linear");W.get("OES_texture_half_float");
-W.get("OES_texture_half_float_linear");W.get("OES_standard_derivatives");W.get("ANGLE_instanced_arrays");W.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);K&&W.get("EXT_frag_depth");var Ma=function(a,b,c,d){!0===G&&(a*=d,b*=d,c*=d);q.clearColor(a,b,c,d)},$a=function(){q.clearColor(0,0,0,1);q.clearDepth(1);q.clearStencil(0);q.enable(q.DEPTH_TEST);q.depthFunc(q.LEQUAL);q.frontFace(q.CCW);q.cullFace(q.BACK);q.enable(q.CULL_FACE);q.enable(q.BLEND);q.blendEquation(q.FUNC_ADD);
-q.blendFunc(q.SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA);q.viewport(ma,Ga,Fa,ya);Ma(A.r,A.g,A.b,H)},Ua=function(){ua=na=null;ja="";ka=-1;Xa=!0;S.reset()};$a();this.context=q;this.extensions=W;this.state=S;var ga=new THREE.WebGLShadowMap(this,B,ha);this.shadowMap=ga;var Sa=q.getParameter(q.MAX_TEXTURE_IMAGE_UNITS),w=q.getParameter(q.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ab=q.getParameter(q.MAX_TEXTURE_SIZE),Ub=q.getParameter(q.MAX_CUBE_MAP_TEXTURE_SIZE),cb=0<w,bb=cb&&W.get("OES_texture_float"),Bb=W.get("ANGLE_instanced_arrays"),
-x=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.HIGH_FLOAT),w=q.getShaderPrecisionFormat(q.VERTEX_SHADER,q.MEDIUM_FLOAT),F=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.HIGH_FLOAT);a=q.getShaderPrecisionFormat(q.FRAGMENT_SHADER,q.MEDIUM_FLOAT);var Rb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(W.get("WEBGL_compressed_texture_pvrtc")||W.get("WEBGL_compressed_texture_s3tc"))for(var b=q.getParameter(q.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),x=0<
-x.precision&&0<F.precision,w=0<w.precision&&0<a.precision;"highp"!==E||x||(w?(E="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(E="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==E||w||(E="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Cb=new THREE.SpritePlugin(this,R),Db=new THREE.LensFlarePlugin(this,P);this.getContext=function(){return q};this.forceContextLoss=function(){W.get("WEBGL_lose_context").loseContext()};
+{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:[]}},r;try{a={alpha:x,depth:F,stencil:I,antialias:C,premultipliedAlpha:G,preserveDrawingBuffer:Q};r=w||v.getContext("webgl",a)||v.getContext("experimental-webgl",a);if(null===r){if(null!==v.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";
+throw"Error creating WebGL context.";}v.addEventListener("webglcontextlost",function(a){a.preventDefault();Ua();$a();ha.objects={}},!1)}catch(zb){console.error("THREE.WebGLRenderer: "+zb)}var S=new THREE.WebGLState(r,u);void 0===r.getShaderPrecisionFormat&&(r.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var W=new THREE.WebGLExtensions(r),ha=new THREE.WebGLObjects(r,this.info);W.get("OES_texture_float");W.get("OES_texture_float_linear");W.get("OES_texture_half_float");
+W.get("OES_texture_half_float_linear");W.get("OES_standard_derivatives");W.get("ANGLE_instanced_arrays");W.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);K&&W.get("EXT_frag_depth");var Ma=function(a,b,c,d){!0===G&&(a*=d,b*=d,c*=d);r.clearColor(a,b,c,d)},$a=function(){r.clearColor(0,0,0,1);r.clearDepth(1);r.clearStencil(0);r.enable(r.DEPTH_TEST);r.depthFunc(r.LEQUAL);r.frontFace(r.CCW);r.cullFace(r.BACK);r.enable(r.CULL_FACE);r.enable(r.BLEND);r.blendEquation(r.FUNC_ADD);
+r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA);r.viewport(ma,Ga,Fa,ya);Ma(A.r,A.g,A.b,H)},Ua=function(){ua=na=null;ja="";ka=-1;Xa=!0;S.reset()};$a();this.context=r;this.extensions=W;this.state=S;var ga=new THREE.WebGLShadowMap(this,B,ha);this.shadowMap=ga;var Sa=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),w=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ab=r.getParameter(r.MAX_TEXTURE_SIZE),Ub=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),cb=0<w,bb=cb&&W.get("OES_texture_float"),Bb=W.get("ANGLE_instanced_arrays"),
+x=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT),w=r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT),F=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);a=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT);var Rb=function(){var a;return function(){if(void 0!==a)return a;a=[];if(W.get("WEBGL_compressed_texture_pvrtc")||W.get("WEBGL_compressed_texture_s3tc"))for(var b=r.getParameter(r.COMPRESSED_TEXTURE_FORMATS),c=0;c<b.length;c++)a.push(b[c]);return a}}(),x=0<
+x.precision&&0<F.precision,w=0<w.precision&&0<a.precision;"highp"!==E||x||(w?(E="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(E="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==E||w||(E="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Cb=new THREE.SpritePlugin(this,R),Db=new THREE.LensFlarePlugin(this,P);this.getContext=function(){return r};this.forceContextLoss=function(){W.get("WEBGL_lose_context").loseContext()};
 this.supportsVertexTextures=function(){return cb};this.supportsInstancedArrays=function(){return Bb};this.supportsFloatTextures=function(){return W.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){return W.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){return W.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){return W.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=function(){return W.get("WEBGL_compressed_texture_pvrtc")};
-this.supportsBlendMinMax=function(){return W.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=W.get("EXT_texture_filter_anisotropic");return a=null!==b?q.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return E};this.getPixelRatio=function(){return D};this.setPixelRatio=function(a){D=a};this.getSize=function(){return{width:z,height:y}};this.setSize=function(a,b,c){z=a;y=b;v.width=a*D;v.height=b*D;!1!==
-c&&(v.style.width=a+"px",v.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ma=a*D;Ga=b*D;Fa=c*D;ya=d*D;q.viewport(ma,Ga,Fa,ya)};this.setScissor=function(a,b,c,d){q.scissor(a*D,b*D,c*D,d*D)};this.enableScissorTest=function(a){a?q.enable(q.SCISSOR_TEST):q.disable(q.SCISSOR_TEST)};this.getClearColor=function(){return A};this.setClearColor=function(a,b){A.set(a);H=void 0!==b?b:1;Ma(A.r,A.g,A.b,H)};this.getClearAlpha=function(){return H};this.setClearAlpha=function(a){H=
-a;Ma(A.r,A.g,A.b,H)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=q.COLOR_BUFFER_BIT;if(void 0===b||b)d|=q.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=q.STENCIL_BUFFER_BIT;q.clear(d)};this.clearColor=function(){q.clear(q.COLOR_BUFFER_BIT)};this.clearDepth=function(){q.clear(q.DEPTH_BUFFER_BIT)};this.clearStencil=function(){q.clear(q.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Ua;var wb=function(a){a=a.target;a.removeEventListener("dispose",
-wb);a.image&&a.image.__webglTextureCube?(q.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(q.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);J.info.memory.textures--},ab=function(a){a=a.target;a.removeEventListener("dispose",ab);if(a&&void 0!==a.__webglTexture){q.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)q.deleteFramebuffer(a.__webglFramebuffer[b]),
-q.deleteRenderbuffer(a.__webglRenderbuffer[b]);else q.deleteFramebuffer(a.__webglFramebuffer),q.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}J.info.memory.textures--},Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);Fb(a)},Fb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=L.length;a<c;a++)if(d=L[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=L.length;a<
-c;a++)d=L[a],d.program!==b&&e.push(d);L=e;q.deleteProgram(b);J.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){S.initAttributes();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=q.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=q.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=q.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=q.createBuffer());a.hasPositions&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglVertexBuffer),
-q.bufferData(q.ARRAY_BUFFER,a.positionArray,q.DYNAMIC_DRAW),S.enableAttribute(b.attributes.position),q.vertexAttribPointer(b.attributes.position,3,q.FLOAT,!1,0,0));if(a.hasNormals){q.bindBuffer(q.ARRAY_BUFFER,a.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,l,n,m,p,r,s=3*a.count;for(r=0;r<s;r+=9)p=a.normalArray,d=p[r],e=p[r+1],f=p[r+2],g=p[r+3],k=p[r+4],n=p[r+5],h=p[r+6],l=p[r+7],m=p[r+8],d=(d+g+h)/3,e=(e+k+l)/3,f=(f+n+m)/3,p[r]=d,
-p[r+1]=e,p[r+2]=f,p[r+3]=d,p[r+4]=e,p[r+5]=f,p[r+6]=d,p[r+7]=e,p[r+8]=f}q.bufferData(q.ARRAY_BUFFER,a.normalArray,q.DYNAMIC_DRAW);S.enableAttribute(b.attributes.normal);q.vertexAttribPointer(b.attributes.normal,3,q.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(q.bindBuffer(q.ARRAY_BUFFER,a.__webglUvBuffer),q.bufferData(q.ARRAY_BUFFER,a.uvArray,q.DYNAMIC_DRAW),S.enableAttribute(b.attributes.uv),q.vertexAttribPointer(b.attributes.uv,2,q.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(q.bindBuffer(q.ARRAY_BUFFER,
-a.__webglColorBuffer),q.bufferData(q.ARRAY_BUFFER,a.colorArray,q.DYNAMIC_DRAW),S.enableAttribute(b.attributes.color),q.vertexAttribPointer(b.attributes.color,3,q.FLOAT,!1,0,0));S.disableUnusedAttributes();q.drawArrays(q.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f){if(!1!==e.visible){var g=ha.geometries.get(f);a=k(a,c,d,e,f);c=!1;d=g.id+"_"+a.id+"_"+(e.wireframe?1:0);d!==ja&&(ja=d,c=!0);c&&S.initAttributes();if(f instanceof THREE.Mesh)a:if(f=c,c=!0===e.wireframe?q.LINES:
-q.TRIANGLES,d=g.attributes.index){var h,l;d.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(h=q.UNSIGNED_INT,l=4):(h=q.UNSIGNED_SHORT,l=2);var n=g.offsets;if(0===n.length){f&&(b(e,a,g,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){var m=W.get("ANGLE_instanced_arrays");if(null===m){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
-break a}m.drawElementsInstancedANGLE(c,d.array.length,h,0,g.maxInstancedCount)}else q.drawElements(c,d.array.length,h,0);J.info.render.calls++;J.info.render.vertices+=d.array.length;J.info.render.faces+=d.array.length/3}else{f=!0;for(var p=0,r=n.length;p<r;p++){m=n[p].index;f&&(b(e,a,g,m),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<n[p].instances){m=W.get("ANGLE_instanced_arrays");if(null===m){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
-break a}m.drawElementsInstancedANGLE(c,n[p].count,h,n[p].start*l,n[p].count,h,n[p].instances)}else q.drawElements(c,n[p].count,h,n[p].start*l);J.info.render.calls++;J.info.render.vertices+=n[p].count;J.info.render.faces+=n[p].count/3}}}else if(n=g.offsets,0===n.length){f&&b(e,a,g,0);e=g.attributes.position;if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){m=W.get("ANGLE_instanced_arrays");if(null===m){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
-break a}e instanceof THREE.InterleavedBufferAttribute?m.drawArraysInstancedANGLE(c,0,e.data.array.length/e.data.stride,g.maxInstancedCount):m.drawArraysInstancedANGLE(c,0,e.array.length/e.itemSize,g.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?q.drawArrays(c,0,e.data.array.length/e.data.stride):q.drawArrays(c,0,e.array.length/e.itemSize);J.info.render.calls++;J.info.render.vertices+=e.array.length/e.itemSize;J.info.render.faces+=e.array.length/(3*e.itemSize)}else for(f&&b(e,
-a,g,0),p=0,r=n.length;p<r;p++){if(g instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else q.drawArrays(c,n[p].start,n[p].count);J.info.render.calls++;J.info.render.vertices+=n[p].count;J.info.render.faces+=n[p].count/3}else if(f instanceof THREE.Line)if(f=f instanceof THREE.LineSegments?q.LINES:q.LINE_STRIP,S.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*D),h=g.attributes.index)if(h.array instanceof
-Uint32Array?(l=q.UNSIGNED_INT,n=4):(l=q.UNSIGNED_SHORT,n=2),d=g.offsets,0===d.length)c&&(b(e,a,g,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(f,h.array.length,l,0),J.info.render.calls++,J.info.render.vertices+=h.array.length;else for(1<d.length&&(c=!0),m=0,p=d.length;m<p;m++)r=d[m].index,c&&(b(e,a,g,r),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(f,d[m].count,l,d[m].start*n),J.info.render.calls++,J.info.render.vertices+=d[m].count;else if(c&&b(e,a,g,0),e=g.attributes.position,
-d=g.offsets,0===d.length)q.drawArrays(f,0,e.array.length/3),J.info.render.calls++,J.info.render.vertices+=e.array.length/3;else for(m=0,p=d.length;m<p;m++)q.drawArrays(f,d[m].index,d[m].count),J.info.render.calls++,J.info.render.vertices+=d[m].count;else if(f instanceof THREE.PointCloud)if(d=c,c=q.POINTS,h=g.attributes.index)if(h.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(l=q.UNSIGNED_INT,n=4):(l=q.UNSIGNED_SHORT,n=2),f=g.offsets,0===f.length)d&&(b(e,a,g,0),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,
-h.buffer)),q.drawElements(c,h.array.length,l,0),J.info.render.calls++,J.info.render.points+=h.array.length;else for(1<f.length&&(d=!0),m=0,p=f.length;m<p;m++)r=f[m].index,d&&(b(e,a,g,r),q.bindBuffer(q.ELEMENT_ARRAY_BUFFER,h.buffer)),q.drawElements(c,f[m].count,l,f[m].start*n),J.info.render.calls++,J.info.render.points+=f[m].count;else if(d&&b(e,a,g,0),e=g.attributes.position,f=g.offsets,0===f.length)q.drawArrays(c,0,e.array.length/3),J.info.render.calls++,J.info.render.points+=e.array.length/3;else for(m=
-0,p=f.length;m<p;m++)q.drawArrays(c,f[m].index,f[m].count),J.info.render.calls++,J.info.render.points+=f[m].count}};this.render=function(a,b,k,l){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var n=a.fog;ja="";ka=-1;ua=null;Xa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);za.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);
-Ha.setFromMatrix(za);B.length=0;T.length=0;O.length=0;R.length=0;P.length=0;e(a);!0===J.sortObjects&&(T.sort(c),O.sort(d));ha.update(T);ha.update(O);ga.render(a,b);J.info.render.calls=0;J.info.render.vertices=0;J.info.render.faces=0;J.info.render.points=0;this.setRenderTarget(k);(this.autoClear||l)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);l=0;for(var m=ha.objectsImmediate.length;l<m;l++){var p=ha.objectsImmediate[l],r=p.object;if(r.visible){var s=r;s._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
-s.matrixWorld);s._normalMatrix.getNormalMatrix(s._modelViewMatrix);r=r.material;r.transparent?(p.transparent=r,p.opaque=null):(p.opaque=r,p.transparent=null)}}a.overrideMaterial?(l=a.overrideMaterial,h(l),f(T,b,B,n,l),f(O,b,B,n,l),g(ha.objectsImmediate,"",b,B,n,l)):(S.setBlending(THREE.NoBlending),f(T,b,B,n,null),g(ha.objectsImmediate,"opaque",b,B,n,null),f(O,b,B,n,null),g(ha.objectsImmediate,"transparent",b,B,n,null));Cb.render(a,b);Db.render(a,b,Ta,ra);k&&k.generateMipmaps&&k.minFilter!==THREE.NearestFilter&&
-k.minFilter!==THREE.LinearFilter&&(k instanceof THREE.WebGLRenderTargetCube?(S.bindTexture(q.TEXTURE_CUBE_MAP,k.__webglTexture),q.generateMipmap(q.TEXTURE_CUBE_MAP),S.bindTexture(q.TEXTURE_CUBE_MAP,null)):(S.bindTexture(q.TEXTURE_2D,k.__webglTexture),q.generateMipmap(q.TEXTURE_2D),S.bindTexture(q.TEXTURE_2D,null)));S.setDepthTest(!0);S.setDepthWrite(!0);S.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=k(a,b,c,d,e);ja="";J.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,
-q,Ha):e.render(function(a){J.renderBufferImmediate(a,f,d)})};var Sb={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?q.disable(q.CULL_FACE):(b===THREE.FrontFaceDirectionCW?q.frontFace(q.CW):q.frontFace(q.CCW),a===THREE.CullFaceBack?q.cullFace(q.BACK):a===THREE.CullFaceFront?
-q.cullFace(q.FRONT):q.cullFace(q.FRONT_AND_BACK),q.enable(q.CULL_FACE))};this.setMaterialFaces=function(a){S.setDoubleSided(a.side===THREE.DoubleSide);S.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a,b){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",wb),a.__webglTexture=q.createTexture(),J.info.memory.textures++);S.activeTexture(q.TEXTURE0+b);S.bindTexture(q.TEXTURE_2D,a.__webglTexture);q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,a.flipY);q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
-a.premultiplyAlpha);q.pixelStorei(q.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=r(a.image,Ab);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=u(a.format),f=u(a.type);n(q.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=
-0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Rb().indexOf(e)?q.compressedTexImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,c.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):q.texImage2D(q.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],q.texImage2D(q.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else q.texImage2D(q.TEXTURE_2D,0,e,e,f,a.image);
-a.generateMipmaps&&d&&q.generateMipmap(q.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){if(!0===a.needsUpdate){var c=a.image;void 0===c?console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a):!1===c.complete?console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a):J.uploadTexture(a,b)}else S.activeTexture(q.TEXTURE0+b),S.bindTexture(q.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=
-a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",ab);a.__webglTexture=q.createTexture();J.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=u(a.format),e=u(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];S.bindTexture(q.TEXTURE_CUBE_MAP,a.__webglTexture);n(q.TEXTURE_CUBE_MAP,a,c);for(var f=
-0;6>f;f++){a.__webglFramebuffer[f]=q.createFramebuffer();a.__webglRenderbuffer[f]=q.createRenderbuffer();q.texImage2D(q.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=q.TEXTURE_CUBE_MAP_POSITIVE_X+f;q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer[f]);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,h,g.__webglTexture,0);t(a.__webglRenderbuffer[f],a)}a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=q.createFramebuffer(),a.__webglRenderbuffer=
-a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:q.createRenderbuffer(),S.bindTexture(q.TEXTURE_2D,a.__webglTexture),n(q.TEXTURE_2D,a,c),q.texImage2D(q.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=q.TEXTURE_2D,q.bindFramebuffer(q.FRAMEBUFFER,a.__webglFramebuffer),q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&
-a.stencilBuffer&&q.framebufferRenderbuffer(q.FRAMEBUFFER,q.DEPTH_STENCIL_ATTACHMENT,q.RENDERBUFFER,a.__webglRenderbuffer):t(a.__webglRenderbuffer,a),a.generateMipmaps&&c&&q.generateMipmap(q.TEXTURE_2D);b?S.bindTexture(q.TEXTURE_CUBE_MAP,null):S.bindTexture(q.TEXTURE_2D,null);q.bindRenderbuffer(q.RENDERBUFFER,null);q.bindFramebuffer(q.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Fa,a=ya,d=ma,e=Ga);b!==da&&(q.bindFramebuffer(q.FRAMEBUFFER,
-b),q.viewport(d,e,c,a),da=b);Ta=c;ra=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(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;a.__webglFramebuffer!==da&&(q.bindFramebuffer(q.FRAMEBUFFER,
-a.__webglFramebuffer),g=!0);q.checkFramebufferStatus(q.FRAMEBUFFER)===q.FRAMEBUFFER_COMPLETE?q.readPixels(b,c,d,e,q.RGBA,q.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&q.bindFramebuffer(q.FRAMEBUFFER,da)}};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};
+this.supportsBlendMinMax=function(){return W.get("EXT_blend_minmax")};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=W.get("EXT_texture_filter_anisotropic");return a=null!==b?r.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=function(){return E};this.getPixelRatio=function(){return D};this.setPixelRatio=function(a){D=a};this.getSize=function(){return{width:z,height:y}};this.setSize=function(a,b,c){z=a;y=b;v.width=a*D;v.height=b*D;!1!==
+c&&(v.style.width=a+"px",v.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){ma=a*D;Ga=b*D;Fa=c*D;ya=d*D;r.viewport(ma,Ga,Fa,ya)};this.setScissor=function(a,b,c,d){r.scissor(a*D,b*D,c*D,d*D)};this.enableScissorTest=function(a){a?r.enable(r.SCISSOR_TEST):r.disable(r.SCISSOR_TEST)};this.getClearColor=function(){return A};this.setClearColor=function(a,b){A.set(a);H=void 0!==b?b:1;Ma(A.r,A.g,A.b,H)};this.getClearAlpha=function(){return H};this.setClearAlpha=function(a){H=
+a;Ma(A.r,A.g,A.b,H)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=r.COLOR_BUFFER_BIT;if(void 0===b||b)d|=r.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=r.STENCIL_BUFFER_BIT;r.clear(d)};this.clearColor=function(){r.clear(r.COLOR_BUFFER_BIT)};this.clearDepth=function(){r.clear(r.DEPTH_BUFFER_BIT)};this.clearStencil=function(){r.clear(r.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=Ua;var wb=function(a){a=a.target;a.removeEventListener("dispose",
+wb);a.image&&a.image.__webglTextureCube?(r.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(r.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);J.info.memory.textures--},ab=function(a){a=a.target;a.removeEventListener("dispose",ab);if(a&&void 0!==a.__webglTexture){r.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)r.deleteFramebuffer(a.__webglFramebuffer[b]),
+r.deleteRenderbuffer(a.__webglRenderbuffer[b]);else r.deleteFramebuffer(a.__webglFramebuffer),r.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}J.info.memory.textures--},Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);Fb(a)},Fb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=L.length;a<c;a++)if(d=L[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=L.length;a<
+c;a++)d=L[a],d.program!==b&&e.push(d);L=e;r.deleteProgram(b);J.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){S.initAttributes();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=r.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=r.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=r.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=r.createBuffer());a.hasPositions&&(r.bindBuffer(r.ARRAY_BUFFER,a.__webglVertexBuffer),
+r.bufferData(r.ARRAY_BUFFER,a.positionArray,r.DYNAMIC_DRAW),S.enableAttribute(b.attributes.position),r.vertexAttribPointer(b.attributes.position,3,r.FLOAT,!1,0,0));if(a.hasNormals){r.bindBuffer(r.ARRAY_BUFFER,a.__webglNormalBuffer);if(!1===c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,k,l,m,n,p,q,s=3*a.count;for(q=0;q<s;q+=9)p=a.normalArray,d=p[q],e=p[q+1],f=p[q+2],g=p[q+3],k=p[q+4],m=p[q+5],h=p[q+6],l=p[q+7],n=p[q+8],d=(d+g+h)/3,e=(e+k+l)/3,f=(f+m+n)/3,p[q]=d,
+p[q+1]=e,p[q+2]=f,p[q+3]=d,p[q+4]=e,p[q+5]=f,p[q+6]=d,p[q+7]=e,p[q+8]=f}r.bufferData(r.ARRAY_BUFFER,a.normalArray,r.DYNAMIC_DRAW);S.enableAttribute(b.attributes.normal);r.vertexAttribPointer(b.attributes.normal,3,r.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(r.bindBuffer(r.ARRAY_BUFFER,a.__webglUvBuffer),r.bufferData(r.ARRAY_BUFFER,a.uvArray,r.DYNAMIC_DRAW),S.enableAttribute(b.attributes.uv),r.vertexAttribPointer(b.attributes.uv,2,r.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(r.bindBuffer(r.ARRAY_BUFFER,
+a.__webglColorBuffer),r.bufferData(r.ARRAY_BUFFER,a.colorArray,r.DYNAMIC_DRAW),S.enableAttribute(b.attributes.color),r.vertexAttribPointer(b.attributes.color,3,r.FLOAT,!1,0,0));S.disableUnusedAttributes();r.drawArrays(r.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f){if(!1!==e.visible){var g=ha.geometries.get(f);a=k(a,c,d,e,f);c=!1;d=g.id+"_"+a.id+"_"+(e.wireframe?1:0);d!==ja&&(ja=d,c=!0);c&&S.initAttributes();if(f instanceof THREE.Mesh)a:if(f=c,c=!0===e.wireframe?r.LINES:
+r.TRIANGLES,d=g.attributes.index){var h,l;d.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(h=r.UNSIGNED_INT,l=4):(h=r.UNSIGNED_SHORT,l=2);var m=g.offsets;if(0===m.length){f&&(b(e,a,g,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){var n=W.get("ANGLE_instanced_arrays");if(null===n){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
+break a}n.drawElementsInstancedANGLE(c,d.array.length,h,0,g.maxInstancedCount)}else r.drawElements(c,d.array.length,h,0);J.info.render.calls++;J.info.render.vertices+=d.array.length;J.info.render.faces+=d.array.length/3}else{f=!0;for(var p=0,q=m.length;p<q;p++){n=m[p].index;f&&(b(e,a,g,n),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,d.buffer));if(g instanceof THREE.InstancedBufferGeometry&&0<m[p].instances){n=W.get("ANGLE_instanced_arrays");if(null===n){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
+break a}n.drawElementsInstancedANGLE(c,m[p].count,h,m[p].start*l,m[p].count,h,m[p].instances)}else r.drawElements(c,m[p].count,h,m[p].start*l);J.info.render.calls++;J.info.render.vertices+=m[p].count;J.info.render.faces+=m[p].count/3}}}else if(m=g.offsets,0===m.length){f&&b(e,a,g,0);e=g.attributes.position;if(g instanceof THREE.InstancedBufferGeometry&&0<g.maxInstancedCount){n=W.get("ANGLE_instanced_arrays");if(null===n){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
+break a}e instanceof THREE.InterleavedBufferAttribute?n.drawArraysInstancedANGLE(c,0,e.data.array.length/e.data.stride,g.maxInstancedCount):n.drawArraysInstancedANGLE(c,0,e.array.length/e.itemSize,g.maxInstancedCount)}else e instanceof THREE.InterleavedBufferAttribute?r.drawArrays(c,0,e.data.array.length/e.data.stride):r.drawArrays(c,0,e.array.length/e.itemSize);J.info.render.calls++;J.info.render.vertices+=e.array.length/e.itemSize;J.info.render.faces+=e.array.length/(3*e.itemSize)}else for(f&&b(e,
+a,g,0),p=0,q=m.length;p<q;p++){if(g instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else r.drawArrays(c,m[p].start,m[p].count);J.info.render.calls++;J.info.render.vertices+=m[p].count;J.info.render.faces+=m[p].count/3}else if(f instanceof THREE.Line)if(f=f instanceof THREE.LineSegments?r.LINES:r.LINE_STRIP,S.setLineWidth((void 0!==e.linewidth?e.linewidth:1)*D),h=g.attributes.index)if(h.array instanceof
+Uint32Array?(l=r.UNSIGNED_INT,m=4):(l=r.UNSIGNED_SHORT,m=2),d=g.offsets,0===d.length)c&&(b(e,a,g,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h.buffer)),r.drawElements(f,h.array.length,l,0),J.info.render.calls++,J.info.render.vertices+=h.array.length;else for(1<d.length&&(c=!0),n=0,p=d.length;n<p;n++)q=d[n].index,c&&(b(e,a,g,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h.buffer)),r.drawElements(f,d[n].count,l,d[n].start*m),J.info.render.calls++,J.info.render.vertices+=d[n].count;else if(c&&b(e,a,g,0),e=g.attributes.position,
+d=g.offsets,0===d.length)r.drawArrays(f,0,e.array.length/3),J.info.render.calls++,J.info.render.vertices+=e.array.length/3;else for(n=0,p=d.length;n<p;n++)r.drawArrays(f,d[n].index,d[n].count),J.info.render.calls++,J.info.render.vertices+=d[n].count;else if(f instanceof THREE.PointCloud)if(d=c,c=r.POINTS,h=g.attributes.index)if(h.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(l=r.UNSIGNED_INT,m=4):(l=r.UNSIGNED_SHORT,m=2),f=g.offsets,0===f.length)d&&(b(e,a,g,0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,
+h.buffer)),r.drawElements(c,h.array.length,l,0),J.info.render.calls++,J.info.render.points+=h.array.length;else for(1<f.length&&(d=!0),n=0,p=f.length;n<p;n++)q=f[n].index,d&&(b(e,a,g,q),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h.buffer)),r.drawElements(c,f[n].count,l,f[n].start*m),J.info.render.calls++,J.info.render.points+=f[n].count;else if(d&&b(e,a,g,0),e=g.attributes.position,f=g.offsets,0===f.length)r.drawArrays(c,0,e.array.length/3),J.info.render.calls++,J.info.render.points+=e.array.length/3;else for(n=
+0,p=f.length;n<p;n++)r.drawArrays(c,f[n].index,f[n].count),J.info.render.calls++,J.info.render.points+=f[n].count}};this.render=function(a,b,k,m){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var l=a.fog;ja="";ka=-1;ua=null;Xa=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);za.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);
+Ha.setFromMatrix(za);B.length=0;T.length=0;O.length=0;R.length=0;P.length=0;e(a);!0===J.sortObjects&&(T.sort(c),O.sort(d));ha.update(T);ha.update(O);ga.render(a,b);J.info.render.calls=0;J.info.render.vertices=0;J.info.render.faces=0;J.info.render.points=0;this.setRenderTarget(k);(this.autoClear||m)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=0;for(var n=ha.objectsImmediate.length;m<n;m++){var p=ha.objectsImmediate[m],q=p.object;if(q.visible){var s=q;s._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
+s.matrixWorld);s._normalMatrix.getNormalMatrix(s._modelViewMatrix);q=q.material;q.transparent?(p.transparent=q,p.opaque=null):(p.opaque=q,p.transparent=null)}}a.overrideMaterial?(m=a.overrideMaterial,h(m),f(T,b,B,l,m),f(O,b,B,l,m),g(ha.objectsImmediate,"",b,B,l,m)):(S.setBlending(THREE.NoBlending),f(T,b,B,l,null),g(ha.objectsImmediate,"opaque",b,B,l,null),f(O,b,B,l,null),g(ha.objectsImmediate,"transparent",b,B,l,null));Cb.render(a,b);Db.render(a,b,Ta,ra);k&&k.generateMipmaps&&k.minFilter!==THREE.NearestFilter&&
+k.minFilter!==THREE.LinearFilter&&(k instanceof THREE.WebGLRenderTargetCube?(S.bindTexture(r.TEXTURE_CUBE_MAP,k.__webglTexture),r.generateMipmap(r.TEXTURE_CUBE_MAP),S.bindTexture(r.TEXTURE_CUBE_MAP,null)):(S.bindTexture(r.TEXTURE_2D,k.__webglTexture),r.generateMipmap(r.TEXTURE_2D),S.bindTexture(r.TEXTURE_2D,null)));S.setDepthTest(!0);S.setDepthWrite(!0);S.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=k(a,b,c,d,e);ja="";J.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,
+r,Ha):e.render(function(a){J.renderBufferImmediate(a,f,d)})};var Sb={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?r.disable(r.CULL_FACE):(b===THREE.FrontFaceDirectionCW?r.frontFace(r.CW):r.frontFace(r.CCW),a===THREE.CullFaceBack?r.cullFace(r.BACK):a===THREE.CullFaceFront?
+r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK),r.enable(r.CULL_FACE))};this.setMaterialFaces=function(a){S.setDoubleSided(a.side===THREE.DoubleSide);S.setFlipSided(a.side===THREE.BackSide)};this.uploadTexture=function(a,b){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",wb),a.__webglTexture=r.createTexture(),J.info.memory.textures++);S.activeTexture(r.TEXTURE0+b);S.bindTexture(r.TEXTURE_2D,a.__webglTexture);r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY);r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
+a.premultiplyAlpha);r.pixelStorei(r.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=s(a.image,Ab);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=u(a.format),f=u(a.type);m(r.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],r.texImage2D(r.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else r.texImage2D(r.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=
+0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Rb().indexOf(e)?r.compressedTexImage2D(r.TEXTURE_2D,h,e,c.width,c.height,0,c.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):r.texImage2D(r.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],r.texImage2D(r.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else r.texImage2D(r.TEXTURE_2D,0,e,e,f,a.image);
+a.generateMipmaps&&d&&r.generateMipmap(r.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate(a)};this.setTexture=function(a,b){if(!0===a.needsUpdate){var c=a.image;void 0===c?console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a):!1===c.complete?console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a):J.uploadTexture(a,b)}else S.activeTexture(r.TEXTURE0+b),S.bindTexture(r.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=
+a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",ab);a.__webglTexture=r.createTexture();J.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=u(a.format),e=u(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];S.bindTexture(r.TEXTURE_CUBE_MAP,a.__webglTexture);m(r.TEXTURE_CUBE_MAP,a,c);for(var f=
+0;6>f;f++){a.__webglFramebuffer[f]=r.createFramebuffer();a.__webglRenderbuffer[f]=r.createRenderbuffer();r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=r.TEXTURE_CUBE_MAP_POSITIVE_X+f;r.bindFramebuffer(r.FRAMEBUFFER,a.__webglFramebuffer[f]);r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,h,g.__webglTexture,0);t(a.__webglRenderbuffer[f],a)}a.generateMipmaps&&c&&r.generateMipmap(r.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=r.createFramebuffer(),a.__webglRenderbuffer=
+a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:r.createRenderbuffer(),S.bindTexture(r.TEXTURE_2D,a.__webglTexture),m(r.TEXTURE_2D,a,c),r.texImage2D(r.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=r.TEXTURE_2D,r.bindFramebuffer(r.FRAMEBUFFER,a.__webglFramebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&
+a.stencilBuffer&&r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a.__webglRenderbuffer):t(a.__webglRenderbuffer,a),a.generateMipmaps&&c&&r.generateMipmap(r.TEXTURE_2D);b?S.bindTexture(r.TEXTURE_CUBE_MAP,null):S.bindTexture(r.TEXTURE_2D,null);r.bindRenderbuffer(r.RENDERBUFFER,null);r.bindFramebuffer(r.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Fa,a=ya,d=ma,e=Ga);b!==da&&(r.bindFramebuffer(r.FRAMEBUFFER,
+b),r.viewport(d,e,c,a),da=b);Ta=c;ra=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(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;a.__webglFramebuffer!==da&&(r.bindFramebuffer(r.FRAMEBUFFER,
+a.__webglFramebuffer),g=!0);r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE?r.readPixels(b,c,d,e,r.RGBA,r.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&r.bindFramebuffer(r.FRAMEBUFFER,da)}};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 ga.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");ga.enabled=a}},shadowMapType:{get:function(){return ga.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");
 ga.type=a}},shadowMapCullFace:{get:function(){return ga.cullFace},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.");ga.cullFace=a}},shadowMapDebug:{get:function(){return ga.debug},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug.");ga.debug=a}},shadowMapCascade:{get:function(){return ga.cascade},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapCascade is now .shadowMap.cascade.");ga.cascade=a}}})};
 THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
@@ -570,77 +569,78 @@ this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;a.shareDepthFrom=this.
 THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
 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){function c(e){e=e.target;e.removeEventListener("dispose",c);e=d[e.id];for(var f in e.attributes){var g=e.attributes[f];void 0!==g.buffer&&(a.deleteBuffer(g.buffer),delete g.buffer)}b.memory.geometries--}var d={};this.get=function(a){var f=a.geometry;if(void 0!==d[f.id])return d[f.id];f.addEventListener("dispose",c);d[f.id]=f instanceof THREE.BufferGeometry?f:(new THREE.BufferGeometry).setFromObject(a);b.memory.geometries++;return d[f.id]}};
-THREE.WebGLObjects=function(a,b){function c(a){a.target.traverse(function(a){a.removeEventListener("remove",c);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete d[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=e,f=b.length-1;0<=f;f--)b[f].object===a&&b.splice(f,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})}var d={},e=[],f=new THREE.WebGLGeometries(a,b);this.objects=
-d;this.objectsImmediate=e;this.geometries=f;this.init=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",c));void 0===a.__webglActive&&(a.__webglActive=!0,a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud?d[a.id]={id:a.id,object:a,z:0}:(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&e.push({id:null,object:a,opaque:null,transparent:null,z:0}))};
-this.update=function(b){for(var c=0,d=b.length;c<d;c++){var e=b[c].object;if(!1!==e.material.visible){var m=f.get(e);e.geometry instanceof THREE.DynamicGeometry&&m.updateFromObject(e);if(m instanceof THREE.BufferGeometry)for(var e=m.attributes,m=m.attributesKeys,p=0,n=m.length;p<n;p++){var r=m[p],t=e[r];if(!1!==t.enabled)if(r="index"===r?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,t=t instanceof THREE.InterleavedBufferAttribute?t.data:t,void 0===t.buffer){t.buffer=a.createBuffer();a.bindBuffer(r,t.buffer);
-var s=a.STATIC_DRAW;if(t instanceof THREE.DynamicBufferAttribute||t instanceof THREE.InstancedBufferAttribute&&!0===t.dynamic||t instanceof THREE.InterleavedBuffer&&!0===t.dynamic)s=a.DYNAMIC_DRAW;a.bufferData(r,t.array,s);t.needsUpdate=!1}else!0===t.needsUpdate&&(a.bindBuffer(r,t.buffer),void 0===t.updateRange||-1===t.updateRange.count?a.bufferSubData(r,0,t.array):0===t.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
-(a.bufferSubData(r,t.updateRange.offset*t.array.BYTES_PER_ELEMENT,t.array.subarray(t.updateRange.offset,t.updateRange.offset+t.updateRange.count)),t.updateRange.count=0),t.needsUpdate=!1)}}}}};
-THREE.WebGLProgram=function(){function a(a,b,e,f){return""!==b&&void 0!==b&&null!==b?a+b+"\n":a}var b=0;return function(c,d,e,f){var g=c.context,h=e.defines,k=e.__webglShader.uniforms,l=e.attributes,m=e.__webglShader.vertexShader,p=e.__webglShader.fragmentShader,n=e.index0AttributeName,r="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");var t="ENVMAP_TYPE_CUBE",s="ENVMAP_MODE_REFLECTION",u="ENVMAP_BLENDING_MULTIPLY";
-if(f.envMap){switch(e.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:t="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:t="ENVMAP_TYPE_SPHERE"}switch(e.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:s="ENVMAP_MODE_REFRACTION"}switch(e.combine){case THREE.MultiplyOperation:u="ENVMAP_BLENDING_MULTIPLY";
+THREE.WebGLObjects=function(a,b){function c(a){a.target.traverse(function(a){a.removeEventListener("remove",c);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete e[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=f,d=b.length-1;0<=d;d--)b[d].object===a&&b.splice(d,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})}function d(a,b){return b[0]-a[0]}var e={},f=[],g=new Float32Array(8),
+h=new THREE.WebGLGeometries(a,b);this.objects=e;this.objectsImmediate=f;this.geometries=h;this.init=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",c));void 0===a.__webglActive&&(a.__webglActive=!0,a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud?e[a.id]={id:a.id,object:a,z:0}:(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&f.push({id:null,
+object:a,opaque:null,transparent:null,z:0}))};this.update=function(b){for(var c=0,e=b.length;c<e;c++){var f=b[c].object;if(!1!==f.material.visible){var m=f,s=h.get(m);m.geometry instanceof THREE.DynamicGeometry&&s.updateFromObject(m);if(void 0!==m.morphTargetInfluences){for(var t=[],f=m.morphTargetInfluences,q=0,u=f.length;q<u;q++)t.push([f[q],q]);t.sort(d);8<t.length&&(t.length=8);q=0;for(u=t.length;q<u;q++)g[q]=t[q][0],f=s.morphAttributes[t[q][1]],s.addAttribute("morphTarget"+q,f);f=m.material;
+void 0!==f.program?null!==f.program.uniforms.morphTargetInfluences&&a.uniform1fv(f.program.uniforms.morphTargetInfluences,g):console.warn("TOFIX: material.program is undefined")}if(s instanceof THREE.BufferGeometry)for(m in s=s.attributes,m=void 0,s)if(f=s[m],t="index"===m?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,f=f instanceof THREE.InterleavedBufferAttribute?f.data:f,void 0===f.buffer){f.buffer=a.createBuffer();a.bindBuffer(t,f.buffer);q=a.STATIC_DRAW;if(f instanceof THREE.DynamicBufferAttribute||
+f instanceof THREE.InstancedBufferAttribute&&!0===f.dynamic||f instanceof THREE.InterleavedBuffer&&!0===f.dynamic)q=a.DYNAMIC_DRAW;a.bufferData(t,f.array,q);f.needsUpdate=!1}else!0===f.needsUpdate&&(a.bindBuffer(t,f.buffer),void 0===f.updateRange||-1===f.updateRange.count?a.bufferSubData(t,0,f.array):0===f.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
+(a.bufferSubData(t,f.updateRange.offset*f.array.BYTES_PER_ELEMENT,f.array.subarray(f.updateRange.offset,f.updateRange.offset+f.updateRange.count)),f.updateRange.count=0),f.needsUpdate=!1)}}}};
+THREE.WebGLProgram=function(){function a(a,b,e,f){return""!==b&&void 0!==b&&null!==b?a+b+"\n":a}var b=0;return function(c,d,e,f){var g=c.context,h=e.defines,k=e.__webglShader.uniforms,l=e.attributes,n=e.__webglShader.vertexShader,p=e.__webglShader.fragmentShader,m=e.index0AttributeName,s="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?s="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(s="SHADOWMAP_TYPE_PCF_SOFT");var t="ENVMAP_TYPE_CUBE",q="ENVMAP_MODE_REFLECTION",u="ENVMAP_BLENDING_MULTIPLY";
+if(f.envMap){switch(e.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:t="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:t="ENVMAP_TYPE_SPHERE"}switch(e.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_MODE_REFRACTION"}switch(e.combine){case THREE.MultiplyOperation:u="ENVMAP_BLENDING_MULTIPLY";
 break;case THREE.MixOperation:u="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:u="ENVMAP_BLENDING_ADD"}}var v=0<c.gammaFactor?c.gammaFactor:1,w,z=[];for(w in h){var y=h[w];!1!==y&&z.push("#define "+w+" "+y)}w=z.join("\n");h=g.createProgram();e instanceof THREE.RawShaderMaterial?c=z="":(z=["precision "+f.precision+" float;","precision "+f.precision+" int;",w,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
-v,"#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 "+s:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",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?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+r:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?
+v,"#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.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?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+s:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?
 "#define SHADOWMAP_CASCADE":"",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR",
 "\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;",
 "\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif",""].reduce(a,""),c=[f.bumpMap||f.normalMap||f.flatShading||e.derivatives?"#extension GL_OES_standard_derivatives : enable":"","precision "+f.precision+" float;","precision "+f.precision+" int;",w,"#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:"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+v,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 "+t:"",f.envMap?"#define "+s:"",f.envMap?"#define "+u:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",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 "+r:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&
-c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",""].reduce(a,""));m=new THREE.WebGLShader(g,g.VERTEX_SHADER,z+m);p=new THREE.WebGLShader(g,g.FRAGMENT_SHADER,c+p);g.attachShader(h,m);g.attachShader(h,p);void 0!==n&&g.bindAttribLocation(h,0,n);g.linkProgram(h);n=g.getProgramInfoLog(h);c=g.getShaderInfoLog(m);r=g.getShaderInfoLog(p);!1===g.getProgramParameter(h,g.LINK_STATUS)&&console.error("THREE.WebGLProgram: shader error: ",
-g.getError(),"gl.VALIDATE_STATUS",g.getProgramParameter(h,g.VALIDATE_STATUS),"gl.getProgramInfoLog",n,c,r);""!==n&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",n);g.deleteShader(m);g.deleteShader(p);n="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");f.useVertexTexture?n.push("boneTexture","boneTextureWidth","boneTextureHeight"):n.push("boneGlobalMatrices");f.logarithmicDepthBuffer&&n.push("logDepthBufFC");
-for(var D in k)n.push(D);k=n;D={};n=0;for(c=k.length;n<c;n++)r=k[n],D[r]=g.getUniformLocation(h,r);this.uniforms=D;if(e instanceof THREE.RawShaderMaterial)n=l;else{n="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(e=0;e<f.maxMorphTargets;e++)n.push("morphTarget"+e);for(e=0;e<f.maxMorphNormals;e++)n.push("morphNormal"+e);Array.isArray(l)&&(n=n.concat(l))}f=n;l={};e=0;for(k=f.length;e<k;e++)D=f[e],l[D]=g.getAttribLocation(h,D);this.attributes=l;this.attributesKeys=
-Object.keys(this.attributes);this.id=b++;this.code=d;this.usedTimes=1;this.program=h;this.vertexShader=m;this.fragmentShader=p;return this}}();
+f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+v,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 "+t:"",f.envMap?"#define "+q:"",f.envMap?"#define "+u:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",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 "+s:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&
+c.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",""].reduce(a,""));n=new THREE.WebGLShader(g,g.VERTEX_SHADER,z+n);p=new THREE.WebGLShader(g,g.FRAGMENT_SHADER,c+p);g.attachShader(h,n);g.attachShader(h,p);void 0!==m&&g.bindAttribLocation(h,0,m);g.linkProgram(h);m=g.getProgramInfoLog(h);c=g.getShaderInfoLog(n);s=g.getShaderInfoLog(p);!1===g.getProgramParameter(h,g.LINK_STATUS)&&console.error("THREE.WebGLProgram: shader error: ",
+g.getError(),"gl.VALIDATE_STATUS",g.getProgramParameter(h,g.VALIDATE_STATUS),"gl.getProgramInfoLog",m,c,s);""!==m&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",m);g.deleteShader(n);g.deleteShader(p);m="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");f.useVertexTexture?m.push("boneTexture","boneTextureWidth","boneTextureHeight"):m.push("boneGlobalMatrices");f.logarithmicDepthBuffer&&m.push("logDepthBufFC");
+for(var D in k)m.push(D);k=m;D={};m=0;for(c=k.length;m<c;m++)s=k[m],D[s]=g.getUniformLocation(h,s);this.uniforms=D;if(e instanceof THREE.RawShaderMaterial)m=l;else{m="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(e=0;e<f.maxMorphTargets;e++)m.push("morphTarget"+e);for(e=0;e<f.maxMorphNormals;e++)m.push("morphNormal"+e);Array.isArray(l)&&(m=m.concat(l))}f=m;l={};e=0;for(k=f.length;e<k;e++)D=f[e],l[D]=g.getAttribLocation(h,D);this.attributes=l;this.id=b++;this.code=
+d;this.usedTimes=1;this.program=h;this.vertexShader=n;this.fragmentShader=p;return this}}();
 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,e){if(b.visible){var g=c.objects[b.id];g&&b.castShadow&&(!1===b.frustumCulled||!0===f.intersectsObject(b))&&(b._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,b.matrixWorld),p.push(g));for(var g=0,h=b.children.length;g<h;g++)d(a,b.children[g],e)}}var e=a.context,f=new THREE.Frustum,g=new THREE.Matrix4,h=new THREE.Vector3,k=new THREE.Vector3,l=c.objectsImmediate,m=new THREE.Vector3,p=[],n=THREE.ShaderLib.depthRGBA,r=THREE.UniformsUtils.clone(n.uniforms),
-t=new THREE.ShaderMaterial({uniforms:r,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}),s=new THREE.ShaderMaterial({uniforms:r,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:r,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,skinning:!0}),v=new THREE.ShaderMaterial({uniforms:r,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0,skinning:!0});t._shadowPass=!0;s._shadowPass=!0;u._shadowPass=
-!0;v._shadowPass=!0;var w=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,n){if(!1!==w.enabled){var r,E,x,F,I,C,G,Q=[];F=0;e.clearColor(1,1,1,1);e.disable(e.BLEND);e.enable(e.CULL_FACE);e.frontFace(e.CCW);w.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);a.state.setDepthTest(!0);r=0;for(E=b.length;r<E;r++)if(x=b[r],x.castShadow)if(x instanceof THREE.DirectionalLight&&x.shadowCascade)for(I=0;I<
+THREE.WebGLShadowMap=function(a,b,c){function d(a,b,e){if(b.visible){var g=c.objects[b.id];g&&b.castShadow&&(!1===b.frustumCulled||!0===f.intersectsObject(b))&&(b._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,b.matrixWorld),p.push(g));for(var g=0,h=b.children.length;g<h;g++)d(a,b.children[g],e)}}var e=a.context,f=new THREE.Frustum,g=new THREE.Matrix4,h=new THREE.Vector3,k=new THREE.Vector3,l=c.objectsImmediate,n=new THREE.Vector3,p=[],m=THREE.ShaderLib.depthRGBA,s=THREE.UniformsUtils.clone(m.uniforms),
+t=new THREE.ShaderMaterial({uniforms:s,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}),q=new THREE.ShaderMaterial({uniforms:s,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:s,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,skinning:!0}),v=new THREE.ShaderMaterial({uniforms:s,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0,skinning:!0});t._shadowPass=!0;q._shadowPass=!0;u._shadowPass=
+!0;v._shadowPass=!0;var w=this;this.enabled=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=this.debug=!1;this.render=function(c,m){if(!1!==w.enabled){var s,E,x,F,I,C,G,Q=[];F=0;e.clearColor(1,1,1,1);e.disable(e.BLEND);e.enable(e.CULL_FACE);e.frontFace(e.CCW);w.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);a.state.setDepthTest(!0);s=0;for(E=b.length;s<E;s++)if(x=b[s],x.castShadow)if(x instanceof THREE.DirectionalLight&&x.shadowCascade)for(I=0;I<
 x.shadowCascadeCount;I++){var K;if(x.shadowCascadeArray[I])K=x.shadowCascadeArray[I];else{var A=x;G=I;K=new THREE.DirectionalLight;K.isVirtual=!0;K.onlyShadow=!0;K.castShadow=!0;K.shadowCameraNear=A.shadowCameraNear;K.shadowCameraFar=A.shadowCameraFar;K.shadowCameraLeft=A.shadowCameraLeft;K.shadowCameraRight=A.shadowCameraRight;K.shadowCameraBottom=A.shadowCameraBottom;K.shadowCameraTop=A.shadowCameraTop;K.shadowCameraVisible=A.shadowCameraVisible;K.shadowDarkness=A.shadowDarkness;K.shadowBias=A.shadowCascadeBias[G];
-K.shadowMapWidth=A.shadowCascadeWidth[G];K.shadowMapHeight=A.shadowCascadeHeight[G];K.pointsWorld=[];K.pointsFrustum=[];var H=K.pointsWorld;C=K.pointsFrustum;for(var B=0;8>B;B++)H[B]=new THREE.Vector3,C[B]=new THREE.Vector3;H=A.shadowCascadeNearZ[G];A=A.shadowCascadeFarZ[G];C[0].set(-1,-1,H);C[1].set(1,-1,H);C[2].set(-1,1,H);C[3].set(1,1,H);C[4].set(-1,-1,A);C[5].set(1,-1,A);C[6].set(-1,1,A);C[7].set(1,1,A);K.originalCamera=n;C=new THREE.Gyroscope;C.position.copy(x.shadowCascadeOffset);C.add(K);C.add(K.target);
-n.add(C);x.shadowCascadeArray[I]=K}G=x;H=I;A=G.shadowCascadeArray[H];A.position.copy(G.position);A.target.position.copy(G.target.position);A.lookAt(A.target);A.shadowCameraVisible=G.shadowCameraVisible;A.shadowDarkness=G.shadowDarkness;A.shadowBias=G.shadowCascadeBias[H];C=G.shadowCascadeNearZ[H];G=G.shadowCascadeFarZ[H];A=A.pointsFrustum;A[0].z=C;A[1].z=C;A[2].z=C;A[3].z=C;A[4].z=G;A[5].z=G;A[6].z=G;A[7].z=G;Q[F]=K;F++}else Q[F]=x,F++;r=0;for(E=Q.length;r<E;r++){x=Q[r];x.shadowMap||(I=THREE.LinearFilter,
+K.shadowMapWidth=A.shadowCascadeWidth[G];K.shadowMapHeight=A.shadowCascadeHeight[G];K.pointsWorld=[];K.pointsFrustum=[];var H=K.pointsWorld;C=K.pointsFrustum;for(var B=0;8>B;B++)H[B]=new THREE.Vector3,C[B]=new THREE.Vector3;H=A.shadowCascadeNearZ[G];A=A.shadowCascadeFarZ[G];C[0].set(-1,-1,H);C[1].set(1,-1,H);C[2].set(-1,1,H);C[3].set(1,1,H);C[4].set(-1,-1,A);C[5].set(1,-1,A);C[6].set(-1,1,A);C[7].set(1,1,A);K.originalCamera=m;C=new THREE.Gyroscope;C.position.copy(x.shadowCascadeOffset);C.add(K);C.add(K.target);
+m.add(C);x.shadowCascadeArray[I]=K}G=x;H=I;A=G.shadowCascadeArray[H];A.position.copy(G.position);A.target.position.copy(G.target.position);A.lookAt(A.target);A.shadowCameraVisible=G.shadowCameraVisible;A.shadowDarkness=G.shadowDarkness;A.shadowBias=G.shadowCascadeBias[H];C=G.shadowCascadeNearZ[H];G=G.shadowCascadeFarZ[H];A=A.pointsFrustum;A[0].z=C;A[1].z=C;A[2].z=C;A[3].z=C;A[4].z=G;A[5].z=G;A[6].z=G;A[7].z=G;Q[F]=K;F++}else Q[F]=x,F++;s=0;for(E=Q.length;s<E;s++){x=Q[s];x.shadowMap||(I=THREE.LinearFilter,
 w.type===THREE.PCFSoftShadowMap&&(I=THREE.NearestFilter),x.shadowMap=new THREE.WebGLRenderTarget(x.shadowMapWidth,x.shadowMapHeight,{minFilter:I,magFilter:I,format:THREE.RGBAFormat}),x.shadowMapSize=new THREE.Vector2(x.shadowMapWidth,x.shadowMapHeight),x.shadowMatrix=new THREE.Matrix4);if(!x.shadowCamera){if(x instanceof THREE.SpotLight)x.shadowCamera=new THREE.PerspectiveCamera(x.shadowCameraFov,x.shadowMapWidth/x.shadowMapHeight,x.shadowCameraNear,x.shadowCameraFar);else if(x instanceof THREE.DirectionalLight)x.shadowCamera=
-new THREE.OrthographicCamera(x.shadowCameraLeft,x.shadowCameraRight,x.shadowCameraTop,x.shadowCameraBottom,x.shadowCameraNear,x.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",x);continue}c.add(x.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}x.shadowCameraVisible&&!x.cameraHelper&&(x.cameraHelper=new THREE.CameraHelper(x.shadowCamera),c.add(x.cameraHelper));if(x.isVirtual&&K.originalCamera==n){I=n;F=x.shadowCamera;C=x.pointsFrustum;A=x.pointsWorld;
-h.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(G=0;8>G;G++)H=A[G],H.copy(C[G]),H.unproject(I),H.applyMatrix4(F.matrixWorldInverse),H.x<h.x&&(h.x=H.x),H.x>k.x&&(k.x=H.x),H.y<h.y&&(h.y=H.y),H.y>k.y&&(k.y=H.y),H.z<h.z&&(h.z=H.z),H.z>k.z&&(k.z=H.z);F.left=h.x;F.right=k.x;F.top=k.y;F.bottom=h.y;F.updateProjectionMatrix()}F=x.shadowMap;C=x.shadowMatrix;I=x.shadowCamera;I.position.setFromMatrixPosition(x.matrixWorld);m.setFromMatrixPosition(x.target.matrixWorld);I.lookAt(m);I.updateMatrixWorld();
+new THREE.OrthographicCamera(x.shadowCameraLeft,x.shadowCameraRight,x.shadowCameraTop,x.shadowCameraBottom,x.shadowCameraNear,x.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",x);continue}c.add(x.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}x.shadowCameraVisible&&!x.cameraHelper&&(x.cameraHelper=new THREE.CameraHelper(x.shadowCamera),c.add(x.cameraHelper));if(x.isVirtual&&K.originalCamera==m){I=m;F=x.shadowCamera;C=x.pointsFrustum;A=x.pointsWorld;
+h.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(G=0;8>G;G++)H=A[G],H.copy(C[G]),H.unproject(I),H.applyMatrix4(F.matrixWorldInverse),H.x<h.x&&(h.x=H.x),H.x>k.x&&(k.x=H.x),H.y<h.y&&(h.y=H.y),H.y>k.y&&(k.y=H.y),H.z<h.z&&(h.z=H.z),H.z>k.z&&(k.z=H.z);F.left=h.x;F.right=k.x;F.top=k.y;F.bottom=h.y;F.updateProjectionMatrix()}F=x.shadowMap;C=x.shadowMatrix;I=x.shadowCamera;I.position.setFromMatrixPosition(x.matrixWorld);n.setFromMatrixPosition(x.target.matrixWorld);I.lookAt(n);I.updateMatrixWorld();
 I.matrixWorldInverse.getInverse(I.matrixWorld);x.cameraHelper&&(x.cameraHelper.visible=x.shadowCameraVisible);x.shadowCameraVisible&&x.cameraHelper.update();C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);C.multiply(I.projectionMatrix);C.multiply(I.matrixWorldInverse);g.multiplyMatrices(I.projectionMatrix,I.matrixWorldInverse);f.setFromMatrix(g);a.setRenderTarget(F);a.clear();p.length=0;d(c,c,I);x=0;for(F=p.length;x<F;x++)C=p[x],C=C.object,A=C.material instanceof THREE.MeshFaceMaterial?C.material.materials[0]:
-C.material,G=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&A.morphTargets,H=C instanceof THREE.SkinnedMesh&&A.skinning,G=C.customDepthMaterial?C.customDepthMaterial:H?G?v:u:G?s:t,a.setMaterialFaces(A),a.renderBufferDirect(I,b,null,G,C);x=0;for(F=l.length;x<F;x++)C=l[x],C=C.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,C.matrixWorld),a.renderImmediateObject(I,b,null,t,C))}r=a.getClearColor();E=a.getClearAlpha();e.clearColor(r.r,r.g,
-r.b,E);e.enable(e.BLEND);w.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
-THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),f=null,g=null,h=null,k=null,l=null,m=null,p=null,n=null,r=null,t=null,s=null,u=null,v=null,w=null,z=null,y=null,D=null,E=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),x=void 0,F={};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&
-(a.disableVertexAttribArray(b),e[b]=0)};this.setBlending=function(c,d,e,n,r,s,t){c!==f&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):
-(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=c);if(c===THREE.CustomBlending){r=r||d;s=s||e;t=t||n;if(d!==g||r!==l)a.blendEquationSeparate(b(d),b(r)),g=d,l=r;if(e!==h||n!==k||s!==m||t!==p)a.blendFuncSeparate(b(e),b(n),b(s),b(t)),h=e,k=n,m=s,p=t}else p=m=l=k=h=g=null};this.setDepthFunc=function(b){if(n!==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);n=b}};this.setDepthTest=function(b){r!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),r=b)};this.setDepthWrite=function(b){t!==
-b&&(a.depthMask(b),t=b)};this.setColorWrite=function(b){s!==b&&(a.colorMask(b,b,b,b),s=b)};this.setDoubleSided=function(b){u!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),u=b)};this.setFlipSided=function(b){v!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),v=b)};this.setLineWidth=function(b){b!==w&&(a.lineWidth(b),w=b)};this.setPolygonOffset=function(b,c,d){z!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),z=b);!b||y===c&&D===d||(a.polygonOffset(c,d),y=c,D=d)};this.activeTexture=
-function(b){void 0===b&&(b=a.TEXTURE0+E-1);x!==b&&(a.activeTexture(b),x=b)};this.bindTexture=function(b,d){void 0===x&&c.activeTexture();var e=F[x];void 0===e&&(e={type:void 0,texture:void 0},F[x]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.reset=function(){for(var a=0;a<e.length;a++)e[a]=0;v=u=s=t=r=f=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,m,p,n=a.context,r,t,s,u,v,w;this.render=function(z,y,D,E){if(0!==b.length){z=new THREE.Vector3;var x=E/D,F=.5*D,I=.5*E,C=16/E,G=new THREE.Vector2(C*x,C),Q=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1);if(void 0===s){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),A=new Uint16Array([0,1,2,0,2,3]);r=n.createBuffer();t=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,r);n.bufferData(n.ARRAY_BUFFER,C,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
-t);n.bufferData(n.ELEMENT_ARRAY_BUFFER,A,n.STATIC_DRAW);v=n.createTexture();w=n.createTexture();a.state.bindTexture(n.TEXTURE_2D,v);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);a.state.bindTexture(n.TEXTURE_2D,w);n.texImage2D(n.TEXTURE_2D,
-0,n.RGBA,16,16,0,n.RGBA,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);var C=(u=0<n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
+C.material,G=void 0!==C.geometry.morphTargets&&0<C.geometry.morphTargets.length&&A.morphTargets,H=C instanceof THREE.SkinnedMesh&&A.skinning,G=C.customDepthMaterial?C.customDepthMaterial:H?G?v:u:G?q:t,a.setMaterialFaces(A),a.renderBufferDirect(I,b,null,G,C);x=0;for(F=l.length;x<F;x++)C=l[x],C=C.object,C.visible&&C.castShadow&&(C._modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,C.matrixWorld),a.renderImmediateObject(I,b,null,t,C))}s=a.getClearColor();E=a.getClearAlpha();e.clearColor(s.r,s.g,
+s.b,E);e.enable(e.BLEND);w.cullFace===THREE.CullFaceFront&&e.cullFace(e.BACK);a.resetGLState()}}};
+THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),f=null,g=null,h=null,k=null,l=null,n=null,p=null,m=null,s=null,t=null,q=null,u=null,v=null,w=null,z=null,y=null,D=null,E=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),x=void 0,F={};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&
+(a.disableVertexAttribArray(b),e[b]=0)};this.setBlending=function(c,d,e,m,q,s,t){c!==f&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):
+(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=c);if(c===THREE.CustomBlending){q=q||d;s=s||e;t=t||m;if(d!==g||q!==l)a.blendEquationSeparate(b(d),b(q)),g=d,l=q;if(e!==h||m!==k||s!==n||t!==p)a.blendFuncSeparate(b(e),b(m),b(s),b(t)),h=e,k=m,n=s,p=t}else p=n=l=k=h=g=null};this.setDepthFunc=function(b){if(m!==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);m=b}};this.setDepthTest=function(b){s!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),s=b)};this.setDepthWrite=function(b){t!==
+b&&(a.depthMask(b),t=b)};this.setColorWrite=function(b){q!==b&&(a.colorMask(b,b,b,b),q=b)};this.setDoubleSided=function(b){u!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),u=b)};this.setFlipSided=function(b){v!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),v=b)};this.setLineWidth=function(b){b!==w&&(a.lineWidth(b),w=b)};this.setPolygonOffset=function(b,c,d){z!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),z=b);!b||y===c&&D===d||(a.polygonOffset(c,d),y=c,D=d)};this.activeTexture=
+function(b){void 0===b&&(b=a.TEXTURE0+E-1);x!==b&&(a.activeTexture(b),x=b)};this.bindTexture=function(b,d){void 0===x&&c.activeTexture();var e=F[x];void 0===e&&(e={type:void 0,texture:void 0},F[x]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.reset=function(){for(var a=0;a<e.length;a++)e[a]=0;v=u=q=t=s=f=null}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m=a.context,s,t,q,u,v,w;this.render=function(z,y,D,E){if(0!==b.length){z=new THREE.Vector3;var x=E/D,F=.5*D,I=.5*E,C=16/E,G=new THREE.Vector2(C*x,C),Q=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1);if(void 0===q){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),A=new Uint16Array([0,1,2,0,2,3]);s=m.createBuffer();t=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,s);m.bufferData(m.ARRAY_BUFFER,C,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
+t);m.bufferData(m.ELEMENT_ARRAY_BUFFER,A,m.STATIC_DRAW);v=m.createTexture();w=m.createTexture();a.state.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);a.state.bindTexture(m.TEXTURE_2D,w);m.texImage2D(m.TEXTURE_2D,
+0,m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var C=(u=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
-A=n.createProgram(),H=n.createShader(n.FRAGMENT_SHADER),B=n.createShader(n.VERTEX_SHADER),T="precision "+a.getPrecision()+" float;\n";n.shaderSource(H,T+C.fragmentShader);n.shaderSource(B,T+C.vertexShader);n.compileShader(H);n.compileShader(B);n.attachShader(A,H);n.attachShader(A,B);n.linkProgram(A);s=A;m=n.getAttribLocation(s,"position");p=n.getAttribLocation(s,"uv");c=n.getUniformLocation(s,"renderType");d=n.getUniformLocation(s,"map");e=n.getUniformLocation(s,"occlusionMap");f=n.getUniformLocation(s,
-"opacity");g=n.getUniformLocation(s,"color");h=n.getUniformLocation(s,"scale");k=n.getUniformLocation(s,"rotation");l=n.getUniformLocation(s,"screenPosition")}n.useProgram(s);a.state.initAttributes();a.state.enableAttribute(m);a.state.enableAttribute(p);a.state.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,r);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(p,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t);n.disable(n.CULL_FACE);
-n.depthMask(!1);A=0;for(H=b.length;A<H;A++)if(C=16/E,G.set(C*x,C),B=b[A],z.set(B.matrixWorld.elements[12],B.matrixWorld.elements[13],B.matrixWorld.elements[14]),z.applyMatrix4(y.matrixWorldInverse),z.applyProjection(y.projectionMatrix),Q.copy(z),K.x=Q.x*F+F,K.y=Q.y*I+I,u||0<K.x&&K.x<D&&0<K.y&&K.y<E){a.state.activeTexture(n.TEXTURE1);a.state.bindTexture(n.TEXTURE_2D,v);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,K.x-8,K.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,G.x,G.y);n.uniform3f(l,Q.x,Q.y,Q.z);n.disable(n.BLEND);
-n.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);a.state.activeTexture(n.TEXTURE0);a.state.bindTexture(n.TEXTURE_2D,w);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,K.x-8,K.y-8,16,16,0);n.uniform1i(c,1);n.disable(n.DEPTH_TEST);a.state.activeTexture(n.TEXTURE1);a.state.bindTexture(n.TEXTURE_2D,v);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);B.positionScreen.copy(Q);B.customUpdateCallback?B.customUpdateCallback(B):B.updateLensFlares();n.uniform1i(c,2);n.enable(n.BLEND);for(var T=
-0,O=B.lensFlares.length;T<O;T++){var R=B.lensFlares[T];.001<R.opacity&&.001<R.scale&&(Q.x=R.x,Q.y=R.y,Q.z=R.z,C=R.size*R.scale/E,G.x=C*x,G.y=C,n.uniform3f(l,Q.x,Q.y,Q.z),n.uniform2f(h,G.x,G.y),n.uniform1f(k,R.rotation),n.uniform1f(f,R.opacity),n.uniform3f(g,R.color.r,R.color.g,R.color.b),a.state.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),a.setTexture(R.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}n.enable(n.CULL_FACE);n.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,m,p,n,r,t,s,u,v,w;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var y=a.context,D,E,x,F,I=new THREE.Vector3,C=new THREE.Quaternion,G=new THREE.Vector3;this.render=function(Q,K){if(0!==b.length){if(void 0===x){var A=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]);D=y.createBuffer();E=y.createBuffer();y.bindBuffer(y.ARRAY_BUFFER,D);y.bufferData(y.ARRAY_BUFFER,A,y.STATIC_DRAW);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,
+A=m.createProgram(),H=m.createShader(m.FRAGMENT_SHADER),B=m.createShader(m.VERTEX_SHADER),T="precision "+a.getPrecision()+" float;\n";m.shaderSource(H,T+C.fragmentShader);m.shaderSource(B,T+C.vertexShader);m.compileShader(H);m.compileShader(B);m.attachShader(A,H);m.attachShader(A,B);m.linkProgram(A);q=A;n=m.getAttribLocation(q,"position");p=m.getAttribLocation(q,"uv");c=m.getUniformLocation(q,"renderType");d=m.getUniformLocation(q,"map");e=m.getUniformLocation(q,"occlusionMap");f=m.getUniformLocation(q,
+"opacity");g=m.getUniformLocation(q,"color");h=m.getUniformLocation(q,"scale");k=m.getUniformLocation(q,"rotation");l=m.getUniformLocation(q,"screenPosition")}m.useProgram(q);a.state.initAttributes();a.state.enableAttribute(n);a.state.enableAttribute(p);a.state.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,s);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,t);m.disable(m.CULL_FACE);
+m.depthMask(!1);A=0;for(H=b.length;A<H;A++)if(C=16/E,G.set(C*x,C),B=b[A],z.set(B.matrixWorld.elements[12],B.matrixWorld.elements[13],B.matrixWorld.elements[14]),z.applyMatrix4(y.matrixWorldInverse),z.applyProjection(y.projectionMatrix),Q.copy(z),K.x=Q.x*F+F,K.y=Q.y*I+I,u||0<K.x&&K.x<D&&0<K.y&&K.y<E){a.state.activeTexture(m.TEXTURE1);a.state.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,K.x-8,K.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,G.x,G.y);m.uniform3f(l,Q.x,Q.y,Q.z);m.disable(m.BLEND);
+m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);a.state.activeTexture(m.TEXTURE0);a.state.bindTexture(m.TEXTURE_2D,w);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,K.x-8,K.y-8,16,16,0);m.uniform1i(c,1);m.disable(m.DEPTH_TEST);a.state.activeTexture(m.TEXTURE1);a.state.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);B.positionScreen.copy(Q);B.customUpdateCallback?B.customUpdateCallback(B):B.updateLensFlares();m.uniform1i(c,2);m.enable(m.BLEND);for(var T=
+0,O=B.lensFlares.length;T<O;T++){var R=B.lensFlares[T];.001<R.opacity&&.001<R.scale&&(Q.x=R.x,Q.y=R.y,Q.z=R.z,C=R.size*R.scale/E,G.x=C*x,G.y=C,m.uniform3f(l,Q.x,Q.y,Q.z),m.uniform2f(h,G.x,G.y),m.uniform1f(k,R.rotation),m.uniform1f(f,R.opacity),m.uniform3f(g,R.color.r,R.color.g,R.color.b),a.state.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),a.setTexture(R.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
+THREE.SpritePlugin=function(a,b){var c,d,e,f,g,h,k,l,n,p,m,s,t,q,u,v,w;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var y=a.context,D,E,x,F,I=new THREE.Vector3,C=new THREE.Quaternion,G=new THREE.Vector3;this.render=function(Q,K){if(0!==b.length){if(void 0===x){var A=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]);D=y.createBuffer();E=y.createBuffer();y.bindBuffer(y.ARRAY_BUFFER,D);y.bufferData(y.ARRAY_BUFFER,A,y.STATIC_DRAW);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,
 E);y.bufferData(y.ELEMENT_ARRAY_BUFFER,H,y.STATIC_DRAW);var A=y.createProgram(),H=y.createShader(y.VERTEX_SHADER),B=y.createShader(y.FRAGMENT_SHADER);y.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"));
 y.shaderSource(B,["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"));
-y.compileShader(H);y.compileShader(B);y.attachShader(A,H);y.attachShader(A,B);y.linkProgram(A);x=A;v=y.getAttribLocation(x,"position");w=y.getAttribLocation(x,"uv");c=y.getUniformLocation(x,"uvOffset");d=y.getUniformLocation(x,"uvScale");e=y.getUniformLocation(x,"rotation");f=y.getUniformLocation(x,"scale");g=y.getUniformLocation(x,"color");h=y.getUniformLocation(x,"map");k=y.getUniformLocation(x,"opacity");l=y.getUniformLocation(x,"modelViewMatrix");m=y.getUniformLocation(x,"projectionMatrix");p=
-y.getUniformLocation(x,"fogType");n=y.getUniformLocation(x,"fogDensity");r=y.getUniformLocation(x,"fogNear");t=y.getUniformLocation(x,"fogFar");s=y.getUniformLocation(x,"fogColor");u=y.getUniformLocation(x,"alphaTest");A=document.createElement("canvas");A.width=8;A.height=8;H=A.getContext("2d");H.fillStyle="white";H.fillRect(0,0,8,8);F=new THREE.Texture(A);F.needsUpdate=!0}y.useProgram(x);a.state.initAttributes();a.state.enableAttribute(v);a.state.enableAttribute(w);a.state.disableUnusedAttributes();
-y.disable(y.CULL_FACE);y.enable(y.BLEND);y.bindBuffer(y.ARRAY_BUFFER,D);y.vertexAttribPointer(v,2,y.FLOAT,!1,16,0);y.vertexAttribPointer(w,2,y.FLOAT,!1,16,8);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,E);y.uniformMatrix4fv(m,!1,K.projectionMatrix.elements);a.state.activeTexture(y.TEXTURE0);y.uniform1i(h,0);H=A=0;(B=Q.fog)?(y.uniform3f(s,B.color.r,B.color.g,B.color.b),B instanceof THREE.Fog?(y.uniform1f(r,B.near),y.uniform1f(t,B.far),y.uniform1i(p,1),H=A=1):B instanceof THREE.FogExp2&&(y.uniform1f(n,B.density),
+y.compileShader(H);y.compileShader(B);y.attachShader(A,H);y.attachShader(A,B);y.linkProgram(A);x=A;v=y.getAttribLocation(x,"position");w=y.getAttribLocation(x,"uv");c=y.getUniformLocation(x,"uvOffset");d=y.getUniformLocation(x,"uvScale");e=y.getUniformLocation(x,"rotation");f=y.getUniformLocation(x,"scale");g=y.getUniformLocation(x,"color");h=y.getUniformLocation(x,"map");k=y.getUniformLocation(x,"opacity");l=y.getUniformLocation(x,"modelViewMatrix");n=y.getUniformLocation(x,"projectionMatrix");p=
+y.getUniformLocation(x,"fogType");m=y.getUniformLocation(x,"fogDensity");s=y.getUniformLocation(x,"fogNear");t=y.getUniformLocation(x,"fogFar");q=y.getUniformLocation(x,"fogColor");u=y.getUniformLocation(x,"alphaTest");A=document.createElement("canvas");A.width=8;A.height=8;H=A.getContext("2d");H.fillStyle="white";H.fillRect(0,0,8,8);F=new THREE.Texture(A);F.needsUpdate=!0}y.useProgram(x);a.state.initAttributes();a.state.enableAttribute(v);a.state.enableAttribute(w);a.state.disableUnusedAttributes();
+y.disable(y.CULL_FACE);y.enable(y.BLEND);y.bindBuffer(y.ARRAY_BUFFER,D);y.vertexAttribPointer(v,2,y.FLOAT,!1,16,0);y.vertexAttribPointer(w,2,y.FLOAT,!1,16,8);y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,E);y.uniformMatrix4fv(n,!1,K.projectionMatrix.elements);a.state.activeTexture(y.TEXTURE0);y.uniform1i(h,0);H=A=0;(B=Q.fog)?(y.uniform3f(q,B.color.r,B.color.g,B.color.b),B instanceof THREE.Fog?(y.uniform1f(s,B.near),y.uniform1f(t,B.far),y.uniform1i(p,1),H=A=1):B instanceof THREE.FogExp2&&(y.uniform1f(m,B.density),
 y.uniform1i(p,2),H=A=2)):(y.uniform1i(p,0),H=A=0);for(var B=0,T=b.length;B<T;B++){var O=b[B];O._modelViewMatrix.multiplyMatrices(K.matrixWorldInverse,O.matrixWorld);O.z=-O._modelViewMatrix.elements[14]}b.sort(z);for(var R=[],B=0,T=b.length;B<T;B++){var O=b[B],P=O.material;y.uniform1f(u,P.alphaTest);y.uniformMatrix4fv(l,!1,O._modelViewMatrix.elements);O.matrixWorld.decompose(I,C,G);R[0]=G.x;R[1]=G.y;O=0;Q.fog&&P.fog&&(O=H);A!==O&&(y.uniform1i(p,O),A=O);null!==P.map?(y.uniform2f(c,P.map.offset.x,P.map.offset.y),
 y.uniform2f(d,P.map.repeat.x,P.map.repeat.y)):(y.uniform2f(c,0,0),y.uniform2f(d,1,1));y.uniform1f(k,P.opacity);y.uniform3f(g,P.color.r,P.color.g,P.color.b);y.uniform1f(e,P.rotation);y.uniform2fv(f,R);a.state.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst);a.state.setDepthTest(P.depthTest);a.state.setDepthWrite(P.depthWrite);P.map&&P.map.image&&P.map.image.width?a.setTexture(P.map,0):a.setTexture(F,0);y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)}y.enable(y.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);e.load(a,function(a){f.image=a;f.needsUpdate=!0;c&&c(f)},void 0,function(a){d&&d(a)});f.sourceFile=a;return f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a;g+=1;6===g&&(f.needsUpdate=!0,c&&
 c(f))},void 0,d)};for(var h=0,k=a.length;h<k;++h)b(h);return f},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");
-f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,m=0;m<d;m++)for(var p=0;p<e;p++){var n=0>p-1?0:p-1,r=p+1>e-1?e-1:p+1,t=0>m-1?0:m-1,s=m+1>d-1?d-1:m+1,u=[],v=[0,0,h[4*(p*d+m)]/255*b];u.push([-1,0,h[4*(p*d+t)]/255*b]);u.push([-1,-1,h[4*(n*d+t)]/255*b]);u.push([0,-1,h[4*(n*d+m)]/255*b]);u.push([1,-1,h[4*(n*d+s)]/255*b]);u.push([1,0,h[4*(p*d+s)]/255*b]);u.push([1,1,h[4*(r*d+s)]/255*b]);u.push([0,1,h[4*(r*d+m)]/255*
-b]);u.push([-1,1,h[4*(r*d+t)]/255*b]);n=[];t=u.length;for(r=0;r<t;r++){var s=u[r],w=u[(r+1)%t],s=[s[0]-v[0],s[1]-v[1],s[2]-v[2]],w=[w[0]-v[0],w[1]-v[1],w[2]-v[2]];n.push(c([s[1]*w[2]-s[2]*w[1],s[2]*w[0]-s[0]*w[2],s[0]*w[1]-s[1]*w[0]]))}u=[0,0,0];for(r=0;r<n.length;r++)u[0]+=n[r][0],u[1]+=n[r][1],u[2]+=n[r][2];u[0]/=n.length;u[1]/=n.length;u[2]/=n.length;v=4*(p*d+m);l[v]=(u[0]+1)/2*255|0;l[v+1]=(u[1]+1)/2*255|0;l[v+2]=255*u[2]|0;l[v+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
+f.width=d;f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,k=g.createImageData(d,e),l=k.data,n=0;n<d;n++)for(var p=0;p<e;p++){var m=0>p-1?0:p-1,s=p+1>e-1?e-1:p+1,t=0>n-1?0:n-1,q=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*(m*d+t)]/255*b]);u.push([0,-1,h[4*(m*d+n)]/255*b]);u.push([1,-1,h[4*(m*d+q)]/255*b]);u.push([1,0,h[4*(p*d+q)]/255*b]);u.push([1,1,h[4*(s*d+q)]/255*b]);u.push([0,1,h[4*(s*d+n)]/255*
+b]);u.push([-1,1,h[4*(s*d+t)]/255*b]);m=[];t=u.length;for(s=0;s<t;s++){var q=u[s],w=u[(s+1)%t],q=[q[0]-v[0],q[1]-v[1],q[2]-v[2]],w=[w[0]-v[0],w[1]-v[1],w[2]-v[2]];m.push(c([q[1]*w[2]-q[2]*w[1],q[2]*w[0]-q[0]*w[2],q[0]*w[1]-q[1]*w[0]]))}u=[0,0,0];for(s=0;s<m.length;s++)u[0]+=m[s][0],u[1]+=m[s][1],u[2]+=m[s][2];u[0]/=m.length;u[1]/=m.length;u[2]/=m.length;v=4*(p*d+n);l[v]=(u[0]+1)/2*255|0;l[v+1]=(u[1]+1)/2*255|0;l[v+2]=255*u[2]|0;l[v+3]=255}g.putImageData(k,0,0);return f},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),g=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing.";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=
-a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,m,p,n,r,t,s,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;m=b[a++]*c;e.moveTo(k,m);
-break;case "l":k=b[a++]*c+d;m=b[a++]*c;e.lineTo(k,m);break;case "q":k=b[a++]*c+d;m=b[a++]*c;r=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(r,t,k,m);if(g=f[f.length-1])for(p=g.x,n=g.y,g=1,h=this.divisions;g<=h;g++){var w=g/h;THREE.Shape.Utils.b2(w,p,r,k);THREE.Shape.Utils.b2(w,n,t,m)}break;case "b":if(k=b[a++]*c+d,m=b[a++]*c,r=b[a++]*c+d,t=b[a++]*c,s=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(r,t,s,u,k,m),g=f[f.length-1])for(p=g.x,n=g.y,g=1,h=this.divisions;g<=h;g++)w=g/h,THREE.Shape.Utils.b3(w,p,r,s,k),THREE.Shape.Utils.b3(w,
-n,t,u,m)}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(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,n,p,m,s,t,q,u,v=b.glyphs[a]||b.glyphs["?"];if(v){if(v.o)for(b=v._cachedOutline||(v._cachedOutline=v.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
+break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;s=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(s,t,k,n);if(g=f[f.length-1])for(p=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++){var w=g/h;THREE.Shape.Utils.b2(w,p,s,k);THREE.Shape.Utils.b2(w,m,t,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,s=b[a++]*c+d,t=b[a++]*c,q=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(s,t,q,u,k,n),g=f[f.length-1])for(p=g.x,m=g.y,g=1,h=this.divisions;g<=h;g++)w=g/h,THREE.Shape.Utils.b3(w,p,s,q,k),THREE.Shape.Utils.b3(w,
+m,t,u,n)}return{offset:v.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,m;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var n;a:{var r=n=void 0,t=void 0,s=void 0,
-u=void 0,v=void 0,w=void 0,z=void 0,y=void 0,r=a[g[k]].x,t=a[g[k]].y,s=a[g[l]].x,u=a[g[l]].y,v=a[g[m]].x,w=a[g[m]].y;if(1E-10>(s-r)*(w-t)-(u-t)*(v-r))n=!1;else{var D=void 0,E=void 0,x=void 0,F=void 0,I=void 0,C=void 0,G=void 0,Q=void 0,K=void 0,A=void 0,K=Q=G=y=z=void 0,D=v-s,E=w-u,x=r-v,F=t-w,I=s-r,C=u-t;for(n=0;n<e;n++)if(z=a[g[n]].x,y=a[g[n]].y,!(z===r&&y===t||z===s&&y===u||z===v&&y===w)&&(G=z-r,Q=y-t,K=z-s,A=y-u,z-=v,y-=w,K=D*A-E*K,G=I*Q-C*G,Q=x*y-F*z,-1E-10<=K&&-1E-10<=Q&&-1E-10<=G)){n=!1;break a}n=
-!0}}if(n){f.push([a[g[k]],a[g[l]],a[g[m]]]);h.push([g[k],g[l],g[m]]);k=l;for(m=l+1;m<e;k++,m++)g[k]=g[m];e--;p=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var m;a:{var s=m=void 0,t=void 0,q=void 0,
+u=void 0,v=void 0,w=void 0,z=void 0,y=void 0,s=a[g[k]].x,t=a[g[k]].y,q=a[g[l]].x,u=a[g[l]].y,v=a[g[n]].x,w=a[g[n]].y;if(1E-10>(q-s)*(w-t)-(u-t)*(v-s))m=!1;else{var D=void 0,E=void 0,x=void 0,F=void 0,I=void 0,C=void 0,G=void 0,Q=void 0,K=void 0,A=void 0,K=Q=G=y=z=void 0,D=v-q,E=w-u,x=s-v,F=t-w,I=q-s,C=u-t;for(m=0;m<e;m++)if(z=a[g[m]].x,y=a[g[m]].y,!(z===s&&y===t||z===q&&y===u||z===v&&y===w)&&(G=z-s,Q=y-t,K=z-q,A=y-u,z-=v,y-=w,K=D*A-E*K,G=I*Q-C*G,Q=x*y-F*z,-1E-10<=K&&-1E-10<=Q&&-1E-10<=G)){m=!1;break a}m=
+!0}}if(m){f.push([a[g[k]],a[g[l]],a[g[n]]]);h.push([g[k],g[l],g[n]]);k=l;for(n=l+1;n<e;k++,n++)g[k]=g[n];e--;p=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);THREE.Audio.prototype.constructor=THREE.Audio;
 THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
 THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{var a=this.context.createBufferSource();a.buffer=this.source.buffer;a.loop=this.source.loop;a.onended=this.source.onended;a.connect(this.panner);a.start(0,this.startTime);this.isPlaying=!0;this.source=a}};THREE.Audio.prototype.pause=function(){this.source.stop();this.startTime=this.context.currentTime};THREE.Audio.prototype.stop=function(){this.source.stop();this.startTime=0};
@@ -655,7 +655,7 @@ THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)
 THREE.Curve.create=function(a,b){a.prototype=Object.create(THREE.Curve.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=!1};THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype);THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};
 THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a};
-THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,m,p=a[0]instanceof THREE.Vector3;m=p?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),p&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),m.add(h);a={minX:e,minY:f,maxX:b,maxY:c};p&&(a.maxZ=d,a.minZ=g);return a};
+THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,f,g;b=c=Number.NEGATIVE_INFINITY;e=f=Number.POSITIVE_INFINITY;var h,k,l,n,p=a[0]instanceof THREE.Vector3;n=p?new THREE.Vector3:new THREE.Vector2;k=0;for(l=a.length;k<l;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<f&&(f=h.y),p&&(h.z>d?d=h.z:h.z<g&&(g=h.z)),n.add(h);a={minX:e,minY:f,maxX:b,maxY:c};p&&(a.maxZ=d,a.minZ=g);return a};
 THREE.CurvePath.prototype.createPointsGeometry=function(a){a=this.getPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){a=this.getSpacedPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vector3(a[c].x,a[c].y,a[c].z||0));return b};THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)};
 THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};
 THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,f,g,h,k;d=0;for(e=a.length;d<e;d++)f=a[d],g=f.x,h=f.y,k=g/c.maxX,k=b.getUtoTmapping(k,g),g=b.getPoint(k),k=b.getTangent(k),k.set(-k.y,k.x).multiplyScalar(h),f.x=g.x+k.x,f.y=g.y+k.y;return a};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);THREE.Gyroscope.prototype.constructor=THREE.Gyroscope;
@@ -668,22 +668,22 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};
 THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,m,p,n,r,t,s;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];p=f[0];n=f[1];0<c.length?(g=c[c.length-1],r=g.x,
-t=g.y):(g=this.actions[d-1].args,r=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b2(s,r,p,h),s=THREE.Shape.Utils.b2(s,t,n,k),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];p=f[0];n=f[1];l=f[2];m=f[3];0<c.length?(g=c[c.length-1],r=g.x,t=g.y):(g=this.actions[d-1].args,r=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)s=f/a,g=THREE.Shape.Utils.b3(s,r,p,l,h),s=THREE.Shape.Utils.b3(s,t,n,m,k),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.CSPLINE_THRU:g=
-this.actions[d-1].args;s=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;s=s.concat(f[0]);s=new THREE.SplineCurve(s);for(f=1;f<=g;f++)c.push(s.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];n=f[2];l=f[3];g=f[4];p=!!f[5];r=g-l;t=2*a;for(f=1;f<=t;f++)s=f/t,p||(s=1-s),s=l+s*r,g=h+n*Math.cos(s),s=k+n*Math.sin(s),c.push(new THREE.Vector2(g,s));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],n=f[2],m=f[3],l=f[4],g=f[5],p=!!f[6],r=g-l,t=2*a,f=1;f<=t;f++)s=f/t,p||
-(s=1-s),s=l+s*r,g=h+n*Math.cos(s),s=k+m*Math.sin(s),c.push(new THREE.Vector2(g,s))}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,n=h.y-g.y;if(1E-10<Math.abs(n)){if(0>n&&(g=b[f],k=-k,h=b[e],n=-n),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=n*(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.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,f,g,h,k,l,n,p,m,s,t,q;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],g=f.action,f=f.args,g){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=f[2];k=f[3];p=f[0];m=f[1];0<c.length?(g=c[c.length-1],s=g.x,
+t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)q=f/a,g=THREE.Shape.Utils.b2(q,s,p,h),q=THREE.Shape.Utils.b2(q,t,m,k),c.push(new THREE.Vector2(g,q));break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];k=f[5];p=f[0];m=f[1];l=f[2];n=f[3];0<c.length?(g=c[c.length-1],s=g.x,t=g.y):(g=this.actions[d-1].args,s=g[g.length-2],t=g[g.length-1]);for(f=1;f<=a;f++)q=f/a,g=THREE.Shape.Utils.b3(q,s,p,l,h),q=THREE.Shape.Utils.b3(q,t,m,n,k),c.push(new THREE.Vector2(g,q));break;case THREE.PathActions.CSPLINE_THRU:g=
+this.actions[d-1].args;q=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;q=q.concat(f[0]);q=new THREE.SplineCurve(q);for(f=1;f<=g;f++)c.push(q.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];k=f[1];m=f[2];l=f[3];g=f[4];p=!!f[5];s=g-l;t=2*a;for(f=1;f<=t;f++)q=f/t,p||(q=1-q),q=l+q*s,g=h+m*Math.cos(q),q=k+m*Math.sin(q),c.push(new THREE.Vector2(g,q));break;case THREE.PathActions.ELLIPSE:for(h=f[0],k=f[1],m=f[2],n=f[3],l=f[4],g=f[5],p=!!f[6],s=g-l,t=2*a,f=1;f<=t;f++)q=f/t,p||
+(q=1-q),q=l+q*s,g=h+m*Math.cos(q),q=k+n*Math.sin(q),c.push(new THREE.Vector2(g,q))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
+THREE.Path.prototype.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,m=h.y-g.y;if(1E-10<Math.abs(m)){if(0>m&&(g=b[f],k=-k,h=b[e],m=-m),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&
 a.x<=h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d===THREE.PathActions.MOVE_TO&&0!==g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!==g.actions.length&&f.push(g);return f}(this.actions);if(0===e.length)return[];if(!0===b)return c(e);var f,g,h,k=[];if(1===e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),
-l=a?!l:l;h=[];var m=[],p=[],n=0,r;m[n]=void 0;p[n]=[];var t,s;t=0;for(s=e.length;t<s;t++)g=e[t],r=g.getPoints(),f=THREE.Shape.Utils.isClockWise(r),(f=a?!f:f)?(!l&&m[n]&&n++,m[n]={s:new THREE.Shape,p:r},m[n].s.actions=g.actions,m[n].s.curves=g.curves,l&&n++,p[n]=[]):p[n].push({h:g,p:r[0]});if(!m[0])return c(e);if(1<m.length){t=!1;s=[];g=0;for(e=m.length;g<e;g++)h[g]=[];g=0;for(e=m.length;g<e;g++)for(f=p[g],l=0;l<f.length;l++){n=f[l];r=!0;for(var u=0;u<m.length;u++)d(n.p,m[u].p)&&(g!==u&&s.push({froms:g,
-tos:u,hole:l}),r?(r=!1,h[u].push(n)):t=!0);r&&h[g].push(n)}0<s.length&&(t||(p=h))}t=0;for(s=m.length;t<s;t++)for(h=m[t].s,k.push(h),g=p[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
+l=a?!l:l;h=[];var n=[],p=[],m=0,s;n[m]=void 0;p[m]=[];var t,q;t=0;for(q=e.length;t<q;t++)g=e[t],s=g.getPoints(),f=THREE.Shape.Utils.isClockWise(s),(f=a?!f:f)?(!l&&n[m]&&m++,n[m]={s:new THREE.Shape,p:s},n[m].s.actions=g.actions,n[m].s.curves=g.curves,l&&m++,p[m]=[]):p[m].push({h:g,p:s[0]});if(!n[0])return c(e);if(1<n.length){t=!1;q=[];g=0;for(e=n.length;g<e;g++)h[g]=[];g=0;for(e=n.length;g<e;g++)for(f=p[g],l=0;l<f.length;l++){m=f[l];s=!0;for(var u=0;u<n.length;u++)d(m.p,n[u].p)&&(g!==u&&q.push({froms:g,
+tos:u,hole:l}),s?(s=!1,h[u].push(m)):t=!0);s&&h[g].push(m)}0<q.length&&(t||(p=h))}t=0;for(q=n.length;t<q;t++)for(h=n[t].s,k.push(h),g=p[t],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,m=a.x-d.x,p=a.y-d.y,x=h*k-g*l,F=h*m-g*p;if(1E-10<Math.abs(x)){if(0<x){if(0>F||F>x)return[];k=l*m-k*p;if(0>k||k>x)return[]}else{if(0<F||F<x)return[];k=l*m-k*p;if(0<k||k<x)return[]}if(0===k)return!f||0!==F&&F!==x?[a]:[];if(k===x)return!f||0!==F&&F!==x?[b]:[];if(0===
-F)return[d];if(F===x)return[e];f=k/x;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==F||l*m!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,x=d.x,l=e,d=e.x):(b=e,x=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,x=d.y,l=e,d=e.y):(b=e,x=e.y,l=d,d=d.y));return k<=x?a<x?[]:a===x?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
-k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,m={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==m[l]&&console.warn("THREE.Shape: Duplicate point",l),m[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
-0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],m,p,E,x,F,I=[],C,G,Q,K=0;for(m=b.length;K<m;K++)l.push(K);C=0;for(var A=2*
-l.length;0<l.length;){A--;if(0>A){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=C;p<h.length;p++){E=h[p];m=-1;for(K=0;K<l.length;K++)if(x=l[K],F=E.x+":"+E.y+":"+x,void 0===I[F]){k=b[x];for(G=0;G<k.length;G++)if(x=k[G],c(p,G)&&!f(E,x)&&!g(E,x)){m=G;l.splice(K,1);C=h.slice(0,p+1);x=h.slice(p);G=k.slice(m);Q=k.slice(0,m+1);h=C.concat(G).concat(Q).concat(x);C=p;break}if(0<=m)break;I[F]=!0}if(0<=m)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(f,
-!1);f=0;for(g=p.length;f<g;f++)for(k=p[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=m[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,x=h*k-g*l,F=h*n-g*p;if(1E-10<Math.abs(x)){if(0<x){if(0>F||F>x)return[];k=l*n-k*p;if(0>k||k>x)return[]}else{if(0<F||F<x)return[];k=l*n-k*p;if(0<k||k<x)return[]}if(0===k)return!f||0!==F&&F!==x?[a]:[];if(k===x)return!f||0!==F&&F!==x?[b]:[];if(0===
+F)return[d];if(F===x)return[e];f=k/x;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==F||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,x=d.x,l=e,d=e.x):(b=e,x=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,x=d.y,l=e,d=e.y):(b=e,x=e.y,l=d,d=d.y));return k<=x?a<x?[]:a===x?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
+k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,n={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==n[l]&&console.warn("THREE.Shape: Duplicate point",l),n[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
+0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,E,x,F,I=[],C,G,Q,K=0;for(n=b.length;K<n;K++)l.push(K);C=0;for(var A=2*
+l.length;0<l.length;){A--;if(0>A){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=C;p<h.length;p++){E=h[p];n=-1;for(K=0;K<l.length;K++)if(x=l[K],F=E.x+":"+E.y+":"+x,void 0===I[F]){k=b[x];for(G=0;G<k.length;G++)if(x=k[G],c(p,G)&&!f(E,x)&&!g(E,x)){n=G;l.splice(K,1);C=h.slice(0,p+1);x=h.slice(p);G=k.slice(n);Q=k.slice(0,n+1);h=C.concat(G).concat(Q).concat(x);C=p;break}if(0<=n)break;I[F]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(f,
+!1);f=0;for(g=p.length;f<g;f++)for(k=p[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=n[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
 a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
 THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
 THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return b};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);return b.normalize()};
@@ -696,9 +696,9 @@ THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1
 THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b=new THREE.Vector3;b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return b});
 THREE.SplineCurve3=THREE.Curve.create(function(a){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3");this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,
 b.z,a);return c});
-THREE.CatmullRomCurve3=function(){function a(){}var b=new THREE.Vector3,c=new a,d=new a,e=new a;a.prototype.init=function(a,b,c,d){this.c0=a;this.c1=c;this.c2=-3*a+3*b-2*c-d;this.c3=2*a-2*b+c+d};a.prototype.initNonuniformCatmullRom=function(a,b,c,d,e,m,p){a=((b-a)/e-(c-a)/(e+m)+(c-b)/m)*m;d=((c-b)/m-(d-b)/(m+p)+(d-c)/p)*m;this.init(b,c,a,d)};a.prototype.initCatmullRom=function(a,b,c,d,e){this.init(b,c,e*(c-a),e*(d-b))};a.prototype.calc=function(a){var b=a*a;return this.c0+this.c1*a+this.c2*b+this.c3*
-b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var g=this.points,h,k;k=g.length;2>k&&console.log("duh, you need at least 2 points");a*=k-1;h=Math.floor(a);a-=h;0===a&&h===k-1&&(h=k-2,a=1);var l,m,p;0===h?(b.subVectors(g[0],g[1]).add(g[0]),l=b):l=g[h-1];m=g[h];p=g[h+1];h+2<k?g=g[h+2]:(b.subVectors(g[k-1],g[k-2]).add(g[k-2]),g=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var n="chordal"===this.type?.5:.25;k=Math.pow(l.distanceToSquared(m),n);
-h=Math.pow(m.distanceToSquared(p),n);n=Math.pow(p.distanceToSquared(g),n);1E-4>h&&(h=1);1E-4>k&&(k=h);1E-4>n&&(n=h);c.initNonuniformCatmullRom(l.x,m.x,p.x,g.x,k,h,n);d.initNonuniformCatmullRom(l.y,m.y,p.y,g.y,k,h,n);e.initNonuniformCatmullRom(l.z,m.z,p.z,g.z,k,h,n)}else"catmullrom"===this.type&&(k=void 0!==this.tension?this.tension:.5,c.initCatmullRom(l.x,m.x,p.x,g.x,k),d.initCatmullRom(l.y,m.y,p.y,g.y,k),e.initCatmullRom(l.z,m.z,p.z,g.z,k));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}();
+THREE.CatmullRomCurve3=function(){function a(){}var b=new THREE.Vector3,c=new a,d=new a,e=new a;a.prototype.init=function(a,b,c,d){this.c0=a;this.c1=c;this.c2=-3*a+3*b-2*c-d;this.c3=2*a-2*b+c+d};a.prototype.initNonuniformCatmullRom=function(a,b,c,d,e,n,p){a=((b-a)/e-(c-a)/(e+n)+(c-b)/n)*n;d=((c-b)/n-(d-b)/(n+p)+(d-c)/p)*n;this.init(b,c,a,d)};a.prototype.initCatmullRom=function(a,b,c,d,e){this.init(b,c,e*(c-a),e*(d-b))};a.prototype.calc=function(a){var b=a*a;return this.c0+this.c1*a+this.c2*b+this.c3*
+b*a};return THREE.Curve.create(function(a){this.points=a||[]},function(a){var g=this.points,h,k;k=g.length;2>k&&console.log("duh, you need at least 2 points");a*=k-1;h=Math.floor(a);a-=h;0===a&&h===k-1&&(h=k-2,a=1);var l,n,p;0===h?(b.subVectors(g[0],g[1]).add(g[0]),l=b):l=g[h-1];n=g[h];p=g[h+1];h+2<k?g=g[h+2]:(b.subVectors(g[k-1],g[k-2]).add(g[k-2]),g=b);if(void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var m="chordal"===this.type?.5:.25;k=Math.pow(l.distanceToSquared(n),m);
+h=Math.pow(n.distanceToSquared(p),m);m=Math.pow(p.distanceToSquared(g),m);1E-4>h&&(h=1);1E-4>k&&(k=h);1E-4>m&&(m=h);c.initNonuniformCatmullRom(l.x,n.x,p.x,g.x,k,h,m);d.initNonuniformCatmullRom(l.y,n.y,p.y,g.y,k,h,m);e.initNonuniformCatmullRom(l.z,n.z,p.z,g.z,k,h,m)}else"catmullrom"===this.type&&(k=void 0!==this.tension?this.tension:.5,c.initCatmullRom(l.x,n.x,p.x,g.x,k),d.initCatmullRom(l.y,n.y,p.y,g.y,k),e.initCatmullRom(l.z,n.z,p.z,g.z,k));return new THREE.Vector3(c.calc(a),d.calc(a),e.calc(a))})}();
 THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0<c?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],f=b[(c+1)%b.length],b=b[(c+2)%b.length],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a);return c});
 THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){console.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){console.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){console.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(a){if(!0===a.initialized)return a;for(var b=0;b<a.hierarchy.length;b++){for(var c=0;c<a.hierarchy[b].keys.length;c++)if(0>a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time=
 0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;c<a.hierarchy[b].keys.length;c++)for(var e=0;e<a.hierarchy[b].keys[c].morphTargets.length;e++){var f=a.hierarchy[b].keys[c].morphTargets[e];d[f]=-1}a.hierarchy[b].usedMorphTargets=d;for(c=0;c<a.hierarchy[b].keys.length;c++){var g=
@@ -707,12 +707,12 @@ THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(
 for(b=0;b<this.animations.length;b++)this.animations[b].update(a)}};THREE.Animation=function(a,b){this.root=a;this.data=THREE.AnimationHandler.init(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=!0;this.weight=0;this.interpolationType=THREE.AnimationHandler.LINEAR};
 THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","scl"],play:function(a,b){this.currentTime=void 0!==a?a:0;this.weight=void 0!==b?b:1;this.isPlaying=!0;this.reset();THREE.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1;THREE.AnimationHandler.stop(this)},reset:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});
 var d=this.data.name,e=c.animationCache.animations,f=e[d];void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f);for(c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(d,a,1);g.time<this.currentTime&&g.index>e.index;)e=g,g=this.getNextKeyWith(d,a,g.index+1);f.prevKey[d]=e;f.nextKey[d]=g}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a].animationCache;void 0!==
-c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,n,r,t,s;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];r=a[c[1]];t=a[c[2]];s=a[c[3]];c=e*e;n=e*c;d[0]=f(p[0],r[0],t[0],s[0],e,c,n);d[1]=f(p[1],r[1],t[1],s[1],e,c,n);d[2]=f(p[2],r[2],t[2],s[2],e,c,n);return d},f=function(a,b,c,d,
-e,f,n){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*n+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],m=k.animationCache.blending,p=0;3>p;p++){var n=this.keyTypes[p],
-r=l.prevKey[n],t=l.nextKey[n];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&r.time>=this.currentTime){r=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(n,f,1);t.time<this.currentTime&&t.index>r.index;)r=t,t=this.getNextKeyWith(n,f,t.index+1);l.prevKey[n]=r;l.nextKey[n]=t}var s=(this.currentTime-r.time)/(t.time-r.time),u=r[n],v=t[n];0>s&&(s=0);1<s&&(s=1);if("pos"===n)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*s,c.y=u[1]+(v[1]-u[1])*s,
-c.z=u[2]+(v[2]-u[2])*s,r=this.weight/(this.weight+m.positionWeight),k.position.lerp(c,r),m.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,r.index-1).pos,a[1]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,s=.33*s+.33,t=e(a,s),r=this.weight/(this.weight+m.positionWeight),m.positionWeight+=this.weight,n=k.position,n.x+=(t[0]-n.x)*r,n.y+=(t[1]-
-n.y)*r,n.z+=(t[2]-n.z)*r,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(n),b.y=0,b.normalize(),s=Math.atan2(b.x,b.z),k.rotation.set(0,s,0))}else"rot"===n?(THREE.Quaternion.slerp(u,v,d,s),0===m.quaternionWeight?(k.quaternion.copy(d),m.quaternionWeight=this.weight):(r=this.weight/(this.weight+m.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,r),m.quaternionWeight+=this.weight)):"scl"===n&&(c.x=u[0]+(v[0]-u[0])*s,c.y=
-u[1]+(v[1]-u[1])*s,c.z=u[2]+(v[2]-u[2])*s,r=this.weight/(this.weight+m.scaleWeight),k.scale.lerp(c,r),m.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
+c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,m,s,t,q;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];s=a[c[1]];t=a[c[2]];q=a[c[3]];c=e*e;m=e*c;d[0]=f(p[0],s[0],t[0],q[0],e,c,m);d[1]=f(p[1],s[1],t[1],q[1],e,c,m);d[2]=f(p[2],s[2],t[2],q[2],e,c,m);return d},f=function(a,b,c,d,
+e,f,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;f<h;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],n=k.animationCache.blending,p=0;3>p;p++){var m=this.keyTypes[p],
+s=l.prevKey[m],t=l.nextKey[m];if(0<this.timeScale&&t.time<=this.currentTime||0>this.timeScale&&s.time>=this.currentTime){s=this.data.hierarchy[f].keys[0];for(t=this.getNextKeyWith(m,f,1);t.time<this.currentTime&&t.index>s.index;)s=t,t=this.getNextKeyWith(m,f,t.index+1);l.prevKey[m]=s;l.nextKey[m]=t}var q=(this.currentTime-s.time)/(t.time-s.time),u=s[m],v=t[m];0>q&&(q=0);1<q&&(q=1);if("pos"===m)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(v[0]-u[0])*q,c.y=u[1]+(v[1]-u[1])*q,
+c.z=u[2]+(v[2]-u[2])*q,s=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,s),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,s.index-1).pos,a[1]=u,a[2]=v,a[3]=this.getNextKeyWith("pos",f,t.index+1).pos,q=.33*q+.33,t=e(a,q),s=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,m=k.position,m.x+=(t[0]-m.x)*s,m.y+=(t[1]-
+m.y)*s,m.z+=(t[2]-m.z)*s,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(q=e(a,1.01*q),b.set(q[0],q[1],q[2]),b.sub(m),b.y=0,b.normalize(),q=Math.atan2(b.x,b.z),k.rotation.set(0,q,0))}else"rot"===m?(THREE.Quaternion.slerp(u,v,d,q),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(s=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,s),n.quaternionWeight+=this.weight)):"scl"===m&&(c.x=u[0]+(v[0]-u[0])*q,c.y=
+u[1]+(v[1]-u[1])*q,c.z=u[2]+(v[2]-u[2])*q,s=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,s),n.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
 this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]}};
 THREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],g=this.getNextKeyWith(f,a,0);g&&g.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
@@ -723,75 +723,75 @@ f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld
 THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
 1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);c[b]=this.currentTime%a/a;c[this.lastFrame]=1-c[b]}}};
-THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g){var s,u=h.widthSegments,v=h.heightSegments,w=e/2,z=f/2,y=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)s="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)s="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)s="x",u=h.depthSegments;var D=u+1,E=v+1,x=e/u,F=f/v,I=new THREE.Vector3;I[s]=0<g?1:-1;for(e=0;e<E;e++)for(f=0;f<D;f++){var C=new THREE.Vector3;C[a]=(f*x-w)*c;C[b]=(e*F-z)*d;C[s]=g;h.vertices.push(C)}for(e=0;e<
-v;e++)for(f=0;f<u;f++)z=f+D*e,a=f+D*(e+1),b=f+1+D*(e+1),c=f+1+D*e,d=new THREE.Vector2(f/u,1-e/v),g=new THREE.Vector2(f/u,1-(e+1)/v),s=new THREE.Vector2((f+1)/u,1-(e+1)/v),w=new THREE.Vector2((f+1)/u,1-e/v),z=new THREE.Face3(z+y,a+y,c+y),z.normal.copy(I),z.vertexNormals.push(I.clone(),I.clone(),I.clone()),h.faces.push(z),h.faceVertexUvs[0].push([d,g,w]),z=new THREE.Face3(a+y,b+y,c+y),z.normal.copy(I),z.vertexNormals.push(I.clone(),I.clone(),I.clone()),h.faces.push(z),h.faceVertexUvs[0].push([g.clone(),
-s,w.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d);g("z","y",1,-1,c,b,-d);g("x","z",1,1,a,c,e);g("x","z",1,-1,a,c,-e);g("x","y",1,-1,a,b,f);g("x","y",-1,-1,a,b,-f);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g){var q,u=h.widthSegments,v=h.heightSegments,w=e/2,z=f/2,y=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)q="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)q="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)q="x",u=h.depthSegments;var D=u+1,E=v+1,x=e/u,F=f/v,I=new THREE.Vector3;I[q]=0<g?1:-1;for(e=0;e<E;e++)for(f=0;f<D;f++){var C=new THREE.Vector3;C[a]=(f*x-w)*c;C[b]=(e*F-z)*d;C[q]=g;h.vertices.push(C)}for(e=0;e<
+v;e++)for(f=0;f<u;f++)z=f+D*e,a=f+D*(e+1),b=f+1+D*(e+1),c=f+1+D*e,d=new THREE.Vector2(f/u,1-e/v),g=new THREE.Vector2(f/u,1-(e+1)/v),q=new THREE.Vector2((f+1)/u,1-(e+1)/v),w=new THREE.Vector2((f+1)/u,1-e/v),z=new THREE.Face3(z+y,a+y,c+y),z.normal.copy(I),z.vertexNormals.push(I.clone(),I.clone(),I.clone()),h.faces.push(z),h.faceVertexUvs[0].push([d,g,w]),z=new THREE.Face3(a+y,b+y,c+y),z.normal.copy(I),z.vertexNormals.push(I.clone(),I.clone(),I.clone()),h.faces.push(z),h.faceVertexUvs[0].push([g.clone(),
+q,w.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d);g("z","y",1,-1,c,b,-d);g("x","z",1,1,a,c,e);g("x","z",1,-1,a,c,-e);g("x","y",1,-1,a,b,f);g("x","y",-1,-1,a,b,-f);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.CubeGeometry=THREE.BoxGeometry;
 THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
-THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,f=new Float32Array(3*e),g=new Float32Array(3*e),e=new Float32Array(2*e);g[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var m=c+h/b*d;f[k]=a*Math.cos(m);f[k+1]=a*Math.sin(m);g[k+2]=1;e[l]=(f[k]/a+1)/2;e[l+1]=(f[k+1]/a+1)/2}c=
+THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,f=new Float32Array(3*e),g=new Float32Array(3*e),e=new Float32Array(2*e);g[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var n=c+h/b*d;f[k]=a*Math.cos(n);f[k+1]=a*Math.sin(n);g[k+2]=1;e[l]=(f[k]/a+1)/2;e[l+1]=(f[k+1]/a+1)/2}c=
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(f,3));this.addAttribute("normal",new THREE.BufferAttribute(g,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
-THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,m,p=[],n=[];for(m=0;m<=e;m++){var r=[],t=[],s=m/e,u=s*(b-a)+a;for(l=0;l<=d;l++){var v=l/d,w=new THREE.Vector3;w.x=u*Math.sin(v*h+
-g);w.y=-s*c+k;w.z=u*Math.cos(v*h+g);this.vertices.push(w);r.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-s))}p.push(r);n.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(g=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var r=p[m][l],t=p[m+1][l],s=p[m+1][l+1],u=p[m][l+1],v=g.clone(),w=g.clone(),
-z=h.clone(),y=h.clone(),D=n[m][l].clone(),E=n[m+1][l].clone(),x=n[m+1][l+1].clone(),F=n[m][l+1].clone();this.faces.push(new THREE.Face3(r,t,u,[v,w,y]));this.faceVertexUvs[0].push([D,E,F]);this.faces.push(new THREE.Face3(t,s,u,[w.clone(),z,y.clone()]));this.faceVertexUvs[0].push([E.clone(),x,F.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)r=p[0][l],t=p[0][l+1],s=this.vertices.length-1,v=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
-1,0),D=n[0][l].clone(),E=n[0][l+1].clone(),x=new THREE.Vector2(E.x,0),this.faces.push(new THREE.Face3(r,t,s,[v,w,z])),this.faceVertexUvs[0].push([D,E,x]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)r=p[e][l+1],t=p[e][l],s=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),D=n[e][l+1].clone(),E=n[e][l].clone(),x=new THREE.Vector2(E.x,1),this.faces.push(new THREE.Face3(r,t,s,[v,w,z])),this.faceVertexUvs[0].push([D,
+THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;g=void 0!==g?g:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,n,p=[],m=[];for(n=0;n<=e;n++){var s=[],t=[],q=n/e,u=q*(b-a)+a;for(l=0;l<=d;l++){var v=l/d,w=new THREE.Vector3;w.x=u*Math.sin(v*h+
+g);w.y=-q*c+k;w.z=u*Math.cos(v*h+g);this.vertices.push(w);s.push(this.vertices.length-1);t.push(new THREE.Vector2(v,1-q))}p.push(s);m.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(g=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(g=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var s=p[n][l],t=p[n+1][l],q=p[n+1][l+1],u=p[n][l+1],v=g.clone(),w=g.clone(),
+z=h.clone(),y=h.clone(),D=m[n][l].clone(),E=m[n+1][l].clone(),x=m[n+1][l+1].clone(),F=m[n][l+1].clone();this.faces.push(new THREE.Face3(s,t,u,[v,w,y]));this.faceVertexUvs[0].push([D,E,F]);this.faces.push(new THREE.Face3(t,q,u,[w.clone(),z,y.clone()]));this.faceVertexUvs[0].push([E.clone(),x,F.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)s=p[0][l],t=p[0][l+1],q=this.vertices.length-1,v=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
+1,0),D=m[0][l].clone(),E=m[0][l+1].clone(),x=new THREE.Vector2(E.x,0),this.faces.push(new THREE.Face3(s,t,q,[v,w,z])),this.faceVertexUvs[0].push([D,E,x]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)s=p[e][l+1],t=p[e][l],q=this.vertices.length-1,v=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),D=m[e][l+1].clone(),E=m[e][l].clone(),x=new THREE.Vector2(E.x,1),this.faces.push(new THREE.Face3(s,t,q,[v,w,z])),this.faceVertexUvs[0].push([D,
 E,x]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
-THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,m=h.length;l<m;l++)for(var p=h[l],n=0;3>n;n++){d[0]=p[g[n]];d[1]=p[g[(n+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?e[r]={vert1:d[0],vert2:d[1],face1:l,
-face2:void 0}:e[r].face2=l}d=[];for(r in e)if(f=e[r],void 0===f.face2||h[f.face1].normal.dot(h[f.face2].normal)<=c)g=k[f.vert1],d.push(g.x),d.push(g.y),d.push(g.z),g=k[f.vert2],d.push(g.x),d.push(g.y),d.push(g.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
+THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,n=h.length;l<n;l++)for(var p=h[l],m=0;3>m;m++){d[0]=p[g[m]];d[1]=p[g[(m+1)%3]];d.sort(f);var s=d.toString();void 0===e[s]?e[s]={vert1:d[0],vert2:d[1],face1:l,
+face2:void 0}:e[s].face2=l}d=[];for(s in e)if(f=e[s],void 0===f.face2||h[f.face1].normal.dot(h[f.face2].normal)<=c)g=k[f.vert1],d.push(g.x),d.push(g.y),d.push(g.z),g=k[f.vert2],d.push(g.x),d.push(g.y),d.push(g.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
-!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(L=a.length;0<=--L;){c=L;d=L-1;0>d&&(d=a.length-1);for(var e=0,f=r+2*m,e=0;e<f;e++){var g=R*e,h=R*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+C,g=g+C,l=l+C,h=h+C;I.faces.push(new THREE.Face3(k,g,h));I.faces.push(new THREE.Face3(g,l,h));k=v.generateSideWallUV(I,k,g,l,h);I.faceVertexUvs[0].push([k[0],k[1],k[3]]);I.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function f(a,b,c){I.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=C;b+=C;c+=C;I.faces.push(new THREE.Face3(a,b,c));a=v.generateTopUV(I,a,b,c);I.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,r=void 0!==b.steps?b.steps:1,t=b.extrudePath,
-s,u=!1,v=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,z,y,D;t&&(s=t.getSpacedPoints(r),u=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,r,!1),z=new THREE.Vector3,y=new THREE.Vector3,D=new THREE.Vector3);p||(l=k=m=0);var E,x,F,I=this,C=this.vertices.length,t=a.extractPoints(n),n=t.shape,G=t.holes;if(t=!THREE.Shape.Utils.isClockWise(n)){n=n.reverse();x=0;for(F=G.length;x<F;x++)E=G[x],THREE.Shape.Utils.isClockWise(E)&&(G[x]=E.reverse());t=
-!1}var Q=THREE.Shape.Utils.triangulateShape(n,G),K=n;x=0;for(F=G.length;x<F;x++)E=G[x],n=n.concat(E);var A,H,B,T,O,R=n.length,P,J=Q.length,t=[],L=0;B=K.length;A=B-1;for(H=L+1;L<B;L++,A++,H++)A===B&&(A=0),H===B&&(H=0),t[L]=d(K[L],K[A],K[H]);var na=[],da,ka=t.concat();x=0;for(F=G.length;x<F;x++){E=G[x];da=[];L=0;B=E.length;A=B-1;for(H=L+1;L<B;L++,A++,H++)A===B&&(A=0),H===B&&(H=0),da[L]=d(E[L],E[A],E[H]);na.push(da);ka=ka.concat(da)}for(A=0;A<m;A++){B=A/m;T=k*(1-B);H=l*Math.sin(B*Math.PI/2);L=0;for(B=
-K.length;L<B;L++)O=c(K[L],t[L],H),f(O.x,O.y,-T);x=0;for(F=G.length;x<F;x++)for(E=G[x],da=na[x],L=0,B=E.length;L<B;L++)O=c(E[L],da[L],H),f(O.x,O.y,-T)}H=l;for(L=0;L<R;L++)O=p?c(n[L],ka[L],H):n[L],u?(y.copy(w.normals[0]).multiplyScalar(O.x),z.copy(w.binormals[0]).multiplyScalar(O.y),D.copy(s[0]).add(y).add(z),f(D.x,D.y,D.z)):f(O.x,O.y,0);for(B=1;B<=r;B++)for(L=0;L<R;L++)O=p?c(n[L],ka[L],H):n[L],u?(y.copy(w.normals[B]).multiplyScalar(O.x),z.copy(w.binormals[B]).multiplyScalar(O.y),D.copy(s[B]).add(y).add(z),
-f(D.x,D.y,D.z)):f(O.x,O.y,h/r*B);for(A=m-1;0<=A;A--){B=A/m;T=k*(1-B);H=l*Math.sin(B*Math.PI/2);L=0;for(B=K.length;L<B;L++)O=c(K[L],t[L],H),f(O.x,O.y,h+T);x=0;for(F=G.length;x<F;x++)for(E=G[x],da=na[x],L=0,B=E.length;L<B;L++)O=c(E[L],da[L],H),u?f(O.x,O.y+s[r-1].y,s[r-1].x+T):f(O.x,O.y,h+T)}(function(){if(p){var a;a=0*R;for(L=0;L<J;L++)P=Q[L],g(P[2]+a,P[1]+a,P[0]+a);a=r+2*m;a*=R;for(L=0;L<J;L++)P=Q[L],g(P[0]+a,P[1]+a,P[2]+a)}else{for(L=0;L<J;L++)P=Q[L],g(P[2],P[1],P[0]);for(L=0;L<J;L++)P=Q[L],g(P[0]+
-R*r,P[1]+R*r,P[2]+R*r)}})();(function(){var a=0;e(K,a);a+=K.length;x=0;for(F=G.length;x<F;x++)E=G[x],e(E,a),a+=E.length})()};
+!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(L=a.length;0<=--L;){c=L;d=L-1;0>d&&(d=a.length-1);for(var e=0,f=s+2*n,e=0;e<f;e++){var g=R*e,h=R*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+C,g=g+C,l=l+C,h=h+C;I.faces.push(new THREE.Face3(k,g,h));I.faces.push(new THREE.Face3(g,l,h));k=v.generateSideWallUV(I,k,g,l,h);I.faceVertexUvs[0].push([k[0],k[1],k[3]]);I.faceVertexUvs[0].push([k[1],
+k[2],k[3]])}}}function f(a,b,c){I.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=C;b+=C;c+=C;I.faces.push(new THREE.Face3(a,b,c));a=v.generateTopUV(I,a,b,c);I.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,
+q,u=!1,v=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,w,z,y,D;t&&(q=t.getSpacedPoints(s),u=!0,p=!1,w=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),z=new THREE.Vector3,y=new THREE.Vector3,D=new THREE.Vector3);p||(l=k=n=0);var E,x,F,I=this,C=this.vertices.length,t=a.extractPoints(m),m=t.shape,G=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();x=0;for(F=G.length;x<F;x++)E=G[x],THREE.Shape.Utils.isClockWise(E)&&(G[x]=E.reverse());t=
+!1}var Q=THREE.Shape.Utils.triangulateShape(m,G),K=m;x=0;for(F=G.length;x<F;x++)E=G[x],m=m.concat(E);var A,H,B,T,O,R=m.length,P,J=Q.length,t=[],L=0;B=K.length;A=B-1;for(H=L+1;L<B;L++,A++,H++)A===B&&(A=0),H===B&&(H=0),t[L]=d(K[L],K[A],K[H]);var na=[],da,ka=t.concat();x=0;for(F=G.length;x<F;x++){E=G[x];da=[];L=0;B=E.length;A=B-1;for(H=L+1;L<B;L++,A++,H++)A===B&&(A=0),H===B&&(H=0),da[L]=d(E[L],E[A],E[H]);na.push(da);ka=ka.concat(da)}for(A=0;A<n;A++){B=A/n;T=k*(1-B);H=l*Math.sin(B*Math.PI/2);L=0;for(B=
+K.length;L<B;L++)O=c(K[L],t[L],H),f(O.x,O.y,-T);x=0;for(F=G.length;x<F;x++)for(E=G[x],da=na[x],L=0,B=E.length;L<B;L++)O=c(E[L],da[L],H),f(O.x,O.y,-T)}H=l;for(L=0;L<R;L++)O=p?c(m[L],ka[L],H):m[L],u?(y.copy(w.normals[0]).multiplyScalar(O.x),z.copy(w.binormals[0]).multiplyScalar(O.y),D.copy(q[0]).add(y).add(z),f(D.x,D.y,D.z)):f(O.x,O.y,0);for(B=1;B<=s;B++)for(L=0;L<R;L++)O=p?c(m[L],ka[L],H):m[L],u?(y.copy(w.normals[B]).multiplyScalar(O.x),z.copy(w.binormals[B]).multiplyScalar(O.y),D.copy(q[B]).add(y).add(z),
+f(D.x,D.y,D.z)):f(O.x,O.y,h/s*B);for(A=n-1;0<=A;A--){B=A/n;T=k*(1-B);H=l*Math.sin(B*Math.PI/2);L=0;for(B=K.length;L<B;L++)O=c(K[L],t[L],H),f(O.x,O.y,h+T);x=0;for(F=G.length;x<F;x++)for(E=G[x],da=na[x],L=0,B=E.length;L<B;L++)O=c(E[L],da[L],H),u?f(O.x,O.y+q[s-1].y,q[s-1].x+T):f(O.x,O.y,h+T)}(function(){if(p){var a;a=0*R;for(L=0;L<J;L++)P=Q[L],g(P[2]+a,P[1]+a,P[0]+a);a=s+2*n;a*=R;for(L=0;L<J;L++)P=Q[L],g(P[0]+a,P[1]+a,P[2]+a)}else{for(L=0;L<J;L++)P=Q[L],g(P[2],P[1],P[0]);for(L=0;L<J;L++)P=Q[L],g(P[0]+
+R*s,P[1]+R*s,P[2]+R*s)}})();(function(){var a=0;e(K,a);a+=K.length;x=0;for(F=G.length;x<F;x++)E=G[x],e(E,a),a+=E.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
-THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var m=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
-k=k.concat(g);l=k.length;f=m.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=m[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,l))};
-THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),m=Math.sin(k),k=0,p=a.length;k<p;k++){var n=a[k],r=new THREE.Vector3;r.x=l*n.x-m*n.y;r.y=m*n.x+l*n.y;r.z=n.z;this.vertices.push(r)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,p=a.length-1;k<p;k++){b=m=k+c*g;d=m+c;var l=m+1+c,m=m+1,n=g*f,r=k*e,t=
-n+f,s=r+e;this.faces.push(new THREE.Face3(b,d,m));this.faceVertexUvs[0].push([new THREE.Vector2(n,r),new THREE.Vector2(t,r),new THREE.Vector2(n,s)]);this.faces.push(new THREE.Face3(d,l,m));this.faceVertexUvs[0].push([new THREE.Vector2(t,r),new THREE.Vector2(t,s),new THREE.Vector2(n,s)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,g,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,f=l.length;e<f;e++)g=l[e],THREE.Shape.Utils.isClockWise(g)&&(l[e]=g.reverse());var n=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(f=l.length;e<f;e++)g=l[e],
+k=k.concat(g);l=k.length;f=n.length;for(e=0;e<l;e++)g=k[e],this.vertices.push(new THREE.Vector3(g.x,g.y,0));for(e=0;e<f;e++)l=n[e],k=l[0]+h,g=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,g,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,g,l))};
+THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;g<=h;g++)for(var k=c+g*f*d,l=Math.cos(k),n=Math.sin(k),k=0,p=a.length;k<p;k++){var m=a[k],s=new THREE.Vector3;s.x=l*m.x-n*m.y;s.y=n*m.x+l*m.y;s.z=m.z;this.vertices.push(s)}c=a.length;g=0;for(h=b;g<h;g++)for(k=0,p=a.length-1;k<p;k++){b=n=k+c*g;d=n+c;var l=n+1+c,n=n+1,m=g*f,s=k*e,t=
+m+f,q=s+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(m,s),new THREE.Vector2(t,s),new THREE.Vector2(m,q)]);this.faces.push(new THREE.Face3(d,l,n));this.faceVertexUvs[0].push([new THREE.Vector2(t,s),new THREE.Vector2(t,q),new THREE.Vector2(m,q)])}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){console.log("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var m=new Float32Array(g*h*2),p=0,n=0,r=0;r<h;r++)for(var t=r*l-f,s=0;s<g;s++)b[p]=s*k-e,b[p+1]=-t,a[p+2]=1,m[n]=s/c,m[n+1]=1-r/d,p+=3,n+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
-d*6);for(r=0;r<d;r++)for(s=0;s<c;s++)f=s+g*(r+1),h=s+1+g*(r+1),k=s+1+g*r,e[p]=s+g*r,e[p+1]=f,e[p+2]=k,e[p+3]=f,e[p+4]=h,e[p+5]=k,p+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(m,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
-THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var m=new THREE.Vector3,p=e+g/c*f;m.x=k*Math.cos(p);m.y=k*Math.sin(p);this.vertices.push(m);h.push(new THREE.Vector2((m.x/b+1)/2,
-(m.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=p=g+e,l=p+c+1,m=p+c+2,this.faces.push(new THREE.Face3(f,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[m].clone()]),f=p,l=p+c+2,m=p+1,this.faces.push(new THREE.Face3(f,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[m].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
+THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var g=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(g*h*3);a=new Float32Array(g*h*3);for(var n=new Float32Array(g*h*2),p=0,m=0,s=0;s<h;s++)for(var t=s*l-f,q=0;q<g;q++)b[p]=q*k-e,b[p+1]=-t,a[p+2]=1,n[m]=q/c,n[m+1]=1-s/d,p+=3,m+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
+d*6);for(s=0;s<d;s++)for(q=0;q<c;q++)f=q+g*(s+1),h=q+1+g*(s+1),k=q+1+g*s,e[p]=q+g*s,e[p+1]=f,e[p+2]=k,e[p+3]=f,e[p+4]=h,e[p+5]=k,p+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(n,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
+THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||0;b=b||50;e=void 0!==e?e:0;f=void 0!==f?f:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var g,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(g=0;g<c+1;g++){var n=new THREE.Vector3,p=e+g/c*f;n.x=k*Math.cos(p);n.y=k*Math.sin(p);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
+(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),g=0;g<c;g++)f=p=g+e,l=p+c+1,n=p+c+2,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]),f=p,l=p+c+2,n=p+1,this.faces.push(new THREE.Face3(f,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[l].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;
-THREE.SphereGeometry=function(a,b,c,d,e,f,g){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(2,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],m=[];for(k=0;k<=c;k++){var p=
-[],n=[];for(h=0;h<=b;h++){var r=h/b,t=k/c,s=new THREE.Vector3;s.x=-a*Math.cos(d+r*e)*Math.sin(f+t*g);s.y=a*Math.cos(f+t*g);s.z=a*Math.sin(d+r*e)*Math.sin(f+t*g);this.vertices.push(s);p.push(this.vertices.length-1);n.push(new THREE.Vector2(r,1-t))}l.push(p);m.push(n)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),r=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),
-s=m[k][h+1].clone(),u=m[k][h].clone(),v=m[k+1][h].clone(),w=m[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(s.x=(s.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[p,r,t])),this.faceVertexUvs[0].push([s,v,w])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+w.x)/2,this.faces.push(new THREE.Face3(d,e,f,[p,n,r])),this.faceVertexUvs[0].push([s,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[p,n,t])),this.faceVertexUvs[0].push([s,u,w]),this.faces.push(new THREE.Face3(e,f,g,[n.clone(),r,t.clone()])),this.faceVertexUvs[0].push([u.clone(),
+THREE.SphereGeometry=function(a,b,c,d,e,f,g){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(2,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;var h,k,l=[],n=[];for(k=0;k<=c;k++){var p=
+[],m=[];for(h=0;h<=b;h++){var s=h/b,t=k/c,q=new THREE.Vector3;q.x=-a*Math.cos(d+s*e)*Math.sin(f+t*g);q.y=a*Math.cos(f+t*g);q.z=a*Math.sin(d+s*e)*Math.sin(f+t*g);this.vertices.push(q);p.push(this.vertices.length-1);m.push(new THREE.Vector2(s,1-t))}l.push(p);n.push(m)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];f=l[k+1][h];g=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),s=this.vertices[f].clone().normalize(),t=this.vertices[g].clone().normalize(),
+q=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?(q.x=(q.x+u.x)/2,this.faces.push(new THREE.Face3(d,f,g,[p,s,t])),this.faceVertexUvs[0].push([q,v,w])):Math.abs(this.vertices[f].y)===a?(v.x=(v.x+w.x)/2,this.faces.push(new THREE.Face3(d,e,f,[p,m,s])),this.faceVertexUvs[0].push([q,u,v])):(this.faces.push(new THREE.Face3(d,e,g,[p,m,t])),this.faceVertexUvs[0].push([q,u,w]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),s,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.SphereBufferGeometry=function(a,b,c,d,e,f,g){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g};a=a||50;b=Math.max(2,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;f=void 0!==f?f:0;g=void 0!==g?g:Math.PI;for(var h=(b+1)*(c+1),k=new THREE.BufferAttribute(new Float32Array(3*h),3),l=new THREE.BufferAttribute(new Float32Array(3*h),
-3),h=new THREE.BufferAttribute(new Float32Array(2*h),2),m=0,p=[],n=new THREE.Vector3,r=0;r<=c;r++){for(var t=[],s=r/c,u=0;u<=b;u++){var v=u/b,w=-a*Math.cos(d+v*e)*Math.sin(f+s*g),z=a*Math.cos(f+s*g),y=a*Math.sin(d+v*e)*Math.sin(f+s*g);n.set(w,z,y).normalize();k.setXYZ(m,w,z,y);l.setXYZ(m,n.x,n.y,n.z);h.setXY(m,v,1-s);t.push(m);m++}p.push(t)}d=[];for(r=0;r<c;r++)for(u=0;u<b;u++)e=p[r][u+1],f=p[r][u],g=p[r+1][u],m=p[r+1][u+1],0!==r&&d.push(e,f,m),r!==c-1&&d.push(f,g,m);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(d),
+3),h=new THREE.BufferAttribute(new Float32Array(2*h),2),n=0,p=[],m=new THREE.Vector3,s=0;s<=c;s++){for(var t=[],q=s/c,u=0;u<=b;u++){var v=u/b,w=-a*Math.cos(d+v*e)*Math.sin(f+q*g),z=a*Math.cos(f+q*g),y=a*Math.sin(d+v*e)*Math.sin(f+q*g);m.set(w,z,y).normalize();k.setXYZ(n,w,z,y);l.setXYZ(n,m.x,m.y,m.z);h.setXY(n,v,1-q);t.push(n);n++}p.push(t)}d=[];for(s=0;s<c;s++)for(u=0;u<b;u++)e=p[s][u+1],f=p[s][u],g=p[s+1][u],n=p[s+1][u+1],0!==s&&d.push(e,f,n),s!==c-1&&d.push(f,g,n);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(d),
 1));this.addAttribute("position",k);this.addAttribute("normal",l);this.addAttribute("uv",h);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
 THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
-THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var m=l/d*e,p=k/c*Math.PI*2;f.x=a*Math.cos(m);f.y=a*Math.sin(m);var n=new THREE.Vector3;n.x=(a+b*Math.cos(p))*Math.cos(m);n.y=(a+b*Math.cos(p))*Math.sin(m);n.z=b*Math.sin(p);this.vertices.push(n);g.push(new THREE.Vector2(l/
-d,k/c));h.push(n.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,m=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),m=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
+THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var n=l/d*e,p=k/c*Math.PI*2;f.x=a*Math.cos(n);f.y=a*Math.sin(n);var m=new THREE.Vector3;m.x=(a+b*Math.cos(p))*Math.cos(n);m.y=(a+b*Math.cos(p))*Math.sin(n);m.z=b*Math.sin(p);this.vertices.push(m);g.push(new THREE.Vector2(l/
+d,k/c));h.push(m.clone().sub(f).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,f=(d+1)*k+l,n=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),n=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
-THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=0;n<c;++n){k[n]=
-Array(d);var r=n/c*2*e*Math.PI,t=h(r,f,e,a,g),r=h(r+.01,f,e,a,g);l.subVectors(r,t);m.addVectors(r,t);p.crossVectors(l,m);m.crossVectors(p,l);p.normalize();m.normalize();for(r=0;r<d;++r){var s=r/d*2*Math.PI,u=-b*Math.cos(s),s=b*Math.sin(s),v=new THREE.Vector3;v.x=t.x+u*m.x+s*p.x;v.y=t.y+u*m.y+s*p.y;v.z=t.z+u*m.z+s*p.z;k[n][r]=this.vertices.push(v)-1}}for(n=0;n<c;++n)for(r=0;r<d;++r)e=(n+1)%c,f=(r+1)%d,a=k[n][r],b=k[e][r],e=k[e][f],f=k[n][f],g=new THREE.Vector2(n/c,r/d),l=new THREE.Vector2((n+1)/c,
-r/d),m=new THREE.Vector2((n+1)/c,(r+1)/d),p=new THREE.Vector2(n/c,(r+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,p]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),m,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
-THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,l=b+1,m,p,n,r,t,s=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<l;u++)for(g[u]=[],m=u/(l-1),t=a.getPointAt(m),h=v[u],k=w[u],n=c*f(m),m=0;m<d;m++)p=
-m/d*2*Math.PI,r=-n*Math.cos(p),p=n*Math.sin(p),s.copy(t),s.x+=r*h.x+p*k.x,s.y+=r*h.y+p*k.y,s.z+=r*h.z+p*k.z,g[u][m]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(u=0;u<b;u++)for(m=0;m<d;m++)f=e?(u+1)%b:u+1,l=(m+1)%d,a=g[u][m],c=g[f][m],f=g[f][l],l=g[u][l],s=new THREE.Vector2(u/b,m/d),v=new THREE.Vector2((u+1)/b,m/d),w=new THREE.Vector2((u+1)/b,(m+1)/d),h=new THREE.Vector2(u/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([s,v,h]),this.faces.push(new THREE.Face3(c,
+THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;f=f||3;g=g||1;for(var k=Array(c),l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=0;m<c;++m){k[m]=
+Array(d);var s=m/c*2*e*Math.PI,t=h(s,f,e,a,g),s=h(s+.01,f,e,a,g);l.subVectors(s,t);n.addVectors(s,t);p.crossVectors(l,n);n.crossVectors(p,l);p.normalize();n.normalize();for(s=0;s<d;++s){var q=s/d*2*Math.PI,u=-b*Math.cos(q),q=b*Math.sin(q),v=new THREE.Vector3;v.x=t.x+u*n.x+q*p.x;v.y=t.y+u*n.y+q*p.y;v.z=t.z+u*n.z+q*p.z;k[m][s]=this.vertices.push(v)-1}}for(m=0;m<c;++m)for(s=0;s<d;++s)e=(m+1)%c,f=(s+1)%d,a=k[m][s],b=k[e][s],e=k[e][f],f=k[m][f],g=new THREE.Vector2(m/c,s/d),l=new THREE.Vector2((m+1)/c,
+s/d),n=new THREE.Vector2((m+1)/c,(s+1)/d),p=new THREE.Vector2(m/c,(s+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,l,p]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([l.clone(),n,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
+THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;f=f||THREE.TubeGeometry.NoTaper;var g=[],h,k,l=b+1,n,p,m,s,t,q=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<l;u++)for(g[u]=[],n=u/(l-1),t=a.getPointAt(n),h=v[u],k=w[u],m=c*f(n),n=0;n<d;n++)p=
+n/d*2*Math.PI,s=-m*Math.cos(p),p=m*Math.sin(p),q.copy(t),q.x+=s*h.x+p*k.x,q.y+=s*h.y+p*k.y,q.z+=s*h.z+p*k.z,g[u][n]=this.vertices.push(new THREE.Vector3(q.x,q.y,q.z))-1;for(u=0;u<b;u++)for(n=0;n<d;n++)f=e?(u+1)%b:u+1,l=(n+1)%d,a=g[u][n],c=g[f][n],f=g[f][l],l=g[u][l],q=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,l)),this.faceVertexUvs[0].push([q,v,h]),this.faces.push(new THREE.Face3(c,
 f,l)),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.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,m,p;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)m=l/(b-1),e[l]=a.getTangentAt(m),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);m=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));m<=a&&(a=m,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
+THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,p;this.tangents=e;this.normals=f;this.binormals=g;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();f[0]=new THREE.Vector3;g[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();f[0].crossVectors(e[0],
 h);g[0].crossVectors(e[0],f[0]);for(l=1;l<b;l++)f[l]=f[l-1].clone(),g[l]=g[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),f[l].applyMatrix4(k.makeRotationAxis(h,d))),g[l].crossVectors(e[l],f[l]);if(c)for(d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(f[0],f[b-1]))&&(d=-d),l=1;l<b;l++)f[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),g[l].crossVectors(e[l],f[l])};
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);u.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(u.z,-u.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,
-b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(g.clone().lerp(h,m/c)),r=c-m,s=0;s<=r;s++)l[m][s]=0===s&&m===c?n:e(n.clone().lerp(p,s/r))}for(m=0;m<c;m++)for(s=0;s<2*(c-m)-1;s++)d=Math.floor(s/2),0===s%2?f(l[m][d+1],l[m+1][d],l[m][d]):f(l[m][d+1],l[m+1][d+1],l[m+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y));
-return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,m=a.length;l<m;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],n=l=0,m=b.length;l<m;l+=3,n++){var r=a[b[l]],t=a[b[l+1]],s=a[b[l+2]];p[n]=new THREE.Face3(r.index,t.index,s.index,[r.clone(),t.clone(),s.clone()])}for(var u=new THREE.Vector3,l=0,m=p.length;l<m;l++)g(p[l],d);l=0;for(m=this.faceVertexUvs[0].length;l<
-m;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,p=b[2].x,n=Math.max(d,Math.max(a,p)),r=Math.min(d,Math.min(a,p)),.9<n&&.1>r&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(m=this.vertices.length;l<m;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
+b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),g=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(g.clone().lerp(h,m/c)),q=c-m,s=0;s<=q;s++)l[m][s]=0===s&&m===c?n:e(n.clone().lerp(p,s/q))}for(m=0;m<c;m++)for(s=0;s<2*(c-m)-1;s++)d=Math.floor(s/2),0===s%2?f(l[m][d+1],l[m+1][d],l[m][d]):f(l[m][d+1],l[m+1][d+1],l[m+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y));
+return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,n=a.length;l<n;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],m=l=0,n=b.length;l<n;l+=3,m++){var s=a[b[l]],t=a[b[l+1]],q=a[b[l+2]];p[m]=new THREE.Face3(s.index,t.index,q.index,[s.clone(),t.clone(),q.clone()])}for(var u=new THREE.Vector3,l=0,n=p.length;l<n;l++)g(p[l],d);l=0;for(n=this.faceVertexUvs[0].length;l<
+n;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,p=b[2].x,m=Math.max(d,Math.max(a,p)),s=Math.min(d,Math.min(a,p)),.9<m&&.1>s&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
 THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,
 11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b)};THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry;
 THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b}};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b}};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
 THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b}};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry;
-THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,m=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,n,r,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*m+h,d=g*m+h+1,l=(g+1)*m+h+1,k=(g+1)*m+h,p=new THREE.Vector2(h/b,g/c),n=new THREE.Vector2((h+1)/b,g/c),r=new THREE.Vector2((h+1)/b,(g+1)/c),t=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
-d,k)),f.push([p,n,t]),e.push(new THREE.Face3(d,l,k)),f.push([n.clone(),r,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
-THREE.WireframeGeometry=function(a){THREE.BufferGeometry.call(this);var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c"];if(a instanceof THREE.Geometry){var f=a.vertices,g=a.faces,h=0,k=new Uint32Array(6*g.length);a=0;for(var l=g.length;a<l;a++)for(var m=g[a],p=0;3>p;p++){b[0]=m[e[p]];b[1]=m[e[(p+1)%3]];b.sort(d);var n=b.toString();void 0===c[n]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)h=f[k[2*a+p]],e=6*a+3*p,b[e+0]=h.x,b[e+1]=h.y,
-b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){f=a.attributes.position;l=a.attributes.index.array;g=a.drawcalls;h=0;0===g.length&&(g=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),m=0,r=g.length;m<r;++m){p=g[m].start;n=g[m].count;e=g[m].index;a=p;for(var t=p+n;a<t;a+=3)for(p=0;3>p;p++)b[0]=e+l[a+p],b[1]=e+l[a+(p+1)%3],b.sort(d),n=b.toString(),void 0===c[n]&&(k[2*h]=b[0],k[2*
-h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)e=6*a+3*p,h=k[2*a+p],b[e+0]=f.getX(h),b[e+1]=f.getY(h),b[e+2]=f.getZ(h)}else for(f=a.attributes.position.array,h=f.length/3,k=h/3,b=new Float32Array(6*h),a=0,l=k;a<l;a++)for(p=0;3>p;p++)e=18*a+6*p,k=9*a+3*p,b[e+0]=f[k],b[e+1]=f[k+1],b[e+2]=f[k+2],h=9*a+(p+1)%3*3,b[e+3]=f[h],b[e+4]=f[h+1],b[e+5]=f[h+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
+THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,f=this.faceVertexUvs[0],g,h,k,l,n=b+1;for(g=0;g<=c;g++)for(l=g/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,m,s,t;for(g=0;g<c;g++)for(h=0;h<b;h++)a=g*n+h,d=g*n+h+1,l=(g+1)*n+h+1,k=(g+1)*n+h,p=new THREE.Vector2(h/b,g/c),m=new THREE.Vector2((h+1)/b,g/c),s=new THREE.Vector2((h+1)/b,(g+1)/c),t=new THREE.Vector2(h/b,(g+1)/c),e.push(new THREE.Face3(a,
+d,k)),f.push([p,m,t]),e.push(new THREE.Face3(d,l,k)),f.push([m.clone(),s,t.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
+THREE.WireframeGeometry=function(a){THREE.BufferGeometry.call(this);var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c"];if(a instanceof THREE.Geometry){var f=a.vertices,g=a.faces,h=0,k=new Uint32Array(6*g.length);a=0;for(var l=g.length;a<l;a++)for(var n=g[a],p=0;3>p;p++){b[0]=n[e[p]];b[1]=n[e[(p+1)%3]];b.sort(d);var m=b.toString();void 0===c[m]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[m]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)h=f[k[2*a+p]],e=6*a+3*p,b[e+0]=h.x,b[e+1]=h.y,
+b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){f=a.attributes.position;l=a.attributes.index.array;g=a.drawcalls;h=0;0===g.length&&(g=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),n=0,s=g.length;n<s;++n){p=g[n].start;m=g[n].count;e=g[n].index;a=p;for(var t=p+m;a<t;a+=3)for(p=0;3>p;p++)b[0]=e+l[a+p],b[1]=e+l[a+(p+1)%3],b.sort(d),m=b.toString(),void 0===c[m]&&(k[2*h]=b[0],k[2*
+h+1]=b[1],c[m]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)e=6*a+3*p,h=k[2*a+p],b[e+0]=f.getX(h),b[e+1]=f.getY(h),b[e+2]=f.getZ(h)}else for(f=a.attributes.position.array,h=f.length/3,k=h/3,b=new Float32Array(6*h),a=0,l=k;a<l;a++)for(p=0;3>p;p++)e=18*a+6*p,k=9*a+3*p,b[e+0]=f[k],b[e+1]=f[k+1],b[e+2]=f[k+2],h=9*a+(p+1)%3*3,b[e+3]=f[h],b[e+4]=f[h+1],b[e+5]=f[h+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
 THREE.WireframeGeometry.prototype.constructor=THREE.WireframeGeometry;THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry;a.addAttribute("position",new THREE.BufferAttribute(b,3));a.addAttribute("color",new THREE.BufferAttribute(c,3));b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.LineSegments.call(this,a,b)};THREE.AxisHelper.prototype=Object.create(THREE.LineSegments.prototype);
 THREE.AxisHelper.prototype.constructor=THREE.AxisHelper;
 THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));return function(c,d,e,f,g,h){THREE.Object3D.call(this);void 0===f&&(f=16776960);void 0===e&&(e=1);void 0===g&&(g=.2*e);void 0===h&&(h=.2*g);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f}));this.line.matrixAutoUpdate=!1;this.add(this.line);
@@ -829,11 +829,11 @@ THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper;THREE.SpotLigh
 THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();
 THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:16711680;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexNormals.length;g<h;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.LineSegments.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}));this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype);
 THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper;
-THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var m=f[k],p=0,n=m.vertexNormals.length;p<n;p++){var r=m.vertexNormals[p];d[h].copy(e[m[a[p]]]).applyMatrix4(g);b.copy(r).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
+THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var n=f[k],p=0,m=n.vertexNormals.length;p<m;p++){var s=n.vertexNormals[p];d[h].copy(e[n[a[p]]]).applyMatrix4(g);b.copy(s).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
 b.add(d[h]);h+=1;d[h].copy(b);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
 THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:255;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,f=a.length;e<f;e++)for(var g=0,h=a[e].vertexTangents.length;g<h;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.LineSegments.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}));this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.LineSegments.prototype);
 THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper;
-THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var m=f[k],p=0,n=m.vertexTangents.length;p<n;p++){var r=m.vertexTangents[p];d[h].copy(e[m[a[p]]]).applyMatrix4(g);b.copy(r).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
+THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,f=this.object.geometry.faces,g=this.object.matrixWorld,h=0,k=0,l=f.length;k<l;k++)for(var n=f[k],p=0,m=n.vertexTangents.length;p<m;p++){var s=n.vertexTangents[p];d[h].copy(e[n[a[p]]]).applyMatrix4(g);b.copy(s).transformDirection(g).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
 h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215;THREE.LineSegments.call(this,new THREE.WireframeGeometry(a.geometry),new THREE.LineBasicMaterial({color:c}));this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper;
 THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject;THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};
 THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh;THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)};