Browse Source

Updated builds.

Mr.doob 10 years ago
parent
commit
fe245700b5
2 changed files with 218 additions and 202 deletions
  1. 77 62
      build/three.js
  2. 141 140
      build/three.min.js

+ 77 - 62
build/three.js

@@ -10392,7 +10392,6 @@ THREE.BufferGeometry = function () {
 	this.morphAttributes = [];
 
 	this.drawcalls = [];
-	this.offsets = this.drawcalls; // backwards compatibility
 
 	this.boundingBox = null;
 	this.boundingSphere = null;
@@ -10425,6 +10424,13 @@ THREE.BufferGeometry.prototype = {
 
 	},
 
+	get offsets() {
+
+		console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .drawcalls.' );
+		return this.drawcalls;
+
+	},
+
 	addDrawCall: function ( start, count, indexOffset ) {
 
 		this.drawcalls.push( {
@@ -10437,6 +10443,12 @@ THREE.BufferGeometry.prototype = {
 
 	},
 
+	clearDrawCalls: function () {
+
+		this.drawcalls = [];
+
+	},
+
 	applyMatrix: function ( matrix ) {
 
 		var position = this.attributes.position;
@@ -10475,8 +10487,10 @@ THREE.BufferGeometry.prototype = {
 
 	copy: function ( geometry ) {
 
+		// TODO Clear attributes? Clear drawcalls? Copy morphTargets?
+
 		var attributes = geometry.attributes;
-		var offsets = geometry.offsets;
+		var offsets = geometry.drawcalls;
 
 		for ( var name in attributes ) {
 
@@ -10489,14 +10503,7 @@ THREE.BufferGeometry.prototype = {
 		for ( var i = 0, il = offsets.length; i < il; i ++ ) {
 
 			var offset = offsets[ i ];
-
-			this.offsets.push( {
-
-				start: offset.start,
-				index: offset.index,
-				count: offset.count
-
-			} );
+			this.addDrawCall( offset.start, offset.count, offset.index );
 
 		}
 
@@ -10927,13 +10934,17 @@ THREE.BufferGeometry.prototype = {
 
 				var indices = attributes.index.array;
 
-				var offsets = ( this.offsets.length > 0 ? this.offsets : [ { start: 0, count: indices.length, index: 0 } ] );
+				if ( this.drawcalls.length === 0 ) {
+
+					this.addDrawCall( 0, indices.length );
+
+				}
 
-				for ( var j = 0, jl = offsets.length; j < jl; ++ j ) {
+				for ( var j = 0, jl = this.drawcalls.length; j < jl; ++ j ) {
 
-					var start = offsets[ j ].start;
-					var count = offsets[ j ].count;
-					var index = offsets[ j ].index;
+					var start = this.drawcalls[ j ].start;
+					var count = this.drawcalls[ j ].count;
+					var index = this.drawcalls[ j ].index;
 
 					for ( var i = start, il = start + count; i < il; i += 3 ) {
 
@@ -11110,7 +11121,7 @@ THREE.BufferGeometry.prototype = {
 
 		if ( this.drawcalls.length === 0 ) {
 
-			this.addDrawCall( 0, indices.length, 0 );
+			this.addDrawCall( 0, indices.length );
 
 		}
 
@@ -11213,8 +11224,8 @@ THREE.BufferGeometry.prototype = {
 		var indexPtr = 0;
 		var vertexPtr = 0;
 
-		var offsets = [ { start:0, count:0, index:0 } ];
-		var offset = offsets[ 0 ];
+		var tmpOffsets = [ { start:0, count:0, index:0 } ];
+		var offset = tmpOffsets[ 0 ];
 
 		var duplicatedVertices = 0;
 		var newVerticeMaps = 0;
@@ -11252,7 +11263,7 @@ THREE.BufferGeometry.prototype = {
 			var faceMax = vertexPtr + newVerticeMaps;
 			if ( faceMax > ( offset.index + size ) ) {
 				var new_offset = { start:indexPtr, count:0, index:vertexPtr };
-				offsets.push( new_offset );
+				tmpOffsets.push( new_offset );
 				offset = new_offset;
 
 				//Re-evaluate reused vertices in light of new offset.
@@ -11280,19 +11291,24 @@ THREE.BufferGeometry.prototype = {
 
 		/* Move all attribute values to map to the new computed indices , also expand the vertex stack to match our new vertexPtr. */
 		this.reorderBuffers( sortedIndices, revVertexMap, vertexPtr );
-		this.offsets = offsets; // TODO: Deprecate
-		this.drawcalls = offsets;
+
+		this.clearDrawCalls();
+
+		for ( var i = 0; i < tmpOffsets.length; i ++ ) {
+
+			var tmpOffset = tmpOffsets[ i ];
+			this.addDrawCall( tmpOffset.start, tmpOffset.count, tmpOffset.index );
+
+		}
 
 		/*
 		var orderTime = Date.now();
 		console.log("Reorder time: "+(orderTime-s)+"ms");
 		console.log("Duplicated "+duplicatedVertices+" vertices.");
 		console.log("Compute Buffers time: "+(Date.now()-s)+"ms");
-		console.log("Draw offsets: "+offsets.length);
+		console.log("Draw tmpOffsets: "+tmpOffsets.length);
 		*/
 
-		return offsets;
-
 	},
 
 	merge: function ( geometry, offset ) {
@@ -11429,7 +11445,7 @@ THREE.BufferGeometry.prototype = {
 		data.data = { attributes: {} };
 
 		var attributes = this.attributes;
-		var offsets = this.offsets;
+		var offsets = this.drawcalls;
 		var boundingSphere = this.boundingSphere;
 
 		for ( var key in attributes ) {
@@ -11476,17 +11492,11 @@ THREE.BufferGeometry.prototype = {
 
 		}
 
-		for ( var i = 0, il = this.offsets.length; i < il; i ++ ) {
-
-			var offset = this.offsets[ i ];
-
-			geometry.offsets.push( {
+		for ( var i = 0, il = this.drawcalls.length; i < il; i ++ ) {
 
-				start: offset.start,
-				index: offset.index,
-				count: offset.count
+			var offset = this.drawcalls[ i ];
 
-			} );
+			geometry.addDrawCall( offset.start, offset.count, offset.index );
 
 		}
 
@@ -11548,18 +11558,10 @@ THREE.InstancedBufferGeometry.prototype.clone = function () {
 
 	}
 
-	for ( var i = 0, il = this.offsets.length; i < il; i++ ) {
-
-		var offset = this.offsets[i];
-
-		geometry.offsets.push( {
+	for ( var i = 0, il = this.drawcalls.length; i < il; i++ ) {
 
-			start: offset.start,
-			index: offset.index,
-			count: offset.count,
-			instances: offset.instances
-
-		} );
+		var offset = this.drawcalls[i];
+		geometry.addDrawCall( offset.start, offset.count, offset.index, offset.instances );
 
 	}
 
@@ -13663,7 +13665,18 @@ THREE.BufferGeometryLoader.prototype = {
 
 		if ( offsets !== undefined ) {
 
-			geometry.offsets = JSON.parse( JSON.stringify( offsets ) );
+			var offsetsArray = JSON.parse( JSON.stringify( offsets ) );
+
+			for ( var i = 0; i < offsetsArray.length; i ++ ) {
+
+				var offset = offsetsArray[i];
+				var indexStart = offset.start;
+				var indexCount = offset.count;
+				var indexOffset = offset.index;
+
+				geometry.addDrawcall( indexStart, indexCount, indexOffset );
+
+			}
 
 		}
 
@@ -16294,15 +16307,11 @@ THREE.PointCloud.prototype.raycast = ( function () {
 			if ( attributes.index !== undefined ) {
 
 				var indices = attributes.index.array;
-				var offsets = geometry.offsets;
+				var offsets = geometry.drawcalls;
 
 				if ( offsets.length === 0 ) {
 
-					offsets.push( {
-						start: 0,
-						count: indices.length,
-						index: 0
-					} );
+					offsets = [ { start: 0, count: indices.length, index: 0 } ];
 
 				}
 
@@ -16463,7 +16472,7 @@ THREE.Line.prototype.raycast = ( function () {
 
 				var indices = attributes.index.array;
 				var positions = attributes.position.array;
-				var offsets = geometry.offsets;
+				var offsets = geometry.drawcalls;
 
 				if ( offsets.length === 0 ) {
 
@@ -16758,7 +16767,7 @@ THREE.Mesh.prototype.raycast = ( function () {
 
 				var indices = attributes.index.array;
 				var positions = attributes.position.array;
-				var offsets = geometry.offsets;
+				var offsets = geometry.drawcalls;
 
 				if ( offsets.length === 0 ) {
 
@@ -20349,7 +20358,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			}
 
-			var offsets = geometry.offsets;
+			var offsets = geometry.drawcalls;
 
 			if ( offsets.length === 0 ) {
 
@@ -20434,7 +20443,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			// non-indexed triangles
 
-			var offsets = geometry.offsets;
+			var offsets = geometry.drawcalls;
 
 			if ( offsets.length === 0 ) {
 
@@ -20555,7 +20564,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			}
 
-			var offsets = geometry.offsets;
+			var offsets = geometry.drawcalls;
 
 			if ( offsets.length === 0 ) {
 
@@ -20612,7 +20621,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 			}
 
 			var position = geometry.attributes.position;
-			var offsets = geometry.offsets;
+			var offsets = geometry.drawcalls;
 
 			if ( offsets.length === 0 ) {
 
@@ -20664,7 +20673,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			}
 
-			var offsets = geometry.offsets;
+			var offsets = geometry.drawcalls;
 
 			if ( offsets.length === 0 ) {
 
@@ -20721,7 +20730,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 			}
 
 			var position = geometry.attributes.position;
-			var offsets = geometry.offsets;
+			var offsets = geometry.drawcalls;
 
 			if ( offsets.length === 0 ) {
 
@@ -23515,9 +23524,15 @@ THREE.WebGLGeometries = function ( gl, info ) {
 
 			geometries[ geometry.id ] = geometry;
 
-		} else {
+		} else if ( geometry instanceof THREE.Geometry ) {
+
+			if ( object._bufferGeometry === undefined ) {
+
+				object._bufferGeometry = new THREE.BufferGeometry().setFromObject( object );
+
+			}
 
-			geometries[ geometry.id ] = new THREE.BufferGeometry().setFromObject( object );
+			geometries[ geometry.id ] = object._bufferGeometry;
 
 		}
 

+ 141 - 140
build/three.min.js

@@ -96,22 +96,22 @@ void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.
 this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},
 transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];
 a[8]=b[8];return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}};THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,k,l,m,p,n,q,s,r){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=g;u[9]=f;u[13]=h;u[2]=k;u[6]=l;u[10]=m;u[14]=p;u[3]=n;u[7]=q;u[11]=s;u[15]=r;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,k,l,m,p,n,q,r,s){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=g;u[9]=f;u[13]=h;u[2]=k;u[6]=l;u[10]=m;u[14]=p;u[3]=n;u[7]=q;u[11]=r;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)},
 copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){var d=this.elements;a.set(d[0],d[1],d[2]);b.set(d[4],d[5],d[6]);c.set(d[8],d[9],d[10]);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],
 b[5],b[6]).length(),g=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*g;c[9]=b[9]*g;c[10]=b[10]*g;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=
 g*h;var k=g*e,l=c*h,m=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+l*d;b[5]=a-m*d;b[9]=-c*f;b[2]=m-a*d;b[6]=l+k*d;b[10]=g*f}else"YXZ"===a.order?(a=f*h,k=f*e,l=d*h,m=d*e,b[0]=a+m*c,b[4]=l*c-k,b[8]=g*d,b[1]=g*e,b[5]=g*h,b[9]=-c,b[2]=k*c-l,b[6]=m+a*c,b[10]=g*f):"ZXY"===a.order?(a=f*h,k=f*e,l=d*h,m=d*e,b[0]=a-m*c,b[4]=-g*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=g*h,b[9]=m-a*c,b[2]=-g*d,b[6]=c,b[10]=g*f):"ZYX"===a.order?(a=g*h,k=g*e,l=c*h,m=c*e,b[0]=f*h,b[4]=l*d-k,b[8]=a*d+m,b[1]=f*e,b[5]=m*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*
 f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,m=c*d,b[0]=f*h,b[4]=m-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-m*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,m=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+m,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=m*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},
 makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var l=c*h,c=c*k,m=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(m+e);b[4]=l-g;b[8]=c+h;b[1]=l+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+m);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);var f=this.elements;c.subVectors(d,
 e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,
-d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],m=c[5],p=c[9],n=c[13],q=c[2],s=c[6],r=c[10],u=c[14],x=c[3],v=c[7],z=c[11],c=c[15],w=d[0],H=d[4],I=d[8],y=d[12],D=d[1],F=d[5],B=d[9],C=d[13],S=d[2],G=d[6],A=d[10],E=d[14],J=d[3],M=d[7],R=d[11],d=d[15];e[0]=g*w+f*D+h*S+k*J;e[4]=g*H+f*F+h*G+k*M;e[8]=g*I+f*B+h*A+k*R;e[12]=g*y+f*C+h*E+k*d;e[1]=l*w+m*D+p*S+n*J;e[5]=l*H+m*F+p*G+n*M;e[9]=l*I+m*B+p*A+n*R;e[13]=l*y+m*C+p*E+n*d;e[2]=q*w+s*D+r*S+u*J;e[6]=q*H+s*F+r*G+u*M;e[10]=q*I+s*B+r*A+u*R;e[14]=
-q*y+s*C+r*E+u*d;e[3]=x*w+v*D+z*S+c*J;e[7]=x*H+v*F+z*G+c*M;e[11]=x*I+v*B+z*A+c*R;e[15]=x*y+v*C+z*E+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
+d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],m=c[5],p=c[9],n=c[13],q=c[2],r=c[6],s=c[10],u=c[14],x=c[3],v=c[7],z=c[11],c=c[15],w=d[0],H=d[4],I=d[8],y=d[12],D=d[1],F=d[5],B=d[9],C=d[13],S=d[2],G=d[6],A=d[10],E=d[14],J=d[3],M=d[7],R=d[11],d=d[15];e[0]=g*w+f*D+h*S+k*J;e[4]=g*H+f*F+h*G+k*M;e[8]=g*I+f*B+h*A+k*R;e[12]=g*y+f*C+h*E+k*d;e[1]=l*w+m*D+p*S+n*J;e[5]=l*H+m*F+p*G+n*M;e[9]=l*I+m*B+p*A+n*R;e[13]=l*y+m*C+p*E+n*d;e[2]=q*w+r*D+s*S+u*J;e[6]=q*H+r*F+s*G+u*M;e[10]=q*I+r*B+s*A+u*R;e[14]=
+q*y+r*C+s*E+u*d;e[3]=x*w+v*D+z*S+c*J;e[7]=x*H+v*F+z*G+c*M;e[11]=x*I+v*B+z*A+c*R;e[15]=x*y+v*C+z*E+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=
 a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
 return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
 a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],m=a[6],p=a[10],n=a[14];return a[3]*(+e*h*m-d*k*
 m-e*f*p+c*k*p+d*f*n-c*h*n)+a[7]*(+b*h*n-b*k*p+e*g*p-d*g*n+d*k*l-e*h*l)+a[11]*(+b*k*m-b*f*n-e*g*m+c*g*n+e*f*l-c*k*l)+a[15]*(-d*f*l-b*h*m+b*f*p+d*g*m-c*g*p+c*h*l)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=
 c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a;return function(){void 0===a&&(a=new THREE.Vector3);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=
-this.elements,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[12],k=d[1],l=d[5],m=d[9],p=d[13],n=d[2],q=d[6],s=d[10],r=d[14],u=d[3],x=d[7],v=d[11],d=d[15];c[0]=m*r*x-p*s*x+p*q*v-l*r*v-m*q*d+l*s*d;c[4]=h*s*x-f*r*x-h*q*v+g*r*v+f*q*d-g*s*d;c[8]=f*p*x-h*m*x+h*l*v-g*p*v-f*l*d+g*m*d;c[12]=h*m*q-f*p*q-h*l*s+g*p*s+f*l*r-g*m*r;c[1]=p*s*u-m*r*u-p*n*v+k*r*v+m*n*d-k*s*d;c[5]=f*r*u-h*s*u+h*n*v-e*r*v-f*n*d+e*s*d;c[9]=h*m*u-f*p*u-h*k*v+e*p*v+f*k*d-e*m*d;c[13]=f*p*n-h*m*n+h*k*s-e*p*s-f*k*r+e*m*r;c[2]=l*r*u-p*q*u+p*n*x-k*r*
-x-l*n*d+k*q*d;c[6]=h*q*u-g*r*u-h*n*x+e*r*x+g*n*d-e*q*d;c[10]=g*p*u-h*l*u+h*k*x-e*p*x-g*k*d+e*l*d;c[14]=h*l*n-g*p*n-h*k*q+e*p*q+g*k*r-e*l*r;c[3]=m*q*u-l*s*u-m*n*x+k*s*x+l*n*v-k*q*v;c[7]=g*s*u-f*q*u+f*n*x-e*s*x-g*n*v+e*q*v;c[11]=f*l*u-g*m*u-f*k*x+e*m*x+g*k*v-e*l*v;c[15]=g*m*n-f*l*n+f*k*q-e*m*q-g*k*s+e*l*s;c=e*c[0]+k*c[4]+n*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
+this.elements,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[12],k=d[1],l=d[5],m=d[9],p=d[13],n=d[2],q=d[6],r=d[10],s=d[14],u=d[3],x=d[7],v=d[11],d=d[15];c[0]=m*s*x-p*r*x+p*q*v-l*s*v-m*q*d+l*r*d;c[4]=h*r*x-f*s*x-h*q*v+g*s*v+f*q*d-g*r*d;c[8]=f*p*x-h*m*x+h*l*v-g*p*v-f*l*d+g*m*d;c[12]=h*m*q-f*p*q-h*l*r+g*p*r+f*l*s-g*m*s;c[1]=p*r*u-m*s*u-p*n*v+k*s*v+m*n*d-k*r*d;c[5]=f*s*u-h*r*u+h*n*v-e*s*v-f*n*d+e*r*d;c[9]=h*m*u-f*p*u-h*k*v+e*p*v+f*k*d-e*m*d;c[13]=f*p*n-h*m*n+h*k*r-e*p*r-f*k*s+e*m*s;c[2]=l*s*u-p*q*u+p*n*x-k*s*
+x-l*n*d+k*q*d;c[6]=h*q*u-g*s*u-h*n*x+e*s*x+g*n*d-e*q*d;c[10]=g*p*u-h*l*u+h*k*x-e*p*x-g*k*d+e*l*d;c[14]=h*l*n-g*p*n-h*k*q+e*p*q+g*k*s-e*l*s;c[3]=m*q*u-l*r*u-m*n*x+k*r*x+l*n*v-k*q*v;c[7]=g*r*u-f*q*u+f*n*x-e*r*x-g*n*v+e*q*v;c[11]=f*l*u-g*m*u-f*k*x+e*m*x+g*k*v-e*l*v;c[15]=g*m*n-f*l*n+f*k*q-e*m*q-g*k*r+e*l*r;c=e*c[0]+k*c[4]+n*c[8]+u*c[12];if(0===c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");
 this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=
 this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,
 0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,k=e*g,l=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,l*f+c,l*h-d*g,0,k*h-d*f,l*h+d*g,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,
@@ -132,8 +132,8 @@ THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.c
 this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);
 return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};
 THREE.Frustum=function(a,b,c,d,e,g){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==g?g:new THREE.Plane]};
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,g){var f=this.planes;f[0].copy(a);f[1].copy(b);f[2].copy(c);f[3].copy(d);f[4].copy(e);f[5].copy(g);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],g=c[3],f=c[4],h=c[5],k=c[6],l=c[7],m=c[8],p=c[9],n=c[10],q=c[11],s=c[12],r=c[13],u=c[14],c=c[15];b[0].setComponents(g-a,l-f,q-m,c-s).normalize();b[1].setComponents(g+
-a,l+f,q+m,c+s).normalize();b[2].setComponents(g+d,l+h,q+p,c+r).normalize();b[3].setComponents(g-d,l-h,q-p,c-r).normalize();b[4].setComponents(g-e,l-k,q-n,c-u).normalize();b[5].setComponents(g+e,l+k,q+n,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,g){var f=this.planes;f[0].copy(a);f[1].copy(b);f[2].copy(c);f[3].copy(d);f[4].copy(e);f[5].copy(g);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],g=c[3],f=c[4],h=c[5],k=c[6],l=c[7],m=c[8],p=c[9],n=c[10],q=c[11],r=c[12],s=c[13],u=c[14],c=c[15];b[0].setComponents(g-a,l-f,q-m,c-r).normalize();b[1].setComponents(g+
+a,l+f,q+m,c+r).normalize();b[2].setComponents(g+d,l+h,q+p,c+s).normalize();b[3].setComponents(g-d,l-h,q-p,c-s).normalize();b[4].setComponents(g-e,l-k,q-n,c-u).normalize();b[5].setComponents(g+e,l+k,q+n,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
 c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var g=d[e];a.x=0<g.normal.x?c.min.x:c.max.x;b.x=0<g.normal.x?c.max.x:c.min.x;a.y=0<g.normal.y?c.min.y:c.max.y;b.y=0<g.normal.y?c.max.y:c.min.y;a.z=0<g.normal.z?c.min.z:c.max.z;b.z=0<g.normal.z?c.max.z:c.min.z;var f=g.distanceToPoint(a),g=g.distanceToPoint(b);if(0>f&&0>g)return!1}return!0}}(),
 containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
@@ -196,60 +196,60 @@ return this},setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data
 THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=
 this.elementsNeedUpdate=this.verticesNeedUpdate=this.hasTangents=!1};
 THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,g=a.vertexNormals.length;e<g;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=
-this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,g=void 0!==c.normal?c.normal.array:void 0,f=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=void 0!==c.uv2?c.uv2.array:void 0,l=void 0!==c.tangent?c.tangent.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);void 0!==l&&(this.hasTangents=!0);for(var m=[],p=[],n=[],q=[],s=c=0,r=0;c<d.length;c+=3,s+=2,r+=4)b.vertices.push(new THREE.Vector3(d[c],
-d[c+1],d[c+2])),void 0!==g&&m.push(new THREE.Vector3(g[c],g[c+1],g[c+2])),void 0!==f&&b.colors.push(new THREE.Color(f[c],f[c+1],f[c+2])),void 0!==h&&p.push(new THREE.Vector2(h[s],h[s+1])),void 0!==k&&n.push(new THREE.Vector2(k[s],k[s+1])),void 0!==l&&q.push(new THREE.Vector4(l[r],l[r+1],l[r+2],l[r+3]));r=function(a,c,d){var e=void 0!==g?[m[a].clone(),m[c].clone(),m[d].clone()]:[],s=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[],e=new THREE.Face3(a,c,d,e,s);b.faces.push(e);
-void 0!==h&&b.faceVertexUvs[0].push([p[a].clone(),p[c].clone(),p[d].clone()]);void 0!==k&&b.faceVertexUvs[1].push([n[a].clone(),n[c].clone(),n[d].clone()]);void 0!==l&&e.vertexTangents.push(q[a].clone(),q[c].clone(),q[d].clone())};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var s=d[c],u=s.start,x=s.count,v=s.index,s=u,u=u+x;s<u;s+=3)r(v+e[s],v+e[s+1],v+e[s+2]);else for(c=0;c<e.length;c+=3)r(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)r(c,c+1,c+2);this.computeFaceNormals();
+this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,g=void 0!==c.normal?c.normal.array:void 0,f=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=void 0!==c.uv2?c.uv2.array:void 0,l=void 0!==c.tangent?c.tangent.array:void 0;void 0!==k&&(this.faceVertexUvs[1]=[]);void 0!==l&&(this.hasTangents=!0);for(var m=[],p=[],n=[],q=[],r=c=0,s=0;c<d.length;c+=3,r+=2,s+=4)b.vertices.push(new THREE.Vector3(d[c],
+d[c+1],d[c+2])),void 0!==g&&m.push(new THREE.Vector3(g[c],g[c+1],g[c+2])),void 0!==f&&b.colors.push(new THREE.Color(f[c],f[c+1],f[c+2])),void 0!==h&&p.push(new THREE.Vector2(h[r],h[r+1])),void 0!==k&&n.push(new THREE.Vector2(k[r],k[r+1])),void 0!==l&&q.push(new THREE.Vector4(l[s],l[s+1],l[s+2],l[s+3]));s=function(a,c,d){var e=void 0!==g?[m[a].clone(),m[c].clone(),m[d].clone()]:[],r=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[],e=new THREE.Face3(a,c,d,e,r);b.faces.push(e);
+void 0!==h&&b.faceVertexUvs[0].push([p[a].clone(),p[c].clone(),p[d].clone()]);void 0!==k&&b.faceVertexUvs[1].push([n[a].clone(),n[c].clone(),n[d].clone()]);void 0!==l&&e.vertexTangents.push(q[a].clone(),q[c].clone(),q[d].clone())};if(void 0!==e)if(d=a.drawcalls,0<d.length)for(c=0;c<d.length;c++)for(var r=d[c],u=r.start,x=r.count,v=r.index,r=u,u=u+x;r<u;r+=3)s(v+e[r],v+e[r+1],v+e[r+2]);else for(c=0;c<e.length;c+=3)s(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)s(c,c+1,c+2);this.computeFaceNormals();
 null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.applyMatrix((new THREE.Matrix4).setPosition(a));return a},normalize:function(){this.computeBoundingSphere();var a=this.boundingSphere.center,b=this.boundingSphere.radius,b=0===b?1:1/b,c=new THREE.Matrix4;c.set(b,0,0,-b*a.x,0,b,0,-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);
 return this},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],g=this.vertices[e.a],f=this.vertices[e.b];a.subVectors(this.vertices[e.c],f);b.subVectors(g,f);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,g,f,h=new THREE.Vector3,k=new THREE.Vector3;a=0;for(b=this.faces.length;a<
 b;a++)c=this.faces[a],e=this.vertices[c.a],g=this.vertices[c.b],f=this.vertices[c.c],h.subVectors(f,g),k.subVectors(e,g),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=c.vertexNormals,3===e.length?(e[0].copy(d[c.a]),e[1].copy(d[c.b]),e[2].copy(d[c.c])):(e[0]=d[c.a].clone(),
 e[1]=d[c.b].clone(),e[2]=d[c.c].clone())},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var g=new THREE.Geometry;
 g.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var f=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();
-c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,g,f,h,k,l,m,p,n,q,s,r,u,x=[],v=[];c=new THREE.Vector3;var z=new THREE.Vector3,w=new THREE.Vector3,H=new THREE.Vector3,I=new THREE.Vector3;
-a=0;for(b=this.vertices.length;a<b;a++)x[a]=new THREE.Vector3,v[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,f=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=g[0],m=g[1],p=g[2],g=h.x-f.x,n=k.x-f.x,q=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=m.x-l.x,r=p.x-l.x,m=m.y-l.y,l=p.y-l.y,p=1/(k*l-r*m),c.set((l*g-m*n)*p,(l*q-m*s)*p,(l*h-m*f)*p),z.set((k*n-r*g)*p,(k*s-r*q)*p,(k*f-r*h)*p),x[d].add(c),x[u].add(c),x[e].add(c),v[d].add(z),
+c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,g,f,h,k,l,m,p,n,q,r,s,u,x=[],v=[];c=new THREE.Vector3;var z=new THREE.Vector3,w=new THREE.Vector3,H=new THREE.Vector3,I=new THREE.Vector3;
+a=0;for(b=this.vertices.length;a<b;a++)x[a]=new THREE.Vector3,v[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,u=e.b,e=e.c,f=this.vertices[d],h=this.vertices[u],k=this.vertices[e],l=g[0],m=g[1],p=g[2],g=h.x-f.x,n=k.x-f.x,q=h.y-f.y,r=k.y-f.y,h=h.z-f.z,f=k.z-f.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*g-m*n)*p,(l*q-m*r)*p,(l*h-m*f)*p),z.set((k*n-s*g)*p,(k*r-s*q)*p,(k*f-s*h)*p),x[d].add(c),x[u].add(c),x[e].add(c),v[d].add(z),
 v[u].add(z),v[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++)I.copy(e.vertexNormals[c]),d=e[z[c]],u=x[d],w.copy(u),w.sub(I.multiplyScalar(I.dot(u))).normalize(),H.crossVectors(e.vertexNormals[c],u),d=H.dot(v[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(w.x,w.y,w.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=
 a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b){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,g=a.vertices,f=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=g.length;m<p;m++){var n=g[m].clone();void 0!==b&&n.applyMatrix4(b);e.push(n)}m=0;for(p=h.length;m<p;m++){var q=h[m],s,r=q.vertexNormals,u=q.vertexColors,n=new THREE.Face3(q.a+d,q.b+d,q.c+d);n.normal.copy(q.normal);void 0!==c&&n.normal.applyMatrix3(c).normalize();e=0;for(g=r.length;e<g;e++)s=r[e].clone(),void 0!==c&&s.applyMatrix3(c).normalize(),n.vertexNormals.push(s);n.color.copy(q.color);
+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=g.length;m<p;m++){var n=g[m].clone();void 0!==b&&n.applyMatrix4(b);e.push(n)}m=0;for(p=h.length;m<p;m++){var q=h[m],r,s=q.vertexNormals,u=q.vertexColors,n=new THREE.Face3(q.a+d,q.b+d,q.c+d);n.normal.copy(q.normal);void 0!==c&&n.normal.applyMatrix3(c).normalize();e=0;for(g=s.length;e<g;e++)r=s[e].clone(),void 0!==c&&r.applyMatrix3(c).normalize(),n.vertexNormals.push(r);n.color.copy(q.color);
 e=0;for(g=u.length;e<g;e++)q=u[e],n.vertexColors.push(q.clone());f.push(n)}m=0;for(p=l.length;m<p;m++)if(c=l[m],d=[],void 0!==c){e=0;for(g=c.length;e<g;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),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=
 this.vertices[g],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];a=[];g=0;for(f=this.faces.length;g<f;g++)for(e=this.faces[g],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]===e[(d+1)%3]){a.push(g);break}for(g=a.length-1;0<=g;g--)for(e=a[g],this.faces.splice(e,1),c=0,f=this.faceVertexUvs.length;c<f;c++)this.faceVertexUvs[c].splice(e,1);g=this.vertices.length-b.length;this.vertices=b;return g},
 toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==l[b])return l[b];l[b]=k.length/3;k.push(a.x,a.y,a.z);return l[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=m.length;m.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=n.length/2;n.push(a.x,a.y);return q[b]}var e={metadata:{version:4.4,type:"Geometry",
-generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],l={},m=[],p={},n=[],q={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],r=void 0!==this.faceVertexUvs[0][f],u=0<s.normal.length(),x=0<s.vertexNormals.length,v=1!==s.color.r||1!==s.color.g||1!==s.color.b,
-z=0<s.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,r),w=a(w,4,u),w=a(w,5,x),w=a(w,6,v),w=a(w,7,z);h.push(w);h.push(s.a,s.b,s.c);r&&(r=this.faceVertexUvs[0][f],h.push(d(r[0]),d(r[1]),d(r[2])));u&&h.push(b(s.normal));x&&(u=s.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));v&&h.push(c(s.color));z&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<m.length&&(e.data.colors=m);0<n.length&&(e.data.uvs=[n]);e.data.faces=h;return e},clone:function(){for(var a=
+generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],l={},m=[],p={},n=[],q={};for(f=0;f<this.faces.length;f++){var r=this.faces[f],s=void 0!==this.faceVertexUvs[0][f],u=0<r.normal.length(),x=0<r.vertexNormals.length,v=1!==r.color.r||1!==r.color.g||1!==r.color.b,
+z=0<r.vertexColors.length,w=0,w=a(w,0,0),w=a(w,1,!1),w=a(w,2,!1),w=a(w,3,s),w=a(w,4,u),w=a(w,5,x),w=a(w,6,v),w=a(w,7,z);h.push(w);h.push(r.a,r.b,r.c);s&&(s=this.faceVertexUvs[0][f],h.push(d(s[0]),d(s[1]),d(s[2])));u&&h.push(b(r.normal));x&&(u=r.vertexNormals,h.push(b(u[0]),b(u[1]),b(u[2])));v&&h.push(c(r.color));z&&(r=r.vertexColors,h.push(c(r[0]),c(r[1]),c(r[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<m.length&&(e.data.colors=m);0<n.length&&(e.data.uvs=[n]);e.data.faces=h;return e},clone:function(){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,g=b.length;e<g;e++){for(var f=b[e],h=[],k=0,l=f.length;k<l;k++)h.push(f[k].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})},set groupsNeedUpdate(a){!0===a&&this.dispose()}};
 THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;
 THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="DirectGeometry";this.indices=[];this.vertices=[];this.colors=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.tangents=[];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.tangentsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=
 this.normalsNeedUpdate=this.verticesNeedUpdate=!1};
 THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.");return this},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.");return this},computeTangents:function(){console.warn("THREE.DirectGeometry: computeTangents() is not a method of this type of geometry.");
-return this},fromGeometry:function(a){for(var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,g=d[1]&&0<d[1].length,f=a.hasTangents,h=a.morphTargets,k=h.length,l=0;l<k;l++)this.morphTargets[l]=[];for(var m=a.morphNormals.length,l=0;l<m;l++)this.morphNormals[l]=[];m=a.morphColors.length;for(l=0;l<m;l++)this.morphColors[l]=[];for(var m=a.skinIndices,p=a.skinWeights,n=m.length===c.length,q=p.length===c.length,l=0;l<b.length;l++){var s=b[l];this.vertices.push(c[s.a],c[s.b],c[s.c]);var r=
-s.vertexNormals;3===r.length?this.normals.push(r[0],r[1],r[2]):(r=s.normal,this.normals.push(r,r,r));r=s.vertexColors;3===r.length?this.colors.push(r[0],r[1],r[2]):(r=s.color,this.colors.push(r,r,r));!0===e&&(r=d[0][l],void 0!==r?this.uvs.push(r[0],r[1],r[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(r=d[1][l],void 0!==r?this.uvs2.push(r[0],r[1],r[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
-l),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(r=s.vertexTangents,3===r.length?this.tangents.push(r[0],r[1],r[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",l),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(r=0;r<k;r++){var u=h[r].vertices;this.morphTargets[r].push(u[s.a],u[s.b],u[s.c])}n&&this.skinIndices.push(m[s.a],m[s.b],m[s.c]);q&&this.skinWeights.push(p[s.a],p[s.b],p[s.c])}this.verticesNeedUpdate=
+return this},fromGeometry:function(a){for(var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,g=d[1]&&0<d[1].length,f=a.hasTangents,h=a.morphTargets,k=h.length,l=0;l<k;l++)this.morphTargets[l]=[];for(var m=a.morphNormals.length,l=0;l<m;l++)this.morphNormals[l]=[];m=a.morphColors.length;for(l=0;l<m;l++)this.morphColors[l]=[];for(var m=a.skinIndices,p=a.skinWeights,n=m.length===c.length,q=p.length===c.length,l=0;l<b.length;l++){var r=b[l];this.vertices.push(c[r.a],c[r.b],c[r.c]);var s=
+r.vertexNormals;3===s.length?this.normals.push(s[0],s[1],s[2]):(s=r.normal,this.normals.push(s,s,s));s=r.vertexColors;3===s.length?this.colors.push(s[0],s[1],s[2]):(s=r.color,this.colors.push(s,s,s));!0===e&&(s=d[0][l],void 0!==s?this.uvs.push(s[0],s[1],s[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===g&&(s=d[1][l],void 0!==s?this.uvs2.push(s[0],s[1],s[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",
+l),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(s=r.vertexTangents,3===s.length?this.tangents.push(s[0],s[1],s[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",l),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(s=0;s<k;s++){var u=h[s].vertices;this.morphTargets[s].push(u[r.a],u[r.b],u[r.c])}n&&this.skinIndices.push(m[r.a],m[r.b],m[r.c]);q&&this.skinWeights.push(p[r.a],p[r.b],p[r.c])}this.verticesNeedUpdate=
 a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.tangentsNeedUpdate=a.tangentsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
-THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
-THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=
-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;if(a instanceof THREE.PointCloud||a instanceof THREE.Line){a=new THREE.Float32Attribute(3*b.vertices.length,3);var c=new THREE.Float32Attribute(3*b.colors.length,3);this.addAttribute("position",a.copyVector3sArray(b.vertices));
-this.addAttribute("color",c.copyColorsArray(b.colors));b.lineDistances&&b.lineDistances.length===b.vertices.length&&(a=new THREE.Float32Attribute(b.lineDistances.length,1),this.addAttribute("lineDistance",a.copyArray(b.lineDistances)));null!==b.boundingSphere&&(this.boundingSphere=b.boundingSphere.clone());null!==b.boundingBox&&(this.boundingBox=b.boundingBox.clone())}else a instanceof THREE.Mesh&&b instanceof THREE.Geometry&&this.fromGeometry(b);return this},updateFromObject:function(a){var b=a.geometry;
-a instanceof THREE.Mesh&&(a=b.__directGeometry,a.verticesNeedUpdate=b.verticesNeedUpdate,a.normalsNeedUpdate=b.normalsNeedUpdate,a.colorsNeedUpdate=b.colorsNeedUpdate,a.uvsNeedUpdate=b.uvsNeedUpdate,a.tangentsNeedUpdate=b.tangentsNeedUpdate,b.verticesNeedUpdate=!1,b.normalsNeedUpdate=!1,b.colorsNeedUpdate=!1,b.uvsNeedUpdate=!1,b.tangentsNeedUpdate=!1,b=a);!0===b.verticesNeedUpdate&&(a=this.attributes.position,void 0!==a&&(a.copyVector3sArray(b.vertices),a.needsUpdate=!0),b.verticesNeedUpdate=!1);
-!0===b.normalsNeedUpdate&&(a=this.attributes.normal,void 0!==a&&(a.copyVector3sArray(b.normals),a.needsUpdate=!0),b.normalsNeedUpdate=!1);!0===b.colorsNeedUpdate&&(a=this.attributes.color,void 0!==a&&(a.copyColorsArray(b.colors),a.needsUpdate=!0),b.colorsNeedUpdate=!1);!0===b.tangentsNeedUpdate&&(a=this.attributes.tangent,void 0!==a&&(a.copyVector4sArray(b.tangents),a.needsUpdate=!0),b.tangentsNeedUpdate=!1);b.lineDistancesNeedUpdate&&(a=this.attributes.lineDistance,void 0!==a&&(a.copyArray(b.lineDistances),
-a.needsUpdate=!0),b.lineDistancesNeedUpdate=!1);return this},fromGeometry:function(a){a.__directGeometry=(new THREE.DirectGeometry).fromGeometry(a);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){var 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)).copyColorsArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute("uv",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs)));0<a.uvs2.length&&(b=new Float32Array(2*a.uvs2.length),this.addAttribute("uv2",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs2)));0<a.tangents.length&&(b=new Float32Array(4*a.tangents.length),this.addAttribute("tangent",
-(new THREE.BufferAttribute(b,4)).copyVector4sArray(a.tangents)));0<a.indices.length&&(b=new Uint16Array(3*a.indices.length),this.addAttribute("index",(new THREE.BufferAttribute(b,1)).copyIndicesArray(a.indices)));if(0<a.morphTargets.length)for(var b=a.morphTargets,c=0,d=b.length;c<d;c++){var e=b[c],g=new THREE.Float32Attribute(3*e.length,3);this.morphAttributes.push(g.copyVector3sArray(e))}0<a.skinIndices.length&&(b=new THREE.Float32Attribute(4*a.skinIndices.length,4),this.addAttribute("skinIndex",
-b.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&(b=new THREE.Float32Attribute(4*a.skinWeights.length,4),this.addAttribute("skinWeight",b.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;
-if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=new THREE.Box3,
-b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
-this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;if(a.index)for(var q=a.index.array,s=0<this.offsets.length?this.offsets:[{start:0,
-count:q.length,index:0}],r=0,u=s.length;r<u;++r){e=s[r].start;g=s[r].count;for(var x=s[r].index,d=e,e=e+g;d<e;d+=3)g=3*(x+q[d]),f=3*(x+q[d+1]),h=3*(x+q[d+2]),k.fromArray(b,g),l.fromArray(b,f),m.fromArray(b,h),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),m.fromArray(b,d+6),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[d]=p.x,
-c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);n.fromArray(d,3*b);q.fromArray(d,3*c);s.fromArray(g,2*a);r.fromArray(g,2*b);u.fromArray(g,2*c);x=n.x-p.x;v=q.x-p.x;z=n.y-p.y;w=q.y-p.y;H=n.z-p.z;I=q.z-p.z;y=r.x-s.x;D=u.x-s.x;F=r.y-s.y;B=u.y-s.y;C=1/(y*B-D*F);S.set((B*x-F*v)*C,(B*z-F*w)*C,(B*H-F*I)*C);G.set((y*v-D*x)*C,(y*w-D*z)*C,(y*I-D*H)*C);k[a].add(S);
-k[b].add(S);k[c].add(S);l[a].add(G);l[b].add(G);l[c].add(G)}function b(a){$.fromArray(e,3*a);ea.copy($);la=k[a];T.copy(la);T.sub($.multiplyScalar($.dot(la))).normalize();L.crossVectors(ea,la);oa=L.dot(l[a]);fa=0>oa?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=fa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
-else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],m=0;m<f;m++)k[m]=new THREE.Vector3,l[m]=new THREE.Vector3;var p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,s=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,x,v,z,w,H,I,
-y,D,F,B,C,S=new THREE.Vector3,G=new THREE.Vector3,A,E,J,M,R;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var U=this.drawcalls,m=0;for(E=U.length;m<E;++m){A=U[m].start;J=U[m].count;var Q=U[m].index,f=A;for(A+=J;f<A;f+=3)J=Q+c[f],M=Q+c[f+1],R=Q+c[f+2],a(J,M,R)}var T=new THREE.Vector3,L=new THREE.Vector3,$=new THREE.Vector3,ea=new THREE.Vector3,fa,la,oa,m=0;for(E=U.length;m<E;++m)for(A=U[m].start,J=U[m].count,Q=U[m].index,f=A,A+=J;f<A;f+=3)J=Q+c[f],M=Q+c[f+1],R=Q+c[f+2],b(J),b(M),b(R)}},
-computeOffsets:function(a){void 0===a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,m=0,p=new Int32Array(6),n=new Int32Array(c.length),q=new Int32Array(c.length),s=0;s<c.length;s++)n[s]=-1,q[s]=-1;for(c=0;c<d;c++){for(var r=m=0;3>r;r++)s=b[3*c+r],-1===n[s]?(p[2*r]=s,p[2*r+1]=-1,m++):
-n[s]<k.index?(p[2*r]=s,p[2*r+1]=-1,l++):(p[2*r]=s,p[2*r+1]=n[s]);if(f+m>k.index+a)for(k={start:g,count:0,index:f},h.push(k),m=0;6>m;m+=2)r=p[m+1],-1<r&&r<k.index&&(p[m+1]=-1);for(m=0;6>m;m+=2)s=p[m],r=p[m+1],-1===r&&(r=f++),n[s]=r,q[r]=s,e[g++]=r-k.index,k.count++}this.reorderBuffers(e,q,f);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,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
+THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes=[];this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
+THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .drawcalls.");return this.drawcalls},
+addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},clearDrawCalls:function(){this.drawcalls=[]},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.drawcalls;for(var c in b)this.addAttribute(c,b[c].clone());b=0;for(c=a.length;b<c;b++){var d=a[b];this.addDrawCall(d.start,d.count,d.index)}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;if(a instanceof THREE.PointCloud||a instanceof THREE.Line){a=new THREE.Float32Attribute(3*
+b.vertices.length,3);var c=new THREE.Float32Attribute(3*b.colors.length,3);this.addAttribute("position",a.copyVector3sArray(b.vertices));this.addAttribute("color",c.copyColorsArray(b.colors));b.lineDistances&&b.lineDistances.length===b.vertices.length&&(a=new THREE.Float32Attribute(b.lineDistances.length,1),this.addAttribute("lineDistance",a.copyArray(b.lineDistances)));null!==b.boundingSphere&&(this.boundingSphere=b.boundingSphere.clone());null!==b.boundingBox&&(this.boundingBox=b.boundingBox.clone())}else a instanceof
+THREE.Mesh&&b instanceof THREE.Geometry&&this.fromGeometry(b);return this},updateFromObject:function(a){var b=a.geometry;a instanceof THREE.Mesh&&(a=b.__directGeometry,a.verticesNeedUpdate=b.verticesNeedUpdate,a.normalsNeedUpdate=b.normalsNeedUpdate,a.colorsNeedUpdate=b.colorsNeedUpdate,a.uvsNeedUpdate=b.uvsNeedUpdate,a.tangentsNeedUpdate=b.tangentsNeedUpdate,b.verticesNeedUpdate=!1,b.normalsNeedUpdate=!1,b.colorsNeedUpdate=!1,b.uvsNeedUpdate=!1,b.tangentsNeedUpdate=!1,b=a);!0===b.verticesNeedUpdate&&
+(a=this.attributes.position,void 0!==a&&(a.copyVector3sArray(b.vertices),a.needsUpdate=!0),b.verticesNeedUpdate=!1);!0===b.normalsNeedUpdate&&(a=this.attributes.normal,void 0!==a&&(a.copyVector3sArray(b.normals),a.needsUpdate=!0),b.normalsNeedUpdate=!1);!0===b.colorsNeedUpdate&&(a=this.attributes.color,void 0!==a&&(a.copyColorsArray(b.colors),a.needsUpdate=!0),b.colorsNeedUpdate=!1);!0===b.tangentsNeedUpdate&&(a=this.attributes.tangent,void 0!==a&&(a.copyVector4sArray(b.tangents),a.needsUpdate=!0),
+b.tangentsNeedUpdate=!1);b.lineDistancesNeedUpdate&&(a=this.attributes.lineDistance,void 0!==a&&(a.copyArray(b.lineDistances),a.needsUpdate=!0),b.lineDistancesNeedUpdate=!1);return this},fromGeometry:function(a){a.__directGeometry=(new THREE.DirectGeometry).fromGeometry(a);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){var 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)).copyColorsArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute("uv",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs)));0<a.uvs2.length&&(b=new Float32Array(2*a.uvs2.length),this.addAttribute("uv2",(new THREE.BufferAttribute(b,
+2)).copyVector2sArray(a.uvs2)));0<a.tangents.length&&(b=new Float32Array(4*a.tangents.length),this.addAttribute("tangent",(new THREE.BufferAttribute(b,4)).copyVector4sArray(a.tangents)));0<a.indices.length&&(b=new Uint16Array(3*a.indices.length),this.addAttribute("index",(new THREE.BufferAttribute(b,1)).copyIndicesArray(a.indices)));if(0<a.morphTargets.length)for(var b=a.morphTargets,c=0,d=b.length;c<d;c++){var e=b[c],g=new THREE.Float32Attribute(3*e.length,3);this.morphAttributes.push(g.copyVector3sArray(e))}0<
+a.skinIndices.length&&(b=new THREE.Float32Attribute(4*a.skinIndices.length,4),this.addAttribute("skinIndex",b.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&(b=new THREE.Float32Attribute(4*a.skinWeights.length,4),this.addAttribute("skinWeight",b.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===
+this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
+this)}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
+this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3;if(a.index){var q=a.index.array;0===this.drawcalls.length&&this.addDrawCall(0,
+q.length);for(var r=0,s=this.drawcalls.length;r<s;++r){e=this.drawcalls[r].start;g=this.drawcalls[r].count;for(var u=this.drawcalls[r].index,d=e,e=e+g;d<e;d+=3)g=3*(u+q[d]),f=3*(u+q[d+1]),h=3*(u+q[d+2]),k.fromArray(b,g),l.fromArray(b,f),m.fromArray(b,h),p.subVectors(m,l),n.subVectors(k,l),p.cross(n),c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}}else for(d=0,e=b.length;d<e;d+=9)k.fromArray(b,d),l.fromArray(b,d+3),m.fromArray(b,d+6),p.subVectors(m,
+l),n.subVectors(k,l),p.cross(n),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);n.fromArray(d,3*b);q.fromArray(d,3*c);r.fromArray(g,2*a);s.fromArray(g,2*b);u.fromArray(g,2*c);x=n.x-p.x;v=q.x-p.x;z=n.y-p.y;w=q.y-p.y;H=n.z-p.z;I=q.z-p.z;y=s.x-r.x;D=u.x-r.x;F=s.y-r.y;B=u.y-r.y;C=1/(y*B-D*F);S.set((B*x-F*v)*C,(B*z-F*w)*C,(B*H-F*I)*C);G.set((y*
+v-D*x)*C,(y*w-D*z)*C,(y*I-D*H)*C);k[a].add(S);k[b].add(S);k[c].add(S);l[a].add(G);l[b].add(G);l[c].add(G)}function b(a){$.fromArray(e,3*a);ea.copy($);la=k[a];T.copy(la);T.sub($.multiplyScalar($.dot(la))).normalize();L.crossVectors(ea,la);oa=L.dot(l[a]);fa=0>oa?-1:1;h[4*a]=T.x;h[4*a+1]=T.y;h[4*a+2]=T.z;h[4*a+3]=fa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
+else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],m=0;m<f;m++)k[m]=new THREE.Vector3,l[m]=new THREE.Vector3;var p=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,r=new THREE.Vector2,s=new THREE.Vector2,u=new THREE.Vector2,x,v,z,w,H,I,
+y,D,F,B,C,S=new THREE.Vector3,G=new THREE.Vector3,A,E,J,M,R;0===this.drawcalls.length&&this.addDrawCall(0,c.length);var U=this.drawcalls,m=0;for(E=U.length;m<E;++m){A=U[m].start;J=U[m].count;var Q=U[m].index,f=A;for(A+=J;f<A;f+=3)J=Q+c[f],M=Q+c[f+1],R=Q+c[f+2],a(J,M,R)}var T=new THREE.Vector3,L=new THREE.Vector3,$=new THREE.Vector3,ea=new THREE.Vector3,fa,la,oa,m=0;for(E=U.length;m<E;++m)for(A=U[m].start,J=U[m].count,Q=U[m].index,f=A,A+=J;f<A;f+=3)J=Q+c[f],M=Q+c[f+1],R=Q+c[f+2],b(J),b(M),b(R)}},computeOffsets:function(a){void 0===
+a&&(a=THREE.BufferGeometry.MaxIndex);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new (65535<c.length/3&&65535<THREE.BufferGeometry.MaxIndex?Uint32Array:Uint16Array)(b.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,m=0,p=new Int32Array(6),n=new Int32Array(c.length),q=new Int32Array(c.length),r=0;r<c.length;r++)n[r]=-1,q[r]=-1;for(c=0;c<d;c++){for(var s=m=0;3>s;s++)r=b[3*c+s],-1===n[r]?(p[2*s]=r,p[2*s+1]=-1,m++):n[r]<k.index?(p[2*s]=r,p[2*s+1]=-1,
+l++):(p[2*s]=r,p[2*s+1]=n[r]);if(f+m>k.index+a)for(k={start:g,count:0,index:f},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)r=p[m],s=p[m+1],-1===s&&(s=f++),n[r]=s,q[s]=r,e[g++]=s-k.index,k.count++}this.reorderBuffers(e,q,f);this.clearDrawCalls();for(a=0;a<h.length;a++)b=h[a],this.addDrawCall(b.start,b.count,b.index)},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
+a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*
 c));for(var g=0;g<c;g++){var f=b[g];for(e in this.attributes)if("index"!==e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],m=0;m<k;m++)l[g*k+m]=h[f*k+m]}this.attributes.index.array=a;for(e in this.attributes)"index"!==e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);
-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 g=b[c],f=Array.prototype.slice.call(g.array);a.data.attributes[c]={itemSize:g.itemSize,type:g.array.constructor.name,array:f}}0<d.length&&(a.data.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);
+if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var b=this.attributes,d=this.drawcalls,e=this.boundingSphere;for(c in b){var g=b[c],f=Array.prototype.slice.call(g.array);a.data.attributes[c]={itemSize:g.itemSize,type:g.array.constructor.name,array:f}}0<d.length&&(a.data.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.drawcalls.length;b<c;b++){var d=this.drawcalls[b];a.addDrawCall(d.start,d.count,d.index)}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.drawcalls.length;b<c;b++){var d=this.drawcalls[b];a.addDrawCall(d.start,d.count,d.index,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 g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,1);g.lookAt(new THREE.Vector3(0,1,0));this.add(g);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,-1);f.lookAt(new THREE.Vector3(0,-1,0));
@@ -293,17 +293,17 @@ void 0!==this.responseType&&(f.responseType=this.responseType);void 0!==this.wit
 THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,g=THREE.Cache.get(a);if(void 0!==g)return b&&setTimeout(function(){b(g)},0),g;var f=document.createElement("img");f.addEventListener("load",function(c){THREE.Cache.add(a,this);b&&b(this);e.manager.itemEnd(a)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);e.manager.itemStart(a);
 f.src=a;return f},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this.withCredentials=!1};
 THREE.JSONLoader.prototype={constructor:THREE.JSONLoader,load:function(a,b,c,d){var e=this,g=this.texturePath&&"string"===typeof this.texturePath?this.texturePath:THREE.Loader.prototype.extractUrlBase(a);c=new THREE.XHRLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.setWithCredentials(this.withCredentials);c.load(a,function(c){c=JSON.parse(c);var d=c.metadata;if(void 0!==d){if("object"===d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.ObjectLoader instead.");return}if("scene"===
-d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,g);b(c.geometry,c.materials)})},setCrossOrigin:function(a){this.crossOrigin=a},setTexturePath:function(a){this.texturePath=a},parse:function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,l,m,p,n,q,s,r,u,x,v=a.faces;m=a.vertices;var z=a.normals,w=a.colors,H=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&H++;for(d=0;d<H;d++)c.faceVertexUvs[d]=
-[]}k=0;for(l=m.length;k<l;)d=new THREE.Vector3,d.x=m[k++]*b,d.y=m[k++]*b,d.z=m[k++]*b,c.vertices.push(d);k=0;for(l=v.length;k<l;)if(b=v[k++],q=b&1,h=b&2,d=b&8,p=b&16,s=b&32,m=b&64,b&=128,q){q=new THREE.Face3;q.a=v[k];q.b=v[k+1];q.c=v[k+3];r=new THREE.Face3;r.a=v[k+1];r.b=v[k+2];r.c=v[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)n=v[k++],x=u[2*n],n=u[2*n+1],x=new THREE.Vector2(x,n),2!==f&&c.faceVertexUvs[d][h].push(x),
-0!==f&&c.faceVertexUvs[d][h+1].push(x);p&&(p=3*v[k++],q.normal.set(z[p++],z[p++],z[p]),r.normal.copy(q.normal));if(s)for(d=0;4>d;d++)p=3*v[k++],s=new THREE.Vector3(z[p++],z[p++],z[p]),2!==d&&q.vertexNormals.push(s),0!==d&&r.vertexNormals.push(s);m&&(m=v[k++],m=w[m],q.color.setHex(m),r.color.setHex(m));if(b)for(d=0;4>d;d++)m=v[k++],m=w[m],2!==d&&q.vertexColors.push(new THREE.Color(m)),0!==d&&r.vertexColors.push(new THREE.Color(m));c.faces.push(q);c.faces.push(r)}else{q=new THREE.Face3;q.a=v[k++];q.b=
-v[k++];q.c=v[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)n=v[k++],x=u[2*n],n=u[2*n+1],x=new THREE.Vector2(x,n),c.faceVertexUvs[d][h].push(x);p&&(p=3*v[k++],q.normal.set(z[p++],z[p++],z[p]));if(s)for(d=0;3>d;d++)p=3*v[k++],s=new THREE.Vector3(z[p++],z[p++],z[p]),q.vertexNormals.push(s);m&&(m=v[k++],q.color.setHex(w[m]));if(b)for(d=0;3>d;d++)m=v[k++],q.vertexColors.push(new THREE.Color(w[m]));c.faces.push(q)}})(d);(function(){var b=void 0!==
+d.type){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,g);b(c.geometry,c.materials)})},setCrossOrigin:function(a){this.crossOrigin=a},setTexturePath:function(a){this.texturePath=a},parse:function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,l,m,p,n,q,r,s,u,x,v=a.faces;m=a.vertices;var z=a.normals,w=a.colors,H=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&H++;for(d=0;d<H;d++)c.faceVertexUvs[d]=
+[]}k=0;for(l=m.length;k<l;)d=new THREE.Vector3,d.x=m[k++]*b,d.y=m[k++]*b,d.z=m[k++]*b,c.vertices.push(d);k=0;for(l=v.length;k<l;)if(b=v[k++],q=b&1,h=b&2,d=b&8,p=b&16,r=b&32,m=b&64,b&=128,q){q=new THREE.Face3;q.a=v[k];q.b=v[k+1];q.c=v[k+3];s=new THREE.Face3;s.a=v[k+1];s.b=v[k+2];s.c=v[k+3];k+=4;h&&k++;h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)n=v[k++],x=u[2*n],n=u[2*n+1],x=new THREE.Vector2(x,n),2!==f&&c.faceVertexUvs[d][h].push(x),
+0!==f&&c.faceVertexUvs[d][h+1].push(x);p&&(p=3*v[k++],q.normal.set(z[p++],z[p++],z[p]),s.normal.copy(q.normal));if(r)for(d=0;4>d;d++)p=3*v[k++],r=new THREE.Vector3(z[p++],z[p++],z[p]),2!==d&&q.vertexNormals.push(r),0!==d&&s.vertexNormals.push(r);m&&(m=v[k++],m=w[m],q.color.setHex(m),s.color.setHex(m));if(b)for(d=0;4>d;d++)m=v[k++],m=w[m],2!==d&&q.vertexColors.push(new THREE.Color(m)),0!==d&&s.vertexColors.push(new THREE.Color(m));c.faces.push(q);c.faces.push(s)}else{q=new THREE.Face3;q.a=v[k++];q.b=
+v[k++];q.c=v[k++];h&&k++;h=c.faces.length;if(d)for(d=0;d<H;d++)for(u=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)n=v[k++],x=u[2*n],n=u[2*n+1],x=new THREE.Vector2(x,n),c.faceVertexUvs[d][h].push(x);p&&(p=3*v[k++],q.normal.set(z[p++],z[p++],z[p]));if(r)for(d=0;3>d;d++)p=3*v[k++],r=new THREE.Vector3(z[p++],z[p++],z[p]),q.vertexNormals.push(r);m&&(m=v[k++],q.color.setHex(w[m]));if(b)for(d=0;3>d;d++)m=v[k++],q.vertexColors.push(new THREE.Color(w[m]));c.faces.push(q)}})(d);(function(){var b=void 0!==
 a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;d<f;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,f=a.skinIndices.length;d<f;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||
 c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,f,h,k,l,m;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,m=a.morphTargets[d].vertices,
 h=0,k=m.length;h<k;h+=3){var p=new THREE.Vector3;p.x=m[h]*b;p.y=m[h+1]*b;p.z=m[h+2]*b;l.push(p)}}if(void 0!==a.morphColors)for(d=0,f=a.morphColors.length;d<f;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)m=new THREE.Color(16755200),m.setRGB(l[b],l[b+1],l[b+2]),k.push(m)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};
 d=THREE.Loader.prototype.initMaterials(a.materials,b,this.crossOrigin);THREE.Loader.prototype.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}}};THREE.LoadingManager=function(a,b,c){var d=this,e=!1,g=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++;if(!1===e&&void 0!==d.onStart)d.onStart(a,g,f);e=!0};this.itemEnd=function(a){g++;if(void 0!==d.onProgress)d.onProgress(a,g,f);if(g===f&&(e=!1,void 0!==d.onLoad))d.onLoad()}};
 THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
-THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,g=new THREE.XHRLoader(e.manager);g.setCrossOrigin(this.crossOrigin);g.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.data.attributes,d;for(d in c){var e=c[d],g=new self[e.type](e.array);b.addAttribute(d,new THREE.BufferAttribute(g,e.itemSize))}c=a.data.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};
+THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,g=new THREE.XHRLoader(e.manager);g.setCrossOrigin(this.crossOrigin);g.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.data.attributes,d;for(d in c){var e=c[d],g=new self[e.type](e.array);b.addAttribute(d,new THREE.BufferAttribute(g,e.itemSize))}c=a.data.offsets;if(void 0!==c)for(c=JSON.parse(JSON.stringify(c)),
+d=0;d<c.length;d++)e=c[d],b.addDrawcall(e.start,e.count,e.index);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};
 THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b,c,d){var e=this,g=new THREE.XHRLoader(e.manager);g.setCrossOrigin(this.crossOrigin);g.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE[a.type];void 0!==a.color&&b.color.setHex(a.color);void 0!==a.emissive&&b.emissive.setHex(a.emissive);void 0!==a.specular&&b.specular.setHex(a.specular);void 0!==a.shininess&&(b.shininess=a.shininess);
 void 0!==a.uniforms&&(b.uniforms=a.uniforms);void 0!==a.attributes&&(b.attributes=a.attributes);void 0!==a.vertexShader&&(b.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(b.fragmentShader=a.fragmentShader);void 0!==a.vertexColors&&(b.vertexColors=a.vertexColors);void 0!==a.shading&&(b.shading=a.shading);void 0!==a.blending&&(b.blending=a.blending);void 0!==a.side&&(b.side=a.side);void 0!==a.opacity&&(b.opacity=a.opacity);void 0!==a.transparent&&(b.transparent=a.transparent);void 0!==a.wireframe&&
 (b.wireframe=a.wireframe);void 0!==a.alphaTest&&(b.alphaTest=a.alphaTest);void 0!==a.size&&(b.size=a.size);void 0!==a.sizeAttenuation&&(b.sizeAttenuation=a.sizeAttenuation);if(void 0!==a.materials)for(var c=0,d=a.materials.length;c<d;c++)b.materials.push(this.parse(a.materials[c]));return b}};THREE.ObjectLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager;this.texturePath=""};
@@ -376,24 +376,24 @@ THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.T
 THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);THREE.Group.prototype.constructor=THREE.Group;THREE.Group.prototype.clone=function(a){void 0===a&&(a=new THREE.Group);THREE.Object3D.prototype.clone.call(this,a);return a};THREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.type="PointCloud";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()})};
 THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);THREE.PointCloud.prototype.constructor=THREE.PointCloud;
 THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,g=e.geometry,f=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===g.boundingBox||!1!==b.isIntersectionBox(g.boundingBox)){var f=f/((this.scale.x+this.scale.y+this.scale.z)/3),h=f*f,k=new THREE.Vector3,f=function(a,f){var g=b.distanceSqToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var l=c.ray.origin.distanceTo(k);
-l<c.near||l>c.far||d.push({distance:l,distanceToRay:Math.sqrt(g),point:k.clone(),index:f,face:null,object:e})}};if(g instanceof THREE.BufferGeometry){var l=g.attributes,m=l.position.array;if(void 0!==l.index){var l=l.index.array,p=g.offsets;0===p.length&&p.push({start:0,count:l.length,index:0});for(var n=0,q=p.length;n<q;++n)for(var s=p[n],r=s.start,u=s.index,g=r,s=r+s.count;g<s;g++)r=u+l[g],k.fromArray(m,3*r),f(k,r)}else for(g=0,l=m.length/3;g<l;g++)k.fromArray(m,3*g),f(k,g)}else for(k=g.vertices,
+l<c.near||l>c.far||d.push({distance:l,distanceToRay:Math.sqrt(g),point:k.clone(),index:f,face:null,object:e})}};if(g instanceof THREE.BufferGeometry){var l=g.attributes,m=l.position.array;if(void 0!==l.index){var l=l.index.array,p=g.drawcalls;0===p.length&&(p=[{start:0,count:l.length,index:0}]);for(var n=0,q=p.length;n<q;++n)for(var r=p[n],s=r.start,u=r.index,g=s,r=s+r.count;g<r;g++)s=u+l[g],k.fromArray(m,3*s),f(k,s)}else for(g=0,l=m.length/3;g<l;g++)k.fromArray(m,3*g),f(k,g)}else for(k=g.vertices,
 g=0,l=k.length;g<l;g++)f(k[g],g)}}}();THREE.PointCloud.prototype.clone=function(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 g=d.linePrecision,g=g*g,f=this.geometry;null===f.boundingSphere&&f.computeBoundingSphere();c.copy(f.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)){a.getInverse(this.matrixWorld);b.copy(d.ray).applyMatrix4(a);var h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=this instanceof THREE.LineSegments?2:1;if(f instanceof
-THREE.BufferGeometry){var n=f.attributes;if(void 0!==n.index){var q=n.index.array,n=n.position.array,s=f.offsets;0===s.length&&(s=[{start:0,count:q.length,index:0}]);for(var r=0;r<s.length;r++)for(var u=s[r].start,x=s[r].count,v=s[r].index,f=u;f<u+x-1;f+=p){var z=v+q[f+1];h.fromArray(n,3*(v+q[f]));k.fromArray(n,3*z);z=b.distanceSqToSegment(h,k,m,l);z>g||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:f,offsetIndex:r,face:null,faceIndex:null,
-object:this}))}}else for(n=n.position.array,f=0;f<n.length/3-1;f+=p)h.fromArray(n,3*f),k.fromArray(n,3*f+3),z=b.distanceSqToSegment(h,k,m,l),z>g||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}else if(f instanceof THREE.Geometry)for(h=f.vertices,k=h.length,f=0;f<k-1;f+=p)z=b.distanceSqToSegment(h[f],h[f+1],m,l),z>g||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),
-index:f,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.BufferGeometry){var n=f.attributes;if(void 0!==n.index){var q=n.index.array,n=n.position.array,r=f.drawcalls;0===r.length&&(r=[{start:0,count:q.length,index:0}]);for(var s=0;s<r.length;s++)for(var u=r[s].start,x=r[s].count,v=r[s].index,f=u;f<u+x-1;f+=p){var z=v+q[f+1];h.fromArray(n,3*(v+q[f]));k.fromArray(n,3*z);z=b.distanceSqToSegment(h,k,m,l);z>g||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:f,offsetIndex:s,face:null,
+faceIndex:null,object:this}))}}else for(n=n.position.array,f=0;f<n.length/3-1;f+=p)h.fromArray(n,3*f),k.fromArray(n,3*f+3),z=b.distanceSqToSegment(h,k,m,l),z>g||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}else if(f instanceof THREE.Geometry)for(h=f.vertices,k=h.length,f=0;f<k-1;f+=p)z=b.distanceSqToSegment(h[f],h[f+1],m,l),z>g||(z=b.origin.distanceTo(m),z<d.near||z>d.far||e.push({distance:z,
+point:l.clone().applyMatrix4(this.matrixWorld),index:f,face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE[this.type](this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a);return a};
 THREE.Line.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON());void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};THREE.LineStrip=0;THREE.LinePieces=1;THREE.LineSegments=function(a,b){THREE.Line.call(this,a,b);this.type="LineSegments"};
 THREE.LineSegments.prototype=Object.create(THREE.Line.prototype);THREE.LineSegments.prototype.constructor=THREE.LineSegments;THREE.LineSegments.prototype.clone=function(a){void 0===a&&(a=new THREE.LineSegments(this.geometry,this.material));THREE.Line.prototype.clone.call(this,a);return a};THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};
 THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);THREE.Mesh.prototype.constructor=THREE.Mesh;
 THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
 THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
 THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3;return function(f,h){var k=this.geometry,l=this.material;if(void 0!==l&&(null===k.boundingSphere&&k.computeBoundingSphere(),c.copy(k.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==f.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(f.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))){var m,
-p,n;if(k instanceof THREE.BufferGeometry)if(m=k.attributes,void 0!==m.index){var q=m.index.array,s=m.position.array,r=k.offsets;0===r.length&&(r=[{start:0,count:q.length,index:0}]);for(var u=0,x=r.length;u<x;++u){m=r[u].start;for(var v=r[u].index,k=m,z=m+r[u].count;k<z;k+=3){m=v+q[k];p=v+q[k+1];n=v+q[k+2];d.fromArray(s,3*m);e.fromArray(s,3*p);g.fromArray(s,3*n);var w=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide);if(null!==w){w.applyMatrix4(this.matrixWorld);
-var H=f.ray.origin.distanceTo(w);H<f.near||H>f.far||h.push({distance:H,point:w,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(k/3),object:this})}}}}else for(s=m.position.array,q=k=0,z=s.length;k<z;k+=3,q+=9)m=k,p=k+1,n=k+2,d.fromArray(s,q),e.fromArray(s,q+3),g.fromArray(s,q+6),w=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide),null!==w&&(w.applyMatrix4(this.matrixWorld),H=f.ray.origin.distanceTo(w),H<f.near||
-H>f.far||h.push({distance:H,point:w,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,g)),index:Math.floor(k/3),object:this}));else if(k instanceof THREE.Geometry)for(q=l instanceof THREE.MeshFaceMaterial,s=!0===q?l.materials:null,r=k.vertices,u=k.faces,x=0,v=u.length;x<v;x++)if(z=u[x],w=!0===q?s[z.materialIndex]:l,void 0!==w){m=r[z.a];p=r[z.b];n=r[z.c];if(!0===w.morphTargets){var H=k.morphTargets,I=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var y=0,D=H.length;y<D;y++){var F=
+p,n;if(k instanceof THREE.BufferGeometry)if(m=k.attributes,void 0!==m.index){var q=m.index.array,r=m.position.array,s=k.drawcalls;0===s.length&&(s=[{start:0,count:q.length,index:0}]);for(var u=0,x=s.length;u<x;++u){m=s[u].start;for(var v=s[u].index,k=m,z=m+s[u].count;k<z;k+=3){m=v+q[k];p=v+q[k+1];n=v+q[k+2];d.fromArray(r,3*m);e.fromArray(r,3*p);g.fromArray(r,3*n);var w=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide);if(null!==w){w.applyMatrix4(this.matrixWorld);
+var H=f.ray.origin.distanceTo(w);H<f.near||H>f.far||h.push({distance:H,point:w,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(k/3),object:this})}}}}else for(r=m.position.array,q=k=0,z=r.length;k<z;k+=3,q+=9)m=k,p=k+1,n=k+2,d.fromArray(r,q),e.fromArray(r,q+3),g.fromArray(r,q+6),w=l.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,l.side!==THREE.DoubleSide),null!==w&&(w.applyMatrix4(this.matrixWorld),H=f.ray.origin.distanceTo(w),H<f.near||
+H>f.far||h.push({distance:H,point:w,face:new THREE.Face3(m,p,n,THREE.Triangle.normal(d,e,g)),index:Math.floor(k/3),object:this}));else if(k instanceof THREE.Geometry)for(q=l instanceof THREE.MeshFaceMaterial,r=!0===q?l.materials:null,s=k.vertices,u=k.faces,x=0,v=u.length;x<v;x++)if(z=u[x],w=!0===q?r[z.materialIndex]:l,void 0!==w){m=s[z.a];p=s[z.b];n=s[z.c];if(!0===w.morphTargets){var H=k.morphTargets,I=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var y=0,D=H.length;y<D;y++){var F=
 I[y];if(0!==F){var B=H[y].vertices;d.x+=(B[z.a].x-m.x)*F;d.y+=(B[z.a].y-m.y)*F;d.z+=(B[z.a].z-m.z)*F;e.x+=(B[z.b].x-p.x)*F;e.y+=(B[z.b].y-p.y)*F;e.z+=(B[z.b].z-p.z)*F;g.x+=(B[z.c].x-n.x)*F;g.y+=(B[z.c].y-n.y)*F;g.z+=(B[z.c].z-n.z)*F}}d.add(m);e.add(p);g.add(n);m=d;p=e;n=g}w=w.side===THREE.BackSide?b.intersectTriangle(n,p,m,!0):b.intersectTriangle(m,p,n,w.side!==THREE.DoubleSide);null!==w&&(w.applyMatrix4(this.matrixWorld),H=f.ray.origin.distanceTo(w),H<f.near||H>f.far||h.push({distance:H,point:w,
 face:z,faceIndex:x,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);
@@ -499,12 +499,12 @@ c.maxInstancedCount&&(c.maxInstancedCount=k.meshPerAttribute*k.count)}}else if(v
 a.z-b.z:a.id-b.id}function m(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function p(a){if(!0===a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),pa.init(a),a instanceof THREE.Light)fa.push(a);else if(a instanceof THREE.Sprite)Ha.push(a);else if(a instanceof THREE.LensFlare)Pa.push(a);else if(a instanceof THREE.ImmediateRenderObject){var b=a.material;
 b.transparent?Ga.push(a):Ba.push(a)}else{var c=pa.objects[a.id];!c||!1!==a.frustumCulled&&!0!==Xa.intersectsObject(a)||(b=a.material,aa.get(b)&&(b.program=aa.get(b).program),b.transparent?oa.push(c):la.push(c),!0===ja.sortObjects&&(na.setFromMatrixPosition(a.matrixWorld),na.applyProjection(Qa),c.z=na.z))}b=0;for(c=a.children.length;b<c;b++)p(a.children[b])}}function n(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g].object,l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);
 l._normalMatrix.getNormalMatrix(l._modelViewMatrix);null===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var l=f.materials,n=0,m=l.length;n<m;n++)ja.renderBufferDirect(b,c,d,l[n],k);else ja.renderBufferDirect(b,c,d,f,k)}}function q(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g],l=k;l._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,l.matrixWorld);l._normalMatrix.getNormalMatrix(l._modelViewMatrix);!0===k.visible&&(null===e&&(f=k.material),ja.renderImmediateObject(b,
-c,d,f,k))}}function s(a){r(a);!0===a.transparent?N.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):N.setBlending(THREE.NoBlending);N.setDepthFunc(a.depthFunc);N.setDepthTest(a.depthTest);N.setDepthWrite(a.depthWrite);N.setColorWrite(a.colorWrite);N.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function r(a){a.side!==THREE.DoubleSide?N.enable(t.CULL_FACE):N.disable(t.CULL_FACE);N.setFlipSided(a.side===
-THREE.BackSide)}function u(a,b,c,d,g){var k,l,n,m;eb=0;var p=aa.get(d);if(d.needsUpdate||!p.program){a:{for(var q=aa.get(d),s=Zb[d.type],r=0,y=0,u=0,D=0,A=0,C=b.length;A<C;A++){var I=b[A];I.onlyShadow||!1===I.visible||(I instanceof THREE.DirectionalLight&&r++,I instanceof THREE.PointLight&&y++,I instanceof THREE.SpotLight&&u++,I instanceof THREE.HemisphereLight&&D++)}k=r;l=y;n=u;m=D;for(var G,J=0,M=0,R=b.length;M<R;M++){var la=b[M];la.castShadow&&(la instanceof THREE.SpotLight&&J++,la instanceof THREE.DirectionalLight&&
+c,d,f,k))}}function r(a){s(a);!0===a.transparent?N.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):N.setBlending(THREE.NoBlending);N.setDepthFunc(a.depthFunc);N.setDepthTest(a.depthTest);N.setDepthWrite(a.depthWrite);N.setColorWrite(a.colorWrite);N.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function s(a){a.side!==THREE.DoubleSide?N.enable(t.CULL_FACE):N.disable(t.CULL_FACE);N.setFlipSided(a.side===
+THREE.BackSide)}function u(a,b,c,d,g){var k,l,n,m;eb=0;var p=aa.get(d);if(d.needsUpdate||!p.program){a:{for(var q=aa.get(d),r=Zb[d.type],s=0,y=0,u=0,D=0,A=0,C=b.length;A<C;A++){var I=b[A];I.onlyShadow||!1===I.visible||(I instanceof THREE.DirectionalLight&&s++,I instanceof THREE.PointLight&&y++,I instanceof THREE.SpotLight&&u++,I instanceof THREE.HemisphereLight&&D++)}k=s;l=y;n=u;m=D;for(var G,J=0,M=0,R=b.length;M<R;M++){var la=b[M];la.castShadow&&(la instanceof THREE.SpotLight&&J++,la instanceof THREE.DirectionalLight&&
 !la.shadowCascade&&J++)}G=J;var S;if(lb&&g&&g.skeleton&&g.skeleton.useVertexTexture)S=1024;else{var Q=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),U=Math.floor((Q-20)/4);void 0!==g&&g instanceof THREE.SkinnedMesh&&(U=Math.min(g.skeleton.bones.length,U),U<g.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+g.skeleton.bones.length+", this GPU supports just "+U+" (try OpenGL instead of ANGLE)"));S=U}var P={precision:E,supportsVertexTextures:mb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&
 d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,emissiveMap:!!d.emissiveMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:L,skinning:d.skinning,maxBones:S,useVertexTexture:lb&&g&&g.skeleton&&g.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,
-maxMorphTargets:ja.maxMorphTargets,maxMorphNormals:ja.maxMorphNormals,maxDirLights:k,maxPointLights:l,maxSpotLights:n,maxHemiLights:m,maxShadows:G,shadowMapEnabled:ma.enabled&&g.receiveShadow&&0<G,shadowMapType:ma.type,shadowMapDebug:ma.debug,shadowMapCascade:ma.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},T=[];s?T.push(s):(T.push(d.fragmentShader),T.push(d.vertexShader));if(void 0!==d.defines)for(var V in d.defines)T.push(V),
-T.push(d.defines[V]);for(V in P)T.push(V),T.push(P[V]);var oa=T.join(),Ga=!0;if(q.program)if(q.program.code!==oa)h(d);else if(void 0!==s)break a;else Ga=!1;else d.addEventListener("dispose",f);if(s){var Ba=THREE.ShaderLib[s];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(Ba.uniforms),vertexShader:Ba.vertexShader,fragmentShader:Ba.fragmentShader}}else q.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var $,Ha=0,fa=va.length;Ha<
+maxMorphTargets:ja.maxMorphTargets,maxMorphNormals:ja.maxMorphNormals,maxDirLights:k,maxPointLights:l,maxSpotLights:n,maxHemiLights:m,maxShadows:G,shadowMapEnabled:ma.enabled&&g.receiveShadow&&0<G,shadowMapType:ma.type,shadowMapDebug:ma.debug,shadowMapCascade:ma.cascade,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},T=[];r?T.push(r):(T.push(d.fragmentShader),T.push(d.vertexShader));if(void 0!==d.defines)for(var V in d.defines)T.push(V),
+T.push(d.defines[V]);for(V in P)T.push(V),T.push(P[V]);var oa=T.join(),Ga=!0;if(q.program)if(q.program.code!==oa)h(d);else if(void 0!==r)break a;else Ga=!1;else d.addEventListener("dispose",f);if(r){var Ba=THREE.ShaderLib[r];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(Ba.uniforms),vertexShader:Ba.vertexShader,fragmentShader:Ba.fragmentShader}}else q.__webglShader={name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var $,Ha=0,fa=va.length;Ha<
 fa;Ha++){var ea=va[Ha];if(ea.code===oa){$=ea;Ga&&$.usedTimes++;break}}void 0===$&&(d.__webglShader=q.__webglShader,$=new THREE.WebGLProgram(ja,oa,d,P),va.push($),Da.programs=va.length);q.program=$;var Pa=$.getAttributes();if(d.morphTargets)for(var ua=d.numSupportedMorphTargets=0;ua<ja.maxMorphTargets;ua++)0<=Pa["morphTarget"+ua]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(ua=d.numSupportedMorphNormals=0;ua<ja.maxMorphNormals;ua++)0<=Pa["morphNormal"+ua]&&d.numSupportedMorphNormals++;q.uniformsList=
 [];var pa=q.program.getUniforms(),xa;for(xa in q.__webglShader.uniforms){var Ia=pa[xa];Ia&&q.uniformsList.push([q.__webglShader.uniforms[xa],Ia])}}d.needsUpdate=!1}var Ja=!1,Ca=!1,wa=!1,Ya=p.program,ca=Ya.getUniforms(),K=p.__webglShader.uniforms;Ya.id!==kb&&(t.useProgram(Ya.program),kb=Ya.id,wa=Ca=Ja=!0);d.id!==Wa&&(-1===Wa&&(wa=!0),Wa=d.id,Ca=!0);if(Ja||a!==Va)t.uniformMatrix4fv(ca.projectionMatrix,!1,a.projectionMatrix.elements),L&&t.uniform1f(ca.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==
 Va&&(Va=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==ca.cameraPosition&&(na.setFromMatrixPosition(a.matrixWorld),t.uniform3f(ca.cameraPosition,na.x,na.y,na.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshBasicMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==ca.viewMatrix&&t.uniformMatrix4fv(ca.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(g.bindMatrix&&null!==
@@ -554,21 +554,21 @@ return function(){if(void 0!==a)return a;var b=V.get("EXT_texture_filter_anisotr
 b,c,d){Ia=a*A;Ja=b*A;Ca=c*A;wa=d*A;t.viewport(Ia,Ja,Ca,wa)};this.setScissor=function(a,b,c,d){t.scissor(a*A,b*A,c*A,d*A)};this.enableScissorTest=function(a){N.setScissorTest(a)};this.getClearColor=function(){return $};this.setClearColor=function(a,c){$.set(a);ea=void 0!==c?c:1;b($.r,$.g,$.b,ea)};this.getClearAlpha=function(){return ea};this.setClearAlpha=function(a){ea=a;b($.r,$.g,$.b,ea)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=t.COLOR_BUFFER_BIT;if(void 0===b||b)d|=t.DEPTH_BUFFER_BIT;
 if(void 0===c||c)d|=t.STENCIL_BUFFER_BIT;t.clear(d)};this.clearColor=function(){t.clear(t.COLOR_BUFFER_BIT)};this.clearDepth=function(){t.clear(t.DEPTH_BUFFER_BIT)};this.clearStencil=function(){t.clear(t.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.renderBufferImmediate=function(a,b,c){N.initAttributes();var d=aa.get(a);a.hasPositions&&!d.__webglVertexBuffer&&(d.__webglVertexBuffer=t.createBuffer());a.hasNormals&&!d.__webglNormalBuffer&&
 (d.__webglNormalBuffer=t.createBuffer());a.hasUvs&&!d.__webglUvBuffer&&(d.__webglUvBuffer=t.createBuffer());a.hasColors&&!d.__webglColorBuffer&&(d.__webglColorBuffer=t.createBuffer());b=b.getAttributes();a.hasPositions&&(t.bindBuffer(t.ARRAY_BUFFER,d.__webglVertexBuffer),t.bufferData(t.ARRAY_BUFFER,a.positionArray,t.DYNAMIC_DRAW),N.enableAttribute(b.position),t.vertexAttribPointer(b.position,3,t.FLOAT,!1,0,0));if(a.hasNormals){t.bindBuffer(t.ARRAY_BUFFER,d.__webglNormalBuffer);if(!1===c instanceof
-THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var e,f,g,h,k,l,n,m,p,q,s,r=3*a.count;for(s=0;s<r;s+=9)q=a.normalArray,e=q[s],f=q[s+1],g=q[s+2],h=q[s+3],l=q[s+4],m=q[s+5],k=q[s+6],n=q[s+7],p=q[s+8],e=(e+h+k)/3,f=(f+l+n)/3,g=(g+m+p)/3,q[s]=e,q[s+1]=f,q[s+2]=g,q[s+3]=e,q[s+4]=f,q[s+5]=g,q[s+6]=e,q[s+7]=f,q[s+8]=g}t.bufferData(t.ARRAY_BUFFER,a.normalArray,t.DYNAMIC_DRAW);N.enableAttribute(b.normal);t.vertexAttribPointer(b.normal,3,t.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(t.bindBuffer(t.ARRAY_BUFFER,
-d.__webglUvBuffer),t.bufferData(t.ARRAY_BUFFER,a.uvArray,t.DYNAMIC_DRAW),N.enableAttribute(b.uv),t.vertexAttribPointer(b.uv,2,t.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(t.bindBuffer(t.ARRAY_BUFFER,d.__webglColorBuffer),t.bufferData(t.ARRAY_BUFFER,a.colorArray,t.DYNAMIC_DRAW),N.enableAttribute(b.color),t.vertexAttribPointer(b.color,3,t.FLOAT,!1,0,0));N.disableUnusedAttributes();t.drawArrays(t.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e){if(!1!==d.visible){s(d);
-var f=pa.geometries.get(e);a=u(a,b,c,d,e);b=!1;c=f.id+"_"+a.id+"_"+(d.wireframe?1:0);c!==xa&&(xa=c,b=!0);b&&N.initAttributes();if(e instanceof THREE.Mesh)a:{e=b;b=t.TRIANGLES;!0===d.wireframe&&(b=t.LINES,N.setLineWidth(d.wireframeLinewidth*A));var g=f.attributes.index;if(g){var h,l=pa.getAttributeBuffer(g);g.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(c=t.UNSIGNED_INT,h=4):(c=t.UNSIGNED_SHORT,h=2);var n=f.offsets;if(0===n.length){e&&(k(d,a,f,0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,
+THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var e,f,g,h,k,l,n,m,p,q,r,s=3*a.count;for(r=0;r<s;r+=9)q=a.normalArray,e=q[r],f=q[r+1],g=q[r+2],h=q[r+3],l=q[r+4],m=q[r+5],k=q[r+6],n=q[r+7],p=q[r+8],e=(e+h+k)/3,f=(f+l+n)/3,g=(g+m+p)/3,q[r]=e,q[r+1]=f,q[r+2]=g,q[r+3]=e,q[r+4]=f,q[r+5]=g,q[r+6]=e,q[r+7]=f,q[r+8]=g}t.bufferData(t.ARRAY_BUFFER,a.normalArray,t.DYNAMIC_DRAW);N.enableAttribute(b.normal);t.vertexAttribPointer(b.normal,3,t.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(t.bindBuffer(t.ARRAY_BUFFER,
+d.__webglUvBuffer),t.bufferData(t.ARRAY_BUFFER,a.uvArray,t.DYNAMIC_DRAW),N.enableAttribute(b.uv),t.vertexAttribPointer(b.uv,2,t.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(t.bindBuffer(t.ARRAY_BUFFER,d.__webglColorBuffer),t.bufferData(t.ARRAY_BUFFER,a.colorArray,t.DYNAMIC_DRAW),N.enableAttribute(b.color),t.vertexAttribPointer(b.color,3,t.FLOAT,!1,0,0));N.disableUnusedAttributes();t.drawArrays(t.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e){if(!1!==d.visible){r(d);
+var f=pa.geometries.get(e);a=u(a,b,c,d,e);b=!1;c=f.id+"_"+a.id+"_"+(d.wireframe?1:0);c!==xa&&(xa=c,b=!0);b&&N.initAttributes();if(e instanceof THREE.Mesh)a:{e=b;b=t.TRIANGLES;!0===d.wireframe&&(b=t.LINES,N.setLineWidth(d.wireframeLinewidth*A));var g=f.attributes.index;if(g){var h,l=pa.getAttributeBuffer(g);g.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(c=t.UNSIGNED_INT,h=4):(c=t.UNSIGNED_SHORT,h=2);var n=f.drawcalls;if(0===n.length){e&&(k(d,a,f,0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,
 l));if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){var m=V.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(b,g.array.length,c,0,f.maxInstancedCount)}else t.drawElements(b,g.array.length,c,0);P.calls++;P.vertices+=g.array.length;P.faces+=g.array.length/3}else{e=!0;for(var g=0,p=n.length;g<p;g++){m=
 n[g].index;e&&(k(d,a,f,m),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,l));if(f instanceof THREE.InstancedBufferGeometry&&0<n[g].instances){m=V.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(b,n[g].count,c,n[g].start*h,n[g].count,c,n[g].instances)}else t.drawElements(b,n[g].count,c,n[g].start*h);P.calls++;P.vertices+=n[g].count;
-P.faces+=n[g].count/3}}}else if(n=f.offsets,0===n.length){e&&k(d,a,f,0);d=f.attributes.position;if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){m=V.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}d instanceof THREE.InterleavedBufferAttribute?m.drawArraysInstancedANGLE(b,0,d.data.count,f.maxInstancedCount):m.drawArraysInstancedANGLE(b,
+P.faces+=n[g].count/3}}}else if(n=f.drawcalls,0===n.length){e&&k(d,a,f,0);d=f.attributes.position;if(f instanceof THREE.InstancedBufferGeometry&&0<f.maxInstancedCount){m=V.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}d instanceof THREE.InterleavedBufferAttribute?m.drawArraysInstancedANGLE(b,0,d.data.count,f.maxInstancedCount):m.drawArraysInstancedANGLE(b,
 0,d.count,f.maxInstancedCount)}else d instanceof THREE.InterleavedBufferAttribute?t.drawArrays(b,0,d.data.count):t.drawArrays(b,0,d.count);P.calls++;P.vertices+=d.count;P.faces+=d.array.length/3}else for(e&&k(d,a,f,0),g=0,p=n.length;g<p;g++){if(f instanceof THREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");break a}else t.drawArrays(b,n[g].start,n[g].count);P.calls++;P.vertices+=n[g].count;P.faces+=n[g].count/3}}else if(e instanceof
-THREE.Line)if(e=e instanceof THREE.LineSegments?t.LINES:t.LINE_STRIP,N.setLineWidth((void 0!==d.linewidth?d.linewidth:1)*A),m=f.attributes.index)if(n=pa.getAttributeBuffer(m),m.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(h=t.UNSIGNED_INT,l=4):(h=t.UNSIGNED_SHORT,l=2),c=f.offsets,0===c.length)b&&(k(d,a,f,0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n)),t.drawElements(e,m.array.length,h,0),P.calls++,P.vertices+=m.array.length;else for(1<c.length&&(b=!0),m=0,g=c.length;m<g;m++)p=c[m].index,
-b&&(k(d,a,f,p),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n)),t.drawElements(e,c[m].count,h,c[m].start*l),P.calls++,P.vertices+=c[m].count;else if(b&&k(d,a,f,0),d=f.attributes.position,c=f.offsets,0===c.length)t.drawArrays(e,0,d.array.length/3),P.calls++,P.vertices+=d.array.length/3;else for(m=0,g=c.length;m<g;m++)t.drawArrays(e,c[m].index,c[m].count),P.calls++,P.vertices+=c[m].count;else if(e instanceof THREE.PointCloud)if(c=b,b=t.POINTS,m=f.attributes.index)if(n=pa.getAttributeBuffer(m),m.array instanceof
-Uint32Array&&V.get("OES_element_index_uint")?(h=t.UNSIGNED_INT,l=4):(h=t.UNSIGNED_SHORT,l=2),e=f.offsets,0===e.length)c&&(k(d,a,f,0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n)),t.drawElements(b,m.array.length,h,0),P.calls++,P.points+=m.array.length;else for(1<e.length&&(c=!0),m=0,g=e.length;m<g;m++)p=e[m].index,c&&(k(d,a,f,p),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n)),t.drawElements(b,e[m].count,h,e[m].start*l),P.calls++,P.points+=e[m].count;else if(c&&k(d,a,f,0),d=f.attributes.position,e=f.offsets,0===
-e.length)t.drawArrays(b,0,d.array.length/3),P.calls++,P.points+=d.array.length/3;else for(m=0,g=e.length;m<g;m++)t.drawArrays(b,e[m].index,e[m].count),P.calls++,P.points+=e[m].count}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;xa="";Wa=-1;Va=null;db=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);
+THREE.Line)if(e=e instanceof THREE.LineSegments?t.LINES:t.LINE_STRIP,N.setLineWidth((void 0!==d.linewidth?d.linewidth:1)*A),m=f.attributes.index)if(n=pa.getAttributeBuffer(m),m.array instanceof Uint32Array&&V.get("OES_element_index_uint")?(h=t.UNSIGNED_INT,l=4):(h=t.UNSIGNED_SHORT,l=2),c=f.drawcalls,0===c.length)b&&(k(d,a,f,0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n)),t.drawElements(e,m.array.length,h,0),P.calls++,P.vertices+=m.array.length;else for(1<c.length&&(b=!0),m=0,g=c.length;m<g;m++)p=c[m].index,
+b&&(k(d,a,f,p),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n)),t.drawElements(e,c[m].count,h,c[m].start*l),P.calls++,P.vertices+=c[m].count;else if(b&&k(d,a,f,0),d=f.attributes.position,c=f.drawcalls,0===c.length)t.drawArrays(e,0,d.array.length/3),P.calls++,P.vertices+=d.array.length/3;else for(m=0,g=c.length;m<g;m++)t.drawArrays(e,c[m].index,c[m].count),P.calls++,P.vertices+=c[m].count;else if(e instanceof THREE.PointCloud)if(c=b,b=t.POINTS,m=f.attributes.index)if(n=pa.getAttributeBuffer(m),m.array instanceof
+Uint32Array&&V.get("OES_element_index_uint")?(h=t.UNSIGNED_INT,l=4):(h=t.UNSIGNED_SHORT,l=2),e=f.drawcalls,0===e.length)c&&(k(d,a,f,0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n)),t.drawElements(b,m.array.length,h,0),P.calls++,P.points+=m.array.length;else for(1<e.length&&(c=!0),m=0,g=e.length;m<g;m++)p=e[m].index,c&&(k(d,a,f,p),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n)),t.drawElements(b,e[m].count,h,e[m].start*l),P.calls++,P.points+=e[m].count;else if(c&&k(d,a,f,0),d=f.attributes.position,e=f.drawcalls,
+0===e.length)t.drawArrays(b,0,d.array.length/3),P.calls++,P.points+=d.array.length/3;else for(m=0,g=e.length;m<g;m++)t.drawArrays(b,e[m].index,e[m].count),P.calls++,P.points+=e[m].count}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e=a.fog;xa="";Wa=-1;Va=null;db=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);
 Qa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Xa.setFromMatrix(Qa);fa.length=0;la.length=0;oa.length=0;Ba.length=0;Ga.length=0;Ha.length=0;Pa.length=0;p(a);!0===ja.sortObjects&&(la.sort(l),oa.sort(m));pa.update(la);pa.update(oa);ma.render(a,b);P.calls=0;P.vertices=0;P.faces=0;P.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,n(la,b,fa,e,d),n(oa,b,fa,e,d),q(Ba,b,fa,
 e,d),q(Ga,b,fa,e,d)):(N.setBlending(THREE.NoBlending),n(la,b,fa,e,null),q(Ba,b,fa,e,null),n(oa,b,fa,e,null),q(Ga,b,fa,e,null));Lb.render(a,b);Mb.render(a,b,ib,jb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(N.bindTexture(t.TEXTURE_CUBE_MAP,aa.get(c).__webglTexture),t.generateMipmap(t.TEXTURE_CUBE_MAP),N.bindTexture(t.TEXTURE_CUBE_MAP,null)):(N.bindTexture(t.TEXTURE_2D,aa.get(c).__webglTexture),t.generateMipmap(t.TEXTURE_2D),
-N.bindTexture(t.TEXTURE_2D,null)));N.setDepthTest(!0);N.setDepthWrite(!0);N.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){s(d);var f=u(a,b,c,d,e);xa="";e.render(function(a){ja.renderBufferImmediate(a,f,d)})};var Zb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===
-THREE.CullFaceNone?N.disable(t.CULL_FACE):(b===THREE.FrontFaceDirectionCW?t.frontFace(t.CW):t.frontFace(t.CCW),a===THREE.CullFaceBack?t.cullFace(t.BACK):a===THREE.CullFaceFront?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK),N.enable(t.CULL_FACE))};this.setMaterialFaces=r;this.uploadTexture=function(a,b){var c=aa.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",e),c.__webglTexture=t.createTexture(),Da.textures++);N.activeTexture(t.TEXTURE0+b);N.bindTexture(t.TEXTURE_2D,
+N.bindTexture(t.TEXTURE_2D,null)));N.setDepthTest(!0);N.setDepthWrite(!0);N.setColorWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){r(d);var f=u(a,b,c,d,e);xa="";e.render(function(a){ja.renderBufferImmediate(a,f,d)})};var Zb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===
+THREE.CullFaceNone?N.disable(t.CULL_FACE):(b===THREE.FrontFaceDirectionCW?t.frontFace(t.CW):t.frontFace(t.CCW),a===THREE.CullFaceBack?t.cullFace(t.BACK):a===THREE.CullFaceFront?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK),N.enable(t.CULL_FACE))};this.setMaterialFaces=s;this.uploadTexture=function(a,b){var c=aa.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",e),c.__webglTexture=t.createTexture(),Da.textures++);N.activeTexture(t.TEXTURE0+b);N.bindTexture(t.TEXTURE_2D,
 c.__webglTexture);t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,a.flipY);t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);t.pixelStorei(t.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=H(a.image,Jb);var d=a.image,c=THREE.Math.isPowerOfTwo(d.width)&&THREE.Math.isPowerOfTwo(d.height),f=F(a.format),g=F(a.type);w(t.TEXTURE_2D,a,c);var h=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<h.length&&c){for(var k=0,l=h.length;k<l;k++)d=h[k],N.texImage2D(t.TEXTURE_2D,k,f,d.width,d.height,0,f,g,d.data);
 a.generateMipmaps=!1}else N.texImage2D(t.TEXTURE_2D,0,f,d.width,d.height,0,f,g,d.data);else if(a instanceof THREE.CompressedTexture)for(k=0,l=h.length;k<l;k++)d=h[k],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<Yb().indexOf(f)?N.compressedTexImage2D(t.TEXTURE_2D,k,f,d.width,d.height,0,d.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):N.texImage2D(t.TEXTURE_2D,k,f,d.width,d.height,0,f,g,d.data);else if(0<h.length&&c){k=
 0;for(l=h.length;k<l;k++)d=h[k],N.texImage2D(t.TEXTURE_2D,k,f,f,g,d);a.generateMipmaps=!1}else N.texImage2D(t.TEXTURE_2D,0,f,f,g,a.image);a.generateMipmaps&&c&&t.generateMipmap(t.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",
@@ -586,31 +586,32 @@ THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:f
 this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
 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;var g=d[e.id],f;for(f in g.attributes){var h=g.attributes[f];void 0!==h.buffer&&(a.deleteBuffer(h.buffer),delete h.buffer)}e.removeEventListener("dispose",c);delete d[e.id];b.memory.geometries--}var d={};this.get=function(a){var g=a.geometry;if(void 0!==d[g.id])return d[g.id];g.addEventListener("dispose",c);d[g.id]=g instanceof THREE.BufferGeometry?g:(new THREE.BufferGeometry).setFromObject(a);b.memory.geometries++;return d[g.id]}};
+THREE.WebGLGeometries=function(a,b){function c(e){e=e.target;var g=d[e.id],f;for(f in g.attributes){var h=g.attributes[f];void 0!==h.buffer&&(a.deleteBuffer(h.buffer),delete h.buffer)}e.removeEventListener("dispose",c);delete d[e.id];b.memory.geometries--}var d={};this.get=function(a){var g=a.geometry;if(void 0!==d[g.id])return d[g.id];g.addEventListener("dispose",c);g instanceof THREE.BufferGeometry?d[g.id]=g:g instanceof THREE.Geometry&&(void 0===a._bufferGeometry&&(a._bufferGeometry=(new THREE.BufferGeometry).setFromObject(a)),
+d[g.id]=a._bufferGeometry);b.memory.geometries++;return d[g.id]}};
 THREE.WebGLObjects=function(a,b,c){function d(a){a.target.traverse(function(a){a.removeEventListener("remove",d);(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)&&delete g[a.id];delete a._modelViewMatrix;delete a._normalMatrix;b.delete(a)})}function e(a,b){return b[0]-a[0]}var g={},f=new Float32Array(8),h=new THREE.WebGLGeometries(a,c);this.objects=g;this.geometries=h;this.init=function(a){var c=b.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a._modelViewMatrix=
 new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",d));void 0===c.__webglActive&&(c.__webglActive=!0,a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud)&&(g[a.id]={id:a.id,object:a,z:0})};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.update=function(c){for(var d=0,g=c.length;d<g;d++){var p=c[d].object;if(!1!==p.material.visible){var n=p,p=h.get(n);
-n.geometry instanceof THREE.Geometry&&p.updateFromObject(n);if(void 0!==n.morphTargetInfluences){for(var q=[],s=n.morphTargetInfluences,r=0,u=s.length;r<u;r++)q.push([s[r],r]);q.sort(e);8<q.length&&(q.length=8);r=0;for(u=q.length;r<u;r++)f[r]=q[r][0],p.addAttribute("morphTarget"+r,p.morphAttributes[q[r][1]]);n=n.material;void 0!==n.program?(n=n.program.getUniforms(),null!==n.morphTargetInfluences&&a.uniform1fv(n.morphTargetInfluences,f)):console.warn("TOFIX: material.program is undefined")}p=p.attributes;
-n=void 0;for(n in p)if(s=p[n],q="index"===n?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,s=s instanceof THREE.InterleavedBufferAttribute?s.data:s,r=b.get(s),void 0===r.__webglBuffer){r.__webglBuffer=a.createBuffer();a.bindBuffer(q,r.__webglBuffer);u=a.STATIC_DRAW;if(s instanceof THREE.DynamicBufferAttribute||s instanceof THREE.InstancedBufferAttribute&&!0===s.dynamic||s instanceof THREE.InterleavedBuffer&&!0===s.dynamic)u=a.DYNAMIC_DRAW;a.bufferData(q,s.array,u);r.version=s.version}else r.version!==s.version&&
-(a.bindBuffer(q,r.__webglBuffer),void 0===s.updateRange||-1===s.updateRange.count?a.bufferSubData(q,0,s.array):0===s.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(a.bufferSubData(q,s.updateRange.offset*s.array.BYTES_PER_ELEMENT,s.array.subarray(s.updateRange.offset,s.updateRange.offset+s.updateRange.count)),s.updateRange.count=0),
-r.version=s.version)}}};this.clear=function(){g={}}};
-THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var f=a[c];!1!==f&&b.push("#define "+c+" "+f)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,g,f){var h=d.context,k=g.defines,l=g.__webglShader.vertexShader,m=g.__webglShader.fragmentShader,p=g.index0AttributeName,n="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?n="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(n="SHADOWMAP_TYPE_PCF_SOFT");var q="ENVMAP_TYPE_CUBE",s="ENVMAP_MODE_REFLECTION",
-r="ENVMAP_BLENDING_MULTIPLY";if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:q="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:q="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:s="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:r=
-"ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:r="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:r="ENVMAP_BLENDING_ADD"}}var u=0<d.gammaFactor?d.gammaFactor:1,x=a(k),v=h.createProgram();g instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,x,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
-u,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,"#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.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":
+n.geometry instanceof THREE.Geometry&&p.updateFromObject(n);if(void 0!==n.morphTargetInfluences){for(var q=[],r=n.morphTargetInfluences,s=0,u=r.length;s<u;s++)q.push([r[s],s]);q.sort(e);8<q.length&&(q.length=8);s=0;for(u=q.length;s<u;s++)f[s]=q[s][0],p.addAttribute("morphTarget"+s,p.morphAttributes[q[s][1]]);n=n.material;void 0!==n.program?(n=n.program.getUniforms(),null!==n.morphTargetInfluences&&a.uniform1fv(n.morphTargetInfluences,f)):console.warn("TOFIX: material.program is undefined")}p=p.attributes;
+n=void 0;for(n in p)if(r=p[n],q="index"===n?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,r=r instanceof THREE.InterleavedBufferAttribute?r.data:r,s=b.get(r),void 0===s.__webglBuffer){s.__webglBuffer=a.createBuffer();a.bindBuffer(q,s.__webglBuffer);u=a.STATIC_DRAW;if(r instanceof THREE.DynamicBufferAttribute||r instanceof THREE.InstancedBufferAttribute&&!0===r.dynamic||r instanceof THREE.InterleavedBuffer&&!0===r.dynamic)u=a.DYNAMIC_DRAW;a.bufferData(q,r.array,u);s.version=r.version}else s.version!==r.version&&
+(a.bindBuffer(q,s.__webglBuffer),void 0===r.updateRange||-1===r.updateRange.count?a.bufferSubData(q,0,r.array):0===r.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(a.bufferSubData(q,r.updateRange.offset*r.array.BYTES_PER_ELEMENT,r.array.subarray(r.updateRange.offset,r.updateRange.offset+r.updateRange.count)),r.updateRange.count=0),
+s.version=r.version)}}};this.clear=function(){g={}}};
+THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var f=a[c];!1!==f&&b.push("#define "+c+" "+f)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,g,f){var h=d.context,k=g.defines,l=g.__webglShader.vertexShader,m=g.__webglShader.fragmentShader,p=g.index0AttributeName,n="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?n="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(n="SHADOWMAP_TYPE_PCF_SOFT");var q="ENVMAP_TYPE_CUBE",r="ENVMAP_MODE_REFLECTION",
+s="ENVMAP_BLENDING_MULTIPLY";if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:q="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:q="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:r="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:s=
+"ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:s="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:s="ENVMAP_BLENDING_ADD"}}var u=0<d.gammaFactor?d.gammaFactor:1,x=a(k),v=h.createProgram();g instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,x,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+
+u,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,"#define MAX_BONES "+f.maxBones,f.map?"#define USE_MAP":"",f.envMap?"#define USE_ENVMAP":"",f.envMap?"#define "+r:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?"#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":
 "",f.specularMap?"#define USE_SPECULARMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.skinning?"#define USE_SKINNING":"",f.useVertexTexture?"#define BONE_TEXTURE":"",f.morphTargets?"#define USE_MORPHTARGETS":"",f.morphNormals?"#define USE_MORPHNORMALS":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+n:"",f.shadowMapDebug?
 "#define SHADOWMAP_DEBUG":"",f.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",f.sizeAttenuation?"#define USE_SIZEATTENUATION":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;",
 "attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;",
 "\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(b).join("\n"),d=[f.bumpMap||f.normalMap||f.flatShading||g.derivatives?"#extension GL_OES_standard_derivatives : enable":"","precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,x,"#define MAX_DIR_LIGHTS "+f.maxDirLights,"#define MAX_POINT_LIGHTS "+f.maxPointLights,"#define MAX_SPOT_LIGHTS "+
-f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+u,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 "+q:"",f.envMap?"#define "+s:"",f.envMap?"#define "+r:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?
+f.maxSpotLights,"#define MAX_HEMI_LIGHTS "+f.maxHemiLights,"#define MAX_SHADOWS "+f.maxShadows,f.alphaTest?"#define ALPHATEST "+f.alphaTest:"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+u,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 "+q:"",f.envMap?"#define "+r:"",f.envMap?"#define "+s:"",f.lightMap?"#define USE_LIGHTMAP":"",f.aoMap?
 "#define USE_AOMAP":"",f.emissiveMap?"#define USE_EMISSIVEMAP":"",f.bumpMap?"#define USE_BUMPMAP":"",f.normalMap?"#define USE_NORMALMAP":"",f.specularMap?"#define USE_SPECULARMAP":"",f.alphaMap?"#define USE_ALPHAMAP":"",f.vertexColors?"#define USE_COLOR":"",f.flatShading?"#define FLAT_SHADED":"",f.metal?"#define METAL":"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+n:"",f.shadowMapDebug?"#define SHADOWMAP_DEBUG":
 "",f.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&d.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(b).join("\n"));m=d+m;l=THREE.WebGLShader(h,h.VERTEX_SHADER,k+l);m=THREE.WebGLShader(h,h.FRAGMENT_SHADER,m);h.attachShader(v,l);h.attachShader(v,m);void 0!==p&&h.bindAttribLocation(v,0,p);h.linkProgram(v);p=h.getProgramInfoLog(v);
-f=h.getShaderInfoLog(l);n=h.getShaderInfoLog(m);s=q=!0;if(!1===h.getProgramParameter(v,h.LINK_STATUS))q=!1,console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(v,h.VALIDATE_STATUS),"gl.getProgramInfoLog",p,f,n);else if(""!==p)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",p);else if(""===f||""===n)s=!1;s&&(this.diagnostics={runnable:q,material:g,programLog:p,vertexShader:{log:f,prefix:k},fragmentShader:{log:n,prefix:d}});h.deleteShader(l);
+f=h.getShaderInfoLog(l);n=h.getShaderInfoLog(m);r=q=!0;if(!1===h.getProgramParameter(v,h.LINK_STATUS))q=!1,console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(v,h.VALIDATE_STATUS),"gl.getProgramInfoLog",p,f,n);else if(""!==p)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",p);else if(""===f||""===n)r=!1;r&&(this.diagnostics={runnable:q,material:g,programLog:p,vertexShader:{log:f,prefix:k},fragmentShader:{log:n,prefix:d}});h.deleteShader(l);
 h.deleteShader(m);var z;this.getUniforms=function(){if(void 0===z){for(var a={},b=h.getProgramParameter(v,h.ACTIVE_UNIFORMS),c=0;c<b;c++){var d=h.getActiveUniform(v,c).name,e=h.getUniformLocation(v,d),f=d.lastIndexOf("[0]");-1!==f&&f===d.length-3&&(a[d.substr(0,f)]=e);a[d]=e}z=a}return z};var w;this.getAttributes=function(){if(void 0===w){for(var a={},b=h.getProgramParameter(v,h.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=h.getActiveAttrib(v,c).name;a[d]=h.getAttribLocation(v,d)}w=a}return w};Object.defineProperties(this,
 {uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");return this.getAttributes()}}});this.id=c++;this.code=e;this.usedTimes=1;this.program=v;this.vertexShader=l;this.fragmentShader=m;return this}}();
 THREE.WebGLProperties=function(){var a={};this.get=function(b){b=b.uuid;var c=a[b];void 0===c&&(c={},a[b]=c);return c};this.delete=function(b){delete a[b.uuid]};this.clear=function(){a={}}};
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){var e=b.createShader(c);b.shaderSource(e,d);b.compileShader(e);!1===b.getShaderParameter(e,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(e)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",c===b.VERTEX_SHADER?"vertex":"fragment",b.getShaderInfoLog(e),a(d));return e}}();
 THREE.WebGLShadowMap=function(a,b,c){function d(a,b){if(!0===a.visible){var e=c.objects[a.id];e&&a.castShadow&&(!1===a.frustumCulled||!0===f.intersectsObject(a))&&(a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),p.push(e));for(var e=0,g=a.children.length;e<g;e++)d(a.children[e],b)}}var e=a.context,g=a.state,f=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3,p=[],n=THREE.ShaderLib.depthRGBA,q=THREE.UniformsUtils.clone(n.uniforms),
-s=new THREE.ShaderMaterial({uniforms:q,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}),r=new THREE.ShaderMaterial({uniforms:q,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:q,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,skinning:!0}),x=new THREE.ShaderMaterial({uniforms:q,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0,skinning:!0});s._shadowPass=!0;r._shadowPass=!0;u._shadowPass=
+r=new THREE.ShaderMaterial({uniforms:q,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}),s=new THREE.ShaderMaterial({uniforms:q,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0}),u=new THREE.ShaderMaterial({uniforms:q,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,skinning:!0}),x=new THREE.ShaderMaterial({uniforms:q,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,morphTargets:!0,skinning:!0});r._shadowPass=!0;s._shadowPass=!0;u._shadowPass=
 !0;x._shadowPass=!0;var v=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.cascade=!1;this.render=function(c,n){if(!1!==v.enabled&&(!1!==v.autoUpdate||!1!==v.needsUpdate)){var q,I,y,D,F,B,C,S=[];D=0;e.clearColor(1,1,1,1);g.disable(e.BLEND);g.enable(e.CULL_FACE);e.frontFace(e.CCW);v.cullFace===THREE.CullFaceFront?e.cullFace(e.FRONT):e.cullFace(e.BACK);g.setDepthTest(!0);q=0;for(I=b.length;q<I;q++)if(y=b[q],y.castShadow)if(y instanceof
 THREE.DirectionalLight&&y.shadowCascade)for(F=0;F<y.shadowCascadeCount;F++){var G;if(y.shadowCascadeArray[F])G=y.shadowCascadeArray[F];else{var A=y;C=F;G=new THREE.DirectionalLight;G.isVirtual=!0;G.onlyShadow=!0;G.castShadow=!0;G.shadowCameraNear=A.shadowCameraNear;G.shadowCameraFar=A.shadowCameraFar;G.shadowCameraLeft=A.shadowCameraLeft;G.shadowCameraRight=A.shadowCameraRight;G.shadowCameraBottom=A.shadowCameraBottom;G.shadowCameraTop=A.shadowCameraTop;G.shadowCameraVisible=A.shadowCameraVisible;
 G.shadowDarkness=A.shadowDarkness;G.shadowBias=A.shadowCascadeBias[C];G.shadowMapWidth=A.shadowCascadeWidth[C];G.shadowMapHeight=A.shadowCascadeHeight[C];G.pointsWorld=[];G.pointsFrustum=[];var E=G.pointsWorld;B=G.pointsFrustum;for(var J=0;8>J;J++)E[J]=new THREE.Vector3,B[J]=new THREE.Vector3;E=A.shadowCascadeNearZ[C];A=A.shadowCascadeFarZ[C];B[0].set(-1,-1,E);B[1].set(1,-1,E);B[2].set(-1,1,E);B[3].set(1,1,E);B[4].set(-1,-1,A);B[5].set(1,-1,A);B[6].set(-1,1,A);B[7].set(1,1,A);G.originalCamera=n;B=
@@ -619,47 +620,47 @@ G;D++}else S[D]=y,D++;q=0;for(I=S.length;q<I;q++){y=S[q];y.shadowMap||(F=THREE.L
 y.shadowMapHeight,y.shadowCameraNear,y.shadowCameraFar);else if(y instanceof THREE.DirectionalLight)y.shadowCamera=new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",y);continue}c.add(y.shadowCamera);!0===c.autoUpdate&&c.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),
 c.add(y.cameraHelper));if(y.isVirtual&&G.originalCamera==n){F=n;D=y.shadowCamera;B=y.pointsFrustum;A=y.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(C=0;8>C;C++)E=A[C],E.copy(B[C]),E.unproject(F),E.applyMatrix4(D.matrixWorldInverse),E.x<k.x&&(k.x=E.x),E.x>l.x&&(l.x=E.x),E.y<k.y&&(k.y=E.y),E.y>l.y&&(l.y=E.y),E.z<k.z&&(k.z=E.z),E.z>l.z&&(l.z=E.z);D.left=k.x;D.right=l.x;D.top=l.y;D.bottom=k.y;D.updateProjectionMatrix()}D=y.shadowMap;B=y.shadowMatrix;F=y.shadowCamera;
 F.position.setFromMatrixPosition(y.matrixWorld);m.setFromMatrixPosition(y.target.matrixWorld);F.lookAt(m);F.updateMatrixWorld();F.matrixWorldInverse.getInverse(F.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();B.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);B.multiply(F.projectionMatrix);B.multiply(F.matrixWorldInverse);h.multiplyMatrices(F.projectionMatrix,F.matrixWorldInverse);f.setFromMatrix(h);a.setRenderTarget(D);a.clear();
-p.length=0;d(c,F);y=0;for(D=p.length;y<D;y++)B=p[y],B=B.object,A=B.material instanceof THREE.MeshFaceMaterial?B.material.materials[0]:B.material,C=void 0!==B.geometry.morphTargets&&0<B.geometry.morphTargets.length&&A.morphTargets,E=B instanceof THREE.SkinnedMesh&&A.skinning,C=B.customDepthMaterial?B.customDepthMaterial:E?C?x:u:C?r:s,a.setMaterialFaces(A),a.renderBufferDirect(F,b,null,C,B)}q=a.getClearColor();I=a.getClearAlpha();e.clearColor(q.r,q.g,q.b,I);g.enable(e.BLEND);v.cullFace===THREE.CullFaceFront&&
+p.length=0;d(c,F);y=0;for(D=p.length;y<D;y++)B=p[y],B=B.object,A=B.material instanceof THREE.MeshFaceMaterial?B.material.materials[0]:B.material,C=void 0!==B.geometry.morphTargets&&0<B.geometry.morphTargets.length&&A.morphTargets,E=B instanceof THREE.SkinnedMesh&&A.skinning,C=B.customDepthMaterial?B.customDepthMaterial:E?C?x:u:C?s:r,a.setMaterialFaces(A),a.renderBufferDirect(F,b,null,C,B)}q=a.getClearColor();I=a.getClearAlpha();e.clearColor(q.r,q.g,q.b,I);g.enable(e.BLEND);v.cullFace===THREE.CullFaceFront&&
 e.cullFace(e.BACK);a.resetGLState();v.needsUpdate=!1}}};
-THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),g={},f=null,h=null,k=null,l=null,m=null,p=null,n=null,q=null,s=null,r=null,u=null,x=null,v=null,z=null,w=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),H=void 0,I={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA,
-a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&(a.disableVertexAttribArray(b),e[b]=0)};this.enable=function(b){!0!==g[b]&&(a.enable(b),g[b]=!0)};this.disable=function(b){!1!==g[b]&&(a.disable(b),g[b]=!1)};this.setBlending=function(c,d,e,g,q,s,r){c!==f&&(c===THREE.NoBlending?this.disable(a.BLEND):
+THREE.WebGLState=function(a,b){var c=this,d=new Uint8Array(16),e=new Uint8Array(16),g={},f=null,h=null,k=null,l=null,m=null,p=null,n=null,q=null,r=null,s=null,u=null,x=null,v=null,z=null,w=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),H=void 0,I={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA,
+a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=d.length;a<b;a++)d[a]=0};this.enableAttribute=function(b){d[b]=1;0===e[b]&&(a.enableVertexAttribArray(b),e[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=e.length;b<c;b++)e[b]!==d[b]&&(a.disableVertexAttribArray(b),e[b]=0)};this.enable=function(b){!0!==g[b]&&(a.enable(b),g[b]=!0)};this.disable=function(b){!1!==g[b]&&(a.disable(b),g[b]=!1)};this.setBlending=function(c,d,e,g,q,r,s){c!==f&&(c===THREE.NoBlending?this.disable(a.BLEND):
 c===THREE.AdditiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(this.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?this.enable(a.BLEND):(this.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,
-a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=c);if(c===THREE.CustomBlending){q=q||d;s=s||e;r=r||g;if(d!==h||q!==m)a.blendEquationSeparate(b(d),b(q)),h=d,m=q;if(e!==k||g!==l||s!==p||r!==n)a.blendFuncSeparate(b(e),b(g),b(s),b(r)),k=e,l=g,p=s,n=r}else n=p=m=l=k=h=null};this.setDepthFunc=function(b){if(q!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);
-break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);q=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){s!==b&&(a.depthMask(b),s=b)};this.setColorWrite=function(b){r!==b&&(a.colorMask(b,b,b,b),r=b)};this.setFlipSided=
+a.ONE,a.ONE_MINUS_SRC_ALPHA)),f=c);if(c===THREE.CustomBlending){q=q||d;r=r||e;s=s||g;if(d!==h||q!==m)a.blendEquationSeparate(b(d),b(q)),h=d,m=q;if(e!==k||g!==l||r!==p||s!==n)a.blendFuncSeparate(b(e),b(g),b(r),b(s)),k=e,l=g,p=r,n=s}else n=p=m=l=k=h=null};this.setDepthFunc=function(b){if(q!==b){if(b)switch(b){case THREE.NeverDepth:a.depthFunc(a.NEVER);break;case THREE.AlwaysDepth:a.depthFunc(a.ALWAYS);break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a.depthFunc(a.LEQUAL);
+break;case THREE.EqualDepth:a.depthFunc(a.EQUAL);break;case THREE.GreaterEqualDepth:a.depthFunc(a.GEQUAL);break;case THREE.GreaterDepth:a.depthFunc(a.GREATER);break;case THREE.NotEqualDepth:a.depthFunc(a.NOTEQUAL);break;default:a.depthFunc(a.LEQUAL)}else a.depthFunc(a.LEQUAL);q=b}};this.setDepthTest=function(b){b?this.enable(a.DEPTH_TEST):this.disable(a.DEPTH_TEST)};this.setDepthWrite=function(b){r!==b&&(a.depthMask(b),r=b)};this.setColorWrite=function(b){s!==b&&(a.colorMask(b,b,b,b),s=b)};this.setFlipSided=
 function(b){u!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),u=b)};this.setLineWidth=function(b){b!==x&&(a.lineWidth(b),x=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||v===c&&z===d||(a.polygonOffset(c,d),v=c,z=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=function(b){void 0===b&&(b=a.TEXTURE0+w-1);H!==b&&(a.activeTexture(b),H=b)};this.bindTexture=function(b,d){void 0===
-H&&c.activeTexture();var e=I[H];void 0===e&&(e={type:void 0,texture:void 0},I[H]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);g={};u=r=s=f=null}};
-THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n=a.context,q=a.state,s,r,u,x,v,z;this.render=function(w,H,I,y){if(0!==b.length){w=new THREE.Vector3;var D=y/I,F=.5*I,B=.5*y,C=16/y,S=new THREE.Vector2(C*D,C),G=new THREE.Vector3(1,1,0),A=new THREE.Vector2(1,1);if(void 0===u){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),E=new Uint16Array([0,1,2,0,2,3]);s=n.createBuffer();r=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,s);n.bufferData(n.ARRAY_BUFFER,C,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
-r);n.bufferData(n.ELEMENT_ARRAY_BUFFER,E,n.STATIC_DRAW);v=n.createTexture();z=n.createTexture();q.bindTexture(n.TEXTURE_2D,v);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);q.bindTexture(n.TEXTURE_2D,z);n.texImage2D(n.TEXTURE_2D,0,
+H&&c.activeTexture();var e=I[H];void 0===e&&(e={type:void 0,texture:void 0},I[H]=e);if(e.type!==b||e.texture!==d)a.bindTexture(b,d),e.type=b,e.texture=d};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=0;b<e.length;b++)1===e[b]&&(a.disableVertexAttribArray(b),e[b]=0);g={};u=s=r=f=null}};
+THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n=a.context,q=a.state,r,s,u,x,v,z;this.render=function(w,H,I,y){if(0!==b.length){w=new THREE.Vector3;var D=y/I,F=.5*I,B=.5*y,C=16/y,S=new THREE.Vector2(C*D,C),G=new THREE.Vector3(1,1,0),A=new THREE.Vector2(1,1);if(void 0===u){var C=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),E=new Uint16Array([0,1,2,0,2,3]);r=n.createBuffer();s=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,r);n.bufferData(n.ARRAY_BUFFER,C,n.STATIC_DRAW);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,
+s);n.bufferData(n.ELEMENT_ARRAY_BUFFER,E,n.STATIC_DRAW);v=n.createTexture();z=n.createTexture();q.bindTexture(n.TEXTURE_2D,v);n.texImage2D(n.TEXTURE_2D,0,n.RGB,16,16,0,n.RGB,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);q.bindTexture(n.TEXTURE_2D,z);n.texImage2D(n.TEXTURE_2D,0,
 n.RGBA,16,16,0,n.RGBA,n.UNSIGNED_BYTE,null);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST);n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST);var C=(x=0<n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
 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}"},
 E=n.createProgram(),J=n.createShader(n.FRAGMENT_SHADER),M=n.createShader(n.VERTEX_SHADER),R="precision "+a.getPrecision()+" float;\n";n.shaderSource(J,R+C.fragmentShader);n.shaderSource(M,R+C.vertexShader);n.compileShader(J);n.compileShader(M);n.attachShader(E,J);n.attachShader(E,M);n.linkProgram(E);u=E;m=n.getAttribLocation(u,"position");p=n.getAttribLocation(u,"uv");c=n.getUniformLocation(u,"renderType");d=n.getUniformLocation(u,"map");e=n.getUniformLocation(u,"occlusionMap");g=n.getUniformLocation(u,
-"opacity");f=n.getUniformLocation(u,"color");h=n.getUniformLocation(u,"scale");k=n.getUniformLocation(u,"rotation");l=n.getUniformLocation(u,"screenPosition")}n.useProgram(u);q.initAttributes();q.enableAttribute(m);q.enableAttribute(p);q.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,s);n.vertexAttribPointer(m,2,n.FLOAT,!1,16,0);n.vertexAttribPointer(p,2,n.FLOAT,!1,16,8);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r);q.disable(n.CULL_FACE);n.depthMask(!1);E=0;for(J=
+"opacity");f=n.getUniformLocation(u,"color");h=n.getUniformLocation(u,"scale");k=n.getUniformLocation(u,"rotation");l=n.getUniformLocation(u,"screenPosition")}n.useProgram(u);q.initAttributes();q.enableAttribute(m);q.enableAttribute(p);q.disableUnusedAttributes();n.uniform1i(e,0);n.uniform1i(d,1);n.bindBuffer(n.ARRAY_BUFFER,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,s);q.disable(n.CULL_FACE);n.depthMask(!1);E=0;for(J=
 b.length;E<J;E++)if(C=16/y,S.set(C*D,C),M=b[E],w.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),w.applyMatrix4(H.matrixWorldInverse),w.applyProjection(H.projectionMatrix),G.copy(w),A.x=G.x*F+F,A.y=G.y*B+B,x||0<A.x&&A.x<I&&0<A.y&&A.y<y){q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,null);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,v);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGB,A.x-8,A.y-8,16,16,0);n.uniform1i(c,0);n.uniform2f(h,S.x,S.y);n.uniform3f(l,
 G.x,G.y,G.z);q.disable(n.BLEND);q.enable(n.DEPTH_TEST);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);q.activeTexture(n.TEXTURE0);q.bindTexture(n.TEXTURE_2D,z);n.copyTexImage2D(n.TEXTURE_2D,0,n.RGBA,A.x-8,A.y-8,16,16,0);n.uniform1i(c,1);q.disable(n.DEPTH_TEST);q.activeTexture(n.TEXTURE1);q.bindTexture(n.TEXTURE_2D,v);n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0);M.positionScreen.copy(G);M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares();n.uniform1i(c,2);q.enable(n.BLEND);for(var R=
 0,U=M.lensFlares.length;R<U;R++){var Q=M.lensFlares[R];.001<Q.opacity&&.001<Q.scale&&(G.x=Q.x,G.y=Q.y,G.z=Q.z,C=Q.size*Q.scale/y,S.x=C*D,S.y=C,n.uniform3f(l,G.x,G.y,G.z),n.uniform2f(h,S.x,S.y),n.uniform1f(k,Q.rotation),n.uniform1f(g,Q.opacity),n.uniform3f(f,Q.color.r,Q.color.g,Q.color.b),q.setBlending(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst),a.setTexture(Q.texture,1),n.drawElements(n.TRIANGLES,6,n.UNSIGNED_SHORT,0))}}q.enable(n.CULL_FACE);q.enable(n.DEPTH_TEST);n.depthMask(!0);a.resetGLState()}}};
-THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n,q,s,r,u,x,v;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,H=a.state,I,y,D,F,B=new THREE.Vector3,C=new THREE.Quaternion,S=new THREE.Vector3;this.render=function(G,A){if(0!==b.length){if(void 0===D){var E=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),J=new Uint16Array([0,1,2,0,2,3]);I=w.createBuffer();y=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,I);w.bufferData(w.ARRAY_BUFFER,E,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
+THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,m,p,n,q,r,s,u,x,v;function z(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var w=a.context,H=a.state,I,y,D,F,B=new THREE.Vector3,C=new THREE.Quaternion,S=new THREE.Vector3;this.render=function(G,A){if(0!==b.length){if(void 0===D){var E=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),J=new Uint16Array([0,1,2,0,2,3]);I=w.createBuffer();y=w.createBuffer();w.bindBuffer(w.ARRAY_BUFFER,I);w.bufferData(w.ARRAY_BUFFER,E,w.STATIC_DRAW);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,
 y);w.bufferData(w.ELEMENT_ARRAY_BUFFER,J,w.STATIC_DRAW);var E=w.createProgram(),J=w.createShader(w.VERTEX_SHADER),M=w.createShader(w.FRAGMENT_SHADER);w.shaderSource(J,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
 w.shaderSource(M,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
 w.compileShader(J);w.compileShader(M);w.attachShader(E,J);w.attachShader(E,M);w.linkProgram(E);D=E;x=w.getAttribLocation(D,"position");v=w.getAttribLocation(D,"uv");c=w.getUniformLocation(D,"uvOffset");d=w.getUniformLocation(D,"uvScale");e=w.getUniformLocation(D,"rotation");g=w.getUniformLocation(D,"scale");f=w.getUniformLocation(D,"color");h=w.getUniformLocation(D,"map");k=w.getUniformLocation(D,"opacity");l=w.getUniformLocation(D,"modelViewMatrix");m=w.getUniformLocation(D,"projectionMatrix");p=
-w.getUniformLocation(D,"fogType");n=w.getUniformLocation(D,"fogDensity");q=w.getUniformLocation(D,"fogNear");s=w.getUniformLocation(D,"fogFar");r=w.getUniformLocation(D,"fogColor");u=w.getUniformLocation(D,"alphaTest");E=document.createElement("canvas");E.width=8;E.height=8;J=E.getContext("2d");J.fillStyle="white";J.fillRect(0,0,8,8);F=new THREE.Texture(E);F.needsUpdate=!0}w.useProgram(D);H.initAttributes();H.enableAttribute(x);H.enableAttribute(v);H.disableUnusedAttributes();H.disable(w.CULL_FACE);
-H.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,I);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,y);w.uniformMatrix4fv(m,!1,A.projectionMatrix.elements);H.activeTexture(w.TEXTURE0);w.uniform1i(h,0);J=E=0;(M=G.fog)?(w.uniform3f(r,M.color.r,M.color.g,M.color.b),M instanceof THREE.Fog?(w.uniform1f(q,M.near),w.uniform1f(s,M.far),w.uniform1i(p,1),J=E=1):M instanceof THREE.FogExp2&&(w.uniform1f(n,M.density),w.uniform1i(p,2),J=E=2)):
+w.getUniformLocation(D,"fogType");n=w.getUniformLocation(D,"fogDensity");q=w.getUniformLocation(D,"fogNear");r=w.getUniformLocation(D,"fogFar");s=w.getUniformLocation(D,"fogColor");u=w.getUniformLocation(D,"alphaTest");E=document.createElement("canvas");E.width=8;E.height=8;J=E.getContext("2d");J.fillStyle="white";J.fillRect(0,0,8,8);F=new THREE.Texture(E);F.needsUpdate=!0}w.useProgram(D);H.initAttributes();H.enableAttribute(x);H.enableAttribute(v);H.disableUnusedAttributes();H.disable(w.CULL_FACE);
+H.enable(w.BLEND);w.bindBuffer(w.ARRAY_BUFFER,I);w.vertexAttribPointer(x,2,w.FLOAT,!1,16,0);w.vertexAttribPointer(v,2,w.FLOAT,!1,16,8);w.bindBuffer(w.ELEMENT_ARRAY_BUFFER,y);w.uniformMatrix4fv(m,!1,A.projectionMatrix.elements);H.activeTexture(w.TEXTURE0);w.uniform1i(h,0);J=E=0;(M=G.fog)?(w.uniform3f(s,M.color.r,M.color.g,M.color.b),M instanceof THREE.Fog?(w.uniform1f(q,M.near),w.uniform1f(r,M.far),w.uniform1i(p,1),J=E=1):M instanceof THREE.FogExp2&&(w.uniform1f(n,M.density),w.uniform1i(p,2),J=E=2)):
 (w.uniform1i(p,0),J=E=0);for(var M=0,R=b.length;M<R;M++){var U=b[M];U._modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,U.matrixWorld);U.z=-U._modelViewMatrix.elements[14]}b.sort(z);for(var Q=[],M=0,R=b.length;M<R;M++){var U=b[M],T=U.material;w.uniform1f(u,T.alphaTest);w.uniformMatrix4fv(l,!1,U._modelViewMatrix.elements);U.matrixWorld.decompose(B,C,S);Q[0]=S.x;Q[1]=S.y;U=0;G.fog&&T.fog&&(U=J);E!==U&&(w.uniform1i(p,U),E=U);null!==T.map?(w.uniform2f(c,T.map.offset.x,T.map.offset.y),w.uniform2f(d,
 T.map.repeat.x,T.map.repeat.y)):(w.uniform2f(c,0,0),w.uniform2f(d,1,1));w.uniform1f(k,T.opacity);w.uniform3f(f,T.color.r,T.color.g,T.color.b);w.uniform1f(e,T.rotation);w.uniform2fv(g,Q);H.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst);H.setDepthTest(T.depthTest);H.setDepthWrite(T.depthWrite);T.map&&T.map.image&&T.map.image.width?a.setTexture(T.map,0):a.setTexture(F,0);w.drawElements(w.TRIANGLES,6,w.UNSIGNED_SHORT,0)}H.enable(w.CULL_FACE);a.resetGLState()}}};
 THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
 THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b),f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&c(g))},void 0,
 d)};for(var h=0,k=a.length;h<k;++h)b(h);return g},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,g=document.createElement("canvas");
-g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,k=f.createImageData(d,e),l=k.data,m=0;m<d;m++)for(var p=0;p<e;p++){var n=0>p-1?0:p-1,q=p+1>e-1?e-1:p+1,s=0>m-1?0:m-1,r=m+1>d-1?d-1:m+1,u=[],x=[0,0,h[4*(p*d+m)]/255*b];u.push([-1,0,h[4*(p*d+s)]/255*b]);u.push([-1,-1,h[4*(n*d+s)]/255*b]);u.push([0,-1,h[4*(n*d+m)]/255*b]);u.push([1,-1,h[4*(n*d+r)]/255*b]);u.push([1,0,h[4*(p*d+r)]/255*b]);u.push([1,1,h[4*(q*d+r)]/255*b]);u.push([0,1,h[4*(q*d+m)]/255*
-b]);u.push([-1,1,h[4*(q*d+s)]/255*b]);n=[];s=u.length;for(q=0;q<s;q++){var r=u[q],v=u[(q+1)%s],r=[r[0]-x[0],r[1]-x[1],r[2]-x[2]],v=[v[0]-x[0],v[1]-x[1],v[2]-x[2]];n.push(c([r[1]*v[2]-r[2]*v[1],r[2]*v[0]-r[0]*v[2],r[0]*v[1]-r[1]*v[0]]))}u=[0,0,0];for(q=0;q<n.length;q++)u[0]+=n[q][0],u[1]+=n[q][1],u[2]+=n[q][2];u[0]/=n.length;u[1]/=n.length;u[2]/=n.length;x=4*(p*d+m);l[x]=(u[0]+1)/2*255|0;l[x+1]=(u[1]+1)/2*255|0;l[x+2]=255*u[2]|0;l[x+3]=255}f.putImageData(k,0,0);return g},generateDataTexture:function(a,
+g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,k=f.createImageData(d,e),l=k.data,m=0;m<d;m++)for(var p=0;p<e;p++){var n=0>p-1?0:p-1,q=p+1>e-1?e-1:p+1,r=0>m-1?0:m-1,s=m+1>d-1?d-1:m+1,u=[],x=[0,0,h[4*(p*d+m)]/255*b];u.push([-1,0,h[4*(p*d+r)]/255*b]);u.push([-1,-1,h[4*(n*d+r)]/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*(q*d+s)]/255*b]);u.push([0,1,h[4*(q*d+m)]/255*
+b]);u.push([-1,1,h[4*(q*d+r)]/255*b]);n=[];r=u.length;for(q=0;q<r;q++){var s=u[q],v=u[(q+1)%r],s=[s[0]-x[0],s[1]-x[1],s[2]-x[2]],v=[v[0]-x[0],v[1]-x[1],v[2]-x[2]];n.push(c([s[1]*v[2]-s[2]*v[1],s[2]*v[0]-s[0]*v[2],s[0]*v[1]-s[1]*v[0]]))}u=[0,0,0];for(q=0;q<n.length;q++)u[0]+=n[q][0],u[1]+=n[q][1],u[2]+=n[q][2];u[0]/=n.length;u[1]/=n.length;u[2]/=n.length;x=4*(p*d+m);l[x]=(u[0]+1)/2*255|0;l[x+1]=(u[1]+1)/2*255|0;l[x+2]=255*u[2]|0;l[x+3]=255}f.putImageData(k,0,0);return g},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),g=Math.floor(255*c.r),f=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=g,e[3*h+1]=f,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face.toLowerCase()][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing.";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=
-a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),g=e.length,f=[];for(a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,k,l,m,p,n,q,s,r,u,x=b.glyphs[a]||b.glyphs["?"];if(x){if(x.o)for(b=x._cachedOutline||(x._cachedOutline=x.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;m=b[a++]*c;e.moveTo(k,m);
-break;case "l":k=b[a++]*c+d;m=b[a++]*c;e.lineTo(k,m);break;case "q":k=b[a++]*c+d;m=b[a++]*c;q=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(q,s,k,m);if(f=g[g.length-1])for(p=f.x,n=f.y,f=1,h=this.divisions;f<=h;f++){var v=f/h;THREE.Shape.Utils.b2(v,p,q,k);THREE.Shape.Utils.b2(v,n,s,m)}break;case "b":if(k=b[a++]*c+d,m=b[a++]*c,q=b[a++]*c+d,s=b[a++]*c,r=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,s,r,u,k,m),f=g[g.length-1])for(p=f.x,n=f.y,f=1,h=this.divisions;f<=h;f++)v=f/h,THREE.Shape.Utils.b3(v,p,q,r,k),THREE.Shape.Utils.b3(v,
-n,s,u,m)}return{offset:x.ha*c,path:e}}}};
+a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),g=e.length,f=[];for(a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,k,l,m,p,n,q,r,s,u,x=b.glyphs[a]||b.glyphs["?"];if(x){if(x.o)for(b=x._cachedOutline||(x._cachedOutline=x.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;m=b[a++]*c;e.moveTo(k,m);
+break;case "l":k=b[a++]*c+d;m=b[a++]*c;e.lineTo(k,m);break;case "q":k=b[a++]*c+d;m=b[a++]*c;q=b[a++]*c+d;r=b[a++]*c;e.quadraticCurveTo(q,r,k,m);if(f=g[g.length-1])for(p=f.x,n=f.y,f=1,h=this.divisions;f<=h;f++){var v=f/h;THREE.Shape.Utils.b2(v,p,q,k);THREE.Shape.Utils.b2(v,n,r,m)}break;case "b":if(k=b[a++]*c+d,m=b[a++]*c,q=b[a++]*c+d,r=b[a++]*c,s=b[a++]*c+d,u=b[a++]*c,e.bezierCurveTo(q,r,s,u,k,m),f=g[g.length-1])for(p=f.x,n=f.y,f=1,h=this.divisions;f<=h;f++)v=f/h,THREE.Shape.Utils.b3(v,p,q,s,k),THREE.Shape.Utils.b3(v,
+n,r,u,m)}return{offset:x.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,m;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var n;a:{var q=n=void 0,s=void 0,r=void 0,
-u=void 0,x=void 0,v=void 0,z=void 0,w=void 0,q=a[f[k]].x,s=a[f[k]].y,r=a[f[l]].x,u=a[f[l]].y,x=a[f[m]].x,v=a[f[m]].y;if(1E-10>(r-q)*(v-s)-(u-s)*(x-q))n=!1;else{var H=void 0,I=void 0,y=void 0,D=void 0,F=void 0,B=void 0,C=void 0,S=void 0,G=void 0,A=void 0,G=S=C=w=z=void 0,H=x-r,I=v-u,y=q-x,D=s-v,F=r-q,B=u-s;for(n=0;n<e;n++)if(z=a[f[n]].x,w=a[f[n]].y,!(z===q&&w===s||z===r&&w===u||z===x&&w===v)&&(C=z-q,S=w-s,G=z-r,A=w-u,z-=x,w-=v,G=H*A-I*G,C=F*S-B*C,S=y*w-D*z,-1E-10<=G&&-1E-10<=S&&-1E-10<=C)){n=!1;break a}n=
+(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,m;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);m=l+1;e<=m&&(m=0);var n;a:{var q=n=void 0,r=void 0,s=void 0,
+u=void 0,x=void 0,v=void 0,z=void 0,w=void 0,q=a[f[k]].x,r=a[f[k]].y,s=a[f[l]].x,u=a[f[l]].y,x=a[f[m]].x,v=a[f[m]].y;if(1E-10>(s-q)*(v-r)-(u-r)*(x-q))n=!1;else{var H=void 0,I=void 0,y=void 0,D=void 0,F=void 0,B=void 0,C=void 0,S=void 0,G=void 0,A=void 0,G=S=C=w=z=void 0,H=x-s,I=v-u,y=q-x,D=r-v,F=s-q,B=u-r;for(n=0;n<e;n++)if(z=a[f[n]].x,w=a[f[n]].y,!(z===q&&w===r||z===s&&w===u||z===x&&w===v)&&(C=z-q,S=w-r,G=z-s,A=w-u,z-=x,w-=v,G=H*A-I*G,C=F*S-B*C,S=y*w-D*z,-1E-10<=G&&-1E-10<=S&&-1E-10<=C)){n=!1;break a}n=
 !0}}if(n){g.push([a[f[k]],a[f[l]],a[f[m]]]);h.push([f[k],f[l],f[m]]);k=l;for(m=l+1;m<e;k++,m++)f[k]=f[m];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
 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};
@@ -688,14 +689,14 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,g){var f=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,g){var f=this.actions[this.actions.length-1].args;this.absarc(a+f[f.length-2],b+f[f.length-1],c,d,e,g)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,g){this.absellipse(a,b,c,c,d,e,g)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,g,f){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,g,f)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,g,f){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,g,f);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};
 THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,g,f,h,k,l,m,p,n,q,s,r;d=0;for(e=this.actions.length;d<e;d++)switch(g=this.actions[d],f=g.action,g=g.args,f){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];k=g[3];p=g[0];n=g[1];0<c.length?(f=c[c.length-1],q=f.x,s=f.y):(f=this.actions[d-
-1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)r=g/a,f=THREE.Shape.Utils.b2(r,q,p,h),r=THREE.Shape.Utils.b2(r,s,n,k),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];p=g[0];n=g[1];l=g[2];m=g[3];0<c.length?(f=c[c.length-1],q=f.x,s=f.y):(f=this.actions[d-1].args,q=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)r=g/a,f=THREE.Shape.Utils.b3(r,q,p,l,h),r=THREE.Shape.Utils.b3(r,s,n,m,k),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.CSPLINE_THRU:f=
-this.actions[d-1].args;r=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;r=r.concat(g[0]);r=new THREE.SplineCurve(r);for(g=1;g<=f;g++)c.push(r.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];n=g[2];l=g[3];f=g[4];p=!!g[5];q=f-l;s=2*a;for(g=1;g<=s;g++)r=g/s,p||(r=1-r),r=l+r*q,f=h+n*Math.cos(r),r=k+n*Math.sin(r),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],n=g[2],m=g[3],l=g[4],f=g[5],p=!!g[6],q=f-l,s=2*a,g=1;g<=s;g++)r=g/s,p||
-(r=1-r),r=l+r*q,f=h+n*Math.cos(r),r=k+m*Math.sin(r),c.push(new THREE.Vector2(f,r))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
+THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,g,f,h,k,l,m,p,n,q,r,s;d=0;for(e=this.actions.length;d<e;d++)switch(g=this.actions[d],f=g.action,g=g.args,f){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];k=g[3];p=g[0];n=g[1];0<c.length?(f=c[c.length-1],q=f.x,r=f.y):(f=this.actions[d-
+1].args,q=f[f.length-2],r=f[f.length-1]);for(g=1;g<=a;g++)s=g/a,f=THREE.Shape.Utils.b2(s,q,p,h),s=THREE.Shape.Utils.b2(s,r,n,k),c.push(new THREE.Vector2(f,s));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];p=g[0];n=g[1];l=g[2];m=g[3];0<c.length?(f=c[c.length-1],q=f.x,r=f.y):(f=this.actions[d-1].args,q=f[f.length-2],r=f[f.length-1]);for(g=1;g<=a;g++)s=g/a,f=THREE.Shape.Utils.b3(s,q,p,l,h),s=THREE.Shape.Utils.b3(s,r,n,m,k),c.push(new THREE.Vector2(f,s));break;case THREE.PathActions.CSPLINE_THRU:f=
+this.actions[d-1].args;s=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;s=s.concat(g[0]);s=new THREE.SplineCurve(s);for(g=1;g<=f;g++)c.push(s.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];n=g[2];l=g[3];f=g[4];p=!!g[5];q=f-l;r=2*a;for(g=1;g<=r;g++)s=g/r,p||(s=1-s),s=l+s*q,f=h+n*Math.cos(s),s=k+n*Math.sin(s),c.push(new THREE.Vector2(f,s));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],n=g[2],m=g[3],l=g[4],f=g[5],p=!!g[6],q=f-l,r=2*a,g=1;g<=r;g++)s=g/r,p||
+(s=1-s),s=l+s*q,f=h+n*Math.cos(s),s=k+m*Math.sin(s),c.push(new THREE.Vector2(f,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,l=h.y-g.y;if(1E-10<Math.abs(l)){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.y<g.y||a.y>h.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&
 a.x<=h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d===THREE.PathActions.MOVE_TO&&0!==g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!==g.actions.length&&f.push(g);return f}(this.actions);if(0===e.length)return[];if(!0===b)return c(e);var g,f,h,k=[];if(1===e.length)return f=e[0],h=new THREE.Shape,h.actions=f.actions,h.curves=f.curves,k.push(h),k;var l=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),
-l=a?!l:l;h=[];var m=[],p=[],n=0,q;m[n]=void 0;p[n]=[];var s,r;s=0;for(r=e.length;s<r;s++)f=e[s],q=f.getPoints(),g=THREE.Shape.Utils.isClockWise(q),(g=a?!g:g)?(!l&&m[n]&&n++,m[n]={s:new THREE.Shape,p:q},m[n].s.actions=f.actions,m[n].s.curves=f.curves,l&&n++,p[n]=[]):p[n].push({h:f,p:q[0]});if(!m[0])return c(e);if(1<m.length){s=!1;r=[];f=0;for(e=m.length;f<e;f++)h[f]=[];f=0;for(e=m.length;f<e;f++)for(g=p[f],l=0;l<g.length;l++){n=g[l];q=!0;for(var u=0;u<m.length;u++)d(n.p,m[u].p)&&(f!==u&&r.push({froms:f,
-tos:u,hole:l}),q?(q=!1,h[u].push(n)):s=!0);q&&h[f].push(n)}0<r.length&&(s||(p=h))}s=0;for(r=m.length;s<r;s++)for(h=m[s].s,k.push(h),f=p[s],e=0,g=f.length;e<g;e++)h.holes.push(f[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
+l=a?!l:l;h=[];var m=[],p=[],n=0,q;m[n]=void 0;p[n]=[];var r,s;r=0;for(s=e.length;r<s;r++)f=e[r],q=f.getPoints(),g=THREE.Shape.Utils.isClockWise(q),(g=a?!g:g)?(!l&&m[n]&&n++,m[n]={s:new THREE.Shape,p:q},m[n].s.actions=f.actions,m[n].s.curves=f.curves,l&&n++,p[n]=[]):p[n].push({h:f,p:q[0]});if(!m[0])return c(e);if(1<m.length){r=!1;s=[];f=0;for(e=m.length;f<e;f++)h[f]=[];f=0;for(e=m.length;f<e;f++)for(g=p[f],l=0;l<g.length;l++){n=g[l];q=!0;for(var u=0;u<m.length;u++)d(n.p,m[u].p)&&(f!==u&&s.push({froms:f,
+tos:u,hole:l}),q?(q=!1,h[u].push(n)):r=!0);q&&h[f].push(n)}0<s.length&&(r||(p=h))}r=0;for(s=m.length;r<s;r++)for(h=m[r].s,k.push(h),f=p[r],e=0,g=f.length;e<g;e++)h.holes.push(f[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.constructor=THREE.Shape;THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};
 THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};
 THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
 THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,m=a.x-d.x,p=a.y-d.y,y=h*k-g*l,D=h*m-g*p;if(1E-10<Math.abs(y)){if(0<y){if(0>D||D>y)return[];k=l*m-k*p;if(0>k||k>y)return[]}else{if(0<D||D<y)return[];k=l*m-k*p;if(0<k||k<y)return[]}if(0===k)return!f||0!==D&&D!==y?[a]:[];if(k===y)return!f||0!==D&&D!==y?[b]:[];if(0===
@@ -727,12 +728,12 @@ THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(
 for(b=0;b<this.animations.length;b++)this.animations[b].update(a)}};THREE.Animation=function(a,b){this.root=a;this.data=THREE.AnimationHandler.init(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=!0;this.weight=0;this.interpolationType=THREE.AnimationHandler.LINEAR};
 THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","scl"],play:function(a,b){this.currentTime=void 0!==a?a:0;this.weight=void 0!==b?b:1;this.isPlaying=!0;this.reset();THREE.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1;THREE.AnimationHandler.stop(this)},reset:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});
 var d=this.data.name,e=c.animationCache.animations,g=e[d];void 0===g&&(g={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=g);for(c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],f=this.getNextKeyWith(d,a,1);f.time<this.currentTime&&f.index>e.index;)e=f,f=this.getNextKeyWith(d,a,f.index+1);g.prevKey[d]=e;g.nextKey[d]=f}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a].animationCache;void 0!==
-c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,n,q,s,r;e=(a.length-1)*b;p=Math.floor(e);e-=p;c[0]=0===p?p:p-1;c[1]=p;c[2]=p>a.length-2?p:p+1;c[3]=p>a.length-3?p:p+2;p=a[c[0]];q=a[c[1]];s=a[c[2]];r=a[c[3]];c=e*e;n=e*c;d[0]=g(p[0],q[0],s[0],r[0],e,c,n);d[1]=g(p[1],q[1],s[1],r[1],e,c,n);d[2]=g(p[2],q[2],s[2],r[2],e,c,n);return d},g=function(a,b,c,d,
+c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,p,n,q,r,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]];q=a[c[1]];r=a[c[2]];s=a[c[3]];c=e*e;n=e*c;d[0]=g(p[0],q[0],r[0],s[0],e,c,n);d[1]=g(p[1],q[1],r[1],s[1],e,c,n);d[2]=g(p[2],q[2],r[2],s[2],e,c,n);return d},g=function(a,b,c,d,
 e,g,n){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*n+(-3*(b-c)-2*a-d)*g+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var g=this.hierarchy.length;f<g;f++)for(var k=this.hierarchy[f],l=k.animationCache.animations[this.data.name],m=k.animationCache.blending,p=0;3>p;p++){var n=this.keyTypes[p],
-q=l.prevKey[n],s=l.nextKey[n];if(0<this.timeScale&&s.time<=this.currentTime||0>this.timeScale&&q.time>=this.currentTime){q=this.data.hierarchy[f].keys[0];for(s=this.getNextKeyWith(n,f,1);s.time<this.currentTime&&s.index>q.index;)q=s,s=this.getNextKeyWith(n,f,s.index+1);l.prevKey[n]=q;l.nextKey[n]=s}var r=(this.currentTime-q.time)/(s.time-q.time),u=q[n],x=s[n];0>r&&(r=0);1<r&&(r=1);if("pos"===n)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(x[0]-u[0])*r,c.y=u[1]+(x[1]-u[1])*r,
-c.z=u[2]+(x[2]-u[2])*r,q=this.weight/(this.weight+m.positionWeight),k.position.lerp(c,q),m.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,q.index-1).pos,a[1]=u,a[2]=x,a[3]=this.getNextKeyWith("pos",f,s.index+1).pos,r=.33*r+.33,s=e(a,r),q=this.weight/(this.weight+m.positionWeight),m.positionWeight+=this.weight,n=k.position,n.x+=(s[0]-n.x)*q,n.y+=(s[1]-
-n.y)*q,n.z+=(s[2]-n.z)*q,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(r=e(a,1.01*r),b.set(r[0],r[1],r[2]),b.sub(n),b.y=0,b.normalize(),r=Math.atan2(b.x,b.z),k.rotation.set(0,r,0))}else"rot"===n?(THREE.Quaternion.slerp(u,x,d,r),0===m.quaternionWeight?(k.quaternion.copy(d),m.quaternionWeight=this.weight):(q=this.weight/(this.weight+m.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,q),m.quaternionWeight+=this.weight)):"scl"===n&&(c.x=u[0]+(x[0]-u[0])*r,c.y=
-u[1]+(x[1]-u[1])*r,c.z=u[2]+(x[2]-u[2])*r,q=this.weight/(this.weight+m.scaleWeight),k.scale.lerp(c,q),m.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
+q=l.prevKey[n],r=l.nextKey[n];if(0<this.timeScale&&r.time<=this.currentTime||0>this.timeScale&&q.time>=this.currentTime){q=this.data.hierarchy[f].keys[0];for(r=this.getNextKeyWith(n,f,1);r.time<this.currentTime&&r.index>q.index;)q=r,r=this.getNextKeyWith(n,f,r.index+1);l.prevKey[n]=q;l.nextKey[n]=r}var s=(this.currentTime-q.time)/(r.time-q.time),u=q[n],x=r[n];0>s&&(s=0);1<s&&(s=1);if("pos"===n)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=u[0]+(x[0]-u[0])*s,c.y=u[1]+(x[1]-u[1])*s,
+c.z=u[2]+(x[2]-u[2])*s,q=this.weight/(this.weight+m.positionWeight),k.position.lerp(c,q),m.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,q.index-1).pos,a[1]=u,a[2]=x,a[3]=this.getNextKeyWith("pos",f,r.index+1).pos,s=.33*s+.33,r=e(a,s),q=this.weight/(this.weight+m.positionWeight),m.positionWeight+=this.weight,n=k.position,n.x+=(r[0]-n.x)*q,n.y+=(r[1]-
+n.y)*q,n.z+=(r[2]-n.z)*q,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,x,d,s),0===m.quaternionWeight?(k.quaternion.copy(d),m.quaternionWeight=this.weight):(q=this.weight/(this.weight+m.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,q),m.quaternionWeight+=this.weight)):"scl"===n&&(c.x=u[0]+(x[0]-u[0])*s,c.y=
+u[1]+(x[1]-u[1])*s,c.z=u[2]+(x[2]-u[2])*s,q=this.weight/(this.weight+m.scaleWeight),k.scale.lerp(c,q),m.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]},getPrevKeyWith:function(a,b,c){var d=
 this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]}};
 THREE.KeyFrameAnimation=function(a){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var g=c[e],f=this.getNextKeyWith(g,a,0);f&&f.apply(g)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
 d.matrixWorldNeedsUpdate=!0}}};
@@ -743,74 +744,74 @@ g.interpolate(f,f.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld
 THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
 THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);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,g){function f(a,b,c,d,e,f,g){var r,u=h.widthSegments,x=h.heightSegments,v=e/2,z=f/2,w=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)r="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)r="y",x=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)r="x",u=h.depthSegments;var H=u+1,I=x+1,y=e/u,D=f/x,F=new THREE.Vector3;F[r]=0<g?1:-1;for(e=0;e<I;e++)for(f=0;f<H;f++){var B=new THREE.Vector3;B[a]=(f*y-v)*c;B[b]=(e*D-z)*d;B[r]=g;h.vertices.push(B)}for(e=0;e<
-x;e++)for(f=0;f<u;f++)z=f+H*e,a=f+H*(e+1),b=f+1+H*(e+1),c=f+1+H*e,d=new THREE.Vector2(f/u,1-e/x),g=new THREE.Vector2(f/u,1-(e+1)/x),r=new THREE.Vector2((f+1)/u,1-(e+1)/x),v=new THREE.Vector2((f+1)/u,1-e/x),z=new THREE.Face3(z+w,a+w,c+w),z.normal.copy(F),z.vertexNormals.push(F.clone(),F.clone(),F.clone()),h.faces.push(z),h.faceVertexUvs[0].push([d,g,v]),z=new THREE.Face3(a+w,b+w,c+w),z.normal.copy(F),z.vertexNormals.push(F.clone(),F.clone(),F.clone()),h.faces.push(z),h.faceVertexUvs[0].push([g.clone(),
-r,v.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d);f("z","y",1,-1,c,b,-d);f("x","z",1,1,a,c,e);f("x","z",1,-1,a,c,-e);f("x","y",1,-1,a,b,g);f("x","y",-1,-1,a,b,-g);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g){var s,u=h.widthSegments,x=h.heightSegments,v=e/2,z=f/2,w=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",x=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)s="x",u=h.depthSegments;var H=u+1,I=x+1,y=e/u,D=f/x,F=new THREE.Vector3;F[s]=0<g?1:-1;for(e=0;e<I;e++)for(f=0;f<H;f++){var B=new THREE.Vector3;B[a]=(f*y-v)*c;B[b]=(e*D-z)*d;B[s]=g;h.vertices.push(B)}for(e=0;e<
+x;e++)for(f=0;f<u;f++)z=f+H*e,a=f+H*(e+1),b=f+1+H*(e+1),c=f+1+H*e,d=new THREE.Vector2(f/u,1-e/x),g=new THREE.Vector2(f/u,1-(e+1)/x),s=new THREE.Vector2((f+1)/u,1-(e+1)/x),v=new THREE.Vector2((f+1)/u,1-e/x),z=new THREE.Face3(z+w,a+w,c+w),z.normal.copy(F),z.vertexNormals.push(F.clone(),F.clone(),F.clone()),h.faces.push(z),h.faceVertexUvs[0].push([d,g,v]),z=new THREE.Face3(a+w,b+w,c+w),z.normal.copy(F),z.vertexNormals.push(F.clone(),F.clone(),F.clone()),h.faces.push(z),h.faceVertexUvs[0].push([g.clone(),
+s,v.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d);f("z","y",1,-1,c,b,-d);f("x","z",1,1,a,c,e);f("x","z",1,-1,a,c,-e);f("x","y",1,-1,a,b,g);f("x","y",-1,-1,a,b,-g);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,g=[];e=new THREE.Vector3;var f=new THREE.Vector2(.5,.5);this.vertices.push(e);g.push(f);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);g.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([g[e].clone(),g[e+1].clone(),f.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
 THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,g=new Float32Array(3*e),f=new Float32Array(3*e),e=new Float32Array(2*e);f[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var m=c+h/b*d;g[k]=a*Math.cos(m);g[k+1]=a*Math.sin(m);f[k+2]=1;e[l]=(g[k]/a+1)/2;e[l+1]=(g[k+1]/a+1)/2}c=
 [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(g,3));this.addAttribute("normal",new THREE.BufferAttribute(f,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
-THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,m,p=[],n=[];for(m=0;m<=e;m++){var q=[],s=[],r=m/e,u=r*(b-a)+a;for(l=0;l<=d;l++){var x=l/d,v=new THREE.Vector3;v.x=u*Math.sin(x*h+
-f);v.y=-r*c+k;v.z=u*Math.cos(x*h+f);this.vertices.push(v);q.push(this.vertices.length-1);s.push(new THREE.Vector2(x,1-r))}p.push(q);n.push(s)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var q=p[m][l],s=p[m+1][l],r=p[m+1][l+1],u=p[m][l+1],x=f.clone(),v=f.clone(),
-z=h.clone(),w=h.clone(),H=n[m][l].clone(),I=n[m+1][l].clone(),y=n[m+1][l+1].clone(),D=n[m][l+1].clone();this.faces.push(new THREE.Face3(q,s,u,[x,v,w]));this.faceVertexUvs[0].push([H,I,D]);this.faces.push(new THREE.Face3(s,r,u,[v.clone(),z,w.clone()]));this.faceVertexUvs[0].push([I.clone(),y,D.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],s=p[0][l+1],r=this.vertices.length-1,x=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
-1,0),H=n[0][l].clone(),I=n[0][l+1].clone(),y=new THREE.Vector2(I.x,0),this.faces.push(new THREE.Face3(q,s,r,[x,v,z])),this.faceVertexUvs[0].push([H,I,y]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],s=p[e][l],r=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),H=n[e][l+1].clone(),I=n[e][l].clone(),y=new THREE.Vector2(I.x,1),this.faces.push(new THREE.Face3(q,s,r,[x,v,z])),this.faceVertexUvs[0].push([H,
+THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,m,p=[],n=[];for(m=0;m<=e;m++){var q=[],r=[],s=m/e,u=s*(b-a)+a;for(l=0;l<=d;l++){var x=l/d,v=new THREE.Vector3;v.x=u*Math.sin(x*h+
+f);v.y=-s*c+k;v.z=u*Math.cos(x*h+f);this.vertices.push(v);q.push(this.vertices.length-1);r.push(new THREE.Vector2(x,1-s))}p.push(q);n.push(r)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),m=0;m<e;m++){var q=p[m][l],r=p[m+1][l],s=p[m+1][l+1],u=p[m][l+1],x=f.clone(),v=f.clone(),
+z=h.clone(),w=h.clone(),H=n[m][l].clone(),I=n[m+1][l].clone(),y=n[m+1][l+1].clone(),D=n[m][l+1].clone();this.faces.push(new THREE.Face3(q,r,u,[x,v,w]));this.faceVertexUvs[0].push([H,I,D]);this.faces.push(new THREE.Face3(r,s,u,[v.clone(),z,w.clone()]));this.faceVertexUvs[0].push([I.clone(),y,D.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],r=p[0][l+1],s=this.vertices.length-1,x=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,
+1,0),H=n[0][l].clone(),I=n[0][l+1].clone(),y=new THREE.Vector2(I.x,0),this.faces.push(new THREE.Face3(q,r,s,[x,v,z])),this.faceVertexUvs[0].push([H,I,y]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],r=p[e][l],s=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),H=n[e][l+1].clone(),I=n[e][l].clone(),y=new THREE.Vector2(I.x,1),this.faces.push(new THREE.Face3(q,r,s,[x,v,z])),this.faceVertexUvs[0].push([H,
 I,y]);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={},g=function(a,b){return a-b},f=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,m=h.length;l<m;l++)for(var p=h[l],n=0;3>n;n++){d[0]=p[f[n]];d[1]=p[f[(n+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l,
 face2:void 0}:e[q].face2=l}d=[];for(q in e)if(g=e[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)f=k[g.vert1],d.push(f.x),d.push(f.y),d.push(f.z),f=k[g.vert2],d.push(f.x),d.push(f.y),d.push(f.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
 !0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(L=a.length;0<=--L;){c=L;d=L-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*m,e=0;e<f;e++){var g=U*e,h=U*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+B,g=g+B,l=l+B,h=h+B;F.faces.push(new THREE.Face3(k,g,h));F.faces.push(new THREE.Face3(g,l,h));k=x.generateSideWallUV(F,k,g,l,h);F.faceVertexUvs[0].push([k[0],k[1],k[3]]);F.faceVertexUvs[0].push([k[1],
-k[2],k[3]])}}}function g(a,b,c){F.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=B;b+=B;c+=B;F.faces.push(new THREE.Face3(a,b,c));a=x.generateTopUV(F,a,b,c);F.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,s=b.extrudePath,
-r,u=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,z,w,H;s&&(r=s.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,q,!1),z=new THREE.Vector3,w=new THREE.Vector3,H=new THREE.Vector3);p||(l=k=m=0);var I,y,D,F=this,B=this.vertices.length,s=a.extractPoints(n),n=s.shape,C=s.holes;if(s=!THREE.Shape.Utils.isClockWise(n)){n=n.reverse();y=0;for(D=C.length;y<D;y++)I=C[y],THREE.Shape.Utils.isClockWise(I)&&(C[y]=I.reverse());s=
-!1}var S=THREE.Shape.Utils.triangulateShape(n,C),G=n;y=0;for(D=C.length;y<D;y++)I=C[y],n=n.concat(I);var A,E,J,M,R,U=n.length,Q,T=S.length,s=[],L=0;J=G.length;A=J-1;for(E=L+1;L<J;L++,A++,E++)A===J&&(A=0),E===J&&(E=0),s[L]=d(G[L],G[A],G[E]);var $=[],ea,fa=s.concat();y=0;for(D=C.length;y<D;y++){I=C[y];ea=[];L=0;J=I.length;A=J-1;for(E=L+1;L<J;L++,A++,E++)A===J&&(A=0),E===J&&(E=0),ea[L]=d(I[L],I[A],I[E]);$.push(ea);fa=fa.concat(ea)}for(A=0;A<m;A++){J=A/m;M=k*(1-J);E=l*Math.sin(J*Math.PI/2);L=0;for(J=
-G.length;L<J;L++)R=c(G[L],s[L],E),g(R.x,R.y,-M);y=0;for(D=C.length;y<D;y++)for(I=C[y],ea=$[y],L=0,J=I.length;L<J;L++)R=c(I[L],ea[L],E),g(R.x,R.y,-M)}E=l;for(L=0;L<U;L++)R=p?c(n[L],fa[L],E):n[L],u?(w.copy(v.normals[0]).multiplyScalar(R.x),z.copy(v.binormals[0]).multiplyScalar(R.y),H.copy(r[0]).add(w).add(z),g(H.x,H.y,H.z)):g(R.x,R.y,0);for(J=1;J<=q;J++)for(L=0;L<U;L++)R=p?c(n[L],fa[L],E):n[L],u?(w.copy(v.normals[J]).multiplyScalar(R.x),z.copy(v.binormals[J]).multiplyScalar(R.y),H.copy(r[J]).add(w).add(z),
-g(H.x,H.y,H.z)):g(R.x,R.y,h/q*J);for(A=m-1;0<=A;A--){J=A/m;M=k*(1-J);E=l*Math.sin(J*Math.PI/2);L=0;for(J=G.length;L<J;L++)R=c(G[L],s[L],E),g(R.x,R.y,h+M);y=0;for(D=C.length;y<D;y++)for(I=C[y],ea=$[y],L=0,J=I.length;L<J;L++)R=c(I[L],ea[L],E),u?g(R.x,R.y+r[q-1].y,r[q-1].x+M):g(R.x,R.y,h+M)}(function(){if(p){var a;a=0*U;for(L=0;L<T;L++)Q=S[L],f(Q[2]+a,Q[1]+a,Q[0]+a);a=q+2*m;a*=U;for(L=0;L<T;L++)Q=S[L],f(Q[0]+a,Q[1]+a,Q[2]+a)}else{for(L=0;L<T;L++)Q=S[L],f(Q[2],Q[1],Q[0]);for(L=0;L<T;L++)Q=S[L],f(Q[0]+
+k[2],k[3]])}}}function g(a,b,c){F.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=B;b+=B;c+=B;F.faces.push(new THREE.Face3(a,b,c));a=x.generateTopUV(F,a,b,c);F.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,m=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,r=b.extrudePath,
+s,u=!1,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,z,w,H;r&&(s=r.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(r,q,!1),z=new THREE.Vector3,w=new THREE.Vector3,H=new THREE.Vector3);p||(l=k=m=0);var I,y,D,F=this,B=this.vertices.length,r=a.extractPoints(n),n=r.shape,C=r.holes;if(r=!THREE.Shape.Utils.isClockWise(n)){n=n.reverse();y=0;for(D=C.length;y<D;y++)I=C[y],THREE.Shape.Utils.isClockWise(I)&&(C[y]=I.reverse());r=
+!1}var S=THREE.Shape.Utils.triangulateShape(n,C),G=n;y=0;for(D=C.length;y<D;y++)I=C[y],n=n.concat(I);var A,E,J,M,R,U=n.length,Q,T=S.length,r=[],L=0;J=G.length;A=J-1;for(E=L+1;L<J;L++,A++,E++)A===J&&(A=0),E===J&&(E=0),r[L]=d(G[L],G[A],G[E]);var $=[],ea,fa=r.concat();y=0;for(D=C.length;y<D;y++){I=C[y];ea=[];L=0;J=I.length;A=J-1;for(E=L+1;L<J;L++,A++,E++)A===J&&(A=0),E===J&&(E=0),ea[L]=d(I[L],I[A],I[E]);$.push(ea);fa=fa.concat(ea)}for(A=0;A<m;A++){J=A/m;M=k*(1-J);E=l*Math.sin(J*Math.PI/2);L=0;for(J=
+G.length;L<J;L++)R=c(G[L],r[L],E),g(R.x,R.y,-M);y=0;for(D=C.length;y<D;y++)for(I=C[y],ea=$[y],L=0,J=I.length;L<J;L++)R=c(I[L],ea[L],E),g(R.x,R.y,-M)}E=l;for(L=0;L<U;L++)R=p?c(n[L],fa[L],E):n[L],u?(w.copy(v.normals[0]).multiplyScalar(R.x),z.copy(v.binormals[0]).multiplyScalar(R.y),H.copy(s[0]).add(w).add(z),g(H.x,H.y,H.z)):g(R.x,R.y,0);for(J=1;J<=q;J++)for(L=0;L<U;L++)R=p?c(n[L],fa[L],E):n[L],u?(w.copy(v.normals[J]).multiplyScalar(R.x),z.copy(v.binormals[J]).multiplyScalar(R.y),H.copy(s[J]).add(w).add(z),
+g(H.x,H.y,H.z)):g(R.x,R.y,h/q*J);for(A=m-1;0<=A;A--){J=A/m;M=k*(1-J);E=l*Math.sin(J*Math.PI/2);L=0;for(J=G.length;L<J;L++)R=c(G[L],r[L],E),g(R.x,R.y,h+M);y=0;for(D=C.length;y<D;y++)for(I=C[y],ea=$[y],L=0,J=I.length;L<J;L++)R=c(I[L],ea[L],E),u?g(R.x,R.y+s[q-1].y,s[q-1].x+M):g(R.x,R.y,h+M)}(function(){if(p){var a;a=0*U;for(L=0;L<T;L++)Q=S[L],f(Q[2]+a,Q[1]+a,Q[0]+a);a=q+2*m;a*=U;for(L=0;L<T;L++)Q=S[L],f(Q[0]+a,Q[1]+a,Q[2]+a)}else{for(L=0;L<T;L++)Q=S[L],f(Q[2],Q[1],Q[0]);for(L=0;L<T;L++)Q=S[L],f(Q[0]+
 U*q,Q[1]+U*q,Q[2]+U*q)}})();(function(){var a=0;e(G,a);a+=G.length;y=0;for(D=C.length;y<D;y++)I=C[y],e(I,a),a+=I.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){a=a.vertices;b=a[b];c=a[c];d=a[d];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){a=a.vertices;b=a[b];c=a[c];d=a[d];e=a[e];return.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,
 1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===Array.isArray(a)&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,l=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=l.length;e<g;e++)f=l[e],THREE.Shape.Utils.isClockWise(f)&&(l[e]=f.reverse());var m=THREE.Shape.Utils.triangulateShape(k,l);e=0;for(g=l.length;e<g;e++)f=l[e],
 k=k.concat(f);l=k.length;g=m.length;for(e=0;e<l;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)l=m[e],k=l[0]+h,f=l[1]+h,l=l[2]+h,this.faces.push(new THREE.Face3(k,f,l,null,null,c)),this.faceVertexUvs[0].push(d.generateTopUV(this,k,f,l))};
-THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,l=Math.cos(k),m=Math.sin(k),k=0,p=a.length;k<p;k++){var n=a[k],q=new THREE.Vector3;q.x=l*n.x-m*n.y;q.y=m*n.x+l*n.y;q.z=n.z;this.vertices.push(q)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,p=a.length-1;k<p;k++){b=m=k+c*f;d=m+c;var l=m+1+c,m=m+1,n=f*g,q=k*e,s=
-n+g,r=q+e;this.faces.push(new THREE.Face3(b,d,m));this.faceVertexUvs[0].push([new THREE.Vector2(n,q),new THREE.Vector2(s,q),new THREE.Vector2(n,r)]);this.faces.push(new THREE.Face3(d,l,m));this.faceVertexUvs[0].push([new THREE.Vector2(s,q),new THREE.Vector2(s,r),new THREE.Vector2(n,r)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
+THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,l=Math.cos(k),m=Math.sin(k),k=0,p=a.length;k<p;k++){var n=a[k],q=new THREE.Vector3;q.x=l*n.x-m*n.y;q.y=m*n.x+l*n.y;q.z=n.z;this.vertices.push(q)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,p=a.length-1;k<p;k++){b=m=k+c*f;d=m+c;var l=m+1+c,m=m+1,n=f*g,q=k*e,r=
+n+g,s=q+e;this.faces.push(new THREE.Face3(b,d,m));this.faceVertexUvs[0].push([new THREE.Vector2(n,q),new THREE.Vector2(r,q),new THREE.Vector2(n,s)]);this.faces.push(new THREE.Face3(d,l,m));this.faceVertexUvs[0].push([new THREE.Vector2(r,q),new THREE.Vector2(r,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.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
-THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,g=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var f=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var m=new Float32Array(f*h*2),p=0,n=0,q=0;q<h;q++)for(var s=q*l-g,r=0;r<f;r++)b[p]=r*k-e,b[p+1]=-s,a[p+2]=1,m[n]=r/c,m[n+1]=1-q/d,p+=3,n+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
-d*6);for(q=0;q<d;q++)for(r=0;r<c;r++)g=r+f*(q+1),h=r+1+f*(q+1),k=r+1+f*q,e[p]=r+f*q,e[p+1]=g,e[p+2]=k,e[p+3]=g,e[p+4]=h,e[p+5]=k,p+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(m,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
+THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,g=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var f=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var m=new Float32Array(f*h*2),p=0,n=0,q=0;q<h;q++)for(var r=q*l-g,s=0;s<f;s++)b[p]=s*k-e,b[p+1]=-r,a[p+2]=1,m[n]=s/c,m[n+1]=1-q/d,p+=3,n+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
+d*6);for(q=0;q<d;q++)for(s=0;s<c;s++)g=s+f*(q+1),h=s+1+f*(q+1),k=s+1+f*q,e[p]=s+f*q,e[p+1]=g,e[p+2]=k,e[p+3]=g,e[p+4]=h,e[p+5]=k,p+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(m,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;
 THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:g};a=a||0;b=b||50;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var f,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(f=0;f<c+1;f++){var m=new THREE.Vector3,p=e+f/c*g;m.x=k*Math.cos(p);m.y=k*Math.sin(p);this.vertices.push(m);h.push(new THREE.Vector2((m.x/b+1)/2,
 (m.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),f=0;f<c;f++)g=p=f+e,l=p+c+1,m=p+c+2,this.faces.push(new THREE.Face3(g,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[m].clone()]),g=p,l=p+c+2,m=p+1,this.faces.push(new THREE.Face3(g,l,m,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[m].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;
 THREE.SphereGeometry=function(a,b,c,d,e,g,f){console.log("THREE.SphereGeometry: Consider using THREE.SphereBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;var h,k,l=[],m=[];for(k=0;k<=c;k++){var p=
-[],n=[];for(h=0;h<=b;h++){var q=h/b,s=k/c,r=new THREE.Vector3;r.x=-a*Math.cos(d+q*e)*Math.sin(g+s*f);r.y=a*Math.cos(g+s*f);r.z=a*Math.sin(d+q*e)*Math.sin(g+s*f);this.vertices.push(r);p.push(this.vertices.length-1);n.push(new THREE.Vector2(q,1-s))}l.push(p);m.push(n)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];g=l[k+1][h];f=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),q=this.vertices[g].clone().normalize(),s=this.vertices[f].clone().normalize(),
-r=m[k][h+1].clone(),u=m[k][h].clone(),x=m[k+1][h].clone(),v=m[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(r.x=(r.x+u.x)/2,this.faces.push(new THREE.Face3(d,g,f,[p,q,s])),this.faceVertexUvs[0].push([r,x,v])):Math.abs(this.vertices[g].y)===a?(x.x=(x.x+v.x)/2,this.faces.push(new THREE.Face3(d,e,g,[p,n,q])),this.faceVertexUvs[0].push([r,u,x])):(this.faces.push(new THREE.Face3(d,e,f,[p,n,s])),this.faceVertexUvs[0].push([r,u,v]),this.faces.push(new THREE.Face3(e,g,f,[n.clone(),q,s.clone()])),this.faceVertexUvs[0].push([u.clone(),
+[],n=[];for(h=0;h<=b;h++){var q=h/b,r=k/c,s=new THREE.Vector3;s.x=-a*Math.cos(d+q*e)*Math.sin(g+r*f);s.y=a*Math.cos(g+r*f);s.z=a*Math.sin(d+q*e)*Math.sin(g+r*f);this.vertices.push(s);p.push(this.vertices.length-1);n.push(new THREE.Vector2(q,1-r))}l.push(p);m.push(n)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=l[k][h+1];e=l[k][h];g=l[k+1][h];f=l[k+1][h+1];var p=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),q=this.vertices[g].clone().normalize(),r=this.vertices[f].clone().normalize(),
+s=m[k][h+1].clone(),u=m[k][h].clone(),x=m[k+1][h].clone(),v=m[k+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(s.x=(s.x+u.x)/2,this.faces.push(new THREE.Face3(d,g,f,[p,q,r])),this.faceVertexUvs[0].push([s,x,v])):Math.abs(this.vertices[g].y)===a?(x.x=(x.x+v.x)/2,this.faces.push(new THREE.Face3(d,e,g,[p,n,q])),this.faceVertexUvs[0].push([s,u,x])):(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(e,g,f,[n.clone(),q,r.clone()])),this.faceVertexUvs[0].push([u.clone(),
 x,v.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
 THREE.SphereBufferGeometry=function(a,b,c,d,e,g,f){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;for(var h=g+f,k=(b+1)*(c+1),l=new THREE.BufferAttribute(new Float32Array(3*k),3),m=new THREE.BufferAttribute(new Float32Array(3*
-k),3),k=new THREE.BufferAttribute(new Float32Array(2*k),2),p=0,n=[],q=new THREE.Vector3,s=0;s<=c;s++){for(var r=[],u=s/c,x=0;x<=b;x++){var v=x/b,z=-a*Math.cos(d+v*e)*Math.sin(g+u*f),w=a*Math.cos(g+u*f),H=a*Math.sin(d+v*e)*Math.sin(g+u*f);q.set(z,w,H).normalize();l.setXYZ(p,z,w,H);m.setXYZ(p,q.x,q.y,q.z);k.setXY(p,v,1-u);r.push(p);p++}n.push(r)}d=[];for(s=0;s<c;s++)for(x=0;x<b;x++)e=n[s][x+1],f=n[s][x],p=n[s+1][x],q=n[s+1][x+1],(0!==s||0<g)&&d.push(e,f,q),(s!==c-1||h<Math.PI)&&d.push(f,p,q);this.addAttribute("index",
+k),3),k=new THREE.BufferAttribute(new Float32Array(2*k),2),p=0,n=[],q=new THREE.Vector3,r=0;r<=c;r++){for(var s=[],u=r/c,x=0;x<=b;x++){var v=x/b,z=-a*Math.cos(d+v*e)*Math.sin(g+u*f),w=a*Math.cos(g+u*f),H=a*Math.sin(d+v*e)*Math.sin(g+u*f);q.set(z,w,H).normalize();l.setXYZ(p,z,w,H);m.setXYZ(p,q.x,q.y,q.z);k.setXY(p,v,1-u);s.push(p);p++}n.push(s)}d=[];for(r=0;r<c;r++)for(x=0;x<b;x++)e=n[r][x+1],f=n[r][x],p=n[r+1][x],q=n[r+1][x+1],(0!==r||0<g)&&d.push(e,f,q),(r!==c-1||h<Math.PI)&&d.push(f,p,q);this.addAttribute("index",
 new THREE.BufferAttribute(new Uint16Array(d),1));this.addAttribute("position",l);this.addAttribute("normal",m);this.addAttribute("uv",k);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
 THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
 THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var g=new THREE.Vector3,f=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var m=l/d*e,p=k/c*Math.PI*2;g.x=a*Math.cos(m);g.y=a*Math.sin(m);var n=new THREE.Vector3;n.x=(a+b*Math.cos(p))*Math.cos(m);n.y=(a+b*Math.cos(p))*Math.sin(m);n.z=b*Math.sin(p);this.vertices.push(n);f.push(new THREE.Vector2(l/
 d,k/c));h.push(n.clone().sub(g).normalize())}for(k=1;k<=c;k++)for(l=1;l<=d;l++)a=(d+1)*k+l-1,b=(d+1)*(k-1)+l-1,e=(d+1)*(k-1)+l,g=(d+1)*k+l,m=new THREE.Face3(a,b,g,[h[a].clone(),h[b].clone(),h[g].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([f[a].clone(),f[b].clone(),f[g].clone()]),m=new THREE.Face3(b,e,g,[h[b].clone(),h[e].clone(),h[g].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([f[b].clone(),f[e].clone(),f[g].clone()]);this.computeFaceNormals()};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
 THREE.TorusKnotGeometry=function(a,b,c,d,e,g,f){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:g,heightScale:f};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;g=g||3;f=f||1;for(var k=Array(c),l=new THREE.Vector3,m=new THREE.Vector3,p=new THREE.Vector3,n=0;n<c;++n){k[n]=
-Array(d);var q=n/c*2*e*Math.PI,s=h(q,g,e,a,f),q=h(q+.01,g,e,a,f);l.subVectors(q,s);m.addVectors(q,s);p.crossVectors(l,m);m.crossVectors(p,l);p.normalize();m.normalize();for(q=0;q<d;++q){var r=q/d*2*Math.PI,u=-b*Math.cos(r),r=b*Math.sin(r),x=new THREE.Vector3;x.x=s.x+u*m.x+r*p.x;x.y=s.y+u*m.y+r*p.y;x.z=s.z+u*m.z+r*p.z;k[n][q]=this.vertices.push(x)-1}}for(n=0;n<c;++n)for(q=0;q<d;++q)e=(n+1)%c,g=(q+1)%d,a=k[n][q],b=k[e][q],e=k[e][g],g=k[n][g],f=new THREE.Vector2(n/c,q/d),l=new THREE.Vector2((n+1)/c,
+Array(d);var q=n/c*2*e*Math.PI,r=h(q,g,e,a,f),q=h(q+.01,g,e,a,f);l.subVectors(q,r);m.addVectors(q,r);p.crossVectors(l,m);m.crossVectors(p,l);p.normalize();m.normalize();for(q=0;q<d;++q){var s=q/d*2*Math.PI,u=-b*Math.cos(s),s=b*Math.sin(s),x=new THREE.Vector3;x.x=r.x+u*m.x+s*p.x;x.y=r.y+u*m.y+s*p.y;x.z=r.z+u*m.z+s*p.z;k[n][q]=this.vertices.push(x)-1}}for(n=0;n<c;++n)for(q=0;q<d;++q)e=(n+1)%c,g=(q+1)%d,a=k[n][q],b=k[e][q],e=k[e][g],g=k[n][g],f=new THREE.Vector2(n/c,q/d),l=new THREE.Vector2((n+1)/c,
 q/d),m=new THREE.Vector2((n+1)/c,(q+1)/d),p=new THREE.Vector2(n/c,(q+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,l,p]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([l.clone(),m,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;
-THREE.TubeGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;g=g||THREE.TubeGeometry.NoTaper;var f=[],h,k,l=b+1,m,p,n,q,s,r=new THREE.Vector3,u,x,v;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);x=u.normals;v=u.binormals;this.tangents=u.tangents;this.normals=x;this.binormals=v;for(u=0;u<l;u++)for(f[u]=[],m=u/(l-1),s=a.getPointAt(m),h=x[u],k=v[u],n=c*g(m),m=0;m<d;m++)p=
-m/d*2*Math.PI,q=-n*Math.cos(p),p=n*Math.sin(p),r.copy(s),r.x+=q*h.x+p*k.x,r.y+=q*h.y+p*k.y,r.z+=q*h.z+p*k.z,f[u][m]=this.vertices.push(new THREE.Vector3(r.x,r.y,r.z))-1;for(u=0;u<b;u++)for(m=0;m<d;m++)g=e?(u+1)%b:u+1,l=(m+1)%d,a=f[u][m],c=f[g][m],g=f[g][l],l=f[u][l],r=new THREE.Vector2(u/b,m/d),x=new THREE.Vector2((u+1)/b,m/d),v=new THREE.Vector2((u+1)/b,(m+1)/d),h=new THREE.Vector2(u/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([r,x,h]),this.faces.push(new THREE.Face3(c,
+THREE.TubeGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;g=g||THREE.TubeGeometry.NoTaper;var f=[],h,k,l=b+1,m,p,n,q,r,s=new THREE.Vector3,u,x,v;u=new THREE.TubeGeometry.FrenetFrames(a,b,e);x=u.normals;v=u.binormals;this.tangents=u.tangents;this.normals=x;this.binormals=v;for(u=0;u<l;u++)for(f[u]=[],m=u/(l-1),r=a.getPointAt(m),h=x[u],k=v[u],n=c*g(m),m=0;m<d;m++)p=
+m/d*2*Math.PI,q=-n*Math.cos(p),p=n*Math.sin(p),s.copy(r),s.x+=q*h.x+p*k.x,s.y+=q*h.y+p*k.y,s.z+=q*h.z+p*k.z,f[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++)g=e?(u+1)%b:u+1,l=(m+1)%d,a=f[u][m],c=f[g][m],g=f[g][l],l=f[u][l],s=new THREE.Vector2(u/b,m/d),x=new THREE.Vector2((u+1)/b,m/d),v=new THREE.Vector2((u+1)/b,(m+1)/d),h=new THREE.Vector2(u/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,l)),this.faceVertexUvs[0].push([s,x,h]),this.faces.push(new THREE.Face3(c,
 g,l)),this.faceVertexUvs[0].push([x.clone(),v,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,m,p;this.tangents=e;this.normals=g;this.binormals=f;for(l=0;l<b;l++)m=l/(b-1),e[l]=a.getTangentAt(m),e[l].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);m=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));m<=a&&(a=m,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();g[0].crossVectors(e[0],
 h);f[0].crossVectors(e[0],g[0]);for(l=1;l<b;l++)g[l]=g[l-1].clone(),f[l]=f[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),g[l].applyMatrix4(k.makeRotationAxis(h,d))),f[l].crossVectors(e[l],g[l]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),l=1;l<b;l++)g[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),f[l].crossVectors(e[l],g[l])};
 THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function g(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);u.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(u.z,-u.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function f(a,
 b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),f=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(f.clone().lerp(h,m/c)),q=c-m,r=0;r<=q;r++)l[m][r]=0===r&&m===c?n:e(n.clone().lerp(p,r/q))}for(m=0;m<c;m++)for(r=0;r<2*(c-m)-1;r++)d=Math.floor(r/2),0===r%2?g(l[m][d+1],l[m+1][d],l[m][d]):g(l[m][d+1],l[m+1][d+1],l[m+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y));
-return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,m=a.length;l<m;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],n=l=0,m=b.length;l<m;l+=3,n++){var q=a[b[l]],s=a[b[l+1]],r=a[b[l+2]];p[n]=new THREE.Face3(q.index,s.index,r.index,[q.clone(),s.clone(),r.clone()])}for(var u=new THREE.Vector3,l=0,m=p.length;l<m;l++)f(p[l],d);l=0;for(m=this.faceVertexUvs[0].length;l<
+return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,m=a.length;l<m;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],n=l=0,m=b.length;l<m;l+=3,n++){var q=a[b[l]],r=a[b[l+1]],s=a[b[l+2]];p[n]=new THREE.Face3(q.index,r.index,s.index,[q.clone(),r.clone(),s.clone()])}for(var u=new THREE.Vector3,l=0,m=p.length;l<m;l++)f(p[l],d);l=0;for(m=this.faceVertexUvs[0].length;l<
 m;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,p=b[2].x,n=Math.max(d,Math.max(a,p)),q=Math.min(d,Math.min(a,p)),.9<n&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(m=this.vertices.length;l<m;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
 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,g=this.faceVertexUvs[0],f,h,k,l,m=b+1;for(f=0;f<=c;f++)for(l=f/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,n,q,s;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*m+h,d=f*m+h+1,l=(f+1)*m+h+1,k=(f+1)*m+h,p=new THREE.Vector2(h/b,f/c),n=new THREE.Vector2((h+1)/b,f/c),q=new THREE.Vector2((h+1)/b,(f+1)/c),s=new THREE.Vector2(h/b,(f+1)/c),e.push(new THREE.Face3(a,
-d,k)),g.push([p,n,s]),e.push(new THREE.Face3(d,l,k)),g.push([n.clone(),q,s.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
+THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,g=this.faceVertexUvs[0],f,h,k,l,m=b+1;for(f=0;f<=c;f++)for(l=f/c,h=0;h<=b;h++)k=h/b,k=a(k,l),d.push(k);var p,n,q,r;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*m+h,d=f*m+h+1,l=(f+1)*m+h+1,k=(f+1)*m+h,p=new THREE.Vector2(h/b,f/c),n=new THREE.Vector2((h+1)/b,f/c),q=new THREE.Vector2((h+1)/b,(f+1)/c),r=new THREE.Vector2(h/b,(f+1)/c),e.push(new THREE.Face3(a,
+d,k)),g.push([p,n,r]),e.push(new THREE.Face3(d,l,k)),g.push([n.clone(),q,r.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry;
 THREE.WireframeGeometry=function(a){THREE.BufferGeometry.call(this);var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c"];if(a instanceof THREE.Geometry){var g=a.vertices,f=a.faces,h=0,k=new Uint32Array(6*f.length);a=0;for(var l=f.length;a<l;a++)for(var m=f[a],p=0;3>p;p++){b[0]=m[e[p]];b[1]=m[e[(p+1)%3]];b.sort(d);var n=b.toString();void 0===c[n]&&(k[2*h]=b[0],k[2*h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)h=g[k[2*a+p]],e=6*a+3*p,b[e+0]=h.x,b[e+1]=h.y,
-b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){g=a.attributes.position;l=a.attributes.index.array;f=a.drawcalls;h=0;0===f.length&&(f=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),m=0,q=f.length;m<q;++m){p=f[m].start;n=f[m].count;e=f[m].index;a=p;for(var s=p+n;a<s;a+=3)for(p=0;3>p;p++)b[0]=e+l[a+p],b[1]=e+l[a+(p+1)%3],b.sort(d),n=b.toString(),void 0===c[n]&&(k[2*h]=b[0],k[2*
+b[e+2]=h.z;this.addAttribute("position",new THREE.BufferAttribute(b,3))}else if(a instanceof THREE.BufferGeometry){if(void 0!==a.attributes.index){g=a.attributes.position;l=a.attributes.index.array;f=a.drawcalls;h=0;0===f.length&&(f=[{count:l.length,index:0,start:0}]);for(var k=new Uint32Array(2*l.length),m=0,q=f.length;m<q;++m){p=f[m].start;n=f[m].count;e=f[m].index;a=p;for(var r=p+n;a<r;a+=3)for(p=0;3>p;p++)b[0]=e+l[a+p],b[1]=e+l[a+(p+1)%3],b.sort(d),n=b.toString(),void 0===c[n]&&(k[2*h]=b[0],k[2*
 h+1]=b[1],c[n]=!0,h++)}b=new Float32Array(6*h);a=0;for(l=h;a<l;a++)for(p=0;2>p;p++)e=6*a+3*p,h=k[2*a+p],b[e+0]=g.getX(h),b[e+1]=g.getY(h),b[e+2]=g.getZ(h)}else for(g=a.attributes.position.array,h=g.length/3,k=h/3,b=new Float32Array(6*h),a=0,l=k;a<l;a++)for(p=0;3>p;p++)e=18*a+6*p,k=9*a+3*p,b[e+0]=g[k],b[e+1]=g[k+1],b[e+2]=g[k+2],h=9*a+(p+1)%3*3,b[e+3]=g[h],b[e+4]=g[h+1],b[e+5]=g[h+2];this.addAttribute("position",new THREE.BufferAttribute(b,3))}};THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
 THREE.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;
@@ -854,7 +855,7 @@ THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3,b=
 b.copy(q).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a);e.setXYZ(g,a.x,a.y,a.z);g+=1;e.setXYZ(g,b.x,b.y,b.z);g+=1}else if(g instanceof THREE.BufferGeometry)for(c=g.attributes.position,f=g.attributes.normal,p=g=0,n=c.count;p<n;p++)a.set(c.getX(p),c.getY(p),c.getZ(p)).applyMatrix4(d),b.set(f.getX(p),f.getY(p),f.getZ(p)),b.applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a),e.setXYZ(g,a.x,a.y,a.z),g+=1,e.setXYZ(g,b.x,b.y,b.z),g+=1;e.needsUpdate=
 !0;return this}}();THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:255;d=void 0!==d?d:1;b=0;c=this.object.geometry;c instanceof THREE.Geometry?b=3*c.faces.length:c instanceof THREE.BufferGeometry&&(b=c.attributes.tangent.count);c=new THREE.BufferGeometry;b=new THREE.Float32Attribute(6*b,3);c.addAttribute("position",b);THREE.LineSegments.call(this,c,new THREE.LineBasicMaterial({color:a,linewidth:d}));this.matrixAutoUpdate=!1;this.update()};
 THREE.VertexTangentsHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper;
-THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3,c=new THREE.Vector3;return function(){var a=["a","b","c"];this.object.updateMatrixWorld(!0);var e=this.object.matrixWorld,g=this.geometry.attributes.position,f=this.object.geometry;if(f instanceof THREE.Geometry)for(var h=f.vertices,k=f.faces,l=f=0,m=k.length;l<m;l++)for(var p=k[l],n=0,q=p.vertexTangents.length;n<q;n++){var s=p.vertexTangents[n];b.copy(h[p[a[n]]]).applyMatrix4(e);c.set(s.x,s.y,s.z);c.transformDirection(e).multiplyScalar(this.size).add(b);
+THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3,c=new THREE.Vector3;return function(){var a=["a","b","c"];this.object.updateMatrixWorld(!0);var e=this.object.matrixWorld,g=this.geometry.attributes.position,f=this.object.geometry;if(f instanceof THREE.Geometry)for(var h=f.vertices,k=f.faces,l=f=0,m=k.length;l<m;l++)for(var p=k[l],n=0,q=p.vertexTangents.length;n<q;n++){var r=p.vertexTangents[n];b.copy(h[p[a[n]]]).applyMatrix4(e);c.set(r.x,r.y,r.z);c.transformDirection(e).multiplyScalar(this.size).add(b);
 g.setXYZ(f,b.x,b.y,b.z);f+=1;g.setXYZ(f,c.x,c.y,c.z);f+=1}else if(f instanceof THREE.BufferGeometry)for(a=f.attributes.position,h=f.attributes.tangent,n=f=0,q=a.count;n<q;n++)b.set(a.getX(n),a.getY(n),a.getZ(n)).applyMatrix4(e),c.set(h.getX(n),h.getY(n),h.getZ(n)),c.transformDirection(e).multiplyScalar(this.size).add(b),g.setXYZ(f,b.x,b.y,b.z),f+=1,g.setXYZ(f,c.x,c.y,c.z),f+=1;g.needsUpdate=!0;return this}}();
 THREE.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;