Jelajahi Sumber

Updated builds.

Mr.doob 11 tahun lalu
induk
melakukan
e480b338a2
2 mengubah file dengan 254 tambahan dan 207 penghapusan
  1. 86 41
      build/three.js
  2. 168 166
      build/three.min.js

+ 86 - 41
build/three.js

@@ -9580,13 +9580,19 @@ THREE.BufferGeometry.prototype = {
 		var j, jl;
 		var iA, iB, iC;
 
-		var offsets = this.offsets;
+		if ( this.drawcalls.length === 0 ) {
+
+			this.addDrawCall( 0, indices.length, 0 );
+
+		}
+
+		var drawcalls = this.drawcalls;
 
-		for ( j = 0, jl = offsets.length; j < jl; ++ j ) {
+		for ( j = 0, jl = drawcalls.length; j < jl; ++ j ) {
 
-			var start = offsets[ j ].start;
-			var count = offsets[ j ].count;
-			var index = offsets[ j ].index;
+			var start = drawcalls[ j ].start;
+			var count = drawcalls[ j ].count;
+			var index = drawcalls[ j ].index;
 
 			for ( i = start, il = start + count; i < il; i += 3 ) {
 
@@ -9632,11 +9638,11 @@ THREE.BufferGeometry.prototype = {
 
 		}
 
-		for ( j = 0, jl = offsets.length; j < jl; ++ j ) {
+		for ( j = 0, jl = drawcalls.length; j < jl; ++ j ) {
 
-			var start = offsets[ j ].start;
-			var count = offsets[ j ].count;
-			var index = offsets[ j ].index;
+			var start = drawcalls[ j ].start;
+			var count = drawcalls[ j ].count;
+			var index = drawcalls[ j ].index;
 
 			for ( i = start, il = start + count; i < il; i += 3 ) {
 
@@ -10103,7 +10109,7 @@ THREE.Geometry.prototype = {
 
 		var addFace = function ( a, b, c ) {
 
-			var vertexNormals = normals !== undefined ? [ tempNormals[ a ], tempNormals[ b ], tempNormals[ c ] ] : [];
+			var vertexNormals = normals !== undefined ? [ tempNormals[ a ].clone(), tempNormals[ b ].clone(), tempNormals[ c ].clone() ] : [];
 			var vertexColors = colors !== undefined ? [ scope.colors[ a ], scope.colors[ b ], scope.colors[ c ] ] : [];
 
 			scope.faces.push( new THREE.Face3( a, b, c, vertexNormals, vertexColors ) );
@@ -31718,7 +31724,33 @@ THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments )
 	THREE.Geometry.call( this );
 
 	this.type = 'PlaneGeometry';
-	
+
+	this.parameters = {
+		width: width,
+		height: height,
+		widthSegments: widthSegments,
+		heightSegments: heightSegments
+	};
+
+	this.fromBufferGeometry( new THREE.PlaneBufferGeometry( width, height, widthSegments, heightSegments ) );
+
+};
+
+THREE.PlaneGeometry.prototype = Object.create( THREE.Geometry.prototype );
+
+// File:src/extras/geometries/PlaneBufferGeometry.js
+
+/**
+ * @author mrdoob / http://mrdoob.com/
+ * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as
+ */
+
+THREE.PlaneBufferGeometry = function ( width, height, widthSegments, heightSegments ) {
+
+	THREE.BufferGeometry.call( this );
+
+	this.type = 'PlaneBufferGeometry';
+
 	this.parameters = {
 		width: width,
 		height: height,
@@ -31726,70 +31758,83 @@ THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments )
 		heightSegments: heightSegments
 	};
 
-	var ix, iz;
 	var width_half = width / 2;
 	var height_half = height / 2;
 
 	var gridX = widthSegments || 1;
-	var gridZ = heightSegments || 1;
+	var gridY = heightSegments || 1;
 
 	var gridX1 = gridX + 1;
-	var gridZ1 = gridZ + 1;
+	var gridY1 = gridY + 1;
 
 	var segment_width = width / gridX;
-	var segment_height = height / gridZ;
+	var segment_height = height / gridY;
+
+	var vertices = new Float32Array( gridX1 * gridY1 * 3 );
+	var normals = new Float32Array( gridX1 * gridY1 * 3 );
+	var uvs = new Float32Array( gridX1 * gridY1 * 2 );
 
-	var normal = new THREE.Vector3( 0, 0, 1 );
+	var offset = 0;
+	var offset2 = 0;
 
-	for ( iz = 0; iz < gridZ1; iz ++ ) {
+	for ( var iy = 0; iy < gridY1; iy ++ ) {
 
-		var y = iz * segment_height - height_half;
+		var y = iy * segment_height - height_half;
 
-		for ( ix = 0; ix < gridX1; ix ++ ) {
+		for ( var ix = 0; ix < gridX1; ix ++ ) {
 
 			var x = ix * segment_width - width_half;
 
-			this.vertices.push( new THREE.Vector3( x, - y, 0 ) );
+			vertices[ offset     ] = x;
+			vertices[ offset + 1 ] = - y;
+
+			normals[ offset + 2 ] = 1;
+
+			uvs[ offset2     ] = ix / gridX;
+			uvs[ offset2 + 1 ] = 1 - ( iy / gridY );
+
+			offset += 3;
+			offset2 += 2;
 
 		}
 
 	}
 
-	for ( iz = 0; iz < gridZ; iz ++ ) {
+	offset = 0;
 
-		for ( ix = 0; ix < gridX; ix ++ ) {
+	var indices = new ( ( vertices.length / 3 ) > 65535 ? Uint32Array : Uint16Array )( gridX * gridY * 6 );
 
-			var a = ix + gridX1 * iz;
-			var b = ix + gridX1 * ( iz + 1 );
-			var c = ( ix + 1 ) + gridX1 * ( iz + 1 );
-			var d = ( ix + 1 ) + gridX1 * iz;
+	for ( var iy = 0; iy < gridY; iy ++ ) {
 
-			var uva = new THREE.Vector2( ix / gridX, 1 - iz / gridZ );
-			var uvb = new THREE.Vector2( ix / gridX, 1 - ( iz + 1 ) / gridZ );
-			var uvc = new THREE.Vector2( ( ix + 1 ) / gridX, 1 - ( iz + 1 ) / gridZ );
-			var uvd = new THREE.Vector2( ( ix + 1 ) / gridX, 1 - iz / gridZ );
+		for ( var ix = 0; ix < gridX; ix ++ ) {
 
-			var face = new THREE.Face3( a, b, d );
-			face.normal.copy( normal );
-			face.vertexNormals.push( normal.clone(), normal.clone(), normal.clone() );
+			var a = ix + gridX1 * iy;
+			var b = ix + gridX1 * ( iy + 1 );
+			var c = ( ix + 1 ) + gridX1 * ( iy + 1 );
+			var d = ( ix + 1 ) + gridX1 * iy;
 
-			this.faces.push( face );
-			this.faceVertexUvs[ 0 ].push( [ uva, uvb, uvd ] );
+			indices[ offset     ] = a;
+			indices[ offset + 1 ] = b;
+			indices[ offset + 2 ] = d;
 
-			face = new THREE.Face3( b, c, d );
-			face.normal.copy( normal );
-			face.vertexNormals.push( normal.clone(), normal.clone(), normal.clone() );
+			indices[ offset + 3 ] = b;
+			indices[ offset + 4 ] = c;
+			indices[ offset + 5 ] = d;
 
-			this.faces.push( face );
-			this.faceVertexUvs[ 0 ].push( [ uvb.clone(), uvc, uvd.clone() ] );
+			offset += 6;
 
 		}
 
 	}
 
+	this.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) );
+	this.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
+	this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
+	this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
+
 };
 
-THREE.PlaneGeometry.prototype = Object.create( THREE.Geometry.prototype );
+THREE.PlaneBufferGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
 
 // File:src/extras/geometries/RingGeometry.js
 

+ 168 - 166
build/three.min.js

@@ -60,9 +60,9 @@ Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;
 setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,
 this.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ";
 THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x=
-a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[1],k=d[5],m=d[9],n=d[2],r=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(f,-1,1)),0.99999>Math.abs(f)?(this._x=Math.atan2(-m,d),this._z=Math.atan2(-g,e)):(this._x=Math.atan2(r,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(m,-1,1)),0.99999>Math.abs(m)?(this._y=Math.atan2(f,d),this._z=Math.atan2(h,k)):
-(this._y=Math.atan2(-n,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(r,-1,1)),0.99999>Math.abs(r)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-g,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(n,-1,1)),0.99999>Math.abs(n)?(this._x=Math.atan2(r,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-g,k))):"YZX"===b?(this._z=Math.asin(c(h,-1,1)),0.99999>Math.abs(h)?(this._x=Math.atan2(-m,k),this._y=Math.atan2(-n,e)):(this._x=0,this._y=Math.atan2(f,d))):"XZY"===b?(this._z=
-Math.asin(-c(g,-1,1)),0.99999>Math.abs(g)?(this._x=Math.atan2(r,k),this._y=Math.atan2(f,e)):(this._x=Math.atan2(-m,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,g=a.y*a.y,f=a.z*a.z,h=a.w*a.w;b=b||this._order;"XYZ"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-g+f),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2*
+a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[1],k=d[5],m=d[9],n=d[2],q=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(f,-1,1)),0.99999>Math.abs(f)?(this._x=Math.atan2(-m,d),this._z=Math.atan2(-g,e)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(m,-1,1)),0.99999>Math.abs(m)?(this._y=Math.atan2(f,d),this._z=Math.atan2(h,k)):
+(this._y=Math.atan2(-n,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(q,-1,1)),0.99999>Math.abs(q)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-g,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(n,-1,1)),0.99999>Math.abs(n)?(this._x=Math.atan2(q,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-g,k))):"YZX"===b?(this._z=Math.asin(c(h,-1,1)),0.99999>Math.abs(h)?(this._x=Math.atan2(-m,k),this._y=Math.atan2(-n,e)):(this._x=0,this._y=Math.atan2(f,d))):"XZY"===b?(this._z=
+Math.asin(-c(g,-1,1)),0.99999>Math.abs(g)?(this._x=Math.atan2(q,k),this._y=Math.atan2(f,e)):(this._x=Math.atan2(-m,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,g=a.y*a.y,f=a.z*a.z,h=a.w*a.w;b=b||this._order;"XYZ"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-g+f),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2*
 (a.z*a.w-a.x*a.y),h+e-g-f)):"YXZ"===b?(this._x=Math.asin(d(2*(a.x*a.w-a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h-e-g+f),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h-e+g-f)):"ZXY"===b?(this._x=Math.asin(d(2*(a.x*a.w+a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.y*a.w-a.z*a.x),h-e-g+f),this._z=Math.atan2(2*(a.z*a.w-a.x*a.y),h-e+g-f)):"ZYX"===b?(this._x=Math.atan2(2*(a.x*a.w+a.z*a.y),h-e-g+f),this._y=Math.asin(d(2*(a.y*a.w-a.x*a.z),-1,1)),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h+e-g-f)):"YZX"===
 b?(this._x=Math.atan2(2*(a.x*a.w-a.z*a.y),h-e+g-f),this._y=Math.atan2(2*(a.y*a.w-a.x*a.z),h+e-g-f),this._z=Math.asin(d(2*(a.x*a.y+a.z*a.w),-1,1))):"XZY"===b?(this._x=Math.atan2(2*(a.x*a.w+a.y*a.z),h-e+g-f),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h+e-g-f),this._z=Math.asin(d(2*(a.z*a.w-a.x*a.y),-1,1))):console.warn("THREE.Euler: .setFromQuaternion() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);
 this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};
@@ -89,21 +89,21 @@ a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:funct
 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,m,n,r,s,t,q,p){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=g;v[9]=f;v[13]=h;v[2]=k;v[6]=m;v[10]=n;v[14]=r;v[3]=s;v[7]=t;v[11]=q;v[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,k,m,n,q,s,t,r,p){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=g;v[9]=f;v[13]=h;v[2]=k;v[6]=m;v[10]=n;v[14]=q;v[3]=s;v[7]=t;v[11]=r;v[15]=p;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
 copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(){var a=new THREE.Vector3;return function(b){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,m=c*h,n=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+m*d;b[5]=a-n*d;b[9]=-c*f;b[2]=n-a*d;b[6]=m+k*d;b[10]=g*f}else"YXZ"===a.order?(a=f*h,k=f*e,m=d*h,n=d*e,b[0]=a+n*c,b[4]=m*c-k,b[8]=g*d,b[1]=g*e,b[5]=g*h,b[9]=-c,b[2]=k*c-m,b[6]=n+a*c,
 b[10]=g*f):"ZXY"===a.order?(a=f*h,k=f*e,m=d*h,n=d*e,b[0]=a-n*c,b[4]=-g*e,b[8]=m+k*c,b[1]=k+m*c,b[5]=g*h,b[9]=n-a*c,b[2]=-g*d,b[6]=c,b[10]=g*f):"ZYX"===a.order?(a=g*h,k=g*e,m=c*h,n=c*e,b[0]=f*h,b[4]=m*d-k,b[8]=a*d+n,b[1]=f*e,b[5]=n*d+a,b[9]=k*d-m,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,m=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=m*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+m,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,m=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*
 e-m,b[2]=m*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var m=c*h,c=c*k,n=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(n+e);b[4]=m-g;b[8]=c+h;b[1]=m+g;b[5]=1-
 (a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g){var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),
-multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],m=c[1],n=c[5],r=c[9],s=c[13],t=c[2],q=c[6],p=c[10],v=c[14],x=c[3],u=c[7],E=c[11],c=c[15],y=d[0],z=d[4],B=d[8],D=d[12],w=d[1],A=d[5],N=d[9],P=d[13],K=d[2],R=d[6],M=d[10],H=d[14],C=d[3],
-T=d[7],L=d[11],d=d[15];e[0]=g*y+f*w+h*K+k*C;e[4]=g*z+f*A+h*R+k*T;e[8]=g*B+f*N+h*M+k*L;e[12]=g*D+f*P+h*H+k*d;e[1]=m*y+n*w+r*K+s*C;e[5]=m*z+n*A+r*R+s*T;e[9]=m*B+n*N+r*M+s*L;e[13]=m*D+n*P+r*H+s*d;e[2]=t*y+q*w+p*K+v*C;e[6]=t*z+q*A+p*R+v*T;e[10]=t*B+q*N+p*M+v*L;e[14]=t*D+q*P+p*H+v*d;e[3]=x*y+u*w+E*K+c*C;e[7]=x*z+u*A+E*R+c*T;e[11]=x*B+u*N+E*M+c*L;e[15]=x*D+u*P+E*H+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=
+multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],m=c[1],n=c[5],q=c[9],s=c[13],t=c[2],r=c[6],p=c[10],v=c[14],x=c[3],u=c[7],E=c[11],c=c[15],y=d[0],z=d[4],B=d[8],D=d[12],w=d[1],A=d[5],N=d[9],P=d[13],K=d[2],R=d[6],M=d[10],H=d[14],C=d[3],
+T=d[7],L=d[11],d=d[15];e[0]=g*y+f*w+h*K+k*C;e[4]=g*z+f*A+h*R+k*T;e[8]=g*B+f*N+h*M+k*L;e[12]=g*D+f*P+h*H+k*d;e[1]=m*y+n*w+q*K+s*C;e[5]=m*z+n*A+q*R+s*T;e[9]=m*B+n*N+q*M+s*L;e[13]=m*D+n*P+q*H+s*d;e[2]=t*y+r*w+p*K+v*C;e[6]=t*z+r*A+p*R+v*T;e[10]=t*B+r*N+p*M+v*L;e[14]=t*D+r*P+p*H+v*d;e[3]=x*y+u*w+E*K+c*C;e[7]=x*z+u*A+E*R+c*T;e[11]=x*B+u*N+E*M+c*L;e[15]=x*D+u*P+E*H+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=
 d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
 return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=
 b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=
-a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],m=a[2],n=a[6],r=a[10],s=a[14];return a[3]*(+e*h*n-d*k*n-e*f*r+c*k*r+d*f*s-c*h*s)+a[7]*(+b*h*s-b*k*r+e*g*r-d*g*s+d*k*m-e*h*m)+a[11]*(+b*k*n-b*f*s-e*g*n+c*g*s+e*f*m-c*k*m)+a[15]*(-d*f*m-b*h*n+b*f*r+d*g*n-c*g*r+c*h*m)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,
+a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],m=a[2],n=a[6],q=a[10],s=a[14];return a[3]*(+e*h*n-d*k*n-e*f*q+c*k*q+d*f*s-c*h*s)+a[7]*(+b*h*s-b*k*q+e*g*q-d*g*s+d*k*m-e*h*m)+a[11]*(+b*k*n-b*f*s-e*g*n+c*g*s+e*f*m-c*k*m)+a[15]*(-d*f*m-b*h*n+b*f*q+d*g*n-c*g*q+c*h*m)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,
 b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=new THREE.Vector3;return function(){console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=
-this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[12],k=d[1],m=d[5],n=d[9],r=d[13],s=d[2],t=d[6],q=d[10],p=d[14],v=d[3],x=d[7],u=d[11],d=d[15];c[0]=n*p*x-r*q*x+r*t*u-m*p*u-n*t*d+m*q*d;c[4]=h*q*x-f*p*x-h*t*u+g*p*u+f*t*d-g*q*d;c[8]=f*r*x-h*n*x+h*m*u-g*r*u-f*m*d+g*n*d;c[12]=h*n*t-f*r*t-h*m*q+g*r*q+f*m*p-g*n*p;c[1]=r*q*v-n*p*v-r*s*u+k*p*u+n*s*d-k*q*d;c[5]=f*p*v-h*q*v+h*s*u-e*p*u-f*s*d+e*q*d;c[9]=h*n*v-f*r*v-h*k*
-u+e*r*u+f*k*d-e*n*d;c[13]=f*r*s-h*n*s+h*k*q-e*r*q-f*k*p+e*n*p;c[2]=m*p*v-r*t*v+r*s*x-k*p*x-m*s*d+k*t*d;c[6]=h*t*v-g*p*v-h*s*x+e*p*x+g*s*d-e*t*d;c[10]=g*r*v-h*m*v+h*k*x-e*r*x-g*k*d+e*m*d;c[14]=h*m*s-g*r*s-h*k*t+e*r*t+g*k*p-e*m*p;c[3]=n*t*v-m*q*v-n*s*x+k*q*x+m*s*u-k*t*u;c[7]=g*q*v-f*t*v+f*s*x-e*q*x-g*s*u+e*t*u;c[11]=f*m*v-g*n*v-f*k*x+e*n*x+g*k*u-e*m*u;c[15]=g*n*s-f*m*s+f*k*t-e*n*t-g*k*q+e*m*q;c=e*c[0]+k*c[4]+s*c[8]+v*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");
+this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[12],k=d[1],m=d[5],n=d[9],q=d[13],s=d[2],t=d[6],r=d[10],p=d[14],v=d[3],x=d[7],u=d[11],d=d[15];c[0]=n*p*x-q*r*x+q*t*u-m*p*u-n*t*d+m*r*d;c[4]=h*r*x-f*p*x-h*t*u+g*p*u+f*t*d-g*r*d;c[8]=f*q*x-h*n*x+h*m*u-g*q*u-f*m*d+g*n*d;c[12]=h*n*t-f*q*t-h*m*r+g*q*r+f*m*p-g*n*p;c[1]=q*r*v-n*p*v-q*s*u+k*p*u+n*s*d-k*r*d;c[5]=f*p*v-h*r*v+h*s*u-e*p*u-f*s*d+e*r*d;c[9]=h*n*v-f*q*v-h*k*
+u+e*q*u+f*k*d-e*n*d;c[13]=f*q*s-h*n*s+h*k*r-e*q*r-f*k*p+e*n*p;c[2]=m*p*v-q*t*v+q*s*x-k*p*x-m*s*d+k*t*d;c[6]=h*t*v-g*p*v-h*s*x+e*p*x+g*s*d-e*t*d;c[10]=g*q*v-h*m*v+h*k*x-e*q*x-g*k*d+e*m*d;c[14]=h*m*s-g*q*s-h*k*t+e*q*t+g*k*p-e*m*p;c[3]=n*t*v-m*r*v-n*s*x+k*r*x+m*s*u-k*t*u;c[7]=g*r*v-f*t*v+f*s*x-e*r*x-g*s*u+e*t*u;c[11]=f*m*v-g*n*v-f*k*x+e*n*x+g*k*u-e*m*u;c[15]=g*n*s-f*m*s+f*k*t-e*n*t-g*k*r+e*m*r;c=e*c[0]+k*c[4]+s*c[8]+v*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");
 console.warn("Matrix4.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.warn("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.warn("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.warn("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.warn("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.warn("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,m=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,m*f+c,m*h-d*g,0,k*h-d*f,m*h+d*g,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,
@@ -113,8 +113,8 @@ var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b
 THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);
 var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(a,b,c,d){var e=a.clone().add(b).multiplyScalar(0.5),g=b.clone().sub(a).normalize(),f=0.5*a.distanceTo(b),
-h=this.origin.clone().sub(e);a=-this.direction.dot(g);b=h.dot(this.direction);var k=-h.dot(g),m=h.lengthSq(),n=Math.abs(1-a*a),r,s;0<=n?(h=a*k-b,r=a*b-k,s=f*n,0<=h?r>=-s?r<=s?(f=1/n,h*=f,r*=f,a=h*(h+a*r+2*b)+r*(a*h+r+2*k)+m):(r=f,h=Math.max(0,-(a*r+b)),a=-h*h+r*(r+2*k)+m):(r=-f,h=Math.max(0,-(a*r+b)),a=-h*h+r*(r+2*k)+m):r<=-s?(h=Math.max(0,-(-a*f+b)),r=0<h?-f:Math.min(Math.max(-f,-k),f),a=-h*h+r*(r+2*k)+m):r<=s?(h=0,r=Math.min(Math.max(-f,-k),f),a=r*(r+2*k)+m):(h=Math.max(0,-(a*f+b)),r=0<h?f:Math.min(Math.max(-f,
--k),f),a=-h*h+r*(r+2*k)+m)):(r=0<a?-f:f,h=Math.max(0,-(a*r+b)),a=-h*h+r*(r+2*k)+m);c&&c.copy(this.direction.clone().multiplyScalar(h).add(this.origin));d&&d.copy(g.clone().multiplyScalar(r).add(e));return a},isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,g=b.radius*b.radius;if(e>g)return null;g=Math.sqrt(g-e);e=d-g;
+h=this.origin.clone().sub(e);a=-this.direction.dot(g);b=h.dot(this.direction);var k=-h.dot(g),m=h.lengthSq(),n=Math.abs(1-a*a),q,s;0<=n?(h=a*k-b,q=a*b-k,s=f*n,0<=h?q>=-s?q<=s?(f=1/n,h*=f,q*=f,a=h*(h+a*q+2*b)+q*(a*h+q+2*k)+m):(q=f,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+m):(q=-f,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+m):q<=-s?(h=Math.max(0,-(-a*f+b)),q=0<h?-f:Math.min(Math.max(-f,-k),f),a=-h*h+q*(q+2*k)+m):q<=s?(h=0,q=Math.min(Math.max(-f,-k),f),a=q*(q+2*k)+m):(h=Math.max(0,-(a*f+b)),q=0<h?f:Math.min(Math.max(-f,
+-k),f),a=-h*h+q*(q+2*k)+m)):(q=0<a?-f:f,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+m);c&&c.copy(this.direction.clone().multiplyScalar(h).add(this.origin));d&&d.copy(g.clone().multiplyScalar(q).add(e));return a},isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,g=b.radius*b.radius;if(e>g)return null;g=Math.sqrt(g-e);e=d-g;
 d+=g;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;
 return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,g,f;d=1/this.direction.x;g=1/this.direction.y;f=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=g?(e=(a.min.y-h.y)*g,g*=a.max.y-h.y):(e=(a.max.y-h.y)*g,g*=a.min.y-h.y);if(c>g||e>d)return null;if(e>c||c!==c)c=e;if(g<d||d!==d)d=g;0<=f?(e=(a.min.z-h.z)*f,f*=a.max.z-h.z):(e=(a.max.z-h.z)*f,f*=a.min.z-h.z);if(c>f||e>d)return null;if(e>c||c!==
 c)c=e;if(f<d||d!==d)d=f;return 0>d?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,g,f,h,k){b.subVectors(g,e);c.subVectors(f,e);d.crossVectors(b,c);g=this.direction.dot(d);if(0<g){if(h)return null;h=1}else if(0>g)h=-1,g=-g;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;f=h*this.direction.dot(b.cross(a));if(0>f||e+f>g)return null;
@@ -123,8 +123,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],m=c[7],n=c[8],r=c[9],s=c[10],t=c[11],q=c[12],p=c[13],v=c[14],c=c[15];b[0].setComponents(g-a,m-f,t-n,c-q).normalize();b[1].setComponents(g+
-a,m+f,t+n,c+q).normalize();b[2].setComponents(g+d,m+h,t+r,c+p).normalize();b[3].setComponents(g-d,m-h,t-r,c-p).normalize();b[4].setComponents(g-e,m-k,t-s,c-v).normalize();b[5].setComponents(g+e,m+k,t+s,c+v).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],m=c[7],n=c[8],q=c[9],s=c[10],t=c[11],r=c[12],p=c[13],v=c[14],c=c[15];b[0].setComponents(g-a,m-f,t-n,c-r).normalize();b[1].setComponents(g+
+a,m+f,t+n,c+r).normalize();b[2].setComponents(g+d,m+h,t+q,c+p).normalize();b[3].setComponents(g-d,m-h,t-q,c-p).normalize();b[4].setComponents(g-e,m-k,t-s,c-v).normalize();b[5].setComponents(g+e,m+k,t+s,c+v).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,
@@ -135,8 +135,8 @@ a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}}
 THREE.Math={generateUUID:function(){var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){if(a<=
 b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(0.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=
 180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a}};
-THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,k,m,n,r,s;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?this.points.length-1:g+1;c[3]=g>this.points.length-3?this.points.length-1:
-g+2;m=this.points[c[0]];n=this.points[c[1]];r=this.points[c[2]];s=this.points[c[3]];h=f*f;k=f*h;d.x=b(m.x,n.x,r.x,s.x,f,h,k);d.y=b(m.y,n.y,r.y,s.y,f,h,k);d.z=b(m.z,n.z,r.z,s.z,f,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,g=new THREE.Vector3,f=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=
+THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,k,m,n,q,s;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?this.points.length-1:g+1;c[3]=g>this.points.length-3?this.points.length-1:
+g+2;m=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];s=this.points[c[3]];h=f*f;k=f*h;d.x=b(m.x,n.x,q.x,s.x,f,h,k);d.y=b(m.y,n.y,q.y,s.y,f,h,k);d.z=b(m.z,n.z,q.z,s.z,f,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,g=new THREE.Vector3,f=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=
 a/c,d=this.getPoint(b),f.copy(d),k+=f.distanceTo(g),g.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,g,f,h=[],k=new THREE.Vector3,m=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=m.chunks[b]-m.chunks[b-1];f=Math.ceil(a*c/m.total);e=(b-1)/(this.points.length-1);g=b/(this.points.length-1);for(c=1;c<f-1;c++)d=e+1/f*c*(g-e),d=this.getPoint(d),h.push(k.copy(d).clone());
 h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
 THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g,f,h){a.subVectors(f,e);b.subVectors(g,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);g=a.dot(c);var k=b.dot(b);f=b.dot(c);var m=d*k-e*e;h=h||new THREE.Vector3;if(0==m)return h.set(-2,-1,-1);m=1/m;k=(k*g-e*f)*m;d=(d*f-e*g)*m;return h.set(1-k-d,d,k)}}();
@@ -166,21 +166,21 @@ c.color.getHex(),f.intensity=c.intensity;else if(c instanceof THREE.PointLight)f
 b[h.uuid]){var k=h.toJSON();delete k.metadata;b[h.uuid]=k;a.geometries.push(k)}f.geometry=h.uuid;f.material=d(c.material)}else c instanceof THREE.Sprite&&(f.material=d(c.material));f.matrix=c.matrix.toArray();if(0<c.children.length)for(f.children=[],h=0;h<c.children.length;h++)f.children.push(e(c.children[h]));return f};a.object=e(this);return a},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);
 a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));void 0!==this.script&&(a.script=this.script.clone());if(!0===b)for(var c=
 0;c<this.children.length;c++)a.add(this.children[c].clone());return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;
-THREE.Projector=function(){function a(){if(r===t){var a=new THREE.RenderableVertex;s.push(a);t++;r++;return a}return s[r++]}function b(){if(p===x){var a=new THREE.RenderableFace;v.push(a);x++;p++;return a}return v[p++]}function c(){if(E===z){var a=new THREE.RenderableLine;y.push(a);z++;E++;return a}return y[E++]}function d(){if(D===A){var a=new THREE.RenderableSprite;w.push(a);A++;D++;return a}return w[D++]}function e(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function g(a,b){var c=0,d=
-1,e=a.z+a.w,g=b.z+b.w,f=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=g&&0<=f&&0<=h)return!0;if(0>e&&0>g||0>f&&0>h)return!1;0>e?c=Math.max(c,e/(e-g)):0>g&&(d=Math.min(d,e/(e-g)));0>f?c=Math.max(c,f/(f-h)):0>h&&(d=Math.min(d,f/(f-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,h,k=[],m=0,n,r,s=[],t=0,q,p,v=[],x=0,u,E,y=[],z=0,B,D,w=[],A=0,N={objects:[],lights:[],elements:[]},P=new THREE.Vector3,K=new THREE.Vector3,R=new THREE.Vector3,M=new THREE.Vector3,H=new THREE.Vector4,C=new THREE.Box3(new THREE.Vector3(-1,
+THREE.Projector=function(){function a(){if(q===t){var a=new THREE.RenderableVertex;s.push(a);t++;q++;return a}return s[q++]}function b(){if(p===x){var a=new THREE.RenderableFace;v.push(a);x++;p++;return a}return v[p++]}function c(){if(E===z){var a=new THREE.RenderableLine;y.push(a);z++;E++;return a}return y[E++]}function d(){if(D===A){var a=new THREE.RenderableSprite;w.push(a);A++;D++;return a}return w[D++]}function e(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function g(a,b){var c=0,d=
+1,e=a.z+a.w,g=b.z+b.w,f=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=g&&0<=f&&0<=h)return!0;if(0>e&&0>g||0>f&&0>h)return!1;0>e?c=Math.max(c,e/(e-g)):0>g&&(d=Math.min(d,e/(e-g)));0>f?c=Math.max(c,f/(f-h)):0>h&&(d=Math.min(d,f/(f-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var f,h,k=[],m=0,n,q,s=[],t=0,r,p,v=[],x=0,u,E,y=[],z=0,B,D,w=[],A=0,N={objects:[],lights:[],elements:[]},P=new THREE.Vector3,K=new THREE.Vector3,R=new THREE.Vector3,M=new THREE.Vector3,H=new THREE.Vector4,C=new THREE.Box3(new THREE.Vector3(-1,
 -1,-1),new THREE.Vector3(1,1,1)),T=new THREE.Box3,L=Array(3),V=new THREE.Matrix4,J=new THREE.Matrix4,Y,aa=new THREE.Matrix4,na=new THREE.Matrix3,I=new THREE.Frustum,ba=new THREE.Vector4,Q=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);J.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(J)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);J.multiplyMatrices(c.matrixWorld,
 a);return b.applyProjection(J)}}();this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var ca=new function(){var d=[],e=[],g=null,f=null,h=new THREE.Matrix3,k=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(Y);c.copy(b).applyMatrix4(J);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},m=function(a,
-b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return C.isIntersectionBox(T.setFromPoints(L))},r=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){g=a;f=g.material;h.getNormalMatrix(g.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:m,
-checkBackfaceCulling:r,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=s[a],e=s[b];u=c();u.id=g.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=g.material;N.elements.push(u)},pushTriangle:function(a,c,k){var n=s[a],p=s[c],t=s[k];if(!1!==m(n,p,t)&&(f.side===THREE.DoubleSide||!0===r(n,p,t))){q=b();q.id=g.id;q.v1.copy(n);q.v2.copy(p);q.v3.copy(t);
-q.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=q.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],q.uvs[n].set(e[p],e[p+1]);q.vertexNormalsLength=3;q.material=g.material;N.elements.push(q)}}}};this.projectScene=function(n,t,v,x){D=E=p=0;N.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();V.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));J.multiplyMatrices(t.projectionMatrix,
+b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return C.isIntersectionBox(T.setFromPoints(L))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){g=a;f=g.material;h.getNormalMatrix(g.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:m,
+checkBackfaceCulling:q,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=s[a],e=s[b];u=c();u.id=g.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=g.material;N.elements.push(u)},pushTriangle:function(a,c,k){var n=s[a],p=s[c],t=s[k];if(!1!==m(n,p,t)&&(f.side===THREE.DoubleSide||!0===q(n,p,t))){r=b();r.id=g.id;r.v1.copy(n);r.v2.copy(p);r.v3.copy(t);
+r.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=r.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],r.uvs[n].set(e[p],e[p+1]);r.vertexNormalsLength=3;r.material=g.material;N.elements.push(r)}}}};this.projectScene=function(n,t,v,x){D=E=p=0;N.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();V.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));J.multiplyMatrices(t.projectionMatrix,
 V);I.setFromMatrix(J);h=0;N.objects.length=0;N.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)N.lights.push(a);else if((a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)&&!1!==a.material.visible&&(!1===a.frustumCulled||!0===I.intersectsObject(a))){if(h===m){var b=new THREE.RenderableObject;k.push(b);m++;h++;f=b}else f=k[h++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:(M.setFromMatrixPosition(a.matrixWorld),M.applyProjection(J),
-f.z=M.z);N.objects.push(f)}});!0===v&&N.objects.sort(e);n=0;for(v=N.objects.length;n<v;n++){var y=N.objects[n].object,w=y.geometry;ca.setObject(y);Y=y.matrixWorld;r=0;if(y instanceof THREE.Mesh)if(w instanceof THREE.BufferGeometry){var z=w.attributes,y=w.offsets;if(void 0!==z.position){for(var A=z.position.array,w=0,G=A.length;w<G;w+=3)ca.pushVertex(A[w],A[w+1],A[w+2]);if(void 0!==z.normal)for(var L=z.normal.array,w=0,G=L.length;w<G;w+=3)ca.pushNormal(L[w],L[w+1],L[w+2]);if(void 0!==z.uv)for(L=z.uv.array,
+f.z=M.z);N.objects.push(f)}});!0===v&&N.objects.sort(e);n=0;for(v=N.objects.length;n<v;n++){var y=N.objects[n].object,w=y.geometry;ca.setObject(y);Y=y.matrixWorld;q=0;if(y instanceof THREE.Mesh)if(w instanceof THREE.BufferGeometry){var z=w.attributes,y=w.offsets;if(void 0!==z.position){for(var A=z.position.array,w=0,G=A.length;w<G;w+=3)ca.pushVertex(A[w],A[w+1],A[w+2]);if(void 0!==z.normal)for(var L=z.normal.array,w=0,G=L.length;w<G;w+=3)ca.pushNormal(L[w],L[w+1],L[w+2]);if(void 0!==z.uv)for(L=z.uv.array,
 w=0,G=L.length;w<G;w+=2)ca.pushUv(L[w],L[w+1]);if(void 0!==z.index)if(z=z.index.array,0<y.length)for(n=0;n<y.length;n++)for(G=y[n],A=G.index,w=G.start,G=G.start+G.count;w<G;w+=3)ca.pushTriangle(z[w]+A,z[w+1]+A,z[w+2]+A);else for(w=0,G=z.length;w<G;w+=3)ca.pushTriangle(z[w],z[w+1],z[w+2]);else for(w=0,G=A.length/3;w<G;w+=3)ca.pushTriangle(w,w+1,w+2)}}else{if(w instanceof THREE.Geometry){var T=w.vertices,G=w.faces,z=w.faceVertexUvs[0];na.getNormalMatrix(Y);for(var A=y.material instanceof THREE.MeshFaceMaterial,
 L=!0===A?y.material:null,C=0,qa=T.length;C<qa;C++){var oa=T[C];ca.pushVertex(oa.x,oa.y,oa.z)}T=0;for(C=G.length;T<C;T++){var qa=G[T],Za=!0===A?L.materials[qa.materialIndex]:y.material;if(void 0!==Za){var Ha=Za.side,oa=s[qa.a],ya=s[qa.b],Ia=s[qa.c];if(!0===Za.morphTargets){var ua=w.morphTargets,ka=y.morphTargetInfluences,da=oa.position,xa=ya.position,ta=Ia.position;P.set(0,0,0);K.set(0,0,0);R.set(0,0,0);for(var Sa=0,pb=ua.length;Sa<pb;Sa++){var Na=ka[Sa];if(0!==Na){var Ca=ua[Sa].vertices;P.x+=(Ca[qa.a].x-
 da.x)*Na;P.y+=(Ca[qa.a].y-da.y)*Na;P.z+=(Ca[qa.a].z-da.z)*Na;K.x+=(Ca[qa.b].x-xa.x)*Na;K.y+=(Ca[qa.b].y-xa.y)*Na;K.z+=(Ca[qa.b].z-xa.z)*Na;R.x+=(Ca[qa.c].x-ta.x)*Na;R.y+=(Ca[qa.c].y-ta.y)*Na;R.z+=(Ca[qa.c].z-ta.z)*Na}}oa.position.add(P);ya.position.add(K);Ia.position.add(R);ca.projectVertex(oa);ca.projectVertex(ya);ca.projectVertex(Ia)}if(!1!==ca.checkTriangleVisibility(oa,ya,Ia)){ua=ca.checkBackfaceCulling(oa,ya,Ia);if(Ha!==THREE.DoubleSide){if(Ha===THREE.FrontSide&&!1===ua)continue;if(Ha===THREE.BackSide&&
-!0===ua)continue}q=b();q.id=y.id;q.v1.copy(oa);q.v2.copy(ya);q.v3.copy(Ia);q.normalModel.copy(qa.normal);!1!==ua||Ha!==THREE.BackSide&&Ha!==THREE.DoubleSide||q.normalModel.negate();q.normalModel.applyMatrix3(na).normalize();ka=qa.vertexNormals;da=0;for(xa=Math.min(ka.length,3);da<xa;da++)ta=q.vertexNormalsModel[da],ta.copy(ka[da]),!1!==ua||Ha!==THREE.BackSide&&Ha!==THREE.DoubleSide||ta.negate(),ta.applyMatrix3(na).normalize();q.vertexNormalsLength=ka.length;Ha=z[T];if(void 0!==Ha)for(ua=0;3>ua;ua++)q.uvs[ua].copy(Ha[ua]);
-q.color=qa.color;q.material=Za;q.z=(oa.positionScreen.z+ya.positionScreen.z+Ia.positionScreen.z)/3;N.elements.push(q)}}}}}else if(y instanceof THREE.Line)if(w instanceof THREE.BufferGeometry){if(z=w.attributes,void 0!==z.position){A=z.position.array;w=0;for(G=A.length;w<G;w+=3)ca.pushVertex(A[w],A[w+1],A[w+2]);if(void 0!==z.index)for(z=z.index.array,w=0,G=z.length;w<G;w+=2)ca.pushLine(z[w],z[w+1]);else for(z=y.type===THREE.LinePieces?2:1,w=0,G=A.length/3-1;w<G;w+=z)ca.pushLine(w,w+1)}}else{if(w instanceof
-THREE.Geometry&&(aa.multiplyMatrices(J,Y),T=y.geometry.vertices,0!==T.length))for(oa=a(),oa.positionScreen.copy(T[0]).applyMatrix4(aa),z=y.type===THREE.LinePieces?2:1,C=1,qa=T.length;C<qa;C++)oa=a(),oa.positionScreen.copy(T[C]).applyMatrix4(aa),0<(C+1)%z||(ya=s[r-2],ba.copy(oa.positionScreen),Q.copy(ya.positionScreen),!0===g(ba,Q)&&(ba.multiplyScalar(1/ba.w),Q.multiplyScalar(1/Q.w),u=c(),u.id=y.id,u.v1.positionScreen.copy(ba),u.v2.positionScreen.copy(Q),u.z=Math.max(ba.z,Q.z),u.material=y.material,
+!0===ua)continue}r=b();r.id=y.id;r.v1.copy(oa);r.v2.copy(ya);r.v3.copy(Ia);r.normalModel.copy(qa.normal);!1!==ua||Ha!==THREE.BackSide&&Ha!==THREE.DoubleSide||r.normalModel.negate();r.normalModel.applyMatrix3(na).normalize();ka=qa.vertexNormals;da=0;for(xa=Math.min(ka.length,3);da<xa;da++)ta=r.vertexNormalsModel[da],ta.copy(ka[da]),!1!==ua||Ha!==THREE.BackSide&&Ha!==THREE.DoubleSide||ta.negate(),ta.applyMatrix3(na).normalize();r.vertexNormalsLength=ka.length;Ha=z[T];if(void 0!==Ha)for(ua=0;3>ua;ua++)r.uvs[ua].copy(Ha[ua]);
+r.color=qa.color;r.material=Za;r.z=(oa.positionScreen.z+ya.positionScreen.z+Ia.positionScreen.z)/3;N.elements.push(r)}}}}}else if(y instanceof THREE.Line)if(w instanceof THREE.BufferGeometry){if(z=w.attributes,void 0!==z.position){A=z.position.array;w=0;for(G=A.length;w<G;w+=3)ca.pushVertex(A[w],A[w+1],A[w+2]);if(void 0!==z.index)for(z=z.index.array,w=0,G=z.length;w<G;w+=2)ca.pushLine(z[w],z[w+1]);else for(z=y.type===THREE.LinePieces?2:1,w=0,G=A.length/3-1;w<G;w+=z)ca.pushLine(w,w+1)}}else{if(w instanceof
+THREE.Geometry&&(aa.multiplyMatrices(J,Y),T=y.geometry.vertices,0!==T.length))for(oa=a(),oa.positionScreen.copy(T[0]).applyMatrix4(aa),z=y.type===THREE.LinePieces?2:1,C=1,qa=T.length;C<qa;C++)oa=a(),oa.positionScreen.copy(T[C]).applyMatrix4(aa),0<(C+1)%z||(ya=s[q-2],ba.copy(oa.positionScreen),Q.copy(ya.positionScreen),!0===g(ba,Q)&&(ba.multiplyScalar(1/ba.w),Q.multiplyScalar(1/Q.w),u=c(),u.id=y.id,u.v1.positionScreen.copy(ba),u.v2.positionScreen.copy(Q),u.z=Math.max(ba.z,Q.z),u.material=y.material,
 y.material.vertexColors===THREE.VertexColors&&(u.vertexColors[0].copy(y.geometry.colors[C]),u.vertexColors[1].copy(y.geometry.colors[C-1])),N.elements.push(u)))}else y instanceof THREE.Sprite&&(H.set(Y.elements[12],Y.elements[13],Y.elements[14],1),H.applyMatrix4(J),w=1/H.w,H.z*=w,-1<=H.z&&1>=H.z&&(B=d(),B.id=y.id,B.x=H.x*w,B.y=H.y*w,B.z=H.z,B.object=y,B.rotation=y.rotation,B.scale.x=y.scale.x*Math.abs(B.x-(H.x+t.projectionMatrix.elements[0])/(H.w+t.projectionMatrix.elements[12])),B.scale.y=y.scale.y*
 Math.abs(B.y-(H.y+t.projectionMatrix.elements[5])/(H.w+t.projectionMatrix.elements[13])),B.material=y.material,N.elements.push(B)))}!0===x&&N.elements.sort(e);return N}};THREE.Face3=function(a,b,c,d,e,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==g?g:0};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}};
@@ -194,43 +194,44 @@ THREE.Float32Attribute=function(a,b){console.warn("THREE.Float32Attribute has be
 THREE.BufferGeometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.attributesKeys=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=
 this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,g=b.vertexColors,f=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var m=new Float32Array(9*d.length);
-this.addAttribute("normal",new THREE.BufferAttribute(m,3));if(g!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===f){var r=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(r,2))}for(var s=0,t=0,q=0;s<d.length;s++,t+=6,q+=9){var p=d[s],v=c[p.a],x=c[p.b],u=c[p.c];k[q]=v.x;k[q+1]=v.y;k[q+2]=v.z;k[q+3]=x.x;k[q+4]=x.y;k[q+5]=x.z;k[q+6]=u.x;k[q+7]=u.y;k[q+8]=u.z;!0===h?(v=p.vertexNormals[0],x=p.vertexNormals[1],
-u=p.vertexNormals[2],m[q]=v.x,m[q+1]=v.y,m[q+2]=v.z,m[q+3]=x.x,m[q+4]=x.y,m[q+5]=x.z,m[q+6]=u.x,m[q+7]=u.y,m[q+8]=u.z):(v=p.normal,m[q]=v.x,m[q+1]=v.y,m[q+2]=v.z,m[q+3]=v.x,m[q+4]=v.y,m[q+5]=v.z,m[q+6]=v.x,m[q+7]=v.y,m[q+8]=v.z);g===THREE.FaceColors?(p=p.color,n[q]=p.r,n[q+1]=p.g,n[q+2]=p.b,n[q+3]=p.r,n[q+4]=p.g,n[q+5]=p.b,n[q+6]=p.r,n[q+7]=p.g,n[q+8]=p.b):g===THREE.VertexColors&&(v=p.vertexColors[0],x=p.vertexColors[1],p=p.vertexColors[2],n[q]=v.r,n[q+1]=v.g,n[q+2]=v.b,n[q+3]=x.r,n[q+4]=x.g,n[q+
-5]=x.b,n[q+6]=p.r,n[q+7]=p.g,n[q+8]=p.b);!0===f&&(p=e[0][s][0],v=e[0][s][1],x=e[0][s][2],r[t]=p.x,r[t+1]=p.y,r[t+2]=v.x,r[t+3]=v.y,r[t+4]=x.x,r[t+5]=x.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===b||0===
+this.addAttribute("normal",new THREE.BufferAttribute(m,3));if(g!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===f){var q=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(q,2))}for(var s=0,t=0,r=0;s<d.length;s++,t+=6,r+=9){var p=d[s],v=c[p.a],x=c[p.b],u=c[p.c];k[r]=v.x;k[r+1]=v.y;k[r+2]=v.z;k[r+3]=x.x;k[r+4]=x.y;k[r+5]=x.z;k[r+6]=u.x;k[r+7]=u.y;k[r+8]=u.z;!0===h?(v=p.vertexNormals[0],x=p.vertexNormals[1],
+u=p.vertexNormals[2],m[r]=v.x,m[r+1]=v.y,m[r+2]=v.z,m[r+3]=x.x,m[r+4]=x.y,m[r+5]=x.z,m[r+6]=u.x,m[r+7]=u.y,m[r+8]=u.z):(v=p.normal,m[r]=v.x,m[r+1]=v.y,m[r+2]=v.z,m[r+3]=v.x,m[r+4]=v.y,m[r+5]=v.z,m[r+6]=v.x,m[r+7]=v.y,m[r+8]=v.z);g===THREE.FaceColors?(p=p.color,n[r]=p.r,n[r+1]=p.g,n[r+2]=p.b,n[r+3]=p.r,n[r+4]=p.g,n[r+5]=p.b,n[r+6]=p.r,n[r+7]=p.g,n[r+8]=p.b):g===THREE.VertexColors&&(v=p.vertexColors[0],x=p.vertexColors[1],p=p.vertexColors[2],n[r]=v.r,n[r+1]=v.g,n[r+2]=v.b,n[r+3]=x.r,n[r+4]=x.g,n[r+
+5]=x.b,n[r+6]=p.r,n[r+7]=p.g,n[r+8]=p.b);!0===f&&(p=e[0][s][0],v=e[0][s][1],x=e[0][s][2],q[t]=p.x,q[t+1]=p.y,q[t+2]=v.x,q[t+3]=v.y,q[t+4]=x.x,q[t+5]=x.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),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.')}}(),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.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.set(c[e],c[e+1],c[e+2]),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.')}}}(),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,m,n,r=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector3,q=new THREE.Vector3,p=new THREE.Vector3;if(a.index)for(var v=a.index.array,x=0<this.offsets.length?this.offsets:[{start:0,count:v.length,index:0}],u=0,E=x.length;u<E;++u){e=x[u].start;g=x[u].count;
-for(var y=x[u].index,d=e,e=e+g;d<e;d+=3)g=y+v[d],f=y+v[d+1],h=y+v[d+2],k=b[3*g],m=b[3*g+1],n=b[3*g+2],r.set(k,m,n),k=b[3*f],m=b[3*f+1],n=b[3*f+2],s.set(k,m,n),k=b[3*h],m=b[3*h+1],n=b[3*h+2],t.set(k,m,n),q.subVectors(t,s),p.subVectors(r,s),q.cross(p),c[3*g]+=q.x,c[3*g+1]+=q.y,c[3*g+2]+=q.z,c[3*f]+=q.x,c[3*f+1]+=q.y,c[3*f+2]+=q.z,c[3*h]+=q.x,c[3*h+1]+=q.y,c[3*h+2]+=q.z}else for(d=0,e=b.length;d<e;d+=9)k=b[d],m=b[d+1],n=b[d+2],r.set(k,m,n),k=b[d+3],m=b[d+4],n=b[d+5],s.set(k,m,n),k=b[d+6],m=b[d+7],n=
-b[d+8],t.set(k,m,n),q.subVectors(t,s),p.subVectors(r,s),q.cross(p),c[d]=q.x,c[d+1]=q.y,c[d+2]=q.z,c[d+3]=q.x,c[d+4]=q.y,c[d+5]=q.z,c[d+6]=q.x,c[d+7]=q.y,c[d+8]=q.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){r=d[3*a];s=d[3*a+1];t=d[3*a+2];q=d[3*b];p=d[3*b+1];v=d[3*b+2];x=d[3*c];u=d[3*c+1];E=d[3*c+2];y=g[2*a];z=g[2*a+1];B=g[2*b];D=g[2*b+1];w=g[2*c];A=g[2*c+1];N=q-r;P=x-r;K=p-s;R=u-s;M=v-t;H=E-t;C=B-y;T=w-y;L=D-z;V=A-z;J=1/(C*V-T*L);Y.set((V*N-L*P)*
+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,m,n,q=new THREE.Vector3,s=new THREE.Vector3,t=new THREE.Vector3,r=new THREE.Vector3,p=new THREE.Vector3;if(a.index)for(var v=a.index.array,x=0<this.offsets.length?this.offsets:[{start:0,count:v.length,index:0}],u=0,E=x.length;u<E;++u){e=x[u].start;g=x[u].count;
+for(var y=x[u].index,d=e,e=e+g;d<e;d+=3)g=y+v[d],f=y+v[d+1],h=y+v[d+2],k=b[3*g],m=b[3*g+1],n=b[3*g+2],q.set(k,m,n),k=b[3*f],m=b[3*f+1],n=b[3*f+2],s.set(k,m,n),k=b[3*h],m=b[3*h+1],n=b[3*h+2],t.set(k,m,n),r.subVectors(t,s),p.subVectors(q,s),r.cross(p),c[3*g]+=r.x,c[3*g+1]+=r.y,c[3*g+2]+=r.z,c[3*f]+=r.x,c[3*f+1]+=r.y,c[3*f+2]+=r.z,c[3*h]+=r.x,c[3*h+1]+=r.y,c[3*h+2]+=r.z}else for(d=0,e=b.length;d<e;d+=9)k=b[d],m=b[d+1],n=b[d+2],q.set(k,m,n),k=b[d+3],m=b[d+4],n=b[d+5],s.set(k,m,n),k=b[d+6],m=b[d+7],n=
+b[d+8],t.set(k,m,n),r.subVectors(t,s),p.subVectors(q,s),r.cross(p),c[d]=r.x,c[d+1]=r.y,c[d+2]=r.z,c[d+3]=r.x,c[d+4]=r.y,c[d+5]=r.z,c[d+6]=r.x,c[d+7]=r.y,c[d+8]=r.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q=d[3*a];s=d[3*a+1];t=d[3*a+2];r=d[3*b];p=d[3*b+1];v=d[3*b+2];x=d[3*c];u=d[3*c+1];E=d[3*c+2];y=g[2*a];z=g[2*a+1];B=g[2*b];D=g[2*b+1];w=g[2*c];A=g[2*c+1];N=r-q;P=x-q;K=p-s;R=u-s;M=v-t;H=E-t;C=B-y;T=w-y;L=D-z;V=A-z;J=1/(C*V-T*L);Y.set((V*N-L*P)*
 J,(V*K-L*R)*J,(V*M-L*H)*J);aa.set((C*P-T*N)*J,(C*R-T*K)*J,(C*H-T*M)*J);k[a].add(Y);k[b].add(Y);k[c].add(Y);m[a].add(aa);m[b].add(aa);m[c].add(aa)}function b(a){La.x=e[3*a];La.y=e[3*a+1];La.z=e[3*a+2];la.copy(La);sa=k[a];Oa.copy(sa);Oa.sub(La.multiplyScalar(La.dot(sa))).normalize();Pa.crossVectors(la,sa);G=Pa.dot(m[a]);bb=0>G?-1:1;h[4*a]=Oa.x;h[4*a+1]=Oa.y;h[4*a+2]=Oa.z;h[4*a+3]=bb}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
-else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],m=[],n=0;n<f;n++)k[n]=new THREE.Vector3,m[n]=new THREE.Vector3;var r,s,t,q,p,v,x,u,E,y,z,B,D,w,A,N,P,K,R,M,H,C,T,L,V,J,Y=new THREE.Vector3,aa=new THREE.Vector3,na,I,ba,Q,ca,Ga=this.offsets,n=0;for(I=
-Ga.length;n<I;++n){na=Ga[n].start;ba=Ga[n].count;var Ea=Ga[n].index,f=na;for(na+=ba;f<na;f+=3)ba=Ea+c[f],Q=Ea+c[f+1],ca=Ea+c[f+2],a(ba,Q,ca)}var Oa=new THREE.Vector3,Pa=new THREE.Vector3,La=new THREE.Vector3,la=new THREE.Vector3,bb,sa,G,n=0;for(I=Ga.length;n<I;++n)for(na=Ga[n].start,ba=Ga[n].count,Ea=Ga[n].index,f=na,na+=ba;f<na;f+=3)ba=Ea+c[f],Q=Ea+c[f+1],ca=Ea+c[f+2],b(ba),b(Q),b(ca)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,
-d=a.length/3,e=new Uint16Array(a.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],m=0,n=0,r=new Int32Array(6),s=new Int32Array(c.length),t=new Int32Array(c.length),q=0;q<c.length;q++)s[q]=-1,t[q]=-1;for(c=0;c<d;c++){for(var p=n=0;3>p;p++)q=a[3*c+p],-1==s[q]?(r[2*p]=q,r[2*p+1]=-1,n++):s[q]<k.index?(r[2*p]=q,r[2*p+1]=-1,m++):(r[2*p]=q,r[2*p+1]=s[q]);if(f+n>k.index+b)for(k={start:g,count:0,index:f},h.push(k),n=0;6>n;n+=2)p=r[n+1],-1<p&&p<k.index&&(r[n+1]=-1);for(n=0;6>n;n+=2)q=r[n],p=r[n+1],-1===
-p&&(p=f++),s[q]=p,t[p]=q,e[g++]=p-k.index,k.count++}this.reorderBuffers(e,t,f);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},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=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],g;for(g in this.attributes)if("index"!=
-g)for(var f=this.attributes[g].array,h=0,k=e.length;h<k;h++){var m=e[h];if(f instanceof m){d[g]=new m(this.attributes[g].itemSize*c);break}}for(e=0;e<c;e++)for(g in f=b[e],this.attributes)if("index"!=g)for(var h=this.attributes[g].array,k=this.attributes[g].itemSize,m=d[g],n=0;n<k;n++)m[e*k+n]=h[f*k+n];this.attributes.index.array=a;for(g in this.attributes)"index"!=g&&(this.attributes[g].array=d[g],this.attributes[g].numItems=this.attributes[g].itemSize*c)},toJSON:function(){var a={metadata:{version:4,
-type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){for(var g=b[e],f=[],h=g.array,k=0,m=h.length;k<m;k++)f[k]=h[k];a.data.attributes[e]={itemSize:g.itemSize,type:g.array.constructor.name,array:f}}0<c.length&&(a.data.offsets=JSON.parse(JSON.stringify(c)));null!==d&&(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius});return a},clone:function(){var a=new THREE.BufferGeometry,
-b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,g={itemSize:d.itemSize,array:null},d=0,f=b.length;d<f;d++){var h=b[d];if(e instanceof h){g.array=new h(e);break}}a.attributes[c]=g}d=0;for(f=this.offsets.length;d<f;d++)b=this.offsets[d],a.offsets.push({start:b.start,index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);
+else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],m=[],n=0;n<f;n++)k[n]=new THREE.Vector3,m[n]=new THREE.Vector3;var q,s,t,r,p,v,x,u,E,y,z,B,D,w,A,N,P,K,R,M,H,C,T,L,V,J,Y=new THREE.Vector3,aa=new THREE.Vector3,na,I,ba,Q,ca;0===this.drawcalls.length&&
+this.addDrawCall(0,c.length,0);var Ga=this.drawcalls,n=0;for(I=Ga.length;n<I;++n){na=Ga[n].start;ba=Ga[n].count;var Ea=Ga[n].index,f=na;for(na+=ba;f<na;f+=3)ba=Ea+c[f],Q=Ea+c[f+1],ca=Ea+c[f+2],a(ba,Q,ca)}var Oa=new THREE.Vector3,Pa=new THREE.Vector3,La=new THREE.Vector3,la=new THREE.Vector3,bb,sa,G,n=0;for(I=Ga.length;n<I;++n)for(na=Ga[n].start,ba=Ga[n].count,Ea=Ga[n].index,f=na,na+=ba;f<na;f+=3)ba=Ea+c[f],Q=Ea+c[f+1],ca=Ea+c[f+2],b(ba),b(Q),b(ca)}},computeOffsets:function(a){var b=a;void 0===a&&
+(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],m=0,n=0,q=new Int32Array(6),s=new Int32Array(c.length),t=new Int32Array(c.length),r=0;r<c.length;r++)s[r]=-1,t[r]=-1;for(c=0;c<d;c++){for(var p=n=0;3>p;p++)r=a[3*c+p],-1==s[r]?(q[2*p]=r,q[2*p+1]=-1,n++):s[r]<k.index?(q[2*p]=r,q[2*p+1]=-1,m++):(q[2*p]=r,q[2*p+1]=s[r]);if(f+n>k.index+b)for(k={start:g,count:0,index:f},h.push(k),
+n=0;6>n;n+=2)p=q[n+1],-1<p&&p<k.index&&(q[n+1]=-1);for(n=0;6>n;n+=2)r=q[n],p=q[n+1],-1===p&&(p=f++),s[r]=p,t[p]=r,e[g++]=p-k.index,k.count++}this.reorderBuffers(e,t,f);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},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=[Int8Array,Uint8Array,Uint8ClampedArray,
+Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],g;for(g in this.attributes)if("index"!=g)for(var f=this.attributes[g].array,h=0,k=e.length;h<k;h++){var m=e[h];if(f instanceof m){d[g]=new m(this.attributes[g].itemSize*c);break}}for(e=0;e<c;e++)for(g in f=b[e],this.attributes)if("index"!=g)for(var h=this.attributes[g].array,k=this.attributes[g].itemSize,m=d[g],n=0;n<k;n++)m[e*k+n]=h[f*k+n];this.attributes.index.array=a;for(g in this.attributes)"index"!=g&&(this.attributes[g].array=
+d[g],this.attributes[g].numItems=this.attributes[g].itemSize*c)},toJSON:function(){var a={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){for(var g=b[e],f=[],h=g.array,k=0,m=h.length;k<m;k++)f[k]=h[k];a.data.attributes[e]={itemSize:g.itemSize,type:g.array.constructor.name,array:f}}0<c.length&&(a.data.offsets=JSON.parse(JSON.stringify(c)));null!==d&&
+(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,g={itemSize:d.itemSize,array:null},d=0,f=b.length;d<f;d++){var h=b[d];if(e instanceof h){g.array=new h(e);break}}a.attributes[c]=g}d=0;for(f=this.offsets.length;d<f;d++)b=this.offsets[d],a.offsets.push({start:b.start,
+index:b.index,count:b.count});return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);
 THREE.Geometry=function(){this.id=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.hasTangents=!1;this.dynamic=!0;this.groupsNeedUpdate=this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=
 this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!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()}this.boundingBox instanceof THREE.Box3&&this.computeBoundingBox();this.boundingSphere instanceof THREE.Sphere&&this.computeBoundingSphere()},
 fromBufferGeometry:function(a){for(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=[],m=[],n=c=0;c<d.length;c+=3,n+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==g&&k.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&&m.push(new THREE.Vector2(h[n],h[n+1]));h=
-function(a,c,d){b.faces.push(new THREE.Face3(a,c,d,void 0!==g?[k[a],k[c],k[d]]:[],void 0!==f?[b.colors[a],b.colors[c],b.colors[d]]:[]));b.faceVertexUvs[0].push([m[a],m[c],m[d]])};if(void 0!==e)for(c=0;c<e.length;c+=3)h(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)h(c,c+1,c+2);null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();var a=new THREE.Vector3;a.addVectors(this.boundingBox.min,
-this.boundingBox.max);a.multiplyScalar(-0.5);this.applyMatrix((new THREE.Matrix4).makeTranslation(a.x,a.y,a.z));this.computeBoundingBox();return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],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;new THREE.Vector3;new THREE.Vector3;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],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?
-e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var 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,m,n,r,s,t,q,p,v,x=[],u=[];c=new THREE.Vector3;var E=new THREE.Vector3,y=new THREE.Vector3,z=new THREE.Vector3,B=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)x[a]=new THREE.Vector3,u[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,v=e.b,e=e.c,f=this.vertices[d],h=this.vertices[v],k=this.vertices[e],m=g[0],n=g[1],r=g[2],g=h.x-f.x,s=k.x-f.x,t=h.y-f.y,q=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=n.x-m.x,p=r.x-m.x,n=n.y-m.y,m=r.y-
-m.y,r=1/(k*m-p*n),c.set((m*g-n*s)*r,(m*t-n*q)*r,(m*h-n*f)*r),E.set((k*s-p*g)*r,(k*q-p*t)*r,(k*f-p*h)*r),x[d].add(c),x[v].add(c),x[e].add(c),u[d].add(E),u[v].add(E),u[e].add(E);E=["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++)B.copy(e.vertexNormals[c]),d=e[E[c]],v=x[d],y.copy(v),y.sub(B.multiplyScalar(B.dot(v))).normalize(),z.crossVectors(e.vertexNormals[c],v),d=z.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(y.x,
+function(a,c,d){var e=void 0!==g?[k[a].clone(),k[c].clone(),k[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,void 0!==f?[b.colors[a],b.colors[c],b.colors[d]]:[]));b.faceVertexUvs[0].push([m[a],m[c],m[d]])};if(void 0!==e)for(c=0;c<e.length;c+=3)h(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)h(c,c+1,c+2);null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();
+var a=new THREE.Vector3;a.addVectors(this.boundingBox.min,this.boundingBox.max);a.multiplyScalar(-0.5);this.applyMatrix((new THREE.Matrix4).makeTranslation(a.x,a.y,a.z));this.computeBoundingBox();return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],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;new THREE.Vector3;new THREE.Vector3;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],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<
+b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var 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,m,n,q,s,t,r,p,v,x=[],u=[];c=new THREE.Vector3;var E=new THREE.Vector3,y=new THREE.Vector3,z=new THREE.Vector3,B=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)x[a]=new THREE.Vector3,u[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,v=e.b,e=e.c,f=this.vertices[d],h=this.vertices[v],k=this.vertices[e],m=g[0],n=g[1],q=g[2],g=h.x-f.x,s=k.x-f.x,t=h.y-f.y,r=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=n.x-m.x,p=q.x-m.x,n=n.y-m.y,m=q.y-
+m.y,q=1/(k*m-p*n),c.set((m*g-n*s)*q,(m*t-n*r)*q,(m*h-n*f)*q),E.set((k*s-p*g)*q,(k*r-p*t)*q,(k*f-p*h)*q),x[d].add(c),x[v].add(c),x[e].add(c),u[d].add(E),u[v].add(E),u[e].add(E);E=["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++)B.copy(e.vertexNormals[c]),d=e[E[c]],v=x[d],y.copy(v),y.sub(B.multiplyScalar(B.dot(v))).normalize(),z.crossVectors(e.vertexNormals[c],v),d=z.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(y.x,
 y.y,y.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof
-THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,g=this.vertices,f=a.vertices,h=this.faces,k=a.faces,m=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,r=f.length;n<r;n++){var s=f[n].clone();void 0!==b&&s.applyMatrix4(b);g.push(s)}n=0;for(r=k.length;n<r;n++){var f=k[n],t,q=f.vertexNormals,p=f.vertexColors,s=new THREE.Face3(f.a+e,f.b+
-e,f.c+e);s.normal.copy(f.normal);void 0!==d&&s.normal.applyMatrix3(d).normalize();b=0;for(g=q.length;b<g;b++)t=q[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),s.vertexNormals.push(t);s.color.copy(f.color);b=0;for(g=p.length;b<g;b++)t=p[b],s.vertexColors.push(t.clone());s.materialIndex=f.materialIndex+c;h.push(s)}n=0;for(r=a.length;n<r;n++)if(c=a[n],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));m.push(d)}}},mergeVertices:function(){var a={},b=[],c=[],d,
+THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,g=this.vertices,f=a.vertices,h=this.faces,k=a.faces,m=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,q=f.length;n<q;n++){var s=f[n].clone();void 0!==b&&s.applyMatrix4(b);g.push(s)}n=0;for(q=k.length;n<q;n++){var f=k[n],t,r=f.vertexNormals,p=f.vertexColors,s=new THREE.Face3(f.a+e,f.b+
+e,f.c+e);s.normal.copy(f.normal);void 0!==d&&s.normal.applyMatrix3(d).normalize();b=0;for(g=r.length;b<g;b++)t=r[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),s.vertexNormals.push(t);s.color.copy(f.color);b=0;for(g=p.length;b<g;b++)t=p[b],s.vertexColors.push(t.clone());s.materialIndex=f.materialIndex+c;h.push(s)}n=0;for(q=a.length;n<q;n++)if(c=a[n],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));m.push(d)}}},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},makeGroups:function(){var a=0;return function(b,c){var d,e,g,f,h={},k,m=this.morphTargets.length,n=this.morphNormals.length;this.geometryGroups={};this.geometryGroupsList=[];d=0;for(e=this.faces.length;d<e;d++)g=this.faces[d],g=b?g.materialIndex:0,g in h||(h[g]={hash:g,counter:0}),f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:m,numMorphNormals:n},this.geometryGroups[f]=
 k,this.geometryGroupsList.push(k)),this.geometryGroups[f].vertices+3>c&&(h[g].counter+=1,f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:m,numMorphNormals:n},this.geometryGroups[f]=k,this.geometryGroupsList.push(k))),this.geometryGroups[f].faces3.push(d),this.geometryGroups[f].vertices+=3}}(),toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==
-m[b])return m[b];m[b]=k.length/3;k.push(a.x,a.y,a.z);return m[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==r[b])return r[b];r[b]=n.length;n.push(a.getHex());return r[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==t[b])return t[b];t[b]=s.length/2;s.push(a.x,a.y);return t[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=
-this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],m={},n=[],r={},s=[],t={};for(f=0;f<this.faces.length;f++){var q=this.faces[f],p=void 0!==this.faceVertexUvs[0][f],v=0<q.normal.length(),x=0<q.vertexNormals.length,u=1!==q.color.r||1!==q.color.g||1!==q.color.b,E=0<q.vertexColors.length,y=0,y=a(y,0,0),y=a(y,1,!1),y=a(y,2,!1),y=a(y,3,p),y=a(y,4,v),y=a(y,5,x),y=a(y,6,u),y=a(y,7,E);h.push(y);
-h.push(q.a,q.b,q.c);p&&(p=this.faceVertexUvs[0][f],h.push(d(p[0]),d(p[1]),d(p[2])));v&&h.push(b(q.normal));x&&(v=q.vertexNormals,h.push(b(v[0]),b(v[1]),b(v[2])));u&&h.push(c(q.color));E&&(q=q.vertexColors,h.push(c(q[0]),c(q[1]),c(q[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<n.length&&(e.data.colors=n);0<s.length&&(e.data.uvs=[s]);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=
+m[b])return m[b];m[b]=k.length/3;k.push(a.x,a.y,a.z);return m[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==q[b])return q[b];q[b]=n.length;n.push(a.getHex());return q[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==t[b])return t[b];t[b]=s.length/2;s.push(a.x,a.y);return t[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=
+this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],m={},n=[],q={},s=[],t={};for(f=0;f<this.faces.length;f++){var r=this.faces[f],p=void 0!==this.faceVertexUvs[0][f],v=0<r.normal.length(),x=0<r.vertexNormals.length,u=1!==r.color.r||1!==r.color.g||1!==r.color.b,E=0<r.vertexColors.length,y=0,y=a(y,0,0),y=a(y,1,!1),y=a(y,2,!1),y=a(y,3,p),y=a(y,4,v),y=a(y,5,x),y=a(y,6,u),y=a(y,7,E);h.push(y);
+h.push(r.a,r.b,r.c);p&&(p=this.faceVertexUvs[0][f],h.push(d(p[0]),d(p[1]),d(p[2])));v&&h.push(b(r.normal));x&&(v=r.vertexNormals,h.push(b(v[0]),b(v[1]),b(v[2])));u&&h.push(c(r.color));E&&(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<n.length&&(e.data.colors=n);0<s.length&&(e.data.uvs=[s]);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());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],g=[],f=0,h=e.length;f<h;f++)g.push(new THREE.Vector2(e[f].x,e[f].y));a.faceVertexUvs[0].push(g)}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Script=function(a){this.uuid=THREE.Math.generateUUID();this.source=a};THREE.Script.prototype={constructor:THREE.Script,clone:function(){return new THREE.Script(this.source)}};
 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.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};
@@ -272,12 +273,12 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var g=new XMLHttpRequest,f=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(200===g.status||0===g.status){if(g.responseText){var h=JSON.parse(g.responseText);if(void 0!==h.metadata&&"scene"===h.metadata.type){console.error('THREE.JSONLoader: "'+b+'" seems to be a Scene. Use THREE.SceneLoader instead.');return}h=a.parse(h,d);c(h.geometry,h.materials)}else console.error('THREE.JSONLoader: "'+b+'" seems to be unreachable or the file is empty.');
 a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load \""+b+'" ('+g.status+")");else g.readyState===g.LOADING?e&&(0===f&&(f=g.getResponseHeader("Content-Length")),e({total:f,loaded:g.responseText.length})):g.readyState===g.HEADERS_RECEIVED&&void 0!==e&&(f=g.getResponseHeader("Content-Length"))};g.open("GET",b,!0);g.withCredentials=this.withCredentials;g.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,m,n,r,s,t,q,p,v,x,u=a.faces;n=a.vertices;var E=a.normals,y=a.colors,z=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&z++;for(d=0;d<z;d++)c.faceVertexUvs[d]=[]}k=0;for(m=n.length;k<m;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(m=u.length;k<m;)if(b=u[k++],t=b&1,h=b&2,d=b&8,r=b&16,q=b&32,n=b&64,b&=128,t){t=new THREE.Face3;
-t.a=u[k];t.b=u[k+1];t.c=u[k+3];p=new THREE.Face3;p.a=u[k+1];p.b=u[k+2];p.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,p.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)s=u[k++],x=v[2*s],s=v[2*s+1],x=new THREE.Vector2(x,s),2!==f&&c.faceVertexUvs[d][h].push(x),0!==f&&c.faceVertexUvs[d][h+1].push(x);r&&(r=3*u[k++],t.normal.set(E[r++],E[r++],E[r]),p.normal.copy(t.normal));if(q)for(d=0;4>d;d++)r=3*u[k++],q=new THREE.Vector3(E[r++],
-E[r++],E[r]),2!==d&&t.vertexNormals.push(q),0!==d&&p.vertexNormals.push(q);n&&(n=u[k++],n=y[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=y[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)s=u[k++],x=v[2*s],s=v[2*s+1],
-x=new THREE.Vector2(x,s),c.faceVertexUvs[d][h].push(x);r&&(r=3*u[k++],t.normal.set(E[r++],E[r++],E[r]));if(q)for(d=0;3>d;d++)r=3*u[k++],q=new THREE.Vector3(E[r++],E[r++],E[r]),t.vertexNormals.push(q);n&&(n=u[k++],t.color.setHex(y[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(y[n]));c.faces.push(t)}})(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],
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,m,n,q,s,t,r,p,v,x,u=a.faces;n=a.vertices;var E=a.normals,y=a.colors,z=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&z++;for(d=0;d<z;d++)c.faceVertexUvs[d]=[]}k=0;for(m=n.length;k<m;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(m=u.length;k<m;)if(b=u[k++],t=b&1,h=b&2,d=b&8,q=b&16,r=b&32,n=b&64,b&=128,t){t=new THREE.Face3;
+t.a=u[k];t.b=u[k+1];t.c=u[k+3];p=new THREE.Face3;p.a=u[k+1];p.b=u[k+2];p.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,p.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)s=u[k++],x=v[2*s],s=v[2*s+1],x=new THREE.Vector2(x,s),2!==f&&c.faceVertexUvs[d][h].push(x),0!==f&&c.faceVertexUvs[d][h+1].push(x);q&&(q=3*u[k++],t.normal.set(E[q++],E[q++],E[q]),p.normal.copy(t.normal));if(r)for(d=0;4>d;d++)q=3*u[k++],r=new THREE.Vector3(E[q++],
+E[q++],E[q]),2!==d&&t.vertexNormals.push(r),0!==d&&p.vertexNormals.push(r);n&&(n=u[k++],n=y[n],t.color.setHex(n),p.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=y[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&p.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(p)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)s=u[k++],x=v[2*s],s=v[2*s+1],
+x=new THREE.Vector2(x,s),c.faceVertexUvs[d][h].push(x);q&&(q=3*u[k++],t.normal.set(E[q++],E[q++],E[q]));if(r)for(d=0;3>d;d++)q=3*u[k++],r=new THREE.Vector3(E[q++],E[q++],E[q]),t.vertexNormals.push(r);n&&(n=u[k++],t.color.setHex(y[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(y[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;d<f;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
 1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,f=a.skinIndices.length;d<f;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+
-"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,f,h,k,m,n;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],m=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var r=new THREE.Vector3;r.x=n[h]*b;r.y=n[h+1]*b;r.z=n[h+2]*b;m.push(r)}}if(void 0!==a.morphColors)for(d=
+"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,f,h,k,m,n;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],m=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var q=new THREE.Vector3;q.x=n[h]*b;q.y=n[h+1]*b;q.z=n[h+2]*b;m.push(q)}}if(void 0!==a.morphColors)for(d=
 0,f=a.morphColors.length;d<f;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,m=a.morphColors[d].colors,b=0,h=m.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(m[b],m[b+1],m[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};
 THREE.LoadingManager=function(a,b,c){var d=this,e=0,g=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,g);if(e===g&&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;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.attributes,d;for(d in c){var e=c[d],g=new self[e.type](e.array);b.attributes[d]=new THREE.BufferAttribute(g,e.itemSize)}c=a.offsets;void 0!==c&&(b.offsets=JSON.parse(JSON.stringify(c)));
@@ -338,19 +339,19 @@ THREE.CubeTexture.clone=function(a){void 0===a&&(a=new THREE.CubeTexture);THREE.
 THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,g,f,h,k,m,n){THREE.Texture.call(this,null,g,f,h,k,m,d,e,n);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};
 THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);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()});this.sortParticles=!1};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);
 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 h=f/((this.scale.x+this.scale.y+this.scale.z)/3),k=new THREE.Vector3,f=function(a,f){var g=b.distanceToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var m=c.ray.origin.distanceTo(k);
-d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(g instanceof THREE.BufferGeometry){var m=g.attributes,n=m.position.array;if(void 0!==m.index){var m=m.index.array,r=g.offsets;0===r.length&&(r=[{start:0,count:m.length,index:0}]);for(var s=0,t=r.length;s<t;++s)for(var q=r[s].start,p=r[s].index,g=q,q=q+r[s].count;g<q;g++){var v=p+m[g];k.set(n[3*v],n[3*v+1],n[3*v+2]);f(k,v)}}else for(m=n.length/3,g=0;g<m;g++)k.set(n[3*g],n[3*g+1],n[3*g+2]),f(k,g)}else for(k=this.geometry.vertices,
+d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(g instanceof THREE.BufferGeometry){var m=g.attributes,n=m.position.array;if(void 0!==m.index){var m=m.index.array,q=g.offsets;0===q.length&&(q=[{start:0,count:m.length,index:0}]);for(var s=0,t=q.length;s<t;++s)for(var r=q[s].start,p=q[s].index,g=r,r=r+q[s].count;g<r;g++){var v=p+m[g];k.set(n[3*v],n[3*v+1],n[3*v+2]);f(k,v)}}else for(m=n.length/3,g=0;g<m;g++)k.set(n[3*g],n[3*g+1],n[3*g+2]),f(k,g)}else for(k=this.geometry.vertices,
 g=0;g<k.length;g++)f(k[g],g)}}}();THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));a.sortParticles=this.sortParticles;THREE.Object3D.prototype.clone.call(this,a);return a};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){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()});this.type=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);
 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),f instanceof THREE.Geometry))for(var f=f.vertices,h=f.length,k=new THREE.Vector3,m=new THREE.Vector3,n=this.type===THREE.LineStrip?
-1:2,r=0;r<h-1;r+=n)if(!(b.distanceSqToSegment(f[r],f[r+1],m,k)>g)){var s=b.origin.distanceTo(m);s<d.near||s>d.far||e.push({distance:s,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a};
+1:2,q=0;q<h-1;q+=n)if(!(b.distanceSqToSegment(f[q],f[q+1],m,k)>g)){var s=b.origin.distanceTo(m);s<d.near||s>d.far||e.push({distance:s,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.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.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.log("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;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==f.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(f.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var m=
-this.material;if(void 0!==m){var n=k.attributes,r,s,t=f.precision;if(void 0!==n.index){var q=n.index.array,p=n.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:q.length,index:0}]);for(var x=0,u=v.length;x<u;++x)for(var n=v[x].start,E=v[x].index,k=n,y=n+v[x].count;k<y;k+=3){n=E+q[k];r=E+q[k+1];s=E+q[k+2];d.set(p[3*n],p[3*n+1],p[3*n+2]);e.set(p[3*r],p[3*r+1],p[3*r+2]);g.set(p[3*s],p[3*s+1],p[3*s+2]);var z=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==
-THREE.DoubleSide);if(null!==z){z.applyMatrix4(this.matrixWorld);var B=f.ray.origin.distanceTo(z);B<t||B<f.near||B>f.far||h.push({distance:B,point:z,face:new THREE.Face3(n,r,s,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this})}}}else for(p=n.position.array,q=k=0,y=p.length;k<y;k+=3,q+=9)n=k,r=k+1,s=k+2,d.set(p[q],p[q+1],p[q+2]),e.set(p[q+3],p[q+4],p[q+5]),g.set(p[q+6],p[q+7],p[q+8]),z=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide),
-null!==z&&(z.applyMatrix4(this.matrixWorld),B=f.ray.origin.distanceTo(z),B<t||B<f.near||B>f.far||h.push({distance:B,point:z,face:new THREE.Face3(n,r,s,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(q=this.material instanceof THREE.MeshFaceMaterial,p=!0===q?this.material.materials:null,t=f.precision,v=k.vertices,x=0,u=k.faces.length;x<u;x++)if(E=k.faces[x],m=!0===q?p[E.materialIndex]:this.material,void 0!==m){n=v[E.a];r=v[E.b];s=v[E.c];if(!0===
-m.morphTargets){z=k.morphTargets;B=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var y=0,D=z.length;y<D;y++){var w=B[y];if(0!==w){var A=z[y].vertices;d.x+=(A[E.a].x-n.x)*w;d.y+=(A[E.a].y-n.y)*w;d.z+=(A[E.a].z-n.z)*w;e.x+=(A[E.b].x-r.x)*w;e.y+=(A[E.b].y-r.y)*w;e.z+=(A[E.b].z-r.z)*w;g.x+=(A[E.c].x-s.x)*w;g.y+=(A[E.c].y-s.y)*w;g.z+=(A[E.c].z-s.z)*w}}d.add(n);e.add(r);g.add(s);n=d;r=e;s=g}z=m.side===THREE.BackSide?b.intersectTriangle(s,r,n,!0):b.intersectTriangle(n,r,s,m.side!==
+this.material;if(void 0!==m){var n=k.attributes,q,s,t=f.precision;if(void 0!==n.index){var r=n.index.array,p=n.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:r.length,index:0}]);for(var x=0,u=v.length;x<u;++x)for(var n=v[x].start,E=v[x].index,k=n,y=n+v[x].count;k<y;k+=3){n=E+r[k];q=E+r[k+1];s=E+r[k+2];d.set(p[3*n],p[3*n+1],p[3*n+2]);e.set(p[3*q],p[3*q+1],p[3*q+2]);g.set(p[3*s],p[3*s+1],p[3*s+2]);var z=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==
+THREE.DoubleSide);if(null!==z){z.applyMatrix4(this.matrixWorld);var B=f.ray.origin.distanceTo(z);B<t||B<f.near||B>f.far||h.push({distance:B,point:z,face:new THREE.Face3(n,q,s,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this})}}}else for(p=n.position.array,r=k=0,y=p.length;k<y;k+=3,r+=9)n=k,q=k+1,s=k+2,d.set(p[r],p[r+1],p[r+2]),e.set(p[r+3],p[r+4],p[r+5]),g.set(p[r+6],p[r+7],p[r+8]),z=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide),
+null!==z&&(z.applyMatrix4(this.matrixWorld),B=f.ray.origin.distanceTo(z),B<t||B<f.near||B>f.far||h.push({distance:B,point:z,face:new THREE.Face3(n,q,s,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(r=this.material instanceof THREE.MeshFaceMaterial,p=!0===r?this.material.materials:null,t=f.precision,v=k.vertices,x=0,u=k.faces.length;x<u;x++)if(E=k.faces[x],m=!0===r?p[E.materialIndex]:this.material,void 0!==m){n=v[E.a];q=v[E.b];s=v[E.c];if(!0===
+m.morphTargets){z=k.morphTargets;B=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var y=0,D=z.length;y<D;y++){var w=B[y];if(0!==w){var A=z[y].vertices;d.x+=(A[E.a].x-n.x)*w;d.y+=(A[E.a].y-n.y)*w;d.z+=(A[E.a].z-n.z)*w;e.x+=(A[E.b].x-q.x)*w;e.y+=(A[E.b].y-q.y)*w;e.z+=(A[E.b].z-q.z)*w;g.x+=(A[E.c].x-s.x)*w;g.y+=(A[E.c].y-s.y)*w;g.z+=(A[E.c].z-s.z)*w}}d.add(n);e.add(q);g.add(s);n=d;q=e;s=g}z=m.side===THREE.BackSide?b.intersectTriangle(s,q,n,!0):b.intersectTriangle(n,q,s,m.side!==
 THREE.DoubleSide);null!==z&&(z.applyMatrix4(this.matrixWorld),B=f.ray.origin.distanceTo(z),B<t||B<f.near||B>f.far||h.push({distance:B,point:z,face:E,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.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
 this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
@@ -378,10 +379,10 @@ THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);THREE.Sprite.prot
 THREE.Scene=function(){THREE.Object3D.call(this);this.type="Scene";this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};
 THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};
-THREE.CanvasRenderer=function(a){function b(a,b,c,d){m(b);n(c);r(d);s(a.getStyle());M.stroke();xa.expandByScalar(2*b)}function c(a){t(a.getStyle());M.fill()}function d(a){e(a.target)}function e(a){if(!(a instanceof THREE.CompressedTexture)){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement("canvas");e.width=d.width;e.height=d.height;var f=e.getContext("2d");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);ob[a.id]=M.createPattern(e,!0===
-b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":!1===b&&!0===c?"repeat-y":"no-repeat")}}function g(a,b,c,f,g,h,k,m,n,q,s,p,r){if(!(r instanceof THREE.DataTexture)){!1===r.hasEventListener("update",d)&&(void 0!==r.image&&0<r.image.width&&e(r),r.addEventListener("update",d));var u=ob[r.id];if(void 0!==u){t(u);var u=r.offset.x/r.repeat.x,l=r.offset.y/r.repeat.y,v=r.image.width*r.repeat.x;r=r.image.height*r.repeat.y;k=(k+u)*v;m=(m+l)*r;c-=a;f-=b;g-=a;h-=b;n=(n+u)*v-k;q=(q+l)*r-m;s=(s+u)*v-k;p=(p+l)*r-m;
-r=n*p-s*q;0!==r&&(u=1/r,r=(p*c-q*g)*u,q=(p*f-q*h)*u,c=(n*g-s*c)*u,f=(n*h-s*f)*u,a=a-r*k-c*m,b=b-q*k-f*m,M.save(),M.transform(r,q,c,f,a,b),M.fill(),M.restore())}else t("rgba(0,0,0,1)"),M.fill()}}function f(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function h(a){T!==a&&(T=M.globalAlpha=a)}function k(a){L!==a&&(a===THREE.NormalBlending?M.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?M.globalCompositeOperation="lighter":
-a===THREE.SubtractiveBlending&&(M.globalCompositeOperation="darker"),L=a)}function m(a){Y!==a&&(Y=M.lineWidth=a)}function n(a){aa!==a&&(aa=M.lineCap=a)}function r(a){na!==a&&(na=M.lineJoin=a)}function s(a){V!==a&&(V=M.strokeStyle=a)}function t(a){J!==a&&(J=M.fillStyle=a)}function q(a){I.length!==a.length&&(M.setLineDash(a),I=a)}console.log("THREE.CanvasRenderer",THREE.REVISION);var p=THREE.Math.smoothstep;a=a||{};var v=this,x,u,E,y=new THREE.Projector,z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),
+THREE.CanvasRenderer=function(a){function b(a,b,c,d){m(b);n(c);q(d);s(a.getStyle());M.stroke();xa.expandByScalar(2*b)}function c(a){t(a.getStyle());M.fill()}function d(a){e(a.target)}function e(a){if(!(a instanceof THREE.CompressedTexture)){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement("canvas");e.width=d.width;e.height=d.height;var f=e.getContext("2d");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);ob[a.id]=M.createPattern(e,!0===
+b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":!1===b&&!0===c?"repeat-y":"no-repeat")}}function g(a,b,c,f,g,h,k,m,n,r,s,p,q){if(!(q instanceof THREE.DataTexture)){!1===q.hasEventListener("update",d)&&(void 0!==q.image&&0<q.image.width&&e(q),q.addEventListener("update",d));var u=ob[q.id];if(void 0!==u){t(u);var u=q.offset.x/q.repeat.x,l=q.offset.y/q.repeat.y,v=q.image.width*q.repeat.x;q=q.image.height*q.repeat.y;k=(k+u)*v;m=(m+l)*q;c-=a;f-=b;g-=a;h-=b;n=(n+u)*v-k;r=(r+l)*q-m;s=(s+u)*v-k;p=(p+l)*q-m;
+q=n*p-s*r;0!==q&&(u=1/q,q=(p*c-r*g)*u,r=(p*f-r*h)*u,c=(n*g-s*c)*u,f=(n*h-s*f)*u,a=a-q*k-c*m,b=b-r*k-f*m,M.save(),M.transform(q,r,c,f,a,b),M.fill(),M.restore())}else t("rgba(0,0,0,1)"),M.fill()}}function f(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function h(a){T!==a&&(T=M.globalAlpha=a)}function k(a){L!==a&&(a===THREE.NormalBlending?M.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?M.globalCompositeOperation="lighter":
+a===THREE.SubtractiveBlending&&(M.globalCompositeOperation="darker"),L=a)}function m(a){Y!==a&&(Y=M.lineWidth=a)}function n(a){aa!==a&&(aa=M.lineCap=a)}function q(a){na!==a&&(na=M.lineJoin=a)}function s(a){V!==a&&(V=M.strokeStyle=a)}function t(a){J!==a&&(J=M.fillStyle=a)}function r(a){I.length!==a.length&&(M.setLineDash(a),I=a)}console.log("THREE.CanvasRenderer",THREE.REVISION);var p=THREE.Math.smoothstep;a=a||{};var v=this,x,u,E,y=new THREE.Projector,z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),
 B=z.width,D=z.height,w=Math.floor(B/2),A=Math.floor(D/2),N=0,P=0,K=B,R=D,M=z.getContext("2d",{alpha:!0===a.alpha}),H=new THREE.Color(0),C=0,T=1,L=0,V=null,J=null,Y=null,aa=null,na=null,I=[],ba,Q,ca,Ga;new THREE.RenderableVertex;new THREE.RenderableVertex;var Ea,Oa,Pa,La,la,bb,sa=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var G=new THREE.Color,cb=new THREE.Color,jb=new THREE.Color,ob={},qa,oa,Za,Ha,ya,Ia,ua,ka=new THREE.Box2,da=new THREE.Box2,xa=new THREE.Box2,
 ta=new THREE.Color,Sa=new THREE.Color,pb=new THREE.Color,Na=new THREE.Vector3,Ca=new THREE.Vector3,ha=new THREE.Vector3,Qa=new THREE.Matrix3;void 0===M.setLineDash&&(M.setLineDash=function(){});this.domElement=z;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};
 this.setSize=function(a,b,c){B=a*this.devicePixelRatio;D=b*this.devicePixelRatio;z.width=B;z.height=D;w=Math.floor(B/2);A=Math.floor(D/2);!1!==c&&(z.style.width=a+"px",z.style.height=b+"px");ka.min.set(-w,-A);ka.max.set(w,A);da.min.set(-w,-A);da.max.set(w,A);T=1;L=0;na=aa=Y=J=V=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){N=a*this.devicePixelRatio;P=b*this.devicePixelRatio;K=c*this.devicePixelRatio;R=d*this.devicePixelRatio};this.setScissor=function(){};this.enableScissorTest=
@@ -391,8 +392,8 @@ else{!0===this.autoClear&&this.clear();v.info.render.vertices=0;v.info.render.fa
 for(T=u.length;L<T;L++){var H=u[L],J=H.material;if(void 0!==J&&0!==J.opacity){xa.makeEmpty();if(H instanceof THREE.RenderableSprite){Q=H;Q.x*=w;Q.y*=A;var C=Q,V=H,I=J;h(I.opacity);k(I.blending);var Y=V.scale.x*w,V=V.scale.y*A,H=0.5*Math.sqrt(Y*Y+V*V);xa.min.set(C.x-H,C.y-H);xa.max.set(C.x+H,C.y+H);if(I instanceof THREE.SpriteMaterial){var pa=I.map;if(null!==pa&&void 0!==pa.image){!1===pa.hasEventListener("update",d)&&(0<pa.image.width&&e(pa),pa.addEventListener("update",d));H=ob[pa.id];void 0!==H?
 t(H):t("rgba( 0, 0, 0, 1 )");var fa=pa.image,H=fa.width*pa.offset.x,J=fa.height*pa.offset.y,aa=fa.width*pa.repeat.x,pa=fa.height*pa.repeat.y,fa=Y/aa,na=V/pa;M.save();M.translate(C.x,C.y);0!==I.rotation&&M.rotate(I.rotation);M.translate(-Y/2,-V/2);M.scale(fa,na);M.translate(-H,-J);M.fillRect(H,J,aa,pa)}else t(I.color.getStyle()),M.save(),M.translate(C.x,C.y),0!==I.rotation&&M.rotate(I.rotation),M.scale(Y,-V),M.fillRect(-0.5,-0.5,1,1);M.restore()}else I instanceof THREE.SpriteCanvasMaterial&&(s(I.color.getStyle()),
 t(I.color.getStyle()),M.save(),M.translate(C.x,C.y),0!==I.rotation&&M.rotate(I.rotation),M.scale(Y,V),I.program(M),M.restore())}else if(H instanceof THREE.RenderableLine){if(Q=H.v1,ca=H.v2,Q.positionScreen.x*=w,Q.positionScreen.y*=A,ca.positionScreen.x*=w,ca.positionScreen.y*=A,xa.setFromPoints([Q.positionScreen,ca.positionScreen]),!0===ka.isIntersectionBox(xa))if(C=Q,I=ca,Y=H,V=J,h(V.opacity),k(V.blending),M.beginPath(),M.moveTo(C.positionScreen.x,C.positionScreen.y),M.lineTo(I.positionScreen.x,
-I.positionScreen.y),V instanceof THREE.LineBasicMaterial){m(V.linewidth);n(V.linecap);r(V.linejoin);if(V.vertexColors!==THREE.VertexColors)s(V.color.getStyle());else if(H=Y.vertexColors[0].getStyle(),Y=Y.vertexColors[1].getStyle(),H===Y)s(H);else{try{var l=M.createLinearGradient(C.positionScreen.x,C.positionScreen.y,I.positionScreen.x,I.positionScreen.y);l.addColorStop(0,H);l.addColorStop(1,Y)}catch(Ab){l=H}s(l)}M.stroke();xa.expandByScalar(2*V.linewidth)}else V instanceof THREE.LineDashedMaterial&&
-(m(V.linewidth),n(V.linecap),r(V.linejoin),s(V.color.getStyle()),q([V.dashSize,V.gapSize]),M.stroke(),xa.expandByScalar(2*V.linewidth),q([]))}else if(H instanceof THREE.RenderableFace){Q=H.v1;ca=H.v2;Ga=H.v3;if(-1>Q.positionScreen.z||1<Q.positionScreen.z)continue;if(-1>ca.positionScreen.z||1<ca.positionScreen.z)continue;if(-1>Ga.positionScreen.z||1<Ga.positionScreen.z)continue;Q.positionScreen.x*=w;Q.positionScreen.y*=A;ca.positionScreen.x*=w;ca.positionScreen.y*=A;Ga.positionScreen.x*=w;Ga.positionScreen.y*=
+I.positionScreen.y),V instanceof THREE.LineBasicMaterial){m(V.linewidth);n(V.linecap);q(V.linejoin);if(V.vertexColors!==THREE.VertexColors)s(V.color.getStyle());else if(H=Y.vertexColors[0].getStyle(),Y=Y.vertexColors[1].getStyle(),H===Y)s(H);else{try{var l=M.createLinearGradient(C.positionScreen.x,C.positionScreen.y,I.positionScreen.x,I.positionScreen.y);l.addColorStop(0,H);l.addColorStop(1,Y)}catch(Ab){l=H}s(l)}M.stroke();xa.expandByScalar(2*V.linewidth)}else V instanceof THREE.LineDashedMaterial&&
+(m(V.linewidth),n(V.linecap),q(V.linejoin),s(V.color.getStyle()),r([V.dashSize,V.gapSize]),M.stroke(),xa.expandByScalar(2*V.linewidth),r([]))}else if(H instanceof THREE.RenderableFace){Q=H.v1;ca=H.v2;Ga=H.v3;if(-1>Q.positionScreen.z||1<Q.positionScreen.z)continue;if(-1>ca.positionScreen.z||1<ca.positionScreen.z)continue;if(-1>Ga.positionScreen.z||1<Ga.positionScreen.z)continue;Q.positionScreen.x*=w;Q.positionScreen.y*=A;ca.positionScreen.x*=w;ca.positionScreen.y*=A;Ga.positionScreen.x*=w;Ga.positionScreen.y*=
 A;0<J.overdraw&&(f(Q.positionScreen,ca.positionScreen,J.overdraw),f(ca.positionScreen,Ga.positionScreen,J.overdraw),f(Ga.positionScreen,Q.positionScreen,J.overdraw));xa.setFromPoints([Q.positionScreen,ca.positionScreen,Ga.positionScreen]);if(!0===ka.isIntersectionBox(xa)){I=Q;Y=ca;V=Ga;C=J;v.info.render.vertices+=3;v.info.render.faces++;h(C.opacity);k(C.blending);Ea=I.positionScreen.x;Oa=I.positionScreen.y;Pa=Y.positionScreen.x;La=Y.positionScreen.y;la=V.positionScreen.x;bb=V.positionScreen.y;var J=
 Ea,aa=Oa,pa=Pa,fa=La,na=la,xb=bb;M.beginPath();M.moveTo(J,aa);M.lineTo(pa,fa);M.lineTo(na,xb);M.closePath();if((C instanceof THREE.MeshLambertMaterial||C instanceof THREE.MeshPhongMaterial)&&null===C.map){G.copy(C.color);cb.copy(C.emissive);C.vertexColors===THREE.FaceColors&&G.multiply(H.color);sa.copy(ta);Ca.copy(I.positionWorld).add(Y.positionWorld).add(V.positionWorld).divideScalar(3);I=Ca;Y=H.normalModel;V=sa;H=0;for(J=E.length;H<J;H++)aa=E[H],jb.copy(aa.color),aa instanceof THREE.DirectionalLight?
 (pa=Na.setFromMatrixPosition(aa.matrixWorld).normalize(),fa=Y.dot(pa),0>=fa||(fa*=aa.intensity,V.add(jb.multiplyScalar(fa)))):aa instanceof THREE.PointLight&&(pa=Na.setFromMatrixPosition(aa.matrixWorld),fa=Y.dot(Na.subVectors(pa,I).normalize()),0>=fa||(fa*=0==aa.distance?1:1-Math.min(I.distanceTo(pa)/aa.distance,1),0!=fa&&(fa*=aa.intensity,V.add(jb.multiplyScalar(fa)))));sa.multiply(G).add(cb);!0===C.wireframe?b(sa,C.wireframeLinewidth,C.wireframeLinecap,C.wireframeLinejoin):c(sa)}else C instanceof
@@ -465,11 +466,11 @@ THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.mate
 function c(a,b){var c=b.geometry,e=a.faces3,f=3*e.length,g=1*e.length,h=3*e.length,e=d(b,a);a.__vertexArray=new Float32Array(3*f);a.__normalArray=new Float32Array(3*f);a.__colorArray=new Float32Array(3*f);a.__uvArray=new Float32Array(2*f);1<c.faceVertexUvs.length&&(a.__uv2Array=new Float32Array(2*f));c.hasTangents&&(a.__tangentArray=new Float32Array(4*f));b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&(a.__skinIndexArray=new Float32Array(4*f),a.__skinWeightArray=new Float32Array(4*
 f));c=null!==Bb&&21845<g?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*g);a.__lineArray=new c(2*h);var k;if(a.numMorphTargets)for(a.__morphTargetsArrays=[],c=0,k=a.numMorphTargets;c<k;c++)a.__morphTargetsArrays.push(new Float32Array(3*f));if(a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0,k=a.numMorphNormals;c<k;c++)a.__morphNormalsArrays.push(new Float32Array(3*f));a.__webglFaceCount=3*g;a.__webglLineCount=2*h;if(e.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=
 []);for(var m in e.attributes){var g=e.attributes[m],h={},n;for(n in g)h[n]=g[n];if(!h.__webglInitialized||h.createUniqueBuffers)h.__webglInitialized=!0,c=1,"v2"===h.type?c=2:"v3"===h.type?c=3:"v4"===h.type?c=4:"c"===h.type&&(c=3),h.size=c,h.array=new Float32Array(f*c),h.buffer=l.createBuffer(),h.buffer.belongsToAttribute=m,g.needsUpdate=!0,h.__original=g;a.__webglCustomAttributesList.push(h)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:
-a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var g=0,k=b.length;g<k;g++){var m=b[g],n=e[m];if(0<=n){var q=c[m];void 0!==q?(m=q.itemSize,l.bindBuffer(l.ARRAY_BUFFER,q.buffer),f(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}function g(){for(var a=
-0,b=tb.length;a<b;a++)tb[a]=0}function f(a){tb[a]=1;0===Eb[a]&&(l.enableVertexAttribArray(a),Eb[a]=1)}function h(){for(var a=0,b=Eb.length;a<b;a++)Eb[a]!==tb[a]&&(l.disableVertexAttribArray(a),Eb[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function n(a,b){return b[0]-a[0]}function r(a,e,f){if(!1!==e.visible){e instanceof THREE.Light&&Pa.push(e);if(!(e instanceof THREE.Scene)){void 0===
+a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var g=0,k=b.length;g<k;g++){var m=b[g],n=e[m];if(0<=n){var r=c[m];void 0!==r?(m=r.itemSize,l.bindBuffer(l.ARRAY_BUFFER,r.buffer),f(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}function g(){for(var a=
+0,b=tb.length;a<b;a++)tb[a]=0}function f(a){tb[a]=1;0===Eb[a]&&(l.enableVertexAttribArray(a),Eb[a]=1)}function h(){for(var a=0,b=Eb.length;a<b;a++)Eb[a]!==tb[a]&&(l.disableVertexAttribArray(a),Eb[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function n(a,b){return b[0]-a[0]}function q(a,e,f){if(!1!==e.visible){e instanceof THREE.Light&&Pa.push(e);if(!(e instanceof THREE.Scene)){void 0===
 e.__webglInit&&(e.__webglInit=!0,e.addEventListener("dispose",Hc),e._modelViewMatrix=new THREE.Matrix4,e._normalMatrix=new THREE.Matrix3);var g=e.geometry;if(void 0!==g&&void 0===g.__webglInit&&(g.__webglInit=!0,g.addEventListener("dispose",Ic),!(g instanceof THREE.BufferGeometry)))if(e instanceof THREE.Mesh)void 0!==e.__webglActive&&y(e,a),v(a,e,g);else if(e instanceof THREE.Line){if(!g.__webglVertexBuffer){g.__webglVertexBuffer=l.createBuffer();g.__webglColorBuffer=l.createBuffer();g.__webglLineDistanceBuffer=
 l.createBuffer();G.info.memory.geometries++;var h=g.vertices.length;g.__vertexArray=new Float32Array(3*h);g.__colorArray=new Float32Array(3*h);g.__lineDistanceArray=new Float32Array(1*h);g.__webglLineCount=h;b(g,e);g.verticesNeedUpdate=!0;g.colorsNeedUpdate=!0;g.lineDistancesNeedUpdate=!0}}else if(e instanceof THREE.PointCloud&&!g.__webglVertexBuffer){g.__webglVertexBuffer=l.createBuffer();g.__webglColorBuffer=l.createBuffer();G.info.memory.geometries++;var k=g.vertices.length;g.__vertexArray=new Float32Array(3*
-k);g.__colorArray=new Float32Array(3*k);g.__sortArray=[];g.__webglParticleCount=k;b(g,e);g.verticesNeedUpdate=!0;g.colorsNeedUpdate=!0}if(void 0===e.__webglActive){if(e instanceof THREE.Mesh)if(g instanceof THREE.BufferGeometry)x(La,g,e);else{if(g instanceof THREE.Geometry)for(var m=0,q=g.geometryGroupsList.length;m<q;m++)x(La,g.geometryGroupsList[m],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?x(La,g,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&la.push({id:null,
+k);g.__colorArray=new Float32Array(3*k);g.__sortArray=[];g.__webglParticleCount=k;b(g,e);g.verticesNeedUpdate=!0;g.colorsNeedUpdate=!0}if(void 0===e.__webglActive){if(e instanceof THREE.Mesh)if(g instanceof THREE.BufferGeometry)x(La,g,e);else{if(g instanceof THREE.Geometry)for(var m=0,r=g.geometryGroupsList.length;m<r;m++)x(La,g.geometryGroupsList[m],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?x(La,g,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&la.push({id:null,
 object:e,opaque:null,transparent:null,z:0});e.__webglActive=!0}var s=La[e.id];if(s&&(!1===e.frustumCulled||!0===zc.intersectsObject(e))){var p=e.geometry,t,w,z;if(p instanceof THREE.BufferGeometry)for(var D=p.attributes,A=p.attributesKeys,B=0,C=A.length;B<C;B++){var L=A[B],H=D[L];void 0===H.buffer&&(H.buffer=l.createBuffer(),H.needsUpdate=!0);if(!0===H.needsUpdate){var N="index"===L?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(N,H.buffer);l.bufferData(N,H.array,l.STATIC_DRAW);H.needsUpdate=
 !1}}else if(e instanceof THREE.Mesh){(p.buffersNeedUpdate||p.groupsNeedUpdate)&&v(a,e,p);for(var P=0,I=p.geometryGroupsList.length;P<I;P++)if(t=p.geometryGroupsList[P],z=d(e,t),(p.buffersNeedUpdate||p.groupsNeedUpdate)&&c(t,e),w=z.attributes&&u(z),p.verticesNeedUpdate||p.morphTargetsNeedUpdate||p.elementsNeedUpdate||p.uvsNeedUpdate||p.normalsNeedUpdate||p.colorsNeedUpdate||p.tangentsNeedUpdate||w){var K=t,T=e,M=l.DYNAMIC_DRAW,R=!p.dynamic,V=z;if(K.__inittedArrays){var Ga=V&&void 0!==V.shading&&V.shading===
 THREE.SmoothShading,U=void 0,J=void 0,Y=void 0,Q=void 0,ca=void 0,Ea=void 0,aa=void 0,Oa=void 0,da=void 0,fa=void 0,qa=void 0,ia=void 0,ja=void 0,ga=void 0,oa=void 0,na=void 0,lc=void 0,S=void 0,ba=void 0,mc=void 0,ha=void 0,Aa=void 0,ua=void 0,xa=void 0,cb=void 0,nc=void 0,Ha=void 0,ya=void 0,oc=void 0,Ra=void 0,Za=void 0,Ja=void 0,Ia=void 0,ta=void 0,$a=void 0,Na=void 0,ka=void 0,Ca=void 0,Qa=void 0,Sa=void 0,kb=0,ub=0,jb=0,Fb=0,Gb=0,qb=0,Ya=0,lb=0,Wa=0,wa=0,Ma=0,O=0,ab=void 0,mb=K.__vertexArray,
@@ -497,15 +498,15 @@ pc=p.colorsNeedUpdate,Sb=p.__webglCustomAttributesList,yb,hc,ma,zb,za,Z;if(e.sor
 za.x,Z.array[$+1]=za.y,Z.array[$+2]=za.z,Z.array[$+3]=za.w,$+=4}else{if(kc)for(ib=0;ib<Ec;ib++)Kb=vc[ib],$=3*ib,cc[$]=Kb.x,cc[$+1]=Kb.y,cc[$+2]=Kb.z;if(pc)for(Jb=0;Jb<jc;Jb++)Wb=Fc[Jb],$=3*Jb,dc[$]=Wb.r,dc[$+1]=Wb.g,dc[$+2]=Wb.b;if(Sb)for(yb=0,hc=Sb.length;yb<hc;yb++)if(Z=Sb[yb],Z.needsUpdate&&(void 0===Z.boundTo||"vertices"===Z.boundTo))if(zb=Z.value.length,$=0,1===Z.size)for(ma=0;ma<zb;ma++)Z.array[ma]=Z.value[ma];else if(2===Z.size)for(ma=0;ma<zb;ma++)za=Z.value[ma],Z.array[$]=za.x,Z.array[$+1]=
 za.y,$+=2;else if(3===Z.size)if("c"===Z.type)for(ma=0;ma<zb;ma++)za=Z.value[ma],Z.array[$]=za.r,Z.array[$+1]=za.g,Z.array[$+2]=za.b,$+=3;else for(ma=0;ma<zb;ma++)za=Z.value[ma],Z.array[$]=za.x,Z.array[$+1]=za.y,Z.array[$+2]=za.z,$+=3;else if(4===Z.size)for(ma=0;ma<zb;ma++)za=Z.value[ma],Z.array[$]=za.x,Z.array[$+1]=za.y,Z.array[$+2]=za.z,Z.array[$+3]=za.w,$+=4}if(kc||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,p.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,cc,Dc);if(pc||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,
 p.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,dc,Dc);if(Sb)for(yb=0,hc=Sb.length;yb<hc;yb++)if(Z=Sb[yb],Z.needsUpdate||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,Z.buffer),l.bufferData(l.ARRAY_BUFFER,Z.array,Dc)}p.verticesNeedUpdate=!1;p.colorsNeedUpdate=!1;z.attributes&&E(z)}for(var ec=0,Gc=s.length;ec<Gc;ec++){var wc=s[ec],Xb=wc,qc=Xb.object,xc=Xb.buffer,yc=qc.geometry,Yb=qc.material;Yb instanceof THREE.MeshFaceMaterial?(Yb=Yb.materials[yc instanceof THREE.BufferGeometry?0:xc.materialIndex],
-Xb.material=Yb,Yb.transparent?sa.push(Xb):bb.push(Xb)):Yb&&(Xb.material=Yb,Yb.transparent?sa.push(Xb):bb.push(Xb));wc.render=!0;!0===G.sortObjects&&(null!==e.renderDepth?wc.z=e.renderDepth:(pa.setFromMatrixPosition(e.matrixWorld),pa.applyProjection(tc),wc.z=pa.z))}}}ec=0;for(Gc=e.children.length;ec<Gc;ec++)r(a,e.children[ec],f)}}function s(a,b,c){if(0!==a.length)for(var d=0,e=a.length;d<e;d++)Za=jb=null,qa=oa=Ia=ya=Sa=ta=ua=-1,Ub=!0,a[d].render(b,c,Zb,jc),Za=jb=null,qa=oa=Ia=ya=Sa=ta=ua=-1,Ub=!0}
-function t(a,b,c,d,e,g){for(var f,h,k,l=a.length-1;-1!==l;l--){f=a[l];h=f.object;k=f.buffer;w(h,b);if(g)f=g;else{f=f.material;if(!f)continue;e&&G.setBlending(f.blending,f.blendEquation,f.blendSrc,f.blendDst);G.setDepthTest(f.depthTest);G.setDepthWrite(f.depthWrite);K(f.polygonOffset,f.polygonOffsetFactor,f.polygonOffsetUnits)}G.setMaterialFaces(f);k instanceof THREE.BufferGeometry?G.renderBufferDirect(b,c,d,f,k,h):G.renderBuffer(b,c,d,f,k,h)}}function q(a,b,c,d,e,f,g){for(var h,k,l=0,m=a.length;l<
+Xb.material=Yb,Yb.transparent?sa.push(Xb):bb.push(Xb)):Yb&&(Xb.material=Yb,Yb.transparent?sa.push(Xb):bb.push(Xb));wc.render=!0;!0===G.sortObjects&&(null!==e.renderDepth?wc.z=e.renderDepth:(pa.setFromMatrixPosition(e.matrixWorld),pa.applyProjection(tc),wc.z=pa.z))}}}ec=0;for(Gc=e.children.length;ec<Gc;ec++)q(a,e.children[ec],f)}}function s(a,b,c){if(0!==a.length)for(var d=0,e=a.length;d<e;d++)Za=jb=null,qa=oa=Ia=ya=Sa=ta=ua=-1,Ub=!0,a[d].render(b,c,Zb,jc),Za=jb=null,qa=oa=Ia=ya=Sa=ta=ua=-1,Ub=!0}
+function t(a,b,c,d,e,g){for(var f,h,k,l=a.length-1;-1!==l;l--){f=a[l];h=f.object;k=f.buffer;w(h,b);if(g)f=g;else{f=f.material;if(!f)continue;e&&G.setBlending(f.blending,f.blendEquation,f.blendSrc,f.blendDst);G.setDepthTest(f.depthTest);G.setDepthWrite(f.depthWrite);K(f.polygonOffset,f.polygonOffsetFactor,f.polygonOffsetUnits)}G.setMaterialFaces(f);k instanceof THREE.BufferGeometry?G.renderBufferDirect(b,c,d,f,k,h):G.renderBuffer(b,c,d,f,k,h)}}function r(a,b,c,d,e,f,g){for(var h,k,l=0,m=a.length;l<
 m;l++)if(h=a[l],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&G.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);G.setDepthTest(h.depthTest);G.setDepthWrite(h.depthWrite);K(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}G.renderImmediateObject(c,d,e,h,k)}}function p(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function v(a,b,d){var e=!1;a=b.material;if(void 0===d.geometryGroups||d.groupsNeedUpdate)delete La[b.id],
 d.makeGroups(a instanceof THREE.MeshFaceMaterial,Bb?4294967296:65535),d.groupsNeedUpdate=!1;for(var f=0,g=d.geometryGroupsList.length;f<g;f++){a=d.geometryGroupsList[f];if(a.__webglVertexBuffer)e=!1;else{e=a;e.__webglVertexBuffer=l.createBuffer();e.__webglNormalBuffer=l.createBuffer();e.__webglTangentBuffer=l.createBuffer();e.__webglColorBuffer=l.createBuffer();e.__webglUVBuffer=l.createBuffer();e.__webglUV2Buffer=l.createBuffer();e.__webglSkinIndicesBuffer=l.createBuffer();e.__webglSkinWeightsBuffer=
 l.createBuffer();e.__webglFaceBuffer=l.createBuffer();e.__webglLineBuffer=l.createBuffer();var h=void 0,k=void 0;if(e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],h=0,k=e.numMorphTargets;h<k;h++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],h=0,k=e.numMorphNormals;h<k;h++)e.__webglMorphNormalsBuffers.push(l.createBuffer());G.info.memory.geometries++;c(a,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=
 !0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=!0;e=d.colorsNeedUpdate=!0}(e||void 0===b.__webglActive)&&x(La,a,b)}b.__webglActive=!0}function x(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function u(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function E(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function y(a){if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete La[a.id];
 else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=la,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglActive}function z(a,b,c,d,e){var f,g,h,k;Ha=0;if(d.needsUpdate){d.program&&pc(d);d.addEventListener("dispose",qc);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof THREE.MeshLambertMaterial?m="lambert":d instanceof THREE.MeshPhongMaterial?
-m="phong":d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=0,q=0,s=0,r=0,t=0,u=b.length;t<u;t++){var v=b[t];v.onlyShadow||!1===
-v.visible||(v instanceof THREE.DirectionalLight&&p++,v instanceof THREE.PointLight&&q++,v instanceof THREE.SpotLight&&s++,v instanceof THREE.HemisphereLight&&r++)}f=p;g=q;h=s;k=r;for(var x,y=0,w=0,E=b.length;w<E;w++){var z=b[w];z.castShadow&&(z instanceof THREE.SpotLight&&y++,z instanceof THREE.DirectionalLight&&!z.shadowCascade&&y++)}x=y;var C;if(ic&&e&&e.skeleton&&e.skeleton.useVertexTexture)C=1024;else{var K=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),H=Math.floor((K-20)/4);void 0!==e&&e instanceof
+m="phong":d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=0,r=0,s=0,q=0,t=0,u=b.length;t<u;t++){var v=b[t];v.onlyShadow||!1===
+v.visible||(v instanceof THREE.DirectionalLight&&p++,v instanceof THREE.PointLight&&r++,v instanceof THREE.SpotLight&&s++,v instanceof THREE.HemisphereLight&&q++)}f=p;g=r;h=s;k=q;for(var x,y=0,w=0,E=b.length;w<E;w++){var z=b[w];z.castShadow&&(z instanceof THREE.SpotLight&&y++,z instanceof THREE.DirectionalLight&&!z.shadowCascade&&y++)}x=y;var C;if(ic&&e&&e.skeleton&&e.skeleton.useVertexTexture)C=1024;else{var K=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),H=Math.floor((K-20)/4);void 0!==e&&e instanceof
 THREE.SkinnedMesh&&(H=Math.min(e.skeleton.bones.length,H),H<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+H+" (try OpenGL instead of ANGLE)"));C=H}var P={precision:Y,supportsVertexTextures:rc,map:!!d.map,envMap:!!d.envMap,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,
 logarithmicDepthBuffer:Ga,skinning:d.skinning,maxBones:C,useVertexTexture:ic&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:G.maxMorphTargets,maxMorphNormals:G.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:x,shadowMapEnabled:G.shadowMapEnabled&&e.receiveShadow&&0<x,shadowMapType:G.shadowMapType,shadowMapDebug:G.shadowMapDebug,shadowMapCascade:G.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,
 wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},J=[];m?J.push(m):(J.push(d.fragmentShader),J.push(d.vertexShader));if(void 0!==d.defines)for(var I in d.defines)J.push(I),J.push(d.defines[I]);for(I in P)J.push(I),J.push(P[I]);for(var T=J.join(),Q,aa=0,Ea=cb.length;aa<Ea;aa++){var ca=cb[aa];if(ca.code===T){Q=ca;Q.usedTimes++;break}}void 0===Q&&(Q=new THREE.WebGLProgram(G,T,d,P),cb.push(Q),G.info.memory.programs=cb.length);d.program=Q;var Pa=Q.attributes;
@@ -562,24 +563,24 @@ else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRen
 l.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&l.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&l.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&l.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&l.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&l.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&l.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[b].buffer);
 G.info.memory.geometries--},pc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=cb.length;a<c;a++)if(d=cb[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=cb.length;a<c;a++)d=cb[a],d.program!==b&&e.push(d);cb=e;l.deleteProgram(b);G.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){g();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&
 (a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),f(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
-e,k,m,n,p,q,s,r,t,u,v=3*a.count;for(u=0;u<v;u+=9)t=a.normalArray,d=t[u],e=t[u+1],k=t[u+2],m=t[u+3],p=t[u+4],s=t[u+5],n=t[u+6],q=t[u+7],r=t[u+8],d=(d+m+n)/3,e=(e+p+q)/3,k=(k+s+r)/3,t[u]=d,t[u+1]=e,t[u+2]=k,t[u+3]=d,t[u+4]=e,t[u+5]=k,t[u+6]=d,t[u+7]=e,t[u+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);f(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,
+e,k,m,n,p,r,s,q,t,u,v=3*a.count;for(u=0;u<v;u+=9)t=a.normalArray,d=t[u],e=t[u+1],k=t[u+2],m=t[u+3],p=t[u+4],s=t[u+5],n=t[u+6],r=t[u+7],q=t[u+8],d=(d+m+n)/3,e=(e+p+r)/3,k=(k+s+q)/3,t[u]=d,t[u+1]=e,t[u+2]=k,t[u+3]=d,t[u+4]=e,t[u+5]=k,t[u+6]=d,t[u+7]=e,t[u+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);f(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,
 l.DYNAMIC_DRAW),f(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),f(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));h();l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,f,h){if(!1!==d.visible)if(a=z(a,b,c,d,h),b=!1,c=16777215*f.id+2*a.id+(d.wireframe?
-1:0),c!==oa&&(oa=c,b=!0),b&&g(),h instanceof THREE.Mesh)if(c=f.attributes.index){var k,m;c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2);var n=f.offsets;if(0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(l.TRIANGLES,c.array.length,k,0),G.info.render.calls++,G.info.render.vertices+=c.array.length,G.info.render.faces+=c.array.length/3;else{b=!0;for(var p=0,q=n.length;p<q;p++){var s=n[p].index;b&&(e(d,a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
+1:0),c!==oa&&(oa=c,b=!0),b&&g(),h instanceof THREE.Mesh)if(c=f.attributes.index){var k,m;c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2);var n=f.offsets;if(0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(l.TRIANGLES,c.array.length,k,0),G.info.render.calls++,G.info.render.vertices+=c.array.length,G.info.render.faces+=c.array.length/3;else{b=!0;for(var p=0,r=n.length;p<r;p++){var s=n[p].index;b&&(e(d,a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
 c.buffer));l.drawElements(l.TRIANGLES,n[p].count,k,n[p].start*m);G.info.render.calls++;G.info.render.vertices+=n[p].count;G.info.render.faces+=n[p].count/3}}}else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(l.TRIANGLES,0,d.array.length/3),G.info.render.calls++,G.info.render.vertices+=d.array.length/3,G.info.render.faces+=d.array.length/9;else if(h instanceof THREE.PointCloud)b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(l.POINTS,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=
-d.array.length/3;else if(h instanceof THREE.Line)if(h=h.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,P(d.linewidth),c=f.attributes.index)if(c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=f.offsets,0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),G.info.render.calls++,G.info.render.vertices+=c.array.length;else for(1<n.length&&(b=!0),p=0,q=n.length;p<q;p++)s=n[p].index,b&&(e(d,a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
+d.array.length/3;else if(h instanceof THREE.Line)if(h=h.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,P(d.linewidth),c=f.attributes.index)if(c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=f.offsets,0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),G.info.render.calls++,G.info.render.vertices+=c.array.length;else for(1<n.length&&(b=!0),p=0,r=n.length;p<r;p++)s=n[p].index,b&&(e(d,a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,
 c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),G.info.render.calls++,G.info.render.vertices+=n[p].count;else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(h,0,d.array.length/3),G.info.render.calls++,G.info.render.points+=d.array.length/3};this.renderBuffer=function(a,b,c,d,e,k){if(!1!==d.visible){var m,p;c=z(a,b,c,d,k);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==oa&&(oa=c,a=!0);a&&g();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),
-f(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length){var q=0;p=k.morphTargetForcedOrder;
-for(m=k.morphTargetInfluences;q<d.numSupportedMorphTargets&&q<p.length;)0<=c["morphTarget"+q]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[p[q]]),f(c["morphTarget"+q]),l.vertexAttribPointer(c["morphTarget"+q],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+q]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[p[q]]),f(c["morphNormal"+q]),l.vertexAttribPointer(c["morphNormal"+q],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[q]=m[p[q]],q++}else{p=[];m=k.morphTargetInfluences;
-var s,t=m.length;for(s=0;s<t;s++)q=m[s],0<q&&p.push([q,s]);p.length>d.numSupportedMorphTargets?(p.sort(n),p.length=d.numSupportedMorphTargets):p.length>d.numSupportedMorphNormals?p.sort(n):0===p.length&&p.push([0,0]);for(q=0;q<d.numSupportedMorphTargets;)p[q]?(s=p[q][1],0<=c["morphTarget"+q]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[s]),f(c["morphTarget"+q]),l.vertexAttribPointer(c["morphTarget"+q],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+q]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,
-e.__webglMorphNormalsBuffers[s]),f(c["morphNormal"+q]),l.vertexAttribPointer(c["morphNormal"+q],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[q]=m[s]):k.__webglMorphTargetInfluences[q]=0,q++}null!==d.program.uniforms.morphTargetInfluences&&l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(m=0,p=e.__webglCustomAttributesList.length;m<p;m++)c=e.__webglCustomAttributesList[m],0<=b[c.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,
+f(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length){var r=0;p=k.morphTargetForcedOrder;
+for(m=k.morphTargetInfluences;r<d.numSupportedMorphTargets&&r<p.length;)0<=c["morphTarget"+r]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[p[r]]),f(c["morphTarget"+r]),l.vertexAttribPointer(c["morphTarget"+r],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+r]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[p[r]]),f(c["morphNormal"+r]),l.vertexAttribPointer(c["morphNormal"+r],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[r]=m[p[r]],r++}else{p=[];m=k.morphTargetInfluences;
+var s,t=m.length;for(s=0;s<t;s++)r=m[s],0<r&&p.push([r,s]);p.length>d.numSupportedMorphTargets?(p.sort(n),p.length=d.numSupportedMorphTargets):p.length>d.numSupportedMorphNormals?p.sort(n):0===p.length&&p.push([0,0]);for(r=0;r<d.numSupportedMorphTargets;)p[r]?(s=p[r][1],0<=c["morphTarget"+r]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[s]),f(c["morphTarget"+r]),l.vertexAttribPointer(c["morphTarget"+r],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+r]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,
+e.__webglMorphNormalsBuffers[s]),f(c["morphNormal"+r]),l.vertexAttribPointer(c["morphNormal"+r],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[r]=m[s]):k.__webglMorphTargetInfluences[r]=0,r++}null!==d.program.uniforms.morphTargetInfluences&&l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(m=0,p=e.__webglCustomAttributesList.length;m<p;m++)c=e.__webglCustomAttributesList[m],0<=b[c.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,
 c.buffer),f(b[c.buffer.belongsToAttribute]),l.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,l.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglColorBuffer),f(b.color),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglNormalBuffer),f(b.normal),l.vertexAttribPointer(b.normal,
 3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglTangentBuffer),f(b.tangent),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUVBuffer),f(b.uv),l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUV2Buffer),f(b.uv2),l.vertexAttribPointer(b.uv2,
 2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),f(b.skinIndex),l.vertexAttribPointer(b.skinIndex,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),f(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglLineDistanceBuffer),f(b.lineDistance),l.vertexAttribPointer(b.lineDistance,
 1,l.FLOAT,!1,0,0))}h();k instanceof THREE.Mesh?(k=e.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(P(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),G.info.render.calls++,G.info.render.vertices+=e.__webglFaceCount,G.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=
 k.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,P(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),G.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),G.info.render.calls++,G.info.render.points+=e.__webglParticleCount)}};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,f,g,h=a.fog;qa=-1;Za=null;Ub=!0;!0===a.autoUpdate&&a.updateMatrixWorld();
-void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);tc.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);zc.setFromMatrix(tc);Pa.length=0;bb.length=0;sa.length=0;r(a,a,b);!0===G.sortObjects&&(bb.sort(k),sa.sort(m));s(this.renderPluginsPre,a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;G.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&
-this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(e=la.length;d<e;d++)f=la[d],g=f.object,g.visible&&(w(g,b),p(f));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),K(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),t(bb,b,Pa,h,!0,d),t(sa,b,Pa,h,!0,d),q(la,"",b,Pa,h,!1,d)):(d=null,this.setBlending(THREE.NoBlending),t(bb,b,Pa,h,!1,d),q(la,
-"opaque",b,Pa,h,!1,d),t(sa,b,Pa,h,!0,d),q(la,"transparent",b,Pa,h,!0,d));s(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&C(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=z(a,b,c,d,e);oa=-1;G.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,zc):e.render(function(a){G.renderBufferImmediate(a,f,d)})};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
+void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);tc.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);zc.setFromMatrix(tc);Pa.length=0;bb.length=0;sa.length=0;q(a,a,b);!0===G.sortObjects&&(bb.sort(k),sa.sort(m));s(this.renderPluginsPre,a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;G.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&
+this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);d=0;for(e=la.length;d<e;d++)f=la[d],g=f.object,g.visible&&(w(g,b),p(f));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),K(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),t(bb,b,Pa,h,!0,d),t(sa,b,Pa,h,!0,d),r(la,"",b,Pa,h,!1,d)):(d=null,this.setBlending(THREE.NoBlending),t(bb,b,Pa,h,!1,d),r(la,
+"opaque",b,Pa,h,!1,d),t(sa,b,Pa,h,!0,d),r(la,"transparent",b,Pa,h,!0,d));s(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&C(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=z(a,b,c,d,e);oa=-1;G.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,zc):e.render(function(a){G.renderBufferImmediate(a,f,d)})};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
 this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;ya!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),ya=b);Ia!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Ia=a)};this.setDepthTest=
 function(a){ta!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),ta=a)};this.setDepthWrite=function(a){Sa!==a&&(l.depthMask(a),Sa=a)};this.setBlending=function(a,b,c,d){a!==ua&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),
 l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),ua=a);if(a===THREE.CustomBlending){if(b!==ka&&(l.blendEquation(L(b)),ka=b),c!==da||d!==xa)l.blendFunc(L(c),L(d)),da=c,xa=d}else xa=da=ka=null};this.uploadTexture=function(a){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",sc),a.__webglTexture=l.createTexture(),
@@ -594,15 +595,15 @@ THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.
 THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=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.WebGLProgram=function(){var a=0;return function(b,c,d,e){var g=b.context,f=d.defines,h=d.__webglShader.uniforms,k=d.attributes,m=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,r=d.index0AttributeName;void 0===r&&!0===e.morphTargets&&(r="position");var s="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?s="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(s="SHADOWMAP_TYPE_PCF_SOFT");var t,q;t=[];for(var p in f)q=f[p],!1!==q&&(q="#define "+p+" "+q,t.push(q));
+THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var g=b.context,f=d.defines,h=d.__webglShader.uniforms,k=d.attributes,m=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var s="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?s="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(s="SHADOWMAP_TYPE_PCF_SOFT");var t,r;t=[];for(var p in f)r=f[p],!1!==r&&(r="#define "+p+" "+r,t.push(r));
 t=t.join("\n");f=g.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",t,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+
 e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND":
 "",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+s:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"),
 b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",t,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG":
 "",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":
-"",e.shadowMapEnabled?"#define "+s:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));m=new THREE.WebGLShader(g,g.VERTEX_SHADER,d+m);n=new THREE.WebGLShader(g,g.FRAGMENT_SHADER,b+n);g.attachShader(f,m);g.attachShader(f,n);void 0!==r&&g.bindAttribLocation(f,0,r);g.linkProgram(f);!1===g.getProgramParameter(f,g.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),
-console.error("gl.VALIDATE_STATUS",g.getProgramParameter(f,g.VALIDATE_STATUS)),console.error("gl.getError()",g.getError()));""!==g.getProgramInfoLog(f)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",g.getProgramInfoLog(f));g.deleteShader(m);g.deleteShader(n);r="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");e.useVertexTexture?(r.push("boneTexture"),r.push("boneTextureWidth"),r.push("boneTextureHeight")):
-r.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&r.push("logDepthBufFC");for(var v in h)r.push(v);h=r;v={};r=0;for(b=h.length;r<b;r++)s=h[r],v[s]=g.getUniformLocation(f,s);this.uniforms=v;r="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)r.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)r.push("morphNormal"+h);for(var x in k)r.push(x);e=r;k={};x=0;for(h=e.length;x<h;x++)v=e[x],k[v]=g.getAttribLocation(f,v);this.attributes=
+"",e.shadowMapEnabled?"#define "+s:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));m=new THREE.WebGLShader(g,g.VERTEX_SHADER,d+m);n=new THREE.WebGLShader(g,g.FRAGMENT_SHADER,b+n);g.attachShader(f,m);g.attachShader(f,n);void 0!==q&&g.bindAttribLocation(f,0,q);g.linkProgram(f);!1===g.getProgramParameter(f,g.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),
+console.error("gl.VALIDATE_STATUS",g.getProgramParameter(f,g.VALIDATE_STATUS)),console.error("gl.getError()",g.getError()));""!==g.getProgramInfoLog(f)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",g.getProgramInfoLog(f));g.deleteShader(m);g.deleteShader(n);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):
+q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;q<b;q++)s=h[q],v[s]=g.getUniformLocation(f,s);this.uniforms=v;q="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)q.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)q.push("morphNormal"+h);for(var x in k)q.push(x);e=q;k={};x=0;for(h=e.length;x<h;x++)v=e[x],k[v]=g.getAttribLocation(f,v);this.attributes=
 k;this.attributesKeys=Object.keys(this.attributes);this.id=a++;this.code=c;this.usedTimes=1;this.program=f;this.vertexShader=m;this.fragmentShader=n;return this}}();
 THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){c=b.createShader(c);b.shaderSource(c,d);b.compileShader(c);!1===b.getShaderParameter(c,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(c)&&(console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",b.getShaderInfoLog(c)),console.warn(a(d)));return c}}();
 THREE.RenderableVertex=function(){this.position=new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
@@ -611,18 +612,18 @@ THREE.RenderableSprite=function(){this.id=0;this.object=null;this.rotation=this.
 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);g.flipY=!1;var 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))})};d=0;for(var h=a.length;d<h;++d)b(d);return g},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,g=document.createElement("canvas");
-g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,k=f.createImageData(d,e),m=k.data,n=0;n<d;n++)for(var r=0;r<e;r++){var s=0>r-1?0:r-1,t=r+1>e-1?e-1:r+1,q=0>n-1?0:n-1,p=n+1>d-1?d-1:n+1,v=[],x=[0,0,h[4*(r*d+n)]/255*b];v.push([-1,0,h[4*(r*d+q)]/255*b]);v.push([-1,-1,h[4*(s*d+q)]/255*b]);v.push([0,-1,h[4*(s*d+n)]/255*b]);v.push([1,-1,h[4*(s*d+p)]/255*b]);v.push([1,0,h[4*(r*d+p)]/255*b]);v.push([1,1,h[4*(t*d+p)]/255*b]);v.push([0,1,h[4*(t*d+n)]/255*
-b]);v.push([-1,1,h[4*(t*d+q)]/255*b]);s=[];q=v.length;for(t=0;t<q;t++){var p=v[t],u=v[(t+1)%q],p=[p[0]-x[0],p[1]-x[1],p[2]-x[2]],u=[u[0]-x[0],u[1]-x[1],u[2]-x[2]];s.push(c([p[1]*u[2]-p[2]*u[1],p[2]*u[0]-p[0]*u[2],p[0]*u[1]-p[1]*u[0]]))}v=[0,0,0];for(t=0;t<s.length;t++)v[0]+=s[t][0],v[1]+=s[t][1],v[2]+=s[t][2];v[0]/=s.length;v[1]/=s.length;v[2]/=s.length;x=4*(r*d+n);m[x]=(v[0]+1)/2*255|0;m[x+1]=(v[1]+1)/2*255|0;m[x+2]=255*v[2]|0;m[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),m=k.data,n=0;n<d;n++)for(var q=0;q<e;q++){var s=0>q-1?0:q-1,t=q+1>e-1?e-1:q+1,r=0>n-1?0:n-1,p=n+1>d-1?d-1:n+1,v=[],x=[0,0,h[4*(q*d+n)]/255*b];v.push([-1,0,h[4*(q*d+r)]/255*b]);v.push([-1,-1,h[4*(s*d+r)]/255*b]);v.push([0,-1,h[4*(s*d+n)]/255*b]);v.push([1,-1,h[4*(s*d+p)]/255*b]);v.push([1,0,h[4*(q*d+p)]/255*b]);v.push([1,1,h[4*(t*d+p)]/255*b]);v.push([0,1,h[4*(t*d+n)]/255*
+b]);v.push([-1,1,h[4*(t*d+r)]/255*b]);s=[];r=v.length;for(t=0;t<r;t++){var p=v[t],u=v[(t+1)%r],p=[p[0]-x[0],p[1]-x[1],p[2]-x[2]],u=[u[0]-x[0],u[1]-x[1],u[2]-x[2]];s.push(c([p[1]*u[2]-p[2]*u[1],p[2]*u[0]-p[0]*u[2],p[0]*u[1]-p[1]*u[0]]))}v=[0,0,0];for(t=0;t<s.length;t++)v[0]+=s[t][0],v[1]+=s[t][1],v[2]+=s[t][2];v[0]/=s.length;v[1]/=s.length;v[2]/=s.length;x=4*(q*d+n);m[x]=(v[0]+1)/2*255|0;m[x+1]=(v[1]+1)/2*255|0;m[x+2]=255*v[2]|0;m[x+3]=255}f.putImageData(k,0,0);return g},generateDataTexture:function(a,
 b,c){var d=a*b,e=new Uint8Array(3*d),g=Math.floor(255*c.r),f=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=g,e[3*h+1]=f,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
 THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
 THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing.";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=
-a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),g=e.length,f=[];for(a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,k,m,n,r,s,t,q,p,v,x=b.glyphs[a]||b.glyphs["?"];if(x){if(x.o)for(b=x._cachedOutline||(x._cachedOutline=x.o.split(" ")),m=b.length,a=0;a<m;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
-break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;t=b[a++]*c+d;q=b[a++]*c;e.quadraticCurveTo(t,q,k,n);if(f=g[g.length-1])for(r=f.x,s=f.y,f=1,h=this.divisions;f<=h;f++){var u=f/h;THREE.Shape.Utils.b2(u,r,t,k);THREE.Shape.Utils.b2(u,s,q,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,t=b[a++]*c+d,q=b[a++]*c,p=b[a++]*c+d,v=b[a++]*c,e.bezierCurveTo(t,q,p,v,k,n),f=g[g.length-1])for(r=f.x,s=f.y,f=1,h=this.divisions;f<=h;f++)u=f/h,THREE.Shape.Utils.b3(u,r,t,p,k),THREE.Shape.Utils.b3(u,
-s,q,v,n)}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,m,n,q,s,t,r,p,v,x=b.glyphs[a]||b.glyphs["?"];if(x){if(x.o)for(b=x._cachedOutline||(x._cachedOutline=x.o.split(" ")),m=b.length,a=0;a<m;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
+break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;t=b[a++]*c+d;r=b[a++]*c;e.quadraticCurveTo(t,r,k,n);if(f=g[g.length-1])for(q=f.x,s=f.y,f=1,h=this.divisions;f<=h;f++){var u=f/h;THREE.Shape.Utils.b2(u,q,t,k);THREE.Shape.Utils.b2(u,s,r,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,t=b[a++]*c+d,r=b[a++]*c,p=b[a++]*c+d,v=b[a++]*c,e.bezierCurveTo(t,r,p,v,k,n),f=g[g.length-1])for(q=f.x,s=f.y,f=1,h=this.divisions;f<=h;f++)u=f/h,THREE.Shape.Utils.b3(u,q,t,p,k),THREE.Shape.Utils.b3(u,
+s,r,v,n)}return{offset:x.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,m,n;if(0<b(a))for(m=0;m<e;m++)f[m]=m;else for(m=0;m<e;m++)f[m]=e-1-m;var r=2*e;for(m=e-1;2<e;){if(0>=r--){console.log("Warning, unable to triangulate polygon!");break}k=m;e<=k&&(k=0);m=k+1;e<=m&&(m=0);n=m+1;e<=n&&(n=0);var s;a:{var t=s=void 0,q=void 0,p=void 0,v=void 0,x=void 0,u=void 0,E=void 0,y=
-void 0,t=a[f[k]].x,q=a[f[k]].y,p=a[f[m]].x,v=a[f[m]].y,x=a[f[n]].x,u=a[f[n]].y;if(1E-10>(p-t)*(u-q)-(v-q)*(x-t))s=!1;else{var z=void 0,B=void 0,D=void 0,w=void 0,A=void 0,N=void 0,P=void 0,K=void 0,R=void 0,M=void 0,R=K=P=y=E=void 0,z=x-p,B=u-v,D=t-x,w=q-u,A=p-t,N=v-q;for(s=0;s<e;s++)if(E=a[f[s]].x,y=a[f[s]].y,!(E===t&&y===q||E===p&&y===v||E===x&&y===u)&&(P=E-t,K=y-q,R=E-p,M=y-v,E-=x,y-=u,R=z*M-B*R,P=A*K-N*P,K=D*y-w*E,-1E-10<=R&&-1E-10<=K&&-1E-10<=P)){s=!1;break a}s=!0}}if(s){g.push([a[f[k]],a[f[m]],
-a[f[n]]]);h.push([f[k],f[m],f[n]]);k=m;for(n=m+1;n<e;k++,n++)f[k]=f[n];e--;r=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};
+(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 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,m,n;if(0<b(a))for(m=0;m<e;m++)f[m]=m;else for(m=0;m<e;m++)f[m]=e-1-m;var q=2*e;for(m=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=m;e<=k&&(k=0);m=k+1;e<=m&&(m=0);n=m+1;e<=n&&(n=0);var s;a:{var t=s=void 0,r=void 0,p=void 0,v=void 0,x=void 0,u=void 0,E=void 0,y=
+void 0,t=a[f[k]].x,r=a[f[k]].y,p=a[f[m]].x,v=a[f[m]].y,x=a[f[n]].x,u=a[f[n]].y;if(1E-10>(p-t)*(u-r)-(v-r)*(x-t))s=!1;else{var z=void 0,B=void 0,D=void 0,w=void 0,A=void 0,N=void 0,P=void 0,K=void 0,R=void 0,M=void 0,R=K=P=y=E=void 0,z=x-p,B=u-v,D=t-x,w=r-u,A=p-t,N=v-r;for(s=0;s<e;s++)if(E=a[f[s]].x,y=a[f[s]].y,!(E===t&&y===r||E===p&&y===v||E===x&&y===u)&&(P=E-t,K=y-r,R=E-p,M=y-v,E-=x,y-=u,R=z*M-B*R,P=A*K-N*P,K=D*y-w*E,-1E-10<=R&&-1E-10<=K&&-1E-10<=P)){s=!1;break a}s=!0}}if(s){g.push([a[f[k]],a[f[m]],
+a[f[n]]]);h.push([f[k],f[m],f[n]]);k=m;for(n=m+1;n<e;k++,n++)f[k]=f[n];e--;q=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};
 THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};
 THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,g=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),g+=c.distanceTo(d),b.push(g),d=c;return this.cacheArcLengths=b};THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};
 THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,g;g=b?b:a*c[e-1];for(var f=0,h=e-1,k;f<=h;)if(d=Math.floor(f+(h-f)/2),k=c[d]-g,0>k)f=d+1;else if(0<k)h=d-1;else{h=d;break}d=h;if(c[d]==g)return d/(e-1);f=c[d];return c=(d+(g-f)/(c[d+1]-f))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
@@ -631,7 +632,7 @@ THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)
 THREE.Curve.create=function(a,b){a.prototype=Object.create(THREE.Curve.prototype);a.prototype.getPoint=b;return a};THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=!1};THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype);THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};
 THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]};
 THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a};
-THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,g,f;b=c=Number.NEGATIVE_INFINITY;e=g=Number.POSITIVE_INFINITY;var h,k,m,n,r=a[0]instanceof THREE.Vector3;n=r?new THREE.Vector3:new THREE.Vector2;k=0;for(m=a.length;k<m;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<g&&(g=h.y),r&&(h.z>d?d=h.z:h.z<f&&(f=h.z)),n.add(h);a={minX:e,minY:g,maxX:b,maxY:c};r&&(a.maxZ=d,a.minZ=f);return a};
+THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,g,f;b=c=Number.NEGATIVE_INFINITY;e=g=Number.POSITIVE_INFINITY;var h,k,m,n,q=a[0]instanceof THREE.Vector3;n=q?new THREE.Vector3:new THREE.Vector2;k=0;for(m=a.length;k<m;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<g&&(g=h.y),q&&(h.z>d?d=h.z:h.z<f&&(f=h.z)),n.add(h);a={minX:e,minY:g,maxX:b,maxY:c};q&&(a.maxZ=d,a.minZ=f);return a};
 THREE.CurvePath.prototype.createPointsGeometry=function(a){a=this.getPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){a=this.getSpacedPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vector3(a[c].x,a[c].y,a[c].z||0));return b};THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)};
 THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};
 THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,g,f,h,k;d=0;for(e=a.length;d<e;d++)g=a[d],f=g.x,h=g.y,k=f/c.maxX,k=b.getUtoTmapping(k,f),f=b.getPoint(k),k=b.getTangent(k),k.set(-k.y,k.x).multiplyScalar(h),g.x=f.x+k.x,g.y=f.y+k.y;return a};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);
@@ -644,22 +645,22 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,g){var f=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,g){var f=this.actions[this.actions.length-1].args;this.absarc(a+f[f.length-2],b+f[f.length-1],c,d,e,g)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,g){this.absellipse(a,b,c,c,d,e,g)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,g,f){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,g,f)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,g,f){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,g,f);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};
 THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,g,f,h,k,m,n,r,s,t,q,p;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];r=g[0];s=g[1];0<c.length?(f=c[c.length-1],t=f.x,
-q=f.y):(f=this.actions[d-1].args,t=f[f.length-2],q=f[f.length-1]);for(g=1;g<=a;g++)p=g/a,f=THREE.Shape.Utils.b2(p,t,r,h),p=THREE.Shape.Utils.b2(p,q,s,k),c.push(new THREE.Vector2(f,p));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];r=g[0];s=g[1];m=g[2];n=g[3];0<c.length?(f=c[c.length-1],t=f.x,q=f.y):(f=this.actions[d-1].args,t=f[f.length-2],q=f[f.length-1]);for(g=1;g<=a;g++)p=g/a,f=THREE.Shape.Utils.b3(p,t,r,m,h),p=THREE.Shape.Utils.b3(p,q,s,n,k),c.push(new THREE.Vector2(f,p));break;case THREE.PathActions.CSPLINE_THRU:f=
-this.actions[d-1].args;p=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;p=p.concat(g[0]);p=new THREE.SplineCurve(p);for(g=1;g<=f;g++)c.push(p.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];s=g[2];m=g[3];f=g[4];r=!!g[5];t=f-m;q=2*a;for(g=1;g<=q;g++)p=g/q,r||(p=1-p),p=m+p*t,f=h+s*Math.cos(p),p=k+s*Math.sin(p),c.push(new THREE.Vector2(f,p));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],s=g[2],n=g[3],m=g[4],f=g[5],r=!!g[6],t=f-m,q=2*a,g=1;g<=q;g++)p=g/q,r||
+THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,g,f,h,k,m,n,q,s,t,r,p;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];q=g[0];s=g[1];0<c.length?(f=c[c.length-1],t=f.x,
+r=f.y):(f=this.actions[d-1].args,t=f[f.length-2],r=f[f.length-1]);for(g=1;g<=a;g++)p=g/a,f=THREE.Shape.Utils.b2(p,t,q,h),p=THREE.Shape.Utils.b2(p,r,s,k),c.push(new THREE.Vector2(f,p));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];q=g[0];s=g[1];m=g[2];n=g[3];0<c.length?(f=c[c.length-1],t=f.x,r=f.y):(f=this.actions[d-1].args,t=f[f.length-2],r=f[f.length-1]);for(g=1;g<=a;g++)p=g/a,f=THREE.Shape.Utils.b3(p,t,q,m,h),p=THREE.Shape.Utils.b3(p,r,s,n,k),c.push(new THREE.Vector2(f,p));break;case THREE.PathActions.CSPLINE_THRU:f=
+this.actions[d-1].args;p=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;p=p.concat(g[0]);p=new THREE.SplineCurve(p);for(g=1;g<=f;g++)c.push(p.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];s=g[2];m=g[3];f=g[4];q=!!g[5];t=f-m;r=2*a;for(g=1;g<=r;g++)p=g/r,q||(p=1-p),p=m+p*t,f=h+s*Math.cos(p),p=k+s*Math.sin(p),c.push(new THREE.Vector2(f,p));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],s=g[2],n=g[3],m=g[4],f=g[5],q=!!g[6],t=f-m,r=2*a,g=1;g<=r;g++)p=g/r,q||
 (p=1-p),p=m+p*t,f=h+s*Math.cos(p),p=k+n*Math.sin(p),c.push(new THREE.Vector2(f,p))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
 THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,m=h.y-g.y;if(1E-10<Math.abs(m)){if(0>m&&(g=b[f],k=-k,h=b[e],m=-m),!(a.y<g.y||a.y>h.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=
 h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!=g.actions.length&&f.push(g);return f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var g,f,h,k=[];if(1==e.length)return f=e[0],h=new THREE.Shape,h.actions=f.actions,h.curves=f.curves,k.push(h),k;var m=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),m=a?!m:m;
-h=[];var n=[],r=[],s=0,t;n[s]=void 0;r[s]=[];var q,p;q=0;for(p=e.length;q<p;q++)f=e[q],t=f.getPoints(),g=THREE.Shape.Utils.isClockWise(t),(g=a?!g:g)?(!m&&n[s]&&s++,n[s]={s:new THREE.Shape,p:t},n[s].s.actions=f.actions,n[s].s.curves=f.curves,m&&s++,r[s]=[]):r[s].push({h:f,p:t[0]});if(!n[0])return c(e);if(1<n.length){q=!1;p=[];f=0;for(e=n.length;f<e;f++)h[f]=[];f=0;for(e=n.length;f<e;f++)for(g=r[f],m=0;m<g.length;m++){s=g[m];t=!0;for(var v=0;v<n.length;v++)d(s.p,n[v].p)&&(f!=v&&p.push({froms:f,tos:v,
-hole:m}),t?(t=!1,h[v].push(s)):q=!0);t&&h[f].push(s)}0<p.length&&(q||(r=h))}q=0;for(p=n.length;q<p;q++)for(h=n[q].s,k.push(h),f=r[q],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.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};
+h=[];var n=[],q=[],s=0,t;n[s]=void 0;q[s]=[];var r,p;r=0;for(p=e.length;r<p;r++)f=e[r],t=f.getPoints(),g=THREE.Shape.Utils.isClockWise(t),(g=a?!g:g)?(!m&&n[s]&&s++,n[s]={s:new THREE.Shape,p:t},n[s].s.actions=f.actions,n[s].s.curves=f.curves,m&&s++,q[s]=[]):q[s].push({h:f,p:t[0]});if(!n[0])return c(e);if(1<n.length){r=!1;p=[];f=0;for(e=n.length;f<e;f++)h[f]=[];f=0;for(e=n.length;f<e;f++)for(g=q[f],m=0;m<g.length;m++){s=g[m];t=!0;for(var v=0;v<n.length;v++)d(s.p,n[v].p)&&(f!=v&&p.push({froms:f,tos:v,
+hole:m}),t?(t=!1,h[v].push(s)):r=!0);t&&h[f].push(s)}0<p.length&&(r||(q=h))}r=0;for(p=n.length;r<p;r++)for(h=n[r].s,k.push(h),f=q[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.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,m=e.y-d.y,n=a.x-d.x,r=a.y-d.y,D=h*k-g*m,w=h*n-g*r;if(1E-10<Math.abs(D)){if(0<D){if(0>w||w>D)return[];k=m*n-k*r;if(0>k||k>D)return[]}else{if(0<w||w<D)return[];k=m*n-k*r;if(0<k||k<D)return[]}if(0==k)return!f||0!=w&&w!=D?[a]:[];if(k==D)return!f||0!=w&&w!=D?[b]:[];if(0==w)return[d];
-if(w==D)return[e];f=k/D;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=w||m*n!=k*r)return[];h=0==g&&0==h;k=0==k&&0==m;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,D=d.x,m=e,d=e.x):(b=e,D=e.x,m=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,D=d.y,m=e,d=e.y):(b=e,D=e.y,m=d,d=d.y));return k<=D?a<D?[]:a==D?f?[]:[b]:a<=d?[b,h]:[b,m]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,m=e.y-d.y,n=a.x-d.x,q=a.y-d.y,D=h*k-g*m,w=h*n-g*q;if(1E-10<Math.abs(D)){if(0<D){if(0>w||w>D)return[];k=m*n-k*q;if(0>k||k>D)return[]}else{if(0<w||w<D)return[];k=m*n-k*q;if(0<k||k<D)return[]}if(0==k)return!f||0!=w&&w!=D?[a]:[];if(k==D)return!f||0!=w&&w!=D?[b]:[];if(0==w)return[d];
+if(w==D)return[e];f=k/D;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=w||m*n!=k*q)return[];h=0==g&&0==h;k=0==k&&0==m;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,D=d.x,m=e,d=e.x):(b=e,D=e.x,m=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,D=d.y,m=e,d=e.y):(b=e,D=e.y,m=d,d=d.y));return k<=D?a<D?[]:a==D?f?[]:[b]:a<=d?[b,h]:[b,m]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
 [g,m]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,k,m,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)m=h[g].x+":"+h[g].y,void 0!==n[m]&&console.log("Duplicate point",m),n[m]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;
-d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<m.length;e++)for(f=b[m[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,m=[],n,r,B,D,w,A=[],N,P,K,R=0;for(n=b.length;R<n;R++)m.push(R);N=0;for(var M=2*m.length;0<m.length;){M--;if(0>M){console.log("Infinite Loop! Holes left:"+
-m.length+", Probably Hole outside Shape!");break}for(r=N;r<h.length;r++){B=h[r];n=-1;for(R=0;R<m.length;R++)if(D=m[R],w=B.x+":"+B.y+":"+D,void 0===A[w]){k=b[D];for(P=0;P<k.length;P++)if(D=k[P],c(r,P)&&!f(B,D)&&!g(B,D)){n=P;m.splice(R,1);N=h.slice(0,r+1);D=h.slice(r);P=k.slice(n);K=k.slice(0,n+1);h=N.concat(P).concat(K).concat(D);N=r;break}if(0<=n)break;A[w]=!0}if(0<=n)break}}return h}(a,b);var r=THREE.FontUtils.Triangulate(g,!1);g=0;for(f=r.length;g<f;g++)for(k=r[g],h=0;3>h;h++)m=k[h].x+":"+k[h].y,
-m=n[m],void 0!==m&&(k[h]=m);return r.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
+d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<m.length;e++)for(f=b[m[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,m=[],n,q,B,D,w,A=[],N,P,K,R=0;for(n=b.length;R<n;R++)m.push(R);N=0;for(var M=2*m.length;0<m.length;){M--;if(0>M){console.log("Infinite Loop! Holes left:"+
+m.length+", Probably Hole outside Shape!");break}for(q=N;q<h.length;q++){B=h[q];n=-1;for(R=0;R<m.length;R++)if(D=m[R],w=B.x+":"+B.y+":"+D,void 0===A[w]){k=b[D];for(P=0;P<k.length;P++)if(D=k[P],c(q,P)&&!f(B,D)&&!g(B,D)){n=P;m.splice(R,1);N=h.slice(0,q+1);D=h.slice(q);P=k.slice(n);K=k.slice(0,n+1);h=N.concat(P).concat(K).concat(D);N=q;break}if(0<=n)break;A[w]=!0}if(0<=n)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(g,!1);g=0;for(f=q.length;g<f;g++)for(k=q[g],h=0;3>h;h++)m=k[h].x+":"+k[h].y,
+m=n[m],void 0!==m&&(k[h]=m);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
 b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};
 THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};
 THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);
@@ -681,11 +682,11 @@ THREE.Animation.prototype.play=function(a,b){this.currentTime=void 0!==a?a:0;thi
 THREE.Animation.prototype.reset=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];c.matrixAutoUpdate=!0;void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});void 0===c.animationCache.animations[this.data.name]&&(c.animationCache.animations[this.data.name]={},c.animationCache.animations[this.data.name].prevKey={pos:0,rot:0,scl:0},c.animationCache.animations[this.data.name].nextKey={pos:0,rot:0,scl:0},
 c.animationCache.animations[this.data.name].originalMatrix=c.matrix);for(var c=c.animationCache.animations[this.data.name],d=0;3>d;d++){for(var e=this.keyTypes[d],g=this.data.hierarchy[a].keys[0],f=this.getNextKeyWith(e,a,1);f.time<this.currentTime&&f.index>g.index;)g=f,f=this.getNextKeyWith(e,a,f.index+1);c.prevKey[e]=g;c.nextKey[e]=f}}};
 THREE.Animation.prototype.resetBlendWeights=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0!==c.animationCache&&(c.animationCache.blending.positionWeight=0,c.animationCache.blending.quaternionWeight=0,c.animationCache.blending.scaleWeight=0)}};
-THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,r,s,t,q,p;e=(a.length-1)*b;r=Math.floor(e);e-=r;c[0]=0===r?r:r-1;c[1]=r;c[2]=r>a.length-2?r:r+1;c[3]=r>a.length-3?r:r+2;r=a[c[0]];t=a[c[1]];q=a[c[2]];p=a[c[3]];c=e*e;s=e*c;d[0]=g(r[0],t[0],q[0],p[0],e,c,s);d[1]=g(r[1],t[1],q[1],p[1],e,c,s);d[2]=g(r[2],t[2],q[2],p[2],e,c,s);return d},g=function(a,b,c,d,e,g,s){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*
-s+(-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)if(this.loop)this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset();else{this.stop();return}f=0;for(var g=this.hierarchy.length;f<g;f++)for(var k=this.hierarchy[f],m=k.animationCache.animations[this.data.name],n=k.animationCache.blending,r=0;3>r;r++){var s=this.keyTypes[r],t=m.prevKey[s],q=m.nextKey[s];
-if(0<this.timeScale&&q.time<=this.currentTime||0>this.timeScale&&t.time>=this.currentTime){t=this.data.hierarchy[f].keys[0];for(q=this.getNextKeyWith(s,f,1);q.time<this.currentTime&&q.index>t.index;)t=q,q=this.getNextKeyWith(s,f,q.index+1);m.prevKey[s]=t;m.nextKey[s]=q}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var p=(this.currentTime-t.time)/(q.time-t.time),v=t[s],x=q[s];0>p&&(p=0);1<p&&(p=1);if("pos"===s)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=v[0]+(x[0]-v[0])*p,c.y=
-v[1]+(x[1]-v[1])*p,c.z=v[2]+(x[2]-v[2])*p,t=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,t),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,t.index-1).pos,a[1]=v,a[2]=x,a[3]=this.getNextKeyWith("pos",f,q.index+1).pos,p=0.33*p+0.33,q=e(a,p),t=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,s=k.position,s.x+=(q[0]-
-s.x)*t,s.y+=(q[1]-s.y)*t,s.z+=(q[2]-s.z)*t,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(p=e(a,1.01*p),b.set(p[0],p[1],p[2]),b.sub(s),b.y=0,b.normalize(),p=Math.atan2(b.x,b.z),k.rotation.set(0,p,0))}else"rot"===s?(THREE.Quaternion.slerp(v,x,d,p),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(t=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,t),n.quaternionWeight+=this.weight)):"scl"===s&&(c.x=v[0]+
+THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,s,t,r,p;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];r=a[c[2]];p=a[c[3]];c=e*e;s=e*c;d[0]=g(q[0],t[0],r[0],p[0],e,c,s);d[1]=g(q[1],t[1],r[1],p[1],e,c,s);d[2]=g(q[2],t[2],r[2],p[2],e,c,s);return d},g=function(a,b,c,d,e,g,s){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*
+s+(-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)if(this.loop)this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset();else{this.stop();return}f=0;for(var g=this.hierarchy.length;f<g;f++)for(var k=this.hierarchy[f],m=k.animationCache.animations[this.data.name],n=k.animationCache.blending,q=0;3>q;q++){var s=this.keyTypes[q],t=m.prevKey[s],r=m.nextKey[s];
+if(0<this.timeScale&&r.time<=this.currentTime||0>this.timeScale&&t.time>=this.currentTime){t=this.data.hierarchy[f].keys[0];for(r=this.getNextKeyWith(s,f,1);r.time<this.currentTime&&r.index>t.index;)t=r,r=this.getNextKeyWith(s,f,r.index+1);m.prevKey[s]=t;m.nextKey[s]=r}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var p=(this.currentTime-t.time)/(r.time-t.time),v=t[s],x=r[s];0>p&&(p=0);1<p&&(p=1);if("pos"===s)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=v[0]+(x[0]-v[0])*p,c.y=
+v[1]+(x[1]-v[1])*p,c.z=v[2]+(x[2]-v[2])*p,t=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,t),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,t.index-1).pos,a[1]=v,a[2]=x,a[3]=this.getNextKeyWith("pos",f,r.index+1).pos,p=0.33*p+0.33,r=e(a,p),t=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,s=k.position,s.x+=(r[0]-
+s.x)*t,s.y+=(r[1]-s.y)*t,s.z+=(r[2]-s.z)*t,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(p=e(a,1.01*p),b.set(p[0],p[1],p[2]),b.sub(s),b.y=0,b.normalize(),p=Math.atan2(b.x,b.z),k.rotation.set(0,p,0))}else"rot"===s?(THREE.Quaternion.slerp(v,x,d,p),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(t=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,t),n.quaternionWeight+=this.weight)):"scl"===s&&(c.x=v[0]+
 (x[0]-v[0])*p,c.y=v[1]+(x[1]-v[1])*p,c.z=v[2]+(x[2]-v[2])*p,t=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,t),n.scaleWeight+=this.weight)}return!0}}}();THREE.Animation.prototype.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]};
 THREE.Animation.prototype.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=0.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();
@@ -702,56 +703,57 @@ THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,p){var v,x=h.wi
 h.faceVertexUvs[0].push([g.clone(),v,E.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.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(0.5,0.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.CubeGeometry=function(a,b,c,d,e,g){console.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry.");return new THREE.BoxGeometry(a,b,c,d,e,g)};
-THREE.CylinderGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g};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;var f=c/2,h,k,m=[],n=[];for(k=0;k<=e;k++){var r=[],s=[],t=k/e,q=t*(b-a)+a;for(h=0;h<=d;h++){var p=h/d,v=new THREE.Vector3;v.x=q*Math.sin(p*Math.PI*2);v.y=-t*c+f;v.z=q*Math.cos(p*Math.PI*2);this.vertices.push(v);r.push(this.vertices.length-
-1);s.push(new THREE.Vector2(p,1-t))}m.push(r);n.push(s)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(r=this.vertices[m[0][h]].clone(),s=this.vertices[m[0][h+1]].clone()):(r=this.vertices[m[1][h]].clone(),s=this.vertices[m[1][h+1]].clone()),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),s.setY(Math.sqrt(s.x*s.x+s.z*s.z)*c).normalize(),k=0;k<e;k++){var t=m[k][h],q=m[k+1][h],p=m[k+1][h+1],v=m[k][h+1],x=r.clone(),u=r.clone(),E=s.clone(),y=s.clone(),z=n[k][h].clone(),B=n[k+1][h].clone(),D=n[k+1][h+1].clone(),
-w=n[k][h+1].clone();this.faces.push(new THREE.Face3(t,q,v,[x,u,y]));this.faceVertexUvs[0].push([z,B,w]);this.faces.push(new THREE.Face3(q,p,v,[u.clone(),E,y.clone()]));this.faceVertexUvs[0].push([B.clone(),D,w.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,f,0)),h=0;h<d;h++)t=m[0][h],q=m[0][h+1],p=this.vertices.length-1,x=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),E=new THREE.Vector3(0,1,0),z=n[0][h].clone(),B=n[0][h+1].clone(),D=new THREE.Vector2(B.x,0),this.faces.push(new THREE.Face3(t,
-q,p,[x,u,E])),this.faceVertexUvs[0].push([z,B,D]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-f,0)),h=0;h<d;h++)t=m[k][h+1],q=m[k][h],p=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),E=new THREE.Vector3(0,-1,0),z=n[k][h+1].clone(),B=n[k][h].clone(),D=new THREE.Vector2(B.x,1),this.faces.push(new THREE.Face3(t,q,p,[x,u,E])),this.faceVertexUvs[0].push([z,B,D]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.CylinderGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g};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;var f=c/2,h,k,m=[],n=[];for(k=0;k<=e;k++){var q=[],s=[],t=k/e,r=t*(b-a)+a;for(h=0;h<=d;h++){var p=h/d,v=new THREE.Vector3;v.x=r*Math.sin(p*Math.PI*2);v.y=-t*c+f;v.z=r*Math.cos(p*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-
+1);s.push(new THREE.Vector2(p,1-t))}m.push(q);n.push(s)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[m[0][h]].clone(),s=this.vertices[m[0][h+1]].clone()):(q=this.vertices[m[1][h]].clone(),s=this.vertices[m[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),s.setY(Math.sqrt(s.x*s.x+s.z*s.z)*c).normalize(),k=0;k<e;k++){var t=m[k][h],r=m[k+1][h],p=m[k+1][h+1],v=m[k][h+1],x=q.clone(),u=q.clone(),E=s.clone(),y=s.clone(),z=n[k][h].clone(),B=n[k+1][h].clone(),D=n[k+1][h+1].clone(),
+w=n[k][h+1].clone();this.faces.push(new THREE.Face3(t,r,v,[x,u,y]));this.faceVertexUvs[0].push([z,B,w]);this.faces.push(new THREE.Face3(r,p,v,[u.clone(),E,y.clone()]));this.faceVertexUvs[0].push([B.clone(),D,w.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,f,0)),h=0;h<d;h++)t=m[0][h],r=m[0][h+1],p=this.vertices.length-1,x=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),E=new THREE.Vector3(0,1,0),z=n[0][h].clone(),B=n[0][h+1].clone(),D=new THREE.Vector2(B.x,0),this.faces.push(new THREE.Face3(t,
+r,p,[x,u,E])),this.faceVertexUvs[0].push([z,B,D]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-f,0)),h=0;h<d;h++)t=m[k][h+1],r=m[k][h],p=this.vertices.length-1,x=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),E=new THREE.Vector3(0,-1,0),z=n[k][h+1].clone(),B=n[k][h].clone(),D=new THREE.Vector2(B.x,1),this.faces.push(new THREE.Face3(t,r,p,[x,u,E])),this.faceVertexUvs[0].push([z,B,D]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);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.log("die");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),m=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/m-h)*g-(c.y+f/m-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(c,d){var e,f;for(I=c.length;0<=--I;){e=I;f=I-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;g<h;g++){var k=Y*g,m=Y*(g+1),p=d+e+k,k=d+f+k,q=d+f+m,m=d+e+m,r=c,s=g,v=h,x=e,w=f,p=p+K,k=k+K,q=q+K,m=m+K;P.faces.push(new THREE.Face3(p,k,m,null,null,u));P.faces.push(new THREE.Face3(k,q,m,null,null,u));p=E.generateSideWallUV(P,a,r,b,p,k,q,m,s,v,x,w);P.faceVertexUvs[0].push([p[0],p[1],p[3]]);
-P.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function g(a,b,c){P.vertices.push(new THREE.Vector3(a,b,c))}function f(c,d,e,f){c+=K;d+=K;e+=K;P.faces.push(new THREE.Face3(c,d,e,null,null,x));c=f?E.generateBottomUV(P,a,b,c,d,e):E.generateTopUV(P,a,b,c,d,e);P.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,m=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,r=void 0!==b.bevelEnabled?b.bevelEnabled:!0,s=void 0!==
-b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,q=b.extrudePath,p,v=!1,x=b.material,u=b.extrudeMaterial,E=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,y,z,B,D;q&&(p=q.getSpacedPoints(t),v=!0,r=!1,y=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(q,t,!1),z=new THREE.Vector3,B=new THREE.Vector3,D=new THREE.Vector3);r||(m=k=n=0);var w,A,N,P=this,K=this.vertices.length,q=a.extractPoints(s),s=q.shape,R=q.holes;if(q=!THREE.Shape.Utils.isClockWise(s)){s=
-s.reverse();A=0;for(N=R.length;A<N;A++)w=R[A],THREE.Shape.Utils.isClockWise(w)&&(R[A]=w.reverse());q=!1}var M=THREE.Shape.Utils.triangulateShape(s,R),H=s;A=0;for(N=R.length;A<N;A++)w=R[A],s=s.concat(w);var C,T,L,V,J,Y=s.length,aa,na=M.length,q=[],I=0;L=H.length;C=L-1;for(T=I+1;I<L;I++,C++,T++)C===L&&(C=0),T===L&&(T=0),q[I]=d(H[I],H[C],H[T]);var ba=[],Q,ca=q.concat();A=0;for(N=R.length;A<N;A++){w=R[A];Q=[];I=0;L=w.length;C=L-1;for(T=I+1;I<L;I++,C++,T++)C===L&&(C=0),T===L&&(T=0),Q[I]=d(w[I],w[C],w[T]);
-ba.push(Q);ca=ca.concat(Q)}for(C=0;C<n;C++){L=C/n;V=k*(1-L);T=m*Math.sin(L*Math.PI/2);I=0;for(L=H.length;I<L;I++)J=c(H[I],q[I],T),g(J.x,J.y,-V);A=0;for(N=R.length;A<N;A++)for(w=R[A],Q=ba[A],I=0,L=w.length;I<L;I++)J=c(w[I],Q[I],T),g(J.x,J.y,-V)}T=m;for(I=0;I<Y;I++)J=r?c(s[I],ca[I],T):s[I],v?(B.copy(y.normals[0]).multiplyScalar(J.x),z.copy(y.binormals[0]).multiplyScalar(J.y),D.copy(p[0]).add(B).add(z),g(D.x,D.y,D.z)):g(J.x,J.y,0);for(L=1;L<=t;L++)for(I=0;I<Y;I++)J=r?c(s[I],ca[I],T):s[I],v?(B.copy(y.normals[L]).multiplyScalar(J.x),
-z.copy(y.binormals[L]).multiplyScalar(J.y),D.copy(p[L]).add(B).add(z),g(D.x,D.y,D.z)):g(J.x,J.y,h/t*L);for(C=n-1;0<=C;C--){L=C/n;V=k*(1-L);T=m*Math.sin(L*Math.PI/2);I=0;for(L=H.length;I<L;I++)J=c(H[I],q[I],T),g(J.x,J.y,h+V);A=0;for(N=R.length;A<N;A++)for(w=R[A],Q=ba[A],I=0,L=w.length;I<L;I++)J=c(w[I],Q[I],T),v?g(J.x,J.y+p[t-1].y,p[t-1].x+V):g(J.x,J.y,h+V)}(function(){if(r){var a;a=0*Y;for(I=0;I<na;I++)aa=M[I],f(aa[2]+a,aa[1]+a,aa[0]+a,!0);a=t+2*n;a*=Y;for(I=0;I<na;I++)aa=M[I],f(aa[0]+a,aa[1]+a,aa[2]+
+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(c,d){var e,f;for(I=c.length;0<=--I;){e=I;f=I-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;g<h;g++){var k=Y*g,m=Y*(g+1),p=d+e+k,k=d+f+k,r=d+f+m,m=d+e+m,q=c,s=g,v=h,x=e,w=f,p=p+K,k=k+K,r=r+K,m=m+K;P.faces.push(new THREE.Face3(p,k,m,null,null,u));P.faces.push(new THREE.Face3(k,r,m,null,null,u));p=E.generateSideWallUV(P,a,q,b,p,k,r,m,s,v,x,w);P.faceVertexUvs[0].push([p[0],p[1],p[3]]);
+P.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function g(a,b,c){P.vertices.push(new THREE.Vector3(a,b,c))}function f(c,d,e,f){c+=K;d+=K;e+=K;P.faces.push(new THREE.Face3(c,d,e,null,null,x));c=f?E.generateBottomUV(P,a,b,c,d,e):E.generateTopUV(P,a,b,c,d,e);P.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,m=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,s=void 0!==
+b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,r=b.extrudePath,p,v=!1,x=b.material,u=b.extrudeMaterial,E=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,y,z,B,D;r&&(p=r.getSpacedPoints(t),v=!0,q=!1,y=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(r,t,!1),z=new THREE.Vector3,B=new THREE.Vector3,D=new THREE.Vector3);q||(m=k=n=0);var w,A,N,P=this,K=this.vertices.length,r=a.extractPoints(s),s=r.shape,R=r.holes;if(r=!THREE.Shape.Utils.isClockWise(s)){s=
+s.reverse();A=0;for(N=R.length;A<N;A++)w=R[A],THREE.Shape.Utils.isClockWise(w)&&(R[A]=w.reverse());r=!1}var M=THREE.Shape.Utils.triangulateShape(s,R),H=s;A=0;for(N=R.length;A<N;A++)w=R[A],s=s.concat(w);var C,T,L,V,J,Y=s.length,aa,na=M.length,r=[],I=0;L=H.length;C=L-1;for(T=I+1;I<L;I++,C++,T++)C===L&&(C=0),T===L&&(T=0),r[I]=d(H[I],H[C],H[T]);var ba=[],Q,ca=r.concat();A=0;for(N=R.length;A<N;A++){w=R[A];Q=[];I=0;L=w.length;C=L-1;for(T=I+1;I<L;I++,C++,T++)C===L&&(C=0),T===L&&(T=0),Q[I]=d(w[I],w[C],w[T]);
+ba.push(Q);ca=ca.concat(Q)}for(C=0;C<n;C++){L=C/n;V=k*(1-L);T=m*Math.sin(L*Math.PI/2);I=0;for(L=H.length;I<L;I++)J=c(H[I],r[I],T),g(J.x,J.y,-V);A=0;for(N=R.length;A<N;A++)for(w=R[A],Q=ba[A],I=0,L=w.length;I<L;I++)J=c(w[I],Q[I],T),g(J.x,J.y,-V)}T=m;for(I=0;I<Y;I++)J=q?c(s[I],ca[I],T):s[I],v?(B.copy(y.normals[0]).multiplyScalar(J.x),z.copy(y.binormals[0]).multiplyScalar(J.y),D.copy(p[0]).add(B).add(z),g(D.x,D.y,D.z)):g(J.x,J.y,0);for(L=1;L<=t;L++)for(I=0;I<Y;I++)J=q?c(s[I],ca[I],T):s[I],v?(B.copy(y.normals[L]).multiplyScalar(J.x),
+z.copy(y.binormals[L]).multiplyScalar(J.y),D.copy(p[L]).add(B).add(z),g(D.x,D.y,D.z)):g(J.x,J.y,h/t*L);for(C=n-1;0<=C;C--){L=C/n;V=k*(1-L);T=m*Math.sin(L*Math.PI/2);I=0;for(L=H.length;I<L;I++)J=c(H[I],r[I],T),g(J.x,J.y,h+V);A=0;for(N=R.length;A<N;A++)for(w=R[A],Q=ba[A],I=0,L=w.length;I<L;I++)J=c(w[I],Q[I],T),v?g(J.x,J.y+p[t-1].y,p[t-1].x+V):g(J.x,J.y,h+V)}(function(){if(q){var a;a=0*Y;for(I=0;I<na;I++)aa=M[I],f(aa[2]+a,aa[1]+a,aa[0]+a,!0);a=t+2*n;a*=Y;for(I=0;I<na;I++)aa=M[I],f(aa[0]+a,aa[1]+a,aa[2]+
 a,!1)}else{for(I=0;I<na;I++)aa=M[I],f(aa[2],aa[1],aa[0],!0);for(I=0;I<na;I++)aa=M[I],f(aa[0]+Y*t,aa[1]+Y*t,aa[2]+Y*t,!1)}})();(function(){var a=0;e(H,a);a+=H.length;A=0;for(N=R.length;A<N;A++)w=R[A],e(w,a),a+=w.length})()};
-THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,g){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[g].x;g=a.vertices[g].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,g)]},generateBottomUV:function(a,b,c,d,e,g){return this.generateTopUV(a,b,c,d,e,g)},generateSideWallUV:function(a,b,c,d,e,g,f,h,k,m,n,r){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[g].x;k=a.vertices[g].y;g=a.vertices[g].z;m=a.vertices[f].x;
-n=a.vertices[f].y;f=a.vertices[f].z;r=a.vertices[h].x;var s=a.vertices[h].y;a=a.vertices[h].z;return 0.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-g),new THREE.Vector2(m,1-f),new THREE.Vector2(r,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-g),new THREE.Vector2(n,1-f),new THREE.Vector2(s,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
+THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,g){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[g].x;g=a.vertices[g].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,g)]},generateBottomUV:function(a,b,c,d,e,g){return this.generateTopUV(a,b,c,d,e,g)},generateSideWallUV:function(a,b,c,d,e,g,f,h,k,m,n,q){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[g].x;k=a.vertices[g].y;g=a.vertices[g].z;m=a.vertices[f].x;
+n=a.vertices[f].y;f=a.vertices[f].z;q=a.vertices[h].x;var s=a.vertices[h].y;a=a.vertices[h].z;return 0.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-g),new THREE.Vector2(m,1-f),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-g),new THREE.Vector2(n,1-f),new THREE.Vector2(s,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,m=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=m.length;e<g;e++)f=m[e],THREE.Shape.Utils.isClockWise(f)&&(m[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,m);e=0;for(g=m.length;e<g;e++)f=m[e],
 k=k.concat(f);m=k.length;g=n.length;for(e=0;e<m;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)m=n[e],k=m[0]+h,f=m[1]+h,m=m[2]+h,this.faces.push(new THREE.Face3(k,f,m,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,f,m))};
-THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,m=Math.cos(k),n=Math.sin(k),k=0,r=a.length;k<r;k++){var s=a[k],t=new THREE.Vector3;t.x=m*s.x-n*s.y;t.y=n*s.x+m*s.y;t.z=s.z;this.vertices.push(t)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,r=a.length-1;k<r;k++){b=n=k+c*f;d=n+c;var m=n+1+c,n=n+1,s=f*g,t=k*e,q=
-s+g,p=t+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(s,t),new THREE.Vector2(q,t),new THREE.Vector2(s,p)]);this.faces.push(new THREE.Face3(d,m,n));this.faceVertexUvs[0].push([new THREE.Vector2(q,t),new THREE.Vector2(q,p),new THREE.Vector2(s,p)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
-THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,g=b/2;c=c||1;d=d||1;var f=c+1,h=d+1,k=a/c,m=b/d,n=new THREE.Vector3(0,0,1);for(a=0;a<h;a++){var r=a*m-g;for(b=0;b<f;b++)this.vertices.push(new THREE.Vector3(b*k-e,-r,0))}for(a=0;a<d;a++)for(b=0;b<c;b++){var s=b+f*a,e=b+f*(a+1),g=b+1+f*(a+1),h=b+1+f*a,k=new THREE.Vector2(b/c,1-a/d),m=new THREE.Vector2(b/c,1-(a+1)/d),r=new THREE.Vector2((b+
-1)/c,1-(a+1)/d),t=new THREE.Vector2((b+1)/c,1-a/d),s=new THREE.Face3(s,e,h);s.normal.copy(n);s.vertexNormals.push(n.clone(),n.clone(),n.clone());this.faces.push(s);this.faceVertexUvs[0].push([k,m,t]);s=new THREE.Face3(e,g,h);s.normal.copy(n);s.vertexNormals.push(n.clone(),n.clone(),n.clone());this.faces.push(s);this.faceVertexUvs[0].push([m.clone(),r,t.clone()])}};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);
-THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:g};a=a||0;b=b||50;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var f,h=[],k=a,m=(b-a)/d;for(a=0;a<d+1;a++){for(f=0;f<c+1;f++){var n=new THREE.Vector3,r=e+f/c*g;n.x=k*Math.cos(r);n.y=k*Math.sin(r);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
-(n.y/b+1)/2))}k+=m}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),f=0;f<c;f++)g=r=f+e,m=r+c+1,n=r+c+2,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].clone(),h[n].clone()]),g=r,m=r+c+2,n=r+1,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
+THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,m=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var s=a[k],t=new THREE.Vector3;t.x=m*s.x-n*s.y;t.y=n*s.x+m*s.y;t.z=s.z;this.vertices.push(t)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*f;d=n+c;var m=n+1+c,n=n+1,s=f*g,t=k*e,r=
+s+g,p=t+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(s,t),new THREE.Vector2(r,t),new THREE.Vector2(s,p)]);this.faces.push(new THREE.Face3(d,m,n));this.faceVertexUvs[0].push([new THREE.Vector2(r,t),new THREE.Vector2(r,p),new THREE.Vector2(s,p)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
+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.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=c||1;d=d||1;var f=c+1,h=d+1,k=a/c,m=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var n=new Float32Array(f*h*2),q=0,s=0,t=0;t<h;t++)for(var r=t*m-g,p=0;p<f;p++)b[q]=p*k-e,b[q+1]=-r,a[q+2]=1,n[s]=p/c,n[s+1]=1-t/d,q+=3,s+=2;q=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*d*6);for(t=0;t<d;t++)for(p=
+0;p<c;p++)g=p+f*(t+1),h=p+1+f*(t+1),k=p+1+f*t,e[q]=p+f*t,e[q+1]=g,e[q+2]=k,e[q+3]=g,e[q+4]=h,e[q+5]=k,q+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(n,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
+THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:g};a=a||0;b=b||50;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var f,h=[],k=a,m=(b-a)/d;for(a=0;a<d+1;a++){for(f=0;f<c+1;f++){var n=new THREE.Vector3,q=e+f/c*g;n.x=k*Math.cos(q);n.y=k*Math.sin(q);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
+(n.y/b+1)/2))}k+=m}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),f=0;f<c;f++)g=q=f+e,m=q+c+1,n=q+c+2,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].clone(),h[n].clone()]),g=q,m=q+c+2,n=q+1,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
 THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);
-THREE.SphereGeometry=function(a,b,c,d,e,g,f){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;var h,k,m=[],n=[];for(k=0;k<=c;k++){var r=[],s=[];for(h=0;h<=b;h++){var t=h/b,q=k/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+t*e)*Math.sin(g+q*f);
-p.y=a*Math.cos(g+q*f);p.z=a*Math.sin(d+t*e)*Math.sin(g+q*f);this.vertices.push(p);r.push(this.vertices.length-1);s.push(new THREE.Vector2(t,1-q))}m.push(r);n.push(s)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=m[k][h+1];e=m[k][h];g=m[k+1][h];f=m[k+1][h+1];var r=this.vertices[d].clone().normalize(),s=this.vertices[e].clone().normalize(),t=this.vertices[g].clone().normalize(),q=this.vertices[f].clone().normalize(),p=n[k][h+1].clone(),v=n[k][h].clone(),x=n[k+1][h].clone(),u=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===
-a?(p.x=(p.x+v.x)/2,this.faces.push(new THREE.Face3(d,g,f,[r,t,q])),this.faceVertexUvs[0].push([p,x,u])):Math.abs(this.vertices[g].y)===a?(x.x=(x.x+u.x)/2,this.faces.push(new THREE.Face3(d,e,g,[r,s,t])),this.faceVertexUvs[0].push([p,v,x])):(this.faces.push(new THREE.Face3(d,e,f,[r,s,q])),this.faceVertexUvs[0].push([p,v,u]),this.faces.push(new THREE.Face3(e,g,f,[s.clone(),t,q.clone()])),this.faceVertexUvs[0].push([v.clone(),x,u.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
+THREE.SphereGeometry=function(a,b,c,d,e,g,f){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;var h,k,m=[],n=[];for(k=0;k<=c;k++){var q=[],s=[];for(h=0;h<=b;h++){var t=h/b,r=k/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+t*e)*Math.sin(g+r*f);
+p.y=a*Math.cos(g+r*f);p.z=a*Math.sin(d+t*e)*Math.sin(g+r*f);this.vertices.push(p);q.push(this.vertices.length-1);s.push(new THREE.Vector2(t,1-r))}m.push(q);n.push(s)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=m[k][h+1];e=m[k][h];g=m[k+1][h];f=m[k+1][h+1];var q=this.vertices[d].clone().normalize(),s=this.vertices[e].clone().normalize(),t=this.vertices[g].clone().normalize(),r=this.vertices[f].clone().normalize(),p=n[k][h+1].clone(),v=n[k][h].clone(),x=n[k+1][h].clone(),u=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===
+a?(p.x=(p.x+v.x)/2,this.faces.push(new THREE.Face3(d,g,f,[q,t,r])),this.faceVertexUvs[0].push([p,x,u])):Math.abs(this.vertices[g].y)===a?(x.x=(x.x+u.x)/2,this.faces.push(new THREE.Face3(d,e,g,[q,s,t])),this.faceVertexUvs[0].push([p,v,x])):(this.faces.push(new THREE.Face3(d,e,f,[q,s,r])),this.faceVertexUvs[0].push([p,v,u]),this.faces.push(new THREE.Face3(e,g,f,[s.clone(),t,r.clone()])),this.faceVertexUvs[0].push([v.clone(),x,u.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
 a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);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.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 m=0;m<=d;m++){var n=m/d*e,r=k/c*Math.PI*2;g.x=a*Math.cos(n);g.y=a*Math.sin(n);var s=new THREE.Vector3;s.x=(a+b*Math.cos(r))*Math.cos(n);s.y=(a+b*Math.cos(r))*Math.sin(n);s.z=b*Math.sin(r);this.vertices.push(s);f.push(new THREE.Vector2(m/
+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 m=0;m<=d;m++){var n=m/d*e,q=k/c*Math.PI*2;g.x=a*Math.cos(n);g.y=a*Math.sin(n);var s=new THREE.Vector3;s.x=(a+b*Math.cos(q))*Math.cos(n);s.y=(a+b*Math.cos(q))*Math.sin(n);s.z=b*Math.sin(q);this.vertices.push(s);f.push(new THREE.Vector2(m/
 d,k/c));h.push(s.clone().sub(g).normalize())}for(k=1;k<=c;k++)for(m=1;m<=d;m++)a=(d+1)*k+m-1,b=(d+1)*(k-1)+m-1,e=(d+1)*(k-1)+m,g=(d+1)*k+m,n=new THREE.Face3(a,b,g,[h[a].clone(),h[b].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[a].clone(),f[b].clone(),f[g].clone()]),n=new THREE.Face3(b,e,g,[h[b].clone(),h[e].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[b].clone(),f[e].clone(),f[g].clone()]);this.computeFaceNormals()};
 THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);
-THREE.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)*0.5;g=d*(2+b)*g*0.5;d=e*d*Math.sin(a)*0.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:g,heightScale:f};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;g=g||3;f=f||1;for(var k=Array(c),m=new THREE.Vector3,n=new THREE.Vector3,r=new THREE.Vector3,s=0;s<c;++s){k[s]=
-Array(d);var t=s/c*2*e*Math.PI,q=h(t,g,e,a,f),t=h(t+0.01,g,e,a,f);m.subVectors(t,q);n.addVectors(t,q);r.crossVectors(m,n);n.crossVectors(r,m);r.normalize();n.normalize();for(t=0;t<d;++t){var p=t/d*2*Math.PI,v=-b*Math.cos(p),p=b*Math.sin(p),x=new THREE.Vector3;x.x=q.x+v*n.x+p*r.x;x.y=q.y+v*n.y+p*r.y;x.z=q.z+v*n.z+p*r.z;k[s][t]=this.vertices.push(x)-1}}for(s=0;s<c;++s)for(t=0;t<d;++t)e=(s+1)%c,g=(t+1)%d,a=k[s][t],b=k[e][t],e=k[e][g],g=k[s][g],f=new THREE.Vector2(s/c,t/d),m=new THREE.Vector2((s+1)/c,
-t/d),n=new THREE.Vector2((s+1)/c,(t+1)/d),r=new THREE.Vector2(s/c,(t+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,m,r]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([m.clone(),n,r.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);
-THREE.TubeGeometry=function(a,b,c,d,e){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;var g=[],f,h,k=b+1,m,n,r,s,t=new THREE.Vector3,q,p,v;q=new THREE.TubeGeometry.FrenetFrames(a,b,e);p=q.normals;v=q.binormals;this.tangents=q.tangents;this.normals=p;this.binormals=v;for(q=0;q<k;q++)for(g[q]=[],m=q/(k-1),s=a.getPointAt(m),f=p[q],h=v[q],m=0;m<d;m++)n=m/d*2*Math.PI,r=-c*Math.cos(n),n=c*Math.sin(n),
-t.copy(s),t.x+=r*f.x+n*h.x,t.y+=r*f.y+n*h.y,t.z+=r*f.z+n*h.z,g[q][m]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(q=0;q<b;q++)for(m=0;m<d;m++)k=e?(q+1)%b:q+1,t=(m+1)%d,a=g[q][m],c=g[k][m],k=g[k][t],t=g[q][t],p=new THREE.Vector2(q/b,m/d),v=new THREE.Vector2((q+1)/b,m/d),f=new THREE.Vector2((q+1)/b,(m+1)/d),h=new THREE.Vector2(q/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,t)),this.faceVertexUvs[0].push([p,v,h]),this.faces.push(new THREE.Face3(c,k,t)),this.faceVertexUvs[0].push([v.clone(),
+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)*0.5;g=d*(2+b)*g*0.5;d=e*d*Math.sin(a)*0.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:g,heightScale:f};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;g=g||3;f=f||1;for(var k=Array(c),m=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,s=0;s<c;++s){k[s]=
+Array(d);var t=s/c*2*e*Math.PI,r=h(t,g,e,a,f),t=h(t+0.01,g,e,a,f);m.subVectors(t,r);n.addVectors(t,r);q.crossVectors(m,n);n.crossVectors(q,m);q.normalize();n.normalize();for(t=0;t<d;++t){var p=t/d*2*Math.PI,v=-b*Math.cos(p),p=b*Math.sin(p),x=new THREE.Vector3;x.x=r.x+v*n.x+p*q.x;x.y=r.y+v*n.y+p*q.y;x.z=r.z+v*n.z+p*q.z;k[s][t]=this.vertices.push(x)-1}}for(s=0;s<c;++s)for(t=0;t<d;++t)e=(s+1)%c,g=(t+1)%d,a=k[s][t],b=k[e][t],e=k[e][g],g=k[s][g],f=new THREE.Vector2(s/c,t/d),m=new THREE.Vector2((s+1)/c,
+t/d),n=new THREE.Vector2((s+1)/c,(t+1)/d),q=new THREE.Vector2(s/c,(t+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,m,q]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([m.clone(),n,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.TubeGeometry=function(a,b,c,d,e){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;var g=[],f,h,k=b+1,m,n,q,s,t=new THREE.Vector3,r,p,v;r=new THREE.TubeGeometry.FrenetFrames(a,b,e);p=r.normals;v=r.binormals;this.tangents=r.tangents;this.normals=p;this.binormals=v;for(r=0;r<k;r++)for(g[r]=[],m=r/(k-1),s=a.getPointAt(m),f=p[r],h=v[r],m=0;m<d;m++)n=m/d*2*Math.PI,q=-c*Math.cos(n),n=c*Math.sin(n),
+t.copy(s),t.x+=q*f.x+n*h.x,t.y+=q*f.y+n*h.y,t.z+=q*f.z+n*h.z,g[r][m]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(r=0;r<b;r++)for(m=0;m<d;m++)k=e?(r+1)%b:r+1,t=(m+1)%d,a=g[r][m],c=g[k][m],k=g[k][t],t=g[r][t],p=new THREE.Vector2(r/b,m/d),v=new THREE.Vector2((r+1)/b,m/d),f=new THREE.Vector2((r+1)/b,(m+1)/d),h=new THREE.Vector2(r/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,t)),this.faceVertexUvs[0].push([p,v,h]),this.faces.push(new THREE.Face3(c,k,t)),this.faceVertexUvs[0].push([v.clone(),
 f,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);
-THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var m,n,r;this.tangents=e;this.normals=g;this.binormals=f;for(m=0;m<b;m++)n=m/(b-1),e[m]=a.getTangentAt(n),e[m].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;m=Math.abs(e[0].x);n=Math.abs(e[0].y);r=Math.abs(e[0].z);m<=a&&(a=m,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));r<=a&&d.set(0,0,1);h.crossVectors(e[0],
+THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var m,n,q;this.tangents=e;this.normals=g;this.binormals=f;for(m=0;m<b;m++)n=m/(b-1),e[m]=a.getTangentAt(n),e[m].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;m=Math.abs(e[0].x);n=Math.abs(e[0].y);q=Math.abs(e[0].z);m<=a&&(a=m,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));q<=a&&d.set(0,0,1);h.crossVectors(e[0],
 d).normalize();g[0].crossVectors(e[0],h);f[0].crossVectors(e[0],g[0]);for(m=1;m<b;m++)g[m]=g[m-1].clone(),f[m]=f[m-1].clone(),h.crossVectors(e[m-1],e[m]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[m-1].dot(e[m]),-1,1)),g[m].applyMatrix4(k.makeRotationAxis(h,d))),f[m].crossVectors(e[m],g[m]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),m=1;m<b;m++)g[m].applyMatrix4(k.makeRotationAxis(e[m],d*m)),f[m].crossVectors(e[m],
 g[m])};
 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+0.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+0.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);v.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(v.z,-v.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function f(a,b){var c=
-Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),f=e(k.vertices[a.b]),h=e(k.vertices[a.c]),m=[],n=0;n<=c;n++){m[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(f.clone().lerp(h,n/c)),r=c-n,s=0;s<=r;s++)m[n][s]=0==s&&n==c?p:e(p.clone().lerp(q,s/r))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0==s%2?g(m[n][d+1],m[n+1][d],m[n][d]):g(m[n][d+1],m[n+1][d+1],m[n+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+0.5,
-a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,m=0,n=a.length;m<n;m+=3)e(new THREE.Vector3(a[m],a[m+1],a[m+2]));a=this.vertices;for(var r=[],s=m=0,n=b.length;m<n;m+=3,s++){var t=a[b[m]],q=a[b[m+1]],p=a[b[m+2]];r[s]=new THREE.Face3(t.index,q.index,p.index,[t.clone(),q.clone(),p.clone()])}for(var v=new THREE.Vector3,m=0,n=r.length;m<n;m++)f(r[m],d);m=0;for(n=this.faceVertexUvs[0].length;m<
-n;m++)b=this.faceVertexUvs[0][m],d=b[0].x,a=b[1].x,r=b[2].x,s=Math.max(d,Math.max(a,r)),t=Math.min(d,Math.min(a,r)),0.9<s&&0.1>t&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>r&&(b[2].x+=1));m=0;for(n=this.vertices.length;m<n;m++)this.vertices[m].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
+Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),f=e(k.vertices[a.b]),h=e(k.vertices[a.c]),m=[],n=0;n<=c;n++){m[n]=[];for(var p=e(d.clone().lerp(h,n/c)),r=e(f.clone().lerp(h,n/c)),q=c-n,s=0;s<=q;s++)m[n][s]=0==s&&n==c?p:e(p.clone().lerp(r,s/q))}for(n=0;n<c;n++)for(s=0;s<2*(c-n)-1;s++)d=Math.floor(s/2),0==s%2?g(m[n][d+1],m[n+1][d],m[n][d]):g(m[n][d+1],m[n+1][d+1],m[n+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+0.5,
+a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,m=0,n=a.length;m<n;m+=3)e(new THREE.Vector3(a[m],a[m+1],a[m+2]));a=this.vertices;for(var q=[],s=m=0,n=b.length;m<n;m+=3,s++){var t=a[b[m]],r=a[b[m+1]],p=a[b[m+2]];q[s]=new THREE.Face3(t.index,r.index,p.index,[t.clone(),r.clone(),p.clone()])}for(var v=new THREE.Vector3,m=0,n=q.length;m<n;m++)f(q[m],d);m=0;for(n=this.faceVertexUvs[0].length;m<
+n;m++)b=this.faceVertexUvs[0][m],d=b[0].x,a=b[1].x,q=b[2].x,s=Math.max(d,Math.max(a,q)),t=Math.min(d,Math.min(a,q)),0.9<s&&0.1>t&&(0.2>d&&(b[0].x+=1),0.2>a&&(b[1].x+=1),0.2>q&&(b[2].x+=1));m=0;for(n=this.vertices.length;m<n;m++)this.vertices[m].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
 THREE.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.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.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.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,g=this.faceVertexUvs[0],f,h,k,m,n=b+1;for(f=0;f<=c;f++)for(m=f/c,h=0;h<=b;h++)k=h/b,k=a(k,m),d.push(k);var r,s,t,q;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*n+h,d=f*n+h+1,m=(f+1)*n+h+1,k=(f+1)*n+h,r=new THREE.Vector2(h/b,f/c),s=new THREE.Vector2((h+1)/b,f/c),t=new THREE.Vector2((h+1)/b,(f+1)/c),q=new THREE.Vector2(h/b,(f+1)/c),e.push(new THREE.Face3(a,
-d,k)),g.push([r,s,q]),e.push(new THREE.Face3(d,m,k)),g.push([s.clone(),t,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);
+THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,g=this.faceVertexUvs[0],f,h,k,m,n=b+1;for(f=0;f<=c;f++)for(m=f/c,h=0;h<=b;h++)k=h/b,k=a(k,m),d.push(k);var q,s,t,r;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*n+h,d=f*n+h+1,m=(f+1)*n+h+1,k=(f+1)*n+h,q=new THREE.Vector2(h/b,f/c),s=new THREE.Vector2((h+1)/b,f/c),t=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([q,s,r]),e.push(new THREE.Face3(d,m,k)),g.push([s.clone(),t,r.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);
 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,0.6,0,0,1,0,0.6,1,0,0,0,1,0,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.Line.call(this,a,b,THREE.LinePieces)};THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,0.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-0.5,0));return function(c,d,e,g,f,h){THREE.Object3D.call(this);void 0===g&&(g=16776960);void 0===e&&(e=1);void 0===f&&(f=0.2*e);void 0===h&&(h=0.2*f);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:g}));this.line.matrixAutoUpdate=!1;this.add(this.line);
 this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:g}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(c);this.setLength(e,f,h)}}();THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.ArrowHelper.prototype.setDirection=function(){var a=new THREE.Vector3,b;return function(c){0.99999<c.y?this.quaternion.set(0,0,0,1):-0.99999>c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();
@@ -769,7 +771,7 @@ THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=
 c=new THREE.Geometry;c.vertices.push(new THREE.Vector3,new THREE.Vector3);d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);
 THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};
 THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();
-THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var m=k.vertices,k=k.faces,n=0,r=0,s=k.length;r<s;r++)for(var t=k[r],q=0;3>q;q++){d[0]=t[f[q]];d[1]=t[f[(q+1)%3]];d.sort(g);var p=d.toString();void 0===e[p]?(e[p]={vert1:d[0],vert2:d[1],face1:r,face2:void 0},n++):e[p].face2=r}h.addAttribute("position",new THREE.BufferAttribute(new Float32Array(6*
+THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var m=k.vertices,k=k.faces,n=0,q=0,s=k.length;q<s;q++)for(var t=k[q],r=0;3>r;r++){d[0]=t[f[r]];d[1]=t[f[(r+1)%3]];d.sort(g);var p=d.toString();void 0===e[p]?(e[p]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},n++):e[p].face2=q}h.addAttribute("position",new THREE.BufferAttribute(new Float32Array(6*
 n),3));d=h.attributes.position.array;g=0;for(p in e)if(f=e[p],void 0===f.face2||0.9999>k[f.face1].normal.dot(k[f.face2].normal))n=m[f.vert1],d[g++]=n.x,d[g++]=n.y,d[g++]=n.z,n=m[f.vert2],d[g++]=n.x,d[g++]=n.y,d[g++]=n.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(e);for(var g=b=0,f=d.length;b<f;b++,g+=2){var h=d[b];a[g].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e);a[g+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[g])}this.geometry.verticesNeedUpdate=!0;return this};
@@ -786,14 +788,14 @@ THREE.SkeletonHelper.prototype.update=function(){for(var a=this.geometry,b=(new
 THREE.SpotLightHelper=function(a){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.applyMatrix((new THREE.Matrix4).makeTranslation(0,-0.5,0));a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype);
 THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();
 THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:16711680;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,g=a.length;e<g;e++)for(var f=0,h=a[e].vertexNormals.length;f<h;f++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);
-THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,g=this.object.geometry.faces,f=this.object.matrixWorld,h=0,k=0,m=g.length;k<m;k++)for(var n=g[k],r=0,s=n.vertexNormals.length;r<s;r++){var t=n.vertexNormals[r];d[h].copy(e[n[a[r]]]).applyMatrix4(f);b.copy(t).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
+THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,g=this.object.geometry.faces,f=this.object.matrixWorld,h=0,k=0,m=g.length;k<m;k++)for(var n=g[k],q=0,s=n.vertexNormals.length;q<s;q++){var t=n.vertexNormals[q];d[h].copy(e[n[a[q]]]).applyMatrix4(f);b.copy(t).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
 b.add(d[h]);h+=1;d[h].copy(b);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
 THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:255;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,g=a.length;e<g;e++)for(var f=0,h=a[e].vertexTangents.length;f<h;f++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype);
-THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,g=this.object.geometry.faces,f=this.object.matrixWorld,h=0,k=0,m=g.length;k<m;k++)for(var n=g[k],r=0,s=n.vertexTangents.length;r<s;r++){var t=n.vertexTangents[r];d[h].copy(e[n[a[r]]]).applyMatrix4(f);b.copy(t).transformDirection(f).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
+THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,g=this.object.geometry.faces,f=this.object.matrixWorld,h=0,k=0,m=g.length;k<m;k++)for(var n=g[k],q=0,s=n.vertexTangents.length;q<s;q++){var t=n.vertexTangents[q];d[h].copy(e[n[a[q]]]).applyMatrix4(f);b.copy(t).transformDirection(f).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
 h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
-THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,m=a.geometry.faces,n=0,r=new Uint32Array(6*m.length),s=0,t=m.length;s<t;s++)for(var q=m[s],p=0;3>p;p++){d[0]=q[f[p]];d[1]=q[f[(p+1)%3]];d.sort(g);var v=d.toString();void 0===e[v]&&(r[2*n]=d[0],r[2*n+1]=d[1],e[v]=!0,n++)}d=new Float32Array(6*n);s=0;for(t=n;s<t;s++)for(p=0;2>p;p++)n=
-k[r[2*s+p]],f=6*s+3*p,d[f+0]=n.x,d[f+1]=n.y,d[f+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,m=a.geometry.offsets,n=0,r=new Uint32Array(2*t.length),q=0,x=m.length;q<x;++q)for(var p=m[q].start,v=m[q].count,f=m[q].index,s=p,u=p+v;s<u;s+=3)for(p=0;3>p;p++)d[0]=f+t[s+p],d[1]=f+t[s+(p+1)%3],d.sort(g),v=d.toString(),
-void 0===e[v]&&(r[2*n]=d[0],r[2*n+1]=d[1],e[v]=!0,n++);d=new Float32Array(6*n);s=0;for(t=n;s<t;s++)for(p=0;2>p;p++)f=6*s+3*p,n=3*r[2*s+p],d[f+0]=k[n],d[f+1]=k[n+1],d[f+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,r=n/3,d=new Float32Array(6*n),s=0,t=r;s<t;s++)for(p=0;3>p;p++)f=18*s+6*p,r=9*s+3*p,d[f+0]=k[r],d[f+1]=k[r+1],d[f+2]=k[r+2],n=9*s+(p+1)%3*3,d[f+3]=k[n],d[f+4]=k[n+1],d[f+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),
+THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,m=a.geometry.faces,n=0,q=new Uint32Array(6*m.length),s=0,t=m.length;s<t;s++)for(var r=m[s],p=0;3>p;p++){d[0]=r[f[p]];d[1]=r[f[(p+1)%3]];d.sort(g);var v=d.toString();void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++)}d=new Float32Array(6*n);s=0;for(t=n;s<t;s++)for(p=0;2>p;p++)n=
+k[q[2*s+p]],f=6*s+3*p,d[f+0]=n.x,d[f+1]=n.y,d[f+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,m=a.geometry.offsets,n=0,q=new Uint32Array(2*t.length),r=0,x=m.length;r<x;++r)for(var p=m[r].start,v=m[r].count,f=m[r].index,s=p,u=p+v;s<u;s+=3)for(p=0;3>p;p++)d[0]=f+t[s+p],d[1]=f+t[s+(p+1)%3],d.sort(g),v=d.toString(),
+void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++);d=new Float32Array(6*n);s=0;for(t=n;s<t;s++)for(p=0;2>p;p++)f=6*s+3*p,n=3*q[2*s+p],d[f+0]=k[n],d[f+1]=k[n+1],d[f+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),s=0,t=q;s<t;s++)for(p=0;3>p;p++)f=18*s+6*p,q=9*s+3*p,d[f+0]=k[q],d[f+1]=k[q+1],d[f+2]=k[q+2],n=9*s+(p+1)%3*3,d[f+3]=k[n],d[f+4]=k[n+1],d[f+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),
 THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};
 THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.add=function(a,b,c,d,e,g){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===g&&(g=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:g,color:e,blending:d})};
 THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a<b;a++)c=this.lensFlares[a],c.x=this.positionScreen.x+d*c.distance,c.y=this.positionScreen.y+e*c.distance,c.wantedRotation=c.x*Math.PI*0.25,c.rotation+=0.25*(c.wantedRotation-c.rotation)};
@@ -805,17 +807,17 @@ THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.ani
 THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1};
 THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;b<c;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a;if(d.mirroredLoop){if(d.time>d.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var g=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),f=d.weight;
 g!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*f,this.morphTargetInfluences[g]=0,d.lastFrame=d.currentFrame,d.currentFrame=g);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*f;this.morphTargetInfluences[d.lastFrame]=(1-e)*f}}};
-THREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.createShader(c.FRAGMENT_SHADER),f=c.createShader(c.VERTEX_SHADER),g="precision "+b+" float;\n";c.shaderSource(e,g+a.fragmentShader);c.shaderSource(f,g+a.vertexShader);c.compileShader(e);c.compileShader(f);c.attachShader(d,e);c.attachShader(d,f);c.linkProgram(d);return d}var b=[],c,d,e,g,f,h,k,m,n,r,s,t,q;this.init=function(b){c=b.context;d=b;e=b.getPrecision();g=new Float32Array(16);f=new Uint16Array(6);b=0;g[b++]=-1;g[b++]=
+THREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.createShader(c.FRAGMENT_SHADER),f=c.createShader(c.VERTEX_SHADER),g="precision "+b+" float;\n";c.shaderSource(e,g+a.fragmentShader);c.shaderSource(f,g+a.vertexShader);c.compileShader(e);c.compileShader(f);c.attachShader(d,e);c.attachShader(d,f);c.linkProgram(d);return d}var b=[],c,d,e,g,f,h,k,m,n,q,s,t,r;this.init=function(b){c=b.context;d=b;e=b.getPrecision();g=new Float32Array(16);f=new Uint16Array(6);b=0;g[b++]=-1;g[b++]=
 -1;g[b++]=0;g[b++]=0;g[b++]=1;g[b++]=-1;g[b++]=1;g[b++]=0;g[b++]=1;g[b++]=1;g[b++]=1;g[b++]=1;g[b++]=-1;g[b++]=1;g[b++]=0;g[b++]=1;b=0;f[b++]=0;f[b++]=1;f[b++]=2;f[b++]=0;f[b++]=2;f[b++]=3;h=c.createBuffer();k=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,h);c.bufferData(c.ARRAY_BUFFER,g,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.bufferData(c.ELEMENT_ARRAY_BUFFER,f,c.STATIC_DRAW);m=c.createTexture();n=c.createTexture();c.bindTexture(c.TEXTURE_2D,m);c.texImage2D(c.TEXTURE_2D,0,c.RGB,16,
 16,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);c.bindTexture(c.TEXTURE_2D,n);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,16,16,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);
-c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(r=!1,s=a(THREE.ShaderFlares.lensFlare,e)):(r=!0,s=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};q={};t.vertex=c.getAttribLocation(s,"position");t.uv=c.getAttribLocation(s,"uv");q.renderType=c.getUniformLocation(s,"renderType");q.map=c.getUniformLocation(s,"map");q.occlusionMap=c.getUniformLocation(s,"occlusionMap");q.opacity=
-c.getUniformLocation(s,"opacity");q.color=c.getUniformLocation(s,"color");q.scale=c.getUniformLocation(s,"scale");q.rotation=c.getUniformLocation(s,"rotation");q.screenPosition=c.getUniformLocation(s,"screenPosition")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var E=g/f,y=0.5*f,z=0.5*g,B=16/g,D=new THREE.Vector2(B*E,B),w=new THREE.Vector3(1,1,0),A=new THREE.Vector2(1,1),N=q,B=t;c.useProgram(s);
+c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(q=!1,s=a(THREE.ShaderFlares.lensFlare,e)):(q=!0,s=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};r={};t.vertex=c.getAttribLocation(s,"position");t.uv=c.getAttribLocation(s,"uv");r.renderType=c.getUniformLocation(s,"renderType");r.map=c.getUniformLocation(s,"map");r.occlusionMap=c.getUniformLocation(s,"occlusionMap");r.opacity=
+c.getUniformLocation(s,"opacity");r.color=c.getUniformLocation(s,"color");r.scale=c.getUniformLocation(s,"scale");r.rotation=c.getUniformLocation(s,"rotation");r.screenPosition=c.getUniformLocation(s,"screenPosition")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var E=g/f,y=0.5*f,z=0.5*g,B=16/g,D=new THREE.Vector2(B*E,B),w=new THREE.Vector3(1,1,0),A=new THREE.Vector2(1,1),N=r,B=t;c.useProgram(s);
 c.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(N.occlusionMap,0);c.uniform1i(N.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(B.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(B.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var P=0,K=b.length;P<K;P++){B=16/g;D.set(B*E,B);var R=b[P];a.set(R.matrixWorld.elements[12],R.matrixWorld.elements[13],R.matrixWorld.elements[14]);a.applyMatrix4(e.matrixWorldInverse);
-a.applyProjection(e.projectionMatrix);w.copy(a);A.x=w.x*y+y;A.y=w.y*z+z;if(r||0<A.x&&A.x<f&&0<A.y&&A.y<g){c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,m);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGB,A.x-8,A.y-8,16,16,0);c.uniform1i(N.renderType,0);c.uniform2f(N.scale,D.x,D.y);c.uniform3f(N.screenPosition,w.x,w.y,w.z);c.disable(c.BLEND);c.enable(c.DEPTH_TEST);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,n);c.copyTexImage2D(c.TEXTURE_2D,
+a.applyProjection(e.projectionMatrix);w.copy(a);A.x=w.x*y+y;A.y=w.y*z+z;if(q||0<A.x&&A.x<f&&0<A.y&&A.y<g){c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,m);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGB,A.x-8,A.y-8,16,16,0);c.uniform1i(N.renderType,0);c.uniform2f(N.scale,D.x,D.y);c.uniform3f(N.screenPosition,w.x,w.y,w.z);c.disable(c.BLEND);c.enable(c.DEPTH_TEST);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,n);c.copyTexImage2D(c.TEXTURE_2D,
 0,c.RGBA,A.x-8,A.y-8,16,16,0);c.uniform1i(N.renderType,1);c.disable(c.DEPTH_TEST);c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,m);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);R.positionScreen.copy(w);R.customUpdateCallback?R.customUpdateCallback(R):R.updateLensFlares();c.uniform1i(N.renderType,2);c.enable(c.BLEND);for(var M=0,H=R.lensFlares.length;M<H;M++){var C=R.lensFlares[M];0.001<C.opacity&&0.001<C.scale&&(w.x=C.x,w.y=C.y,w.z=C.z,B=C.size*C.scale/g,D.x=B*E,D.y=B,c.uniform3f(N.screenPosition,
 w.x,w.y,w.z),c.uniform2f(N.scale,D.x,D.y),c.uniform1f(N.rotation,C.rotation),c.uniform1f(N.opacity,C.opacity),c.uniform3f(N.color,C.color.r,C.color.g,C.color.b),d.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),d.setTexture(C.texture,1),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0))}}}c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(!0)}}};
-THREE.ShadowMapPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&c.castShadow&&(!1===c.frustumCulled||!0===n.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);p.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}var b,c,d,e,g,f,h,k,m,n=new THREE.Frustum,r=new THREE.Matrix4,s=new THREE.Vector3,t=new THREE.Vector3,q=new THREE.Vector3,p=[];this.init=function(a,n,p,q){b=a.context;c=
-a;d=n;e=p;g=q;a=THREE.ShaderLib.depthRGBA;n=THREE.UniformsUtils.clone(a.uniforms);f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n});h=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0});k=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,skinning:!0});m=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,
+THREE.ShadowMapPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&c.castShadow&&(!1===c.frustumCulled||!0===n.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);p.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}var b,c,d,e,g,f,h,k,m,n=new THREE.Frustum,q=new THREE.Matrix4,s=new THREE.Vector3,t=new THREE.Vector3,r=new THREE.Vector3,p=[];this.init=function(a,n,p,r){b=a.context;c=
+a;d=n;e=p;g=r;a=THREE.ShaderLib.depthRGBA;n=THREE.UniformsUtils.clone(a.uniforms);f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n});h=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0});k=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,skinning:!0});m=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,
 uniforms:n,morphTargets:!0,skinning:!0});f._shadowPass=!0;h._shadowPass=!0;k._shadowPass=!0;m._shadowPass=!0};this.render=function(a,b){c.shadowMapEnabled&&c.shadowMapAutoUpdate&&this.update(a,b)};this.update=function(e,x){var u,E,y,z,B,D,w,A,N=[];z=0;b.clearColor(1,1,1,1);b.disable(b.BLEND);b.enable(b.CULL_FACE);b.frontFace(b.CCW);c.shadowMapCullFace===THREE.CullFaceFront?b.cullFace(b.FRONT):b.cullFace(b.BACK);c.setDepthTest(!0);u=0;for(E=d.length;u<E;u++)if(y=d[u],y.castShadow)if(y instanceof THREE.DirectionalLight&&
 y.shadowCascade)for(B=0;B<y.shadowCascadeCount;B++){var P;if(y.shadowCascadeArray[B])P=y.shadowCascadeArray[B];else{w=y;var K=B;P=new THREE.DirectionalLight;P.isVirtual=!0;P.onlyShadow=!0;P.castShadow=!0;P.shadowCameraNear=w.shadowCameraNear;P.shadowCameraFar=w.shadowCameraFar;P.shadowCameraLeft=w.shadowCameraLeft;P.shadowCameraRight=w.shadowCameraRight;P.shadowCameraBottom=w.shadowCameraBottom;P.shadowCameraTop=w.shadowCameraTop;P.shadowCameraVisible=w.shadowCameraVisible;P.shadowDarkness=w.shadowDarkness;
 P.shadowBias=w.shadowCascadeBias[K];P.shadowMapWidth=w.shadowCascadeWidth[K];P.shadowMapHeight=w.shadowCascadeHeight[K];P.pointsWorld=[];P.pointsFrustum=[];A=P.pointsWorld;D=P.pointsFrustum;for(var R=0;8>R;R++)A[R]=new THREE.Vector3,D[R]=new THREE.Vector3;A=w.shadowCascadeNearZ[K];w=w.shadowCascadeFarZ[K];D[0].set(-1,-1,A);D[1].set(1,-1,A);D[2].set(-1,1,A);D[3].set(1,1,A);D[4].set(-1,-1,w);D[5].set(1,-1,w);D[6].set(-1,1,w);D[7].set(1,1,w);P.originalCamera=x;D=new THREE.Gyroscope;D.position.copy(y.shadowCascadeOffset);
@@ -823,23 +825,23 @@ D.add(P);D.add(P.target);x.add(D);y.shadowCascadeArray[B]=P;console.log("Created
 u=0;for(E=N.length;u<E;u++){y=N[u];y.shadowMap||(B=THREE.LinearFilter,c.shadowMapType===THREE.PCFSoftShadowMap&&(B=THREE.NearestFilter),y.shadowMap=new THREE.WebGLRenderTarget(y.shadowMapWidth,y.shadowMapHeight,{minFilter:B,magFilter:B,format:THREE.RGBAFormat}),y.shadowMapSize=new THREE.Vector2(y.shadowMapWidth,y.shadowMapHeight),y.shadowMatrix=new THREE.Matrix4);if(!y.shadowCamera){if(y instanceof THREE.SpotLight)y.shadowCamera=new THREE.PerspectiveCamera(y.shadowCameraFov,y.shadowMapWidth/y.shadowMapHeight,
 y.shadowCameraNear,y.shadowCameraFar);else if(y instanceof THREE.DirectionalLight)y.shadowCamera=new THREE.OrthographicCamera(y.shadowCameraLeft,y.shadowCameraRight,y.shadowCameraTop,y.shadowCameraBottom,y.shadowCameraNear,y.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}e.add(y.shadowCamera);!0===e.autoUpdate&&e.updateMatrixWorld()}y.shadowCameraVisible&&!y.cameraHelper&&(y.cameraHelper=new THREE.CameraHelper(y.shadowCamera),y.shadowCamera.add(y.cameraHelper));
 if(y.isVirtual&&P.originalCamera==x){B=x;z=y.shadowCamera;D=y.pointsFrustum;w=y.pointsWorld;s.set(Infinity,Infinity,Infinity);t.set(-Infinity,-Infinity,-Infinity);for(K=0;8>K;K++)A=w[K],A.copy(D[K]),THREE.ShadowMapPlugin.__projector.unprojectVector(A,B),A.applyMatrix4(z.matrixWorldInverse),A.x<s.x&&(s.x=A.x),A.x>t.x&&(t.x=A.x),A.y<s.y&&(s.y=A.y),A.y>t.y&&(t.y=A.y),A.z<s.z&&(s.z=A.z),A.z>t.z&&(t.z=A.z);z.left=s.x;z.right=t.x;z.top=t.y;z.bottom=s.y;z.updateProjectionMatrix()}z=y.shadowMap;D=y.shadowMatrix;
-B=y.shadowCamera;B.position.setFromMatrixPosition(y.matrixWorld);q.setFromMatrixPosition(y.target.matrixWorld);B.lookAt(q);B.updateMatrixWorld();B.matrixWorldInverse.getInverse(B.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();D.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);D.multiply(B.projectionMatrix);D.multiply(B.matrixWorldInverse);r.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse);n.setFromMatrix(r);c.setRenderTarget(z);
+B=y.shadowCamera;B.position.setFromMatrixPosition(y.matrixWorld);r.setFromMatrixPosition(y.target.matrixWorld);B.lookAt(r);B.updateMatrixWorld();B.matrixWorldInverse.getInverse(B.matrixWorld);y.cameraHelper&&(y.cameraHelper.visible=y.shadowCameraVisible);y.shadowCameraVisible&&y.cameraHelper.update();D.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);D.multiply(B.projectionMatrix);D.multiply(B.matrixWorldInverse);q.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse);n.setFromMatrix(q);c.setRenderTarget(z);
 c.clear();p.length=0;a(e,e,B);y=0;for(z=p.length;y<z;y++)w=p[y],D=w.object,w=w.buffer,K=D.material instanceof THREE.MeshFaceMaterial?D.material.materials[0]:D.material,A=void 0!==D.geometry.morphTargets&&0<D.geometry.morphTargets.length&&K.morphTargets,R=D instanceof THREE.SkinnedMesh&&K.skinning,A=D.customDepthMaterial?D.customDepthMaterial:R?A?m:k:A?h:f,c.setMaterialFaces(K),w instanceof THREE.BufferGeometry?c.renderBufferDirect(B,d,null,A,w,D):c.renderBuffer(B,d,null,A,w,D);y=0;for(z=g.length;y<
 z;y++)w=g[y],D=w.object,D.visible&&D.castShadow&&(D._modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,D.matrixWorld),c.renderImmediateObject(B,d,null,f,D))}u=c.getClearColor();E=c.getClearAlpha();b.clearColor(u.r,u.g,u.b,E);b.enable(b.BLEND);c.shadowMapCullFace===THREE.CullFaceFront&&b.cullFace(b.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;
-THREE.SpritePlugin=function(){var a,b,c,d,e,g,f,h,k,m,n,r,s,t,q,p,v;function x(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,E,y,z=[],B,D,w,A,N;this.init=function(x){u=x.context;E=x;B=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);D=new Uint16Array([0,1,2,0,2,3]);w=u.createBuffer();A=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,w);u.bufferData(u.ARRAY_BUFFER,B,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,A);u.bufferData(u.ELEMENT_ARRAY_BUFFER,D,u.STATIC_DRAW);x=u.createProgram();
+THREE.SpritePlugin=function(){var a,b,c,d,e,g,f,h,k,m,n,q,s,t,r,p,v;function x(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,E,y,z=[],B,D,w,A,N;this.init=function(x){u=x.context;E=x;B=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);D=new Uint16Array([0,1,2,0,2,3]);w=u.createBuffer();A=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,w);u.bufferData(u.ARRAY_BUFFER,B,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,A);u.bufferData(u.ELEMENT_ARRAY_BUFFER,D,u.STATIC_DRAW);x=u.createProgram();
 var z=u.createShader(u.VERTEX_SHADER),R=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(z,["precision "+E.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"));
 u.shaderSource(R,["precision "+E.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;\nfloat fogFactor = 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"));
 u.compileShader(z);u.compileShader(R);u.attachShader(x,z);u.attachShader(x,R);u.linkProgram(x);N=x;p=u.getAttribLocation(N,"position");v=u.getAttribLocation(N,"uv");a=u.getUniformLocation(N,"uvOffset");b=u.getUniformLocation(N,"uvScale");c=u.getUniformLocation(N,"rotation");d=u.getUniformLocation(N,"scale");e=u.getUniformLocation(N,"color");g=u.getUniformLocation(N,"map");f=u.getUniformLocation(N,"opacity");h=u.getUniformLocation(N,"modelViewMatrix");k=u.getUniformLocation(N,"projectionMatrix");m=
-u.getUniformLocation(N,"fogType");n=u.getUniformLocation(N,"fogDensity");r=u.getUniformLocation(N,"fogNear");s=u.getUniformLocation(N,"fogFar");t=u.getUniformLocation(N,"fogColor");q=u.getUniformLocation(N,"alphaTest");x=document.createElement("canvas");x.width=8;x.height=8;z=x.getContext("2d");z.fillStyle="white";z.fillRect(0,0,8,8);y=new THREE.Texture(x);y.needsUpdate=!0};this.render=function(D,B,R,M){z.length=0;D.traverseVisible(function(a){a instanceof THREE.Sprite&&z.push(a)});if(0!==z.length){u.useProgram(N);
-u.enableVertexAttribArray(p);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,w);u.vertexAttribPointer(p,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,A);u.uniformMatrix4fv(k,!1,B.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(g,0);M=R=0;var H=D.fog;H?(u.uniform3f(t,H.color.r,H.color.g,H.color.b),H instanceof THREE.Fog?(u.uniform1f(r,H.near),u.uniform1f(s,H.far),u.uniform1i(m,1),
-M=R=1):H instanceof THREE.FogExp2&&(u.uniform1f(n,H.density),u.uniform1i(m,2),M=R=2)):(u.uniform1i(m,0),M=R=0);for(var H=0,C=z.length;H<C;H++){var T=z[H],L=T.material;T._modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,T.matrixWorld);T.z=-T._modelViewMatrix.elements[14]}z.sort(x);B=[];H=0;for(C=z.length;H<C;H++)T=z[H],L=T.material,u.uniform1f(q,L.alphaTest),u.uniformMatrix4fv(h,!1,T._modelViewMatrix.elements),B[0]=T.scale.x,B[1]=T.scale.y,T=0,D.fog&&L.fog&&(T=M),R!==T&&(u.uniform1i(m,T),R=T),
+u.getUniformLocation(N,"fogType");n=u.getUniformLocation(N,"fogDensity");q=u.getUniformLocation(N,"fogNear");s=u.getUniformLocation(N,"fogFar");t=u.getUniformLocation(N,"fogColor");r=u.getUniformLocation(N,"alphaTest");x=document.createElement("canvas");x.width=8;x.height=8;z=x.getContext("2d");z.fillStyle="white";z.fillRect(0,0,8,8);y=new THREE.Texture(x);y.needsUpdate=!0};this.render=function(D,B,R,M){z.length=0;D.traverseVisible(function(a){a instanceof THREE.Sprite&&z.push(a)});if(0!==z.length){u.useProgram(N);
+u.enableVertexAttribArray(p);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,w);u.vertexAttribPointer(p,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,A);u.uniformMatrix4fv(k,!1,B.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(g,0);M=R=0;var H=D.fog;H?(u.uniform3f(t,H.color.r,H.color.g,H.color.b),H instanceof THREE.Fog?(u.uniform1f(q,H.near),u.uniform1f(s,H.far),u.uniform1i(m,1),
+M=R=1):H instanceof THREE.FogExp2&&(u.uniform1f(n,H.density),u.uniform1i(m,2),M=R=2)):(u.uniform1i(m,0),M=R=0);for(var H=0,C=z.length;H<C;H++){var T=z[H],L=T.material;T._modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,T.matrixWorld);T.z=-T._modelViewMatrix.elements[14]}z.sort(x);B=[];H=0;for(C=z.length;H<C;H++)T=z[H],L=T.material,u.uniform1f(r,L.alphaTest),u.uniformMatrix4fv(h,!1,T._modelViewMatrix.elements),B[0]=T.scale.x,B[1]=T.scale.y,T=0,D.fog&&L.fog&&(T=M),R!==T&&(u.uniform1i(m,T),R=T),
 null!==L.map?(u.uniform2f(a,L.map.offset.x,L.map.offset.y),u.uniform2f(b,L.map.repeat.x,L.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(f,L.opacity),u.uniform3f(e,L.color.r,L.color.g,L.color.b),u.uniform1f(c,L.rotation),u.uniform2fv(d,B),E.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst),E.setDepthTest(L.depthTest),E.setDepthWrite(L.depthWrite),L.map&&L.map.image&&L.map.image.width?E.setTexture(L.map,0):E.setTexture(y,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,
 0);u.enable(u.CULL_FACE)}}};
-THREE.DepthPassPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&(!1===c.frustumCulled||!0===n.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);s.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}this.enabled=!1;this.renderTarget=null;var b,c,d,e,g,f,h,k,m,n=new THREE.Frustum,r=new THREE.Matrix4,s=[];this.init=function(a,n,p,r){b=a.context;c=a;d=n;e=p;g=r;a=THREE.ShaderLib.depthRGBA;
+THREE.DepthPassPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&(!1===c.frustumCulled||!0===n.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);s.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}this.enabled=!1;this.renderTarget=null;var b,c,d,e,g,f,h,k,m,n=new THREE.Frustum,q=new THREE.Matrix4,s=[];this.init=function(a,n,p,q){b=a.context;c=a;d=n;e=p;g=q;a=THREE.ShaderLib.depthRGBA;
 n=THREE.UniformsUtils.clone(a.uniforms);f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n});h=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0});k=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,skinning:!0});m=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0,skinning:!0});f._shadowPass=
-!0;h._shadowPass=!0;k._shadowPass=!0;m._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(e,q){var p,v,x,u,E;b.clearColor(1,1,1,1);b.disable(b.BLEND);c.setDepthTest(!0);!0===e.autoUpdate&&e.updateMatrixWorld();q.matrixWorldInverse.getInverse(q.matrixWorld);r.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse);n.setFromMatrix(r);c.setRenderTarget(this.renderTarget);c.clear();s.length=0;a(e,e,q);var y;p=0;for(v=s.length;p<v;p++)x=s[p],E=x.object,x=x.buffer,
-E instanceof THREE.PointCloud&&!E.customDepthMaterial||((y=E.material instanceof THREE.MeshFaceMaterial?E.material.materials[0]:E.material)&&c.setMaterialFaces(E.material),u=void 0!==E.geometry.morphTargets&&0<E.geometry.morphTargets.length&&y.morphTargets,y=E instanceof THREE.SkinnedMesh&&y.skinning,u=E.customDepthMaterial?E.customDepthMaterial:y?u?m:k:u?h:f,x instanceof THREE.BufferGeometry?c.renderBufferDirect(q,d,null,u,x,E):c.renderBuffer(q,d,null,u,x,E));p=0;for(v=g.length;p<v;p++)x=g[p],E=
-x.object,E.visible&&(E._modelViewMatrix.multiplyMatrices(q.matrixWorldInverse,E.matrixWorld),c.renderImmediateObject(q,d,null,f,E));p=c.getClearColor();v=c.getClearAlpha();b.clearColor(p.r,p.g,p.b,v);b.enable(b.BLEND)}};
+!0;h._shadowPass=!0;k._shadowPass=!0;m._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(e,r){var p,v,x,u,E;b.clearColor(1,1,1,1);b.disable(b.BLEND);c.setDepthTest(!0);!0===e.autoUpdate&&e.updateMatrixWorld();r.matrixWorldInverse.getInverse(r.matrixWorld);q.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse);n.setFromMatrix(q);c.setRenderTarget(this.renderTarget);c.clear();s.length=0;a(e,e,r);var y;p=0;for(v=s.length;p<v;p++)x=s[p],E=x.object,x=x.buffer,
+E instanceof THREE.PointCloud&&!E.customDepthMaterial||((y=E.material instanceof THREE.MeshFaceMaterial?E.material.materials[0]:E.material)&&c.setMaterialFaces(E.material),u=void 0!==E.geometry.morphTargets&&0<E.geometry.morphTargets.length&&y.morphTargets,y=E instanceof THREE.SkinnedMesh&&y.skinning,u=E.customDepthMaterial?E.customDepthMaterial:y?u?m:k:u?h:f,x instanceof THREE.BufferGeometry?c.renderBufferDirect(r,d,null,u,x,E):c.renderBuffer(r,d,null,u,x,E));p=0;for(v=g.length;p<v;p++)x=g[p],E=
+x.object,E.visible&&(E._modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,E.matrixWorld),c.renderImmediateObject(r,d,null,f,E));p=c.getClearColor();v=c.getClearAlpha();b.clearColor(p.r,p.g,p.b,v);b.enable(b.BLEND)}};
 THREE.ShaderFlares={lensFlareVertexTexture:{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}"},
 lensFlare:{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}"}};