Browse Source

Updated builds.

Mr.doob 12 years ago
parent
commit
2ab124cf1b
2 changed files with 369 additions and 366 deletions
  1. 127 123
      build/three.js
  2. 242 243
      build/three.min.js

+ 127 - 123
build/three.js

@@ -1914,9 +1914,12 @@ THREE.Vector3.prototype = {
 
 
 	crossVectors: function ( a, b ) {
 	crossVectors: function ( a, b ) {
 
 
-		this.x = a.y * b.z - a.z * b.y;
-		this.y = a.z * b.x - a.x * b.z;
-		this.z = a.x * b.y - a.y * b.x;
+		var ax = a.x, ay = a.y, az = a.z;
+		var bx = b.x, by = b.y, bz = b.z;
+
+		this.x = ay * bz - az * by;
+		this.y = az * bx - ax * bz;
+		this.z = ax * by - ay * bx;
 
 
 		return this;
 		return this;
 
 
@@ -5295,6 +5298,7 @@ THREE.Ray.prototype = {
 		this.direction.add( this.origin ).applyMatrix4( matrix4 );
 		this.direction.add( this.origin ).applyMatrix4( matrix4 );
 		this.origin.applyMatrix4( matrix4 );
 		this.origin.applyMatrix4( matrix4 );
 		this.direction.sub( this.origin );
 		this.direction.sub( this.origin );
+		this.direction.normalize();
 
 
 		return this;
 		return this;
 	},
 	},
@@ -6299,6 +6303,69 @@ THREE.Triangle.containsPoint = function() {
 
 
 }();
 }();
 
 
+THREE.Triangle.intersectionRay = function ()	{
+
+	// Compute the offset origin, edges, and normal.
+	var diff = new THREE.Vector3();
+	var edge1 = new THREE.Vector3();
+	var edge2 = new THREE.Vector3();
+	var normal = new THREE.Vector3();
+
+	return function ( ray, a, b, c, backfaceCulling ) {
+
+		//from http://www.geometrictools.com/LibMathematics/Intersection/Wm5IntrRay3Triangle3.cpp
+
+		edge1.subVectors( b, a );
+		edge2.subVectors( c, a );
+		normal.crossVectors( edge1, edge2 );
+
+		// Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,
+		// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by
+		//   |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))
+		//   |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))
+		//   |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)
+		var DdN = ray.direction.dot(normal);
+		var sign;
+		if ( DdN > 0 ) {
+
+				if ( backfaceCulling ) return null;
+				sign = 1;
+
+		} else if ( DdN < 0 ) {
+
+				sign = - 1;
+				DdN = - DdN;
+
+		} else return null;
+
+		diff.subVectors( ray.origin, a );
+		var DdQxE2 = sign * ray.direction.dot( edge2.crossVectors( diff, edge2 ) );
+
+		// b1 < 0, no intersection
+		if ( DdQxE2 < 0 )
+			return null;
+
+		var DdE1xQ = sign * ray.direction.dot( edge1.cross( diff ) );
+		// b2 < 0, no intersection
+		if ( DdE1xQ < 0 )
+			return null;
+
+		// b1+b2 > 1, no intersection
+		if ( DdQxE2 + DdE1xQ > DdN )
+			return null
+
+		// Line intersects triangle, check if ray does.
+		var QdN = - sign * diff.dot( normal );
+		// t < 0, no intersection
+		if ( QdN < 0 )
+			return null
+
+		// Ray intersects triangle.
+		return ray.at( QdN / DdN );
+	}
+
+}();
+
 THREE.Triangle.prototype = {
 THREE.Triangle.prototype = {
 
 
 	constructor: THREE.Triangle,
 	constructor: THREE.Triangle,
@@ -6382,6 +6449,12 @@ THREE.Triangle.prototype = {
 
 
 	},
 	},
 
 
+	intersectionRay: function ( ray, backfaceCulling ) {
+
+		return THREE.Triangle.intersectionRay( ray, this.a, this.b, this.c, backfaceCulling );
+
+	},
+
 	equals: function ( triangle ) {
 	equals: function ( triangle ) {
 
 
 		return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c );
 		return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c );
@@ -6587,6 +6660,7 @@ THREE.EventDispatcher.prototype = {
 /**
 /**
  * @author mrdoob / http://mrdoob.com/
  * @author mrdoob / http://mrdoob.com/
  * @author bhouston / http://exocortex.com/
  * @author bhouston / http://exocortex.com/
+ * @author stephomi / http://stephaneginier.com/
  */
  */
 
 
 ( function ( THREE ) {
 ( function ( THREE ) {
@@ -6594,13 +6668,7 @@ THREE.EventDispatcher.prototype = {
 	THREE.Raycaster = function ( origin, direction, near, far ) {
 	THREE.Raycaster = function ( origin, direction, near, far ) {
 
 
 		this.ray = new THREE.Ray( origin, direction );
 		this.ray = new THREE.Ray( origin, direction );
-
-		// normalized ray.direction required for accurate distance calculations
-		if ( this.ray.direction.lengthSq() > 0 ) {
-
-			this.ray.direction.normalize();
-
-		}
+		// direction is assumed to be normalized (for accurate distance calculations)
 
 
 		this.near = near || 0;
 		this.near = near || 0;
 		this.far = far || Infinity;
 		this.far = far || Infinity;
@@ -6676,11 +6744,6 @@ THREE.EventDispatcher.prototype = {
 				if ( material === undefined ) return intersects;
 				if ( material === undefined ) return intersects;
 				if ( geometry.dynamic === false ) return intersects;
 				if ( geometry.dynamic === false ) return intersects;
 
 
-				var isFaceMaterial = object.material instanceof THREE.MeshFaceMaterial;
-				var objectMaterials = isFaceMaterial === true ? object.material.materials : null;
-
-				var side = object.material.side;
-
 				var a, b, c;
 				var a, b, c;
 				var precision = raycaster.precision;
 				var precision = raycaster.precision;
 
 
@@ -6705,22 +6768,25 @@ THREE.EventDispatcher.prototype = {
 				var vA = new THREE.Vector3();
 				var vA = new THREE.Vector3();
 				var vB = new THREE.Vector3();
 				var vB = new THREE.Vector3();
 				var vC = new THREE.Vector3();
 				var vC = new THREE.Vector3();
-				var vCB = new THREE.Vector3();
-				var vAB = new THREE.Vector3();
 
 
-				for ( var oi = 0; oi < geometry.offsets.length; ++oi ) {
+				var offsets = geometry.offsets;
+				var indices = geometry.attributes.index.array;
+				var positions = geometry.attributes.position.array;
+				var offLength = geometry.offsets.length;
+
+				for ( var oi = 0; oi < offLength; ++oi ) {
 
 
-					var start = geometry.offsets[ oi ].start;
-					var count = geometry.offsets[ oi ].count;
-					var index = geometry.offsets[ oi ].index;
+					var start = offsets[ oi ].start;
+					var count = offsets[ oi ].count;
+					var index = offsets[ oi ].index;
 
 
 					for ( var i = start, il = start + count; i < il; i += 3 ) {
 					for ( var i = start, il = start + count; i < il; i += 3 ) {
 
 
 						if ( indexed ) {
 						if ( indexed ) {
 
 
-							a = index + geometry.attributes.index.array[ i ];
-							b = index + geometry.attributes.index.array[ i + 1 ];
-							c = index + geometry.attributes.index.array[ i + 2 ];
+							a = index + indices[ i ];
+							b = index + indices[ i + 1 ];
+							c = index + indices[ i + 2 ];
 
 
 						} else {
 						} else {
 
 
@@ -6731,70 +6797,37 @@ THREE.EventDispatcher.prototype = {
 						}
 						}
 
 
 						vA.set(
 						vA.set(
-							geometry.attributes.position.array[ a * 3 ],
-							geometry.attributes.position.array[ a * 3 + 1 ],
-							geometry.attributes.position.array[ a * 3 + 2 ]
+							positions[ a * 3 ],
+							positions[ a * 3 + 1 ],
+							positions[ a * 3 + 2 ]
 						);
 						);
 						vB.set(
 						vB.set(
-							geometry.attributes.position.array[ b * 3 ],
-							geometry.attributes.position.array[ b * 3 + 1 ],
-							geometry.attributes.position.array[ b * 3 + 2 ]
+							positions[ b * 3 ],
+							positions[ b * 3 + 1 ],
+							positions[ b * 3 + 2 ]
 						);
 						);
 						vC.set(
 						vC.set(
-							geometry.attributes.position.array[ c * 3 ],
-							geometry.attributes.position.array[ c * 3 + 1 ],
-							geometry.attributes.position.array[ c * 3 + 2 ]
+							positions[ c * 3 ],
+							positions[ c * 3 + 1 ],
+							positions[ c * 3 + 2 ]
 						);
 						);
 
 
-						facePlane.setFromCoplanarPoints( vA, vB, vC );
-
-						var planeDistance = localRay.distanceToPlane( facePlane );
-
-						// bail if the ray is too close to the plane
-						if ( planeDistance < precision ) continue;
-
-						// bail if the ray is behind the plane
-						if ( planeDistance === null ) continue;
-
-						// check if we hit the wrong side of a single sided face
-						side = material.side;
+						var interPoint = THREE.Triangle.intersectionRay( localRay, vA, vB, vC, material.side !== THREE.DoubleSide );
 
 
-						if ( side !== THREE.DoubleSide ) {
+						if ( !interPoint ) continue;
 
 
-							var planeSign = localRay.direction.dot( facePlane.normal );
-							
+						interPoint.applyMatrix4( object.matrixWorld );
+						var distance = raycaster.ray.origin.distanceTo( interPoint );
 
 
-							if ( ! ( side === THREE.FrontSide ? planeSign < 0 : planeSign > 0 ) ) {
-
-								continue;
-
-							}
-
-						}
-
-						// this can be done using the planeDistance from localRay because
-						// localRay wasn't normalized, but ray was
-						if ( planeDistance < raycaster.near || planeDistance > raycaster.far ) {
-
-							continue;
-
-						}
-
-						// passing in intersectPoint avoids a copy
-						intersectPoint = localRay.at( planeDistance, intersectPoint );
-
-						if ( THREE.Triangle.containsPoint( intersectPoint, vA, vB, vC ) === false ) {
+						// bail if the ray is too close to the plane
+						if ( distance < precision ) continue;
 
 
-							continue;
-
-						}
+						if ( distance < raycaster.near || distance > raycaster.far ) continue;
 
 
 						intersects.push( {
 						intersects.push( {
 
 
-							// this works because the original ray was normalized,
-							// and the transformed localRay wasn't
-							distance: planeDistance,
-							point: raycaster.ray.at( planeDistance ),
+							distance: distance,
+							point: interPoint,
 							face: null,
 							face: null,
 							faceIndex: null,
 							faceIndex: null,
 							object: object
 							object: object
@@ -6809,8 +6842,6 @@ THREE.EventDispatcher.prototype = {
 				var isFaceMaterial = object.material instanceof THREE.MeshFaceMaterial;
 				var isFaceMaterial = object.material instanceof THREE.MeshFaceMaterial;
 				var objectMaterials = isFaceMaterial === true ? object.material.materials : null;
 				var objectMaterials = isFaceMaterial === true ? object.material.materials : null;
 
 
-				var side = object.material.side;
-
 				var a, b, c, d;
 				var a, b, c, d;
 				var precision = raycaster.precision;
 				var precision = raycaster.precision;
 
 
@@ -6826,44 +6857,16 @@ THREE.EventDispatcher.prototype = {
 
 
 					if ( material === undefined ) continue;
 					if ( material === undefined ) continue;
 
 
-					facePlane.setFromNormalAndCoplanarPoint( face.normal, vertices[face.a] );
-
-					var planeDistance = localRay.distanceToPlane( facePlane );
-
-					// bail if the ray is too close to the plane
-					if ( planeDistance < precision ) continue;
-
-					// bail if the ray is behind the plane
-					if ( planeDistance === null ) continue;
-
-					// check if we hit the wrong side of a single sided face
-					side = material.side;
-					if ( side !== THREE.DoubleSide ) {
-
-						var planeSign = localRay.direction.dot( facePlane.normal );
-
-						if ( ! ( side === THREE.FrontSide ? planeSign < 0 : planeSign > 0 ) ) {
-
-							continue;
-
-						}
-
-					}
-
-					// this can be done using the planeDistance from localRay because localRay
-					// wasn't normalized, but ray was
-					if ( planeDistance < raycaster.near || planeDistance > raycaster.far ) continue;
-
-					// passing in intersectPoint avoids a copy
-					intersectPoint = localRay.at( planeDistance, intersectPoint );
+					var interPoint;
 
 
 					if ( face instanceof THREE.Face3 ) {
 					if ( face instanceof THREE.Face3 ) {
 
 
 						a = vertices[ face.a ];
 						a = vertices[ face.a ];
 						b = vertices[ face.b ];
 						b = vertices[ face.b ];
 						c = vertices[ face.c ];
 						c = vertices[ face.c ];
+						interPoint = THREE.Triangle.intersectionRay( localRay, a, b, c, material.side !== THREE.DoubleSide );
 
 
-						if ( THREE.Triangle.containsPoint( intersectPoint, a, b, c ) === false ) {
+						if ( !interPoint ) {
 
 
 							continue;
 							continue;
 
 
@@ -6875,11 +6878,13 @@ THREE.EventDispatcher.prototype = {
 						b = vertices[ face.b ];
 						b = vertices[ face.b ];
 						c = vertices[ face.c ];
 						c = vertices[ face.c ];
 						d = vertices[ face.d ];
 						d = vertices[ face.d ];
+						interPoint = THREE.Triangle.intersectionRay( localRay, a, b, d, material.side !== THREE.DoubleSide );
 
 
-						if ( THREE.Triangle.containsPoint( intersectPoint, a, b, d ) === false &&
-						     THREE.Triangle.containsPoint( intersectPoint, b, c, d ) === false ) {
+						if( !interPoint ) {
 
 
-							continue;
+						 interPoint = THREE.Triangle.intersectionRay( localRay, b, c, d, material.side !== THREE.DoubleSide  );
+
+						 if( !interPoint ) continue;
 
 
 						}
 						}
 
 
@@ -6892,12 +6897,18 @@ THREE.EventDispatcher.prototype = {
 
 
 					}
 					}
 
 
+					interPoint.applyMatrix4( object.matrixWorld );
+					var distance = raycaster.ray.origin.distanceTo( interPoint );
+
+					// bail if the ray is too close to the plane
+					if ( distance < precision ) continue;
+
+					if ( distance < raycaster.near || distance > raycaster.far ) continue;
+
 					intersects.push( {
 					intersects.push( {
 
 
-						// this works because the original ray was normalized,
-						// and the transformed localRay wasn't
-						distance: planeDistance,
-						point: raycaster.ray.at( planeDistance ),
+						distance: distance,
+						point: interPoint,
 						face: face,
 						face: face,
 						faceIndex: f,
 						faceIndex: f,
 						object: object
 						object: object
@@ -6929,7 +6940,6 @@ THREE.EventDispatcher.prototype = {
 			
 			
 			inverseMatrix.getInverse( object.matrixWorld );
 			inverseMatrix.getInverse( object.matrixWorld );
 			localRay.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
 			localRay.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
-			localRay.direction.normalize(); // for scale matrix
 
 
 			var vertices = geometry.vertices;
 			var vertices = geometry.vertices;
 			var nbVertices = vertices.length;
 			var nbVertices = vertices.length;
@@ -6988,13 +6998,7 @@ THREE.EventDispatcher.prototype = {
 	THREE.Raycaster.prototype.set = function ( origin, direction ) {
 	THREE.Raycaster.prototype.set = function ( origin, direction ) {
 
 
 		this.ray.set( origin, direction );
 		this.ray.set( origin, direction );
-
-		// normalized ray.direction required for accurate distance calculations
-		if ( this.ray.direction.length() > 0 ) {
-
-			this.ray.direction.normalize();
-
-		}
+		// direction is assumed to be normalized (for accurate distance calculations)
 
 
 	};
 	};
 
 

+ 242 - 243
build/three.min.js

@@ -40,8 +40,8 @@ b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyMatrix3:function(a){var b=th
 this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,h=a.z,a=a.w,g=a*b+f*d-h*c,i=a*c+h*b-e*d,k=a*d+e*c-f*b,b=-e*b-f*c-h*d;this.x=g*a+b*-e+i*-h-k*-f;this.y=i*a+b*-f+k*-e-g*-h;this.z=k*a+b*-h+g*-f-i*-e;return this},transformDirection:function(a){var b=this.x,c=this.y,d=this.z,a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*
 this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,h=a.z,a=a.w,g=a*b+f*d-h*c,i=a*c+h*b-e*d,k=a*d+e*c-f*b,b=-e*b-f*c-h*d;this.x=g*a+b*-e+i*-h-k*-f;this.y=i*a+b*-f+k*-e-g*-h;this.z=k*a+b*-h+g*-f-i*-e;return this},transformDirection:function(a){var b=this.x,c=this.y,d=this.z,a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*
 b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&(this.z=a.z);return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<
 b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&(this.z=a.z);return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<
 a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},
 a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},
-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;return this},cross:function(a,b){if(void 0!==b)return console.warn("DEPRECATED: Vector3's .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){this.x=
-a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},angleTo:function(a){a=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y,a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(){console.error("REMOVED: Vector3's setEulerFromRotationMatrix has been removed in favor of Euler.setFromRotationMatrix(), please update your code.")},
+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;return this},cross:function(a,b){if(void 0!==b)return console.warn("DEPRECATED: Vector3's .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=
+a.x,d=a.y,e=a.z,f=b.x,h=b.y,g=b.z;this.x=d*g-e*h;this.y=e*f-c*g;this.z=c*h-d*f;return this},angleTo:function(a){a=this.dot(a)/(this.length()*a.length());return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y,a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(){console.error("REMOVED: Vector3's setEulerFromRotationMatrix has been removed in favor of Euler.setFromRotationMatrix(), please update your code.")},
 setEulerFromQuaternion:function(){console.error("REMOVED: Vector3's setEulerFromQuaternion: has been removed in favor of Euler.setFromQuaternion(), please update your code.")},getPositionFromMatrix:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},getScaleFromMatrix:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();
 setEulerFromQuaternion:function(){console.error("REMOVED: Vector3's setEulerFromQuaternion: has been removed in favor of Euler.setFromQuaternion(), please update your code.")},getPositionFromMatrix:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},getScaleFromMatrix:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();
 this.x=b;this.y=c;this.z=a;return this},getColumnFromMatrix:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];return this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};
 this.x=b;this.y=c;this.z=a;return this},getColumnFromMatrix:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];return this},toArray:function(){return[this.x,this.y,this.z]},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};
 THREE.extend(THREE.Vector3.prototype,{applyEuler:function(){var a=new THREE.Quaternion;return function(b){void 0===typeof b.order&&console.error("ERROR: Vector3's .applyEuler() now expects a Euler rotation rather than a Vector3 and order.  Please update your code.");b=a.setFromEuler(b);this.applyQuaternion(b);return this}}(),applyAxisAngle:function(){var a=new THREE.Quaternion;return function(b,c){var d=a.setFromAxisAngle(b,c);this.applyQuaternion(d);return this}}(),projectOnVector:function(){var a=
 THREE.extend(THREE.Vector3.prototype,{applyEuler:function(){var a=new THREE.Quaternion;return function(b){void 0===typeof b.order&&console.error("ERROR: Vector3's .applyEuler() now expects a Euler rotation rather than a Vector3 and order.  Please update your code.");b=a.setFromEuler(b);this.applyQuaternion(b);return this}}(),applyAxisAngle:function(){var a=new THREE.Quaternion;return function(b,c){var d=a.setFromAxisAngle(b,c);this.applyQuaternion(d);return this}}(),projectOnVector:function(){var a=
@@ -82,22 +82,22 @@ this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a
 THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,h,g,i){var k=this.elements;k[0]=a;k[3]=b;k[6]=c;k[1]=d;k[4]=e;k[7]=f;k[2]=h;k[5]=g;k[8]=i;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("DEPRECATED: Matrix3's .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)},
 THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,f,h,g,i){var k=this.elements;k[0]=a;k[3]=b;k[6]=c;k[1]=d;k[4]=e;k[7]=f;k[2]=h;k[5]=g;k[8]=i;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("DEPRECATED: Matrix3's .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)},
 multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],h=a[5],g=a[6],i=a[7],a=a[8];return b*f*a-b*h*i-c*e*a+c*h*g+d*e*i-d*f*g},getInverse:function(a,
 multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],h=a[5],g=a[6],i=a[7],a=a[8];return b*f*a-b*h*i-c*e*a+c*h*g+d*e*i-d*f*g},getInverse:function(a,
 b){var c=a.elements,d=this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/
 b){var c=a.elements,d=this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/
-c);return this},transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},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},clone:function(){var a=this.elements;return new THREE.Matrix3(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8])}};THREE.Matrix4=function(a,b,c,d,e,f,h,g,i,k,l,m,n,q,t,p){var r=this.elements=new Float32Array(16);r[0]=void 0!==a?a:1;r[4]=b||0;r[8]=c||0;r[12]=d||0;r[1]=e||0;r[5]=void 0!==f?f:1;r[9]=h||0;r[13]=g||0;r[2]=i||0;r[6]=k||0;r[10]=void 0!==l?l:1;r[14]=m||0;r[3]=n||0;r[7]=q||0;r[11]=t||0;r[15]=void 0!==p?p:1};
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,h,g,i,k,l,m,n,q,t,p){var r=this.elements;r[0]=a;r[4]=b;r[8]=c;r[12]=d;r[1]=e;r[5]=f;r[9]=h;r[13]=g;r[2]=i;r[6]=k;r[10]=l;r[14]=m;r[3]=n;r[7]=q;r[11]=t;r[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("DEPRECATED: Matrix4's .extractPosition() has been renamed to .copyPosition().");
+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},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},clone:function(){var a=this.elements;return new THREE.Matrix3(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8])}};THREE.Matrix4=function(a,b,c,d,e,f,h,g,i,k,l,m,n,t,s,q){var p=this.elements=new Float32Array(16);p[0]=void 0!==a?a:1;p[4]=b||0;p[8]=c||0;p[12]=d||0;p[1]=e||0;p[5]=void 0!==f?f:1;p[9]=h||0;p[13]=g||0;p[2]=i||0;p[6]=k||0;p[10]=void 0!==l?l:1;p[14]=m||0;p[3]=n||0;p[7]=t||0;p[11]=s||0;p[15]=void 0!==q?q:1};
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,h,g,i,k,l,m,n,t,s,q){var p=this.elements;p[0]=a;p[4]=b;p[8]=c;p[12]=d;p[1]=e;p[5]=f;p[9]=h;p[13]=g;p[2]=i;p[6]=k;p[10]=l;p[14]=m;p[3]=n;p[7]=t;p[11]=s;p[15]=q;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("DEPRECATED: Matrix4's .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,d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){void 0===
 return this.copyPosition(a)},copyPosition:function(a){var b=this.elements,a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements,b=b.elements,d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),f=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*f;c[9]=b[9]*f;c[10]=b[10]*f;return this}}(),makeRotationFromEuler:function(a){void 0===
 typeof a.order&&console.error("ERROR: Matrix's .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.  Please update your code.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),h=Math.cos(d),d=Math.sin(d),g=Math.cos(e),e=Math.sin(e);if(void 0===a.order||"XYZ"===a.order){var a=f*g,i=f*e,k=c*g,l=c*e;b[0]=h*g;b[4]=-h*e;b[8]=d;b[1]=i+k*d;b[5]=a-l*d;b[9]=-c*h;b[2]=l-a*d;b[6]=k+i*d;b[10]=f*h}else"YXZ"===a.order?(a=h*g,i=h*e,k=d*g,l=d*e,b[0]=a+l*c,b[4]=
 typeof a.order&&console.error("ERROR: Matrix's .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.  Please update your code.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c),c=Math.sin(c),h=Math.cos(d),d=Math.sin(d),g=Math.cos(e),e=Math.sin(e);if(void 0===a.order||"XYZ"===a.order){var a=f*g,i=f*e,k=c*g,l=c*e;b[0]=h*g;b[4]=-h*e;b[8]=d;b[1]=i+k*d;b[5]=a-l*d;b[9]=-c*h;b[2]=l-a*d;b[6]=k+i*d;b[10]=f*h}else"YXZ"===a.order?(a=h*g,i=h*e,k=d*g,l=d*e,b[0]=a+l*c,b[4]=
 k*c-i,b[8]=f*d,b[1]=f*e,b[5]=f*g,b[9]=-c,b[2]=i*c-k,b[6]=l+a*c,b[10]=f*h):"ZXY"===a.order?(a=h*g,i=h*e,k=d*g,l=d*e,b[0]=a-l*c,b[4]=-f*e,b[8]=k+i*c,b[1]=i+k*c,b[5]=f*g,b[9]=l-a*c,b[2]=-f*d,b[6]=c,b[10]=f*h):"ZYX"===a.order?(a=f*g,i=f*e,k=c*g,l=c*e,b[0]=h*g,b[4]=k*d-i,b[8]=a*d+l,b[1]=h*e,b[5]=l*d+a,b[9]=i*d-k,b[2]=-d,b[6]=c*h,b[10]=f*h):"YZX"===a.order?(a=f*h,i=f*d,k=c*h,l=c*d,b[0]=h*g,b[4]=l-a*e,b[8]=k*e+i,b[1]=e,b[5]=f*g,b[9]=-c*g,b[2]=-d*g,b[6]=i*e+k,b[10]=a-l*e):"XZY"===a.order&&(a=f*h,i=f*d,k=
 k*c-i,b[8]=f*d,b[1]=f*e,b[5]=f*g,b[9]=-c,b[2]=i*c-k,b[6]=l+a*c,b[10]=f*h):"ZXY"===a.order?(a=h*g,i=h*e,k=d*g,l=d*e,b[0]=a-l*c,b[4]=-f*e,b[8]=k+i*c,b[1]=i+k*c,b[5]=f*g,b[9]=l-a*c,b[2]=-f*d,b[6]=c,b[10]=f*h):"ZYX"===a.order?(a=f*g,i=f*e,k=c*g,l=c*e,b[0]=h*g,b[4]=k*d-i,b[8]=a*d+l,b[1]=h*e,b[5]=l*d+a,b[9]=i*d-k,b[2]=-d,b[6]=c*h,b[10]=f*h):"YZX"===a.order?(a=f*h,i=f*d,k=c*h,l=c*d,b[0]=h*g,b[4]=l-a*e,b[8]=k*e+i,b[1]=e,b[5]=f*g,b[9]=-c*g,b[2]=-d*g,b[6]=i*e+k,b[10]=a-l*e):"XZY"===a.order&&(a=f*h,i=f*d,k=
 c*h,l=c*d,b[0]=h*g,b[4]=-e,b[8]=d*g,b[1]=a*e+l,b[5]=f*g,b[9]=i*e-k,b[2]=k*e-i,b[6]=c*g,b[10]=l*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("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion.  Please update your code.");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,h=c+c,g=d+d,i=e+e,
 c*h,l=c*d,b[0]=h*g,b[4]=-e,b[8]=d*g,b[1]=a*e+l,b[5]=f*g,b[9]=i*e-k,b[2]=k*e-i,b[6]=c*g,b[10]=l*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("DEPRECATED: Matrix4's .setRotationFromQuaternion() has been deprecated in favor of makeRotationFromQuaternion.  Please update your code.");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,h=c+c,g=d+d,i=e+e,
 a=c*h,k=c*g,c=c*i,l=d*g,d=d*i,e=e*i,h=f*h,g=f*g,f=f*i;b[0]=1-(l+e);b[4]=k-f;b[8]=c+g;b[1]=k+f;b[5]=1-(a+e);b[9]=d-h;b[2]=c-g;b[6]=d+h;b[10]=1-(a+l);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,f){var h=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,
 a=c*h,k=c*g,c=c*i,l=d*g,d=d*i,e=e*i,h=f*h,g=f*g,f=f*i;b[0]=1-(l+e);b[4]=k-f;b[8]=c+g;b[1]=k+f;b[5]=1-(a+e);b[9]=d-h;b[2]=c-g;b[6]=d+h;b[10]=1-(a+l);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,f){var h=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,
-a);h[0]=a.x;h[4]=b.x;h[8]=c.x;h[1]=a.y;h[5]=b.y;h[9]=c.y;h[2]=a.z;h[6]=b.z;h[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],h=c[4],g=c[8],i=c[12],k=c[1],l=c[5],m=c[9],n=c[13],q=c[2],t=c[6],p=c[10],r=c[14],s=c[3],u=c[7],
-z=c[11],c=c[15],G=d[0],B=d[4],F=d[8],I=d[12],E=d[1],A=d[5],O=d[9],C=d[13],K=d[2],N=d[6],y=d[10],J=d[14],w=d[3],aa=d[7],L=d[11],d=d[15];e[0]=f*G+h*E+g*K+i*w;e[4]=f*B+h*A+g*N+i*aa;e[8]=f*F+h*O+g*y+i*L;e[12]=f*I+h*C+g*J+i*d;e[1]=k*G+l*E+m*K+n*w;e[5]=k*B+l*A+m*N+n*aa;e[9]=k*F+l*O+m*y+n*L;e[13]=k*I+l*C+m*J+n*d;e[2]=q*G+t*E+p*K+r*w;e[6]=q*B+t*A+p*N+r*aa;e[10]=q*F+t*O+p*y+r*L;e[14]=q*I+t*C+p*J+r*d;e[3]=s*G+u*E+z*K+c*w;e[7]=s*B+u*A+z*N+c*aa;e[11]=s*F+u*O+z*y+c*L;e[15]=s*I+u*C+z*J+c*d;return this},multiplyToArray:function(a,
+a);h[0]=a.x;h[4]=b.x;h[8]=c.x;h[1]=a.y;h[5]=b.y;h[9]=c.y;h[2]=a.z;h[6]=b.z;h[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Matrix4's .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],h=c[4],g=c[8],i=c[12],k=c[1],l=c[5],m=c[9],n=c[13],t=c[2],s=c[6],q=c[10],p=c[14],r=c[3],w=c[7],
+z=c[11],c=c[15],C=d[0],F=d[4],G=d[8],E=d[12],I=d[1],B=d[5],O=d[9],A=d[13],K=d[2],N=d[6],y=d[10],J=d[14],v=d[3],aa=d[7],L=d[11],d=d[15];e[0]=f*C+h*I+g*K+i*v;e[4]=f*F+h*B+g*N+i*aa;e[8]=f*G+h*O+g*y+i*L;e[12]=f*E+h*A+g*J+i*d;e[1]=k*C+l*I+m*K+n*v;e[5]=k*F+l*B+m*N+n*aa;e[9]=k*G+l*O+m*y+n*L;e[13]=k*E+l*A+m*J+n*d;e[2]=t*C+s*I+q*K+p*v;e[6]=t*F+s*B+q*N+p*aa;e[10]=t*G+s*O+q*y+p*L;e[14]=t*E+s*A+q*J+p*d;e[3]=r*C+w*I+z*K+c*v;e[7]=r*F+w*B+z*N+c*aa;e[11]=r*G+w*O+z*y+c*L;e[15]=r*E+w*A+z*J+c*d;return this},multiplyToArray:function(a,
 b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=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("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
 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("DEPRECATED: Matrix4's .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
 return a.applyProjection(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyProjection(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");
 return a.applyProjection(this)},multiplyVector4:function(a){console.warn("DEPRECATED: Matrix4's .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(){var a=new THREE.Vector3;return function(b){for(var c=0,d=b.length;c<d;c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyProjection(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("DEPRECATED: Matrix4's .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");
 a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],h=a[5],g=a[9],i=a[13],k=a[2],l=a[6],m=a[10],n=a[14];return a[3]*(+e*g*l-d*i*l-e*h*m+c*i*m+d*h*n-c*g*n)+a[7]*(+b*g*n-b*i*m+e*f*m-d*f*n+d*i*k-e*g*k)+a[11]*(+b*i*l-b*h*n-e*f*l+c*f*n+e*h*k-c*i*k)+a[15]*(-d*h*k-b*g*l+b*h*m+d*f*l-c*f*
 a.transformDirection(this)},crossVector:function(a){console.warn("DEPRECATED: Matrix4's .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],h=a[5],g=a[9],i=a[13],k=a[2],l=a[6],m=a[10],n=a[14];return a[3]*(+e*g*l-d*i*l-e*h*m+c*i*m+d*h*n-c*g*n)+a[7]*(+b*g*n-b*i*m+e*f*m-d*f*n+d*i*k-e*g*k)+a[11]*(+b*i*l-b*h*n-e*f*l+c*f*n+e*h*k-c*i*k)+a[15]*(-d*h*k-b*g*l+b*h*m+d*f*l-c*f*
 m+c*g*k)},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},flattenToArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a},flattenToArrayOffset:function(a,b){var c=this.elements;
 m+c*g*k)},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},flattenToArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[1];a[2]=b[2];a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a},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("DEPRECATED: Matrix4's .getPosition() has been removed. Use Vector3.getPositionFromMatrix( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=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("DEPRECATED: Matrix4's .getPosition() has been removed. Use Vector3.getPositionFromMatrix( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;
-b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],h=d[8],g=d[12],i=d[1],k=d[5],l=d[9],m=d[13],n=d[2],q=d[6],t=d[10],p=d[14],r=d[3],s=d[7],u=d[11],d=d[15];c[0]=l*p*s-m*t*s+m*q*u-k*p*u-l*q*d+k*t*d;c[4]=g*t*s-h*p*s-g*q*u+f*p*u+h*q*d-f*t*d;c[8]=h*m*s-g*l*s+g*k*u-f*m*u-h*k*d+f*l*d;c[12]=g*l*q-h*m*q-g*k*t+f*m*t+h*k*p-f*l*p;c[1]=m*t*r-l*p*r-m*n*u+i*p*u+l*n*d-i*t*d;c[5]=h*p*r-g*t*r+g*n*u-e*p*u-h*n*d+e*t*d;c[9]=g*l*r-h*m*r-g*i*u+e*m*u+h*i*d-
-e*l*d;c[13]=h*m*n-g*l*n+g*i*t-e*m*t-h*i*p+e*l*p;c[2]=k*p*r-m*q*r+m*n*s-i*p*s-k*n*d+i*q*d;c[6]=g*q*r-f*p*r-g*n*s+e*p*s+f*n*d-e*q*d;c[10]=f*m*r-g*k*r+g*i*s-e*m*s-f*i*d+e*k*d;c[14]=g*k*n-f*m*n-g*i*q+e*m*q+f*i*p-e*k*p;c[3]=l*q*r-k*t*r-l*n*s+i*t*s+k*n*u-i*q*u;c[7]=f*t*r-h*q*r+h*n*s-e*t*s-f*n*u+e*q*u;c[11]=h*k*r-f*l*r-h*i*s+e*l*s+f*i*u-e*k*u;c[15]=f*l*n-h*k*n+h*i*q-e*l*q-f*i*t+e*k*t;c=e*c[0]+i*c[4]+n*c[8]+r*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");
+b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],h=d[8],g=d[12],i=d[1],k=d[5],l=d[9],m=d[13],n=d[2],t=d[6],s=d[10],q=d[14],p=d[3],r=d[7],w=d[11],d=d[15];c[0]=l*q*r-m*s*r+m*t*w-k*q*w-l*t*d+k*s*d;c[4]=g*s*r-h*q*r-g*t*w+f*q*w+h*t*d-f*s*d;c[8]=h*m*r-g*l*r+g*k*w-f*m*w-h*k*d+f*l*d;c[12]=g*l*t-h*m*t-g*k*s+f*m*s+h*k*q-f*l*q;c[1]=m*s*p-l*q*p-m*n*w+i*q*w+l*n*d-i*s*d;c[5]=h*q*p-g*s*p+g*n*w-e*q*w-h*n*d+e*s*d;c[9]=g*l*p-h*m*p-g*i*w+e*m*w+h*i*d-
+e*l*d;c[13]=h*m*n-g*l*n+g*i*s-e*m*s-h*i*q+e*l*q;c[2]=k*q*p-m*t*p+m*n*r-i*q*r-k*n*d+i*t*d;c[6]=g*t*p-f*q*p-g*n*r+e*q*r+f*n*d-e*t*d;c[10]=f*m*p-g*k*p+g*i*r-e*m*r-f*i*d+e*k*d;c[14]=g*k*n-f*m*n-g*i*t+e*m*t+f*i*q-e*k*q;c[3]=l*t*p-k*s*p-l*n*r+i*s*r+k*n*w-i*t*w;c[7]=f*s*p-h*t*p+h*n*r-e*s*r-f*n*w+e*t*w;c[11]=h*k*p-f*l*p-h*i*r+e*l*r+f*i*w-e*k*w;c[15]=f*l*n-h*k*n+h*i*t-e*l*t-f*i*s+e*k*s;c=e*c[0]+i*c[4]+n*c[8]+p*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(){console.warn("DEPRECATED: Matrix4's .translate() has been removed.")},rotateX:function(){console.warn("DEPRECATED: Matrix4's .rotateX() has been removed.")},rotateY:function(){console.warn("DEPRECATED: Matrix4's .rotateY() has been removed.")},rotateZ:function(){console.warn("DEPRECATED: Matrix4's .rotateZ() has been removed.")},rotateByAxis:function(){console.warn("DEPRECATED: Matrix4's .rotateByAxis() has been removed.")},
 this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(){console.warn("DEPRECATED: Matrix4's .translate() has been removed.")},rotateX:function(){console.warn("DEPRECATED: Matrix4's .rotateX() has been removed.")},rotateY:function(){console.warn("DEPRECATED: Matrix4's .rotateY() has been removed.")},rotateZ:function(){console.warn("DEPRECATED: Matrix4's .rotateZ() has been removed.")},rotateByAxis:function(){console.warn("DEPRECATED: Matrix4's .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,
 scale:function(a){var b=this.elements,c=a.x,d=a.y,a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,
 0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,h=a.y,g=a.z,i=e*f,k=e*h;this.set(i*f+c,i*h-d*g,i*g+d*h,0,i*h+d*g,k*h+c,k*g-d*f,0,i*g-d*h,k*g+d*f,e*g*g+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,
 0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,h=a.y,g=a.z,i=e*f,k=e*h;this.set(i*f+c,i*h-d*g,i*g+d*h,0,i*h+d*g,k*h+c,k*g-d*f,0,i*g-d*h,k*g+d*f,e*g*g+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,
@@ -109,12 +109,12 @@ THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a)
 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),f=b.clone().sub(a).normalize(),h=0.5*a.distanceTo(b),
 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),f=b.clone().sub(a).normalize(),h=0.5*a.distanceTo(b),
 g=this.origin.clone().sub(e),a=-this.direction.dot(f),b=g.dot(this.direction),i=-g.dot(f),k=g.lengthSq(),l=Math.abs(1-a*a),m,n;0<=l?(g=a*i-b,m=a*b-i,n=h*l,0<=g?m>=-n?m<=n?(h=1/l,g*=h,m*=h,a=g*(g+a*m+2*b)+m*(a*g+m+2*i)+k):(m=h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+k):(m=-h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+k):m<=-n?(g=Math.max(0,-(-a*h+b)),m=0<g?-h:Math.min(Math.max(-h,-i),h),a=-g*g+m*(m+2*i)+k):m<=n?(g=0,m=Math.min(Math.max(-h,-i),h),a=m*(m+2*i)+k):(g=Math.max(0,-(a*h+b)),m=0<g?h:Math.min(Math.max(-h,
 g=this.origin.clone().sub(e),a=-this.direction.dot(f),b=g.dot(this.direction),i=-g.dot(f),k=g.lengthSq(),l=Math.abs(1-a*a),m,n;0<=l?(g=a*i-b,m=a*b-i,n=h*l,0<=g?m>=-n?m<=n?(h=1/l,g*=h,m*=h,a=g*(g+a*m+2*b)+m*(a*g+m+2*i)+k):(m=h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+k):(m=-h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+k):m<=-n?(g=Math.max(0,-(-a*h+b)),m=0<g?-h:Math.min(Math.max(-h,-i),h),a=-g*g+m*(m+2*i)+k):m<=n?(g=0,m=Math.min(Math.max(-h,-i),h),a=m*(m+2*i)+k):(g=Math.max(0,-(a*h+b)),m=0<g?h:Math.min(Math.max(-h,
 -i),h),a=-g*g+m*(m+2*i)+k)):(m=0<a?-h:h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+k);c&&c.copy(this.direction.clone().multiplyScalar(g).add(this.origin));d&&d.copy(f.clone().multiplyScalar(m).add(e));return a},isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},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)?
 -i),h),a=-g*g+m*(m+2*i)+k)):(m=0<a?-h:h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+k);c&&c.copy(this.direction.clone().multiplyScalar(g).add(this.origin));d&&d.copy(f.clone().multiplyScalar(m).add(e));return a},isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},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)},applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0};
+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)},applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0};
 THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(a){for(var b,c=0,d=0,e=a.length;d<e;d++)b=a[d].lengthSq(),c=Math.max(c,b);this.center.set(0,0,0);this.radius=Math.sqrt(c);return this},copy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-
 THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(a){for(var b,c=0,d=0,e=a.length;d<e;d++)b=a[d].lengthSq(),c=Math.max(c,b);this.center.set(0,0,0);this.radius=Math.sqrt(c);return this},copy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-
 this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);
 this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);
 this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
 this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]};
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var h=this.planes;h[0].copy(a);h[1].copy(b);h[2].copy(c);h[3].copy(d);h[4].copy(e);h[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements,a=c[0],d=c[1],e=c[2],f=c[3],h=c[4],g=c[5],i=c[6],k=c[7],l=c[8],m=c[9],n=c[10],q=c[11],t=c[12],p=c[13],r=c[14],c=c[15];b[0].setComponents(f-a,k-h,q-l,c-t).normalize();b[1].setComponents(f+
-a,k+h,q+l,c+t).normalize();b[2].setComponents(f+d,k+g,q+m,c+p).normalize();b[3].setComponents(f-d,k-g,q-m,c-p).normalize();b[4].setComponents(f-e,k-i,q-n,c-r).normalize();b[5].setComponents(f+e,k+i,q+n,c+r).normalize();return this},intersectsObject:function(){var a=new THREE.Vector3;return function(b){var c=b.geometry,b=b.matrixWorld;null===c.boundingSphere&&c.computeBoundingSphere();c=-c.boundingSphere.radius*b.getMaxScaleOnAxis();a.getPositionFromMatrix(b);for(var b=this.planes,d=0;6>d;d++)if(b[d].distanceToPoint(a)<
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var h=this.planes;h[0].copy(a);h[1].copy(b);h[2].copy(c);h[3].copy(d);h[4].copy(e);h[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements,a=c[0],d=c[1],e=c[2],f=c[3],h=c[4],g=c[5],i=c[6],k=c[7],l=c[8],m=c[9],n=c[10],t=c[11],s=c[12],q=c[13],p=c[14],c=c[15];b[0].setComponents(f-a,k-h,t-l,c-s).normalize();b[1].setComponents(f+
+a,k+h,t+l,c+s).normalize();b[2].setComponents(f+d,k+g,t+m,c+q).normalize();b[3].setComponents(f-d,k-g,t-m,c-q).normalize();b[4].setComponents(f-e,k-i,t-n,c-p).normalize();b[5].setComponents(f+e,k+i,t+n,c+p).normalize();return this},intersectsObject:function(){var a=new THREE.Vector3;return function(b){var c=b.geometry,b=b.matrixWorld;null===c.boundingSphere&&c.computeBoundingSphere();c=-c.boundingSphere.radius*b.getMaxScaleOnAxis();a.getPositionFromMatrix(b);for(var b=this.planes,d=0;6>d;d++)if(b[d].distanceToPoint(a)<
 c)return!1;return!0}}(),intersectsSphere:function(a){for(var b=this.planes,c=a.center,a=-a.radius,d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var h=f.distanceToPoint(a),
 c)return!1;return!0}}(),intersectsSphere:function(a){for(var b=this.planes,c=a.center,a=-a.radius,d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var f=d[e];a.x=0<f.normal.x?c.min.x:c.max.x;b.x=0<f.normal.x?c.max.x:c.min.x;a.y=0<f.normal.y?c.min.y:c.max.y;b.y=0<f.normal.y?c.max.y:c.min.y;a.z=0<f.normal.z?c.min.z:c.max.z;b.z=0<f.normal.z?c.max.z:c.min.z;var h=f.distanceToPoint(a),
 f=f.distanceToPoint(b);if(0>h&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 f=f.distanceToPoint(b);if(0>h&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
 THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
 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,
@@ -129,21 +129,20 @@ a/c,d=this.getPoint(b),h.copy(d),i+=h.distanceTo(f),f.copy(d),b*=this.points.len
 g.push(i.copy(d).clone());g.push(i.copy(this.points[b]).clone())}this.points=g}};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)}}();
 g.push(i.copy(d).clone());g.push(i.copy(this.points[b]).clone())}this.points=g}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
 THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,h,g){a.subVectors(h,e);b.subVectors(f,e);c.subVectors(d,e);var d=a.dot(a),e=a.dot(b),f=a.dot(c),i=b.dot(b),h=b.dot(c),k=d*i-e*e,g=g||new THREE.Vector3;if(0==k)return g.set(-2,-1,-1);k=1/k;i=(i*f-e*h)*k;d=(d*h-e*f)*k;return g.set(1-i-d,d,i)}}();
 THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,h,g){a.subVectors(h,e);b.subVectors(f,e);c.subVectors(d,e);var d=a.dot(a),e=a.dot(b),f=a.dot(c),i=b.dot(b),h=b.dot(c),k=d*i-e*e,g=g||new THREE.Vector3;if(0==k)return g.set(-2,-1,-1);k=1/k;i=(i*f-e*h)*k;d=(d*h-e*f)*k;return g.set(1-i-d,d,i)}}();
 THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();
 THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();
+THREE.Triangle.intersectionRay=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,h,g,i){b.subVectors(h,f);c.subVectors(g,f);d.crossVectors(b,c);h=e.direction.dot(d);if(0<h){if(i)return null;i=1}else if(0>h)i=-1,h=-h;else return null;a.subVectors(e.origin,f);f=i*e.direction.dot(c.crossVectors(a,c));if(0>f)return null;g=i*e.direction.dot(b.cross(a));if(0>g||f+g>h)return null;f=-i*a.dot(d);return 0>f?null:e.at(f/h)}}();
 THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return 0.5*a.cross(b).length()}}(),midpoint:function(a){return(a||
 THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return 0.5*a.cross(b).length()}}(),midpoint:function(a){return(a||
-new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},
-clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Vertex=function(a){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.");return a};THREE.UV=function(a,b){console.warn("THREE.UV has been DEPRECATED. Use THREE.Vector2 instead.");return new THREE.Vector2(a,b)};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};
+new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},intersectionRay:function(a,b){return THREE.Triangle.intersectionRay(a,this.a,
+this.b,this.c,b)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Vertex=function(a){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.");return a};THREE.UV=function(a,b){console.warn("THREE.UV has been DEPRECATED. Use THREE.Vector2 instead.");return new THREE.Vector2(a,b)};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};
 THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),
 THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),
 a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){};
 a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){};
 THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&
 THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&
-c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners,d=c[a].indexOf(b);-1!==d&&c[a].splice(d,1)}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=0,d=b.length;c<d;c++)b[c].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);0<this.ray.direction.lengthSq()&&this.ray.direction.normalize();this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray,d=new a.Plane,e=new a.Vector3,f=new a.Vector3,h=new a.Matrix4,g=function(a,b){return a.distance-b.distance},i=function(g,k,n){if(g instanceof a.Particle){f.getPositionFromMatrix(g.matrixWorld);var q=k.ray.distanceToPoint(f);if(q>g.scale.x)return n;n.push({distance:q,point:g.position,face:null,object:g})}else if(g instanceof
-a.LOD)f.getPositionFromMatrix(g.matrixWorld),q=k.ray.origin.distanceTo(f),i(g.getObjectForDistance(q),k,n);else if(g instanceof a.Mesh){q=g.geometry;f.getPositionFromMatrix(g.matrixWorld);null===q.boundingSphere&&q.computeBoundingSphere();b.set(f,q.boundingSphere.radius*g.matrixWorld.getMaxScaleOnAxis());if(!1===k.ray.isIntersectionSphere(b))return n;var t=q.vertices;if(q instanceof a.BufferGeometry){var p=g.material;if(void 0===p||!1===q.dynamic)return n;var r=g.material instanceof a.MeshFaceMaterial,
-s=!0===r?g.material.materials:null,u=g.material.side,z,G,B=k.precision;h.getInverse(g.matrixWorld);c.copy(k.ray).applyMatrix4(h);var F,t=!1;q.attributes.index&&(t=!0);s=new a.Vector3;F=new a.Vector3;var I=new a.Vector3;new a.Vector3;new a.Vector3;for(var E=0;E<q.offsets.length;++E)for(var A=q.offsets[E].start,O=q.offsets[E].index,r=A,C=A+q.offsets[E].count;r<C;r+=3)if(t?(u=O+q.attributes.index.array[r],z=O+q.attributes.index.array[r+1],G=O+q.attributes.index.array[r+2]):(u=O,z=O+1,G=O+2),s.set(q.attributes.position.array[3*
-u],q.attributes.position.array[3*u+1],q.attributes.position.array[3*u+2]),F.set(q.attributes.position.array[3*z],q.attributes.position.array[3*z+1],q.attributes.position.array[3*z+2]),I.set(q.attributes.position.array[3*G],q.attributes.position.array[3*G+1],q.attributes.position.array[3*G+2]),d.setFromCoplanarPoints(s,F,I),A=c.distanceToPlane(d),!(A<B)&&null!==A){u=p.side;if(u!==a.DoubleSide&&(z=c.direction.dot(d.normal),!(u===a.FrontSide?0>z:0<z)))continue;A<k.near||A>k.far||(e=c.at(A,e),!1!==a.Triangle.containsPoint(e,
-s,F,I)&&n.push({distance:A,point:k.ray.at(A),face:null,faceIndex:null,object:g}))}}else if(q instanceof a.Geometry){r=g.material instanceof a.MeshFaceMaterial;s=!0===r?g.material.materials:null;B=k.precision;h.getInverse(g.matrixWorld);c.copy(k.ray).applyMatrix4(h);I=0;for(F=q.faces.length;I<F;I++)if(E=q.faces[I],p=!0===r?s[E.materialIndex]:g.material,void 0!==p&&(d.setFromNormalAndCoplanarPoint(E.normal,t[E.a]),A=c.distanceToPlane(d),!(A<B)&&null!==A)){u=p.side;if(u!==a.DoubleSide&&(z=c.direction.dot(d.normal),
-!(u===a.FrontSide?0>z:0<z)))continue;if(!(A<k.near||A>k.far)){e=c.at(A,e);if(E instanceof a.Face3){if(u=t[E.a],z=t[E.b],G=t[E.c],!1===a.Triangle.containsPoint(e,u,z,G))continue}else if(E instanceof a.Face4){if(u=t[E.a],z=t[E.b],G=t[E.c],p=t[E.d],!1===a.Triangle.containsPoint(e,u,z,p)&&!1===a.Triangle.containsPoint(e,z,G,p))continue}else throw Error("face type not supported");n.push({distance:A,point:k.ray.at(A),face:E,faceIndex:I,object:g})}}}}else if(g instanceof a.Line){B=k.linePrecision;B*=B;q=
-g.geometry;null===q.boundingSphere&&q.computeBoundingSphere();f.getPositionFromMatrix(g.matrixWorld);b.set(f,q.boundingSphere.radius*g.matrixWorld.getMaxScaleOnAxis());if(!1===k.ray.isIntersectionSphere(b))return n;h.getInverse(g.matrixWorld);c.copy(k.ray).applyMatrix4(h);c.direction.normalize();t=q.vertices;p=t.length;A=new a.Vector3;u=new a.Vector3;z=g.type===a.LineStrip?1:2;for(r=0;r<p-1;r+=z)c.distanceSqToSegment(t[r],t[r+1],u,A)<=B&&(q=c.origin.distanceTo(u),k.near<=q&&q<=k.far&&n.push({distance:q,
-point:A.clone().applyMatrix4(g.matrixWorld),face:null,faceIndex:null,object:g}))}},k=function(a,b,c){for(var a=a.getDescendants(),d=0,e=a.length;d<e;d++)i(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b);0<this.ray.direction.length()&&this.ray.direction.normalize()};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&k(a,this,c);i(a,this,c);c.sort(g);return c};a.Raycaster.prototype.intersectObjects=
-function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)i(a[d],this,c),!0===b&&k(a[d],this,c);c.sort(g);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Euler;this.quaternion=new THREE.Quaternion;this.scale=new THREE.Vector3(1,1,1);this.rotation._quaternion=this.quaternion;this.quaternion._euler=this.rotation;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;
+c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners,d=c[a].indexOf(b);-1!==d&&c[a].splice(d,1)}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=0,d=b.length;c<d;c++)b[c].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray;new a.Plane;new a.Vector3;var d=new a.Vector3,e=new a.Matrix4,f=function(a,b){return a.distance-b.distance},h=function(f,g,l){if(f instanceof a.Particle){d.getPositionFromMatrix(f.matrixWorld);var m=g.ray.distanceToPoint(d);if(m>f.scale.x)return l;l.push({distance:m,point:f.position,face:null,object:f})}else if(f instanceof a.LOD)d.getPositionFromMatrix(f.matrixWorld),
+m=g.ray.origin.distanceTo(d),h(f.getObjectForDistance(m),g,l);else if(f instanceof a.Mesh){var n=f.geometry;d.getPositionFromMatrix(f.matrixWorld);null===n.boundingSphere&&n.computeBoundingSphere();b.set(d,n.boundingSphere.radius*f.matrixWorld.getMaxScaleOnAxis());if(!1===g.ray.isIntersectionSphere(b))return l;var t=n.vertices;if(n instanceof a.BufferGeometry){var s=f.material;if(void 0===s||!1===n.dynamic)return l;var q,p,r=g.precision;e.getInverse(f.matrixWorld);c.copy(g.ray).applyMatrix4(e);var w,
+t=!1;n.attributes.index&&(t=!0);w=new a.Vector3;for(var z=new a.Vector3,C=new a.Vector3,F=n.offsets,G=n.attributes.index.array,E=n.attributes.position.array,I=n.offsets.length,B=0;B<I;++B)for(var m=F[B].start,O=F[B].index,n=m,A=m+F[B].count;n<A;n+=3)if(t?(q=O+G[n],m=O+G[n+1],p=O+G[n+2]):(q=O,m=O+1,p=O+2),w.set(E[3*q],E[3*q+1],E[3*q+2]),z.set(E[3*m],E[3*m+1],E[3*m+2]),C.set(E[3*p],E[3*p+1],E[3*p+2]),q=a.Triangle.intersectionRay(c,w,z,C,s.side!==a.DoubleSide))q.applyMatrix4(f.matrixWorld),m=g.ray.origin.distanceTo(q),
+m<r||m<g.near||m>g.far||l.push({distance:m,point:q,face:null,faceIndex:null,object:f})}else if(n instanceof a.Geometry){z=f.material instanceof a.MeshFaceMaterial;C=!0===z?f.material.materials:null;r=g.precision;e.getInverse(f.matrixWorld);c.copy(g.ray).applyMatrix4(e);F=0;for(w=n.faces.length;F<w;F++)if(G=n.faces[F],s=!0===z?C[G.materialIndex]:f.material,void 0!==s){if(G instanceof a.Face3){if(q=t[G.a],m=t[G.b],p=t[G.c],q=a.Triangle.intersectionRay(c,q,m,p,s.side!==a.DoubleSide),!q)continue}else if(G instanceof
+a.Face4){if(q=t[G.a],m=t[G.b],p=t[G.c],E=t[G.d],q=a.Triangle.intersectionRay(c,q,m,E,s.side!==a.DoubleSide),!q&&(q=a.Triangle.intersectionRay(c,m,p,E,s.side!==a.DoubleSide),!q))continue}else throw Error("face type not supported");q.applyMatrix4(f.matrixWorld);m=g.ray.origin.distanceTo(q);m<r||m<g.near||m>g.far||l.push({distance:m,point:q,face:G,faceIndex:F,object:f})}}}else if(f instanceof a.Line){r=g.linePrecision;s=r*r;n=f.geometry;null===n.boundingSphere&&n.computeBoundingSphere();d.getPositionFromMatrix(f.matrixWorld);
+b.set(d,n.boundingSphere.radius*f.matrixWorld.getMaxScaleOnAxis());if(!1===g.ray.isIntersectionSphere(b))return l;e.getInverse(f.matrixWorld);c.copy(g.ray).applyMatrix4(e);t=n.vertices;r=t.length;p=new a.Vector3;q=new a.Vector3;w=f.type===a.LineStrip?1:2;for(n=0;n<r-1;n+=w)c.distanceSqToSegment(t[n],t[n+1],q,p)<=s&&(m=c.origin.distanceTo(q),g.near<=m&&m<=g.far&&l.push({distance:m,point:p.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}},g=function(a,b,c){for(var a=a.getDescendants(),
+d=0,e=a.length;d<e;d++)h(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&g(a,this,c);h(a,this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)h(a[d],this,c),!0===b&&g(a[d],this,c);c.sort(f);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Euler;this.quaternion=new THREE.Quaternion;this.scale=new THREE.Vector3(1,1,1);this.rotation._quaternion=this.quaternion;this.quaternion._euler=this.rotation;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;
 this.visible=this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
 this.visible=this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
 THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");return this.rotation.order},set eulerOrder(a){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");this.rotation.order=a},get useQuaternion(){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},
 THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");return this.rotation.order},set eulerOrder(a){console.warn("DEPRECATED: Object3D's .eulerOrder has been moved to Object3D's .rotation.order.");this.rotation.order=a},get useQuaternion(){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){console.warn("DEPRECATED: Object3D's .useQuaternion has been removed. The library now uses quaternions by default.")},
 applyMatrix:function(){var a=new THREE.Matrix4;return function(b){this.matrix.multiplyMatrices(b,this.matrix);this.position.getPositionFromMatrix(this.matrix);this.scale.getScaleFromMatrix(this.matrix);a.extractRotation(this.matrix);this.quaternion.setFromRotationMatrix(a)}}(),setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},
 applyMatrix:function(){var a=new THREE.Matrix4;return function(b){this.matrix.multiplyMatrices(b,this.matrix);this.position.getPositionFromMatrix(this.matrix);this.scale.getScaleFromMatrix(this.matrix);a.extractRotation(this.matrix);this.quaternion.setFromRotationMatrix(a)}}(),setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},
@@ -156,19 +155,19 @@ e))return e}},getChildByName:function(a,b){console.warn("DEPRECATED: Object3D's
 this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},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);
 this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},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));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());
 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));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());
 return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(i===l){var a=new THREE.RenderableVertex;k.push(a);l++;i++;return a}return k[i++]}function b(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,h=-a.z+a.w,g=-b.z+b.w;if(0<=e&&0<=f&&0<=h&&0<=g)return!0;if(0>e&&0>f||0>h&&0>g)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>h?c=Math.max(c,h/(h-g)):0>g&&(d=Math.min(d,h/(h-g)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var d,e,f=[],h=
 return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(i===l){var a=new THREE.RenderableVertex;k.push(a);l++;i++;return a}return k[i++]}function b(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,h=-a.z+a.w,g=-b.z+b.w;if(0<=e&&0<=f&&0<=h&&0<=g)return!0;if(0>e&&0>f||0>h&&0>g)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>h?c=Math.max(c,h/(h-g)):0>g&&(d=Math.min(d,h/(h-g)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var d,e,f=[],h=
-0,g,i,k=[],l=0,m,n,q=[],t=0,p,r=[],s=0,u,z,G=[],B=0,F,I,E=[],A=0,O={objects:[],sprites:[],lights:[],elements:[]},C=new THREE.Vector3,K=new THREE.Vector4,N=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),y=new THREE.Box3,J=Array(3),w=Array(4),aa=new THREE.Matrix4,L=new THREE.Matrix4,qa,Pa=new THREE.Matrix4,Sa=new THREE.Matrix3,Q=new THREE.Matrix3,ia=new THREE.Vector3,Wa=new THREE.Frustum,M=new THREE.Vector4,sa=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);
+0,g,i,k=[],l=0,m,n,t=[],s=0,q,p=[],r=0,w,z,C=[],F=0,G,E,I=[],B=0,O={objects:[],sprites:[],lights:[],elements:[]},A=new THREE.Vector3,K=new THREE.Vector4,N=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),y=new THREE.Box3,J=Array(3),v=Array(4),aa=new THREE.Matrix4,L=new THREE.Matrix4,qa,Pa=new THREE.Matrix4,Sa=new THREE.Matrix3,Q=new THREE.Matrix3,ia=new THREE.Vector3,Wa=new THREE.Frustum,M=new THREE.Vector4,sa=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);
 L.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(L)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);L.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyProjection(L)};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 H=function(a){if(e===h){var b=new THREE.RenderableObject;
 L.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(L)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);L.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyProjection(L)};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 H=function(a){if(e===h){var b=new THREE.RenderableObject;
-f.push(b);h++;e++;d=b}else d=f[e++];d.id=a.id;d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(C.getPositionFromMatrix(a.matrixWorld),C.applyProjection(L),d.z=C.z);return d},ja=function(a){if(!1!==a.visible){a instanceof THREE.Light?O.lights.push(a):a instanceof THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===Wa.intersectsObject(a))&&O.objects.push(H(a)):(a instanceof THREE.Sprite||a instanceof THREE.Particle)&&O.sprites.push(H(a));for(var b=0,c=a.children.length;b<c;b++)ja(a.children[b])}};
-this.projectScene=function(d,f,h,l){var C=!1,H,X,fa,U,V,oa,ha,da,xa,Ta,la,ka,Ba;I=z=p=n=0;O.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();aa.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));L.multiplyMatrices(f.projectionMatrix,aa);Q.getNormalMatrix(aa);Wa.setFromMatrix(L);e=0;O.objects.length=0;O.sprites.length=0;O.lights.length=0;ja(d);!0===h&&O.objects.sort(b);d=0;for(h=O.objects.length;d<h;d++)if(da=O.objects[d].object,qa=da.matrixWorld,
+f.push(b);h++;e++;d=b}else d=f[e++];d.id=a.id;d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(A.getPositionFromMatrix(a.matrixWorld),A.applyProjection(L),d.z=A.z);return d},ja=function(a){if(!1!==a.visible){a instanceof THREE.Light?O.lights.push(a):a instanceof THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===Wa.intersectsObject(a))&&O.objects.push(H(a)):(a instanceof THREE.Sprite||a instanceof THREE.Particle)&&O.sprites.push(H(a));for(var b=0,c=a.children.length;b<c;b++)ja(a.children[b])}};
+this.projectScene=function(d,f,h,l){var A=!1,H,X,fa,U,V,oa,ha,da,xa,Ta,la,ka,Ba;E=z=q=n=0;O.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();aa.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));L.multiplyMatrices(f.projectionMatrix,aa);Q.getNormalMatrix(aa);Wa.setFromMatrix(L);e=0;O.objects.length=0;O.sprites.length=0;O.lights.length=0;ja(d);!0===h&&O.objects.sort(b);d=0;for(h=O.objects.length;d<h;d++)if(da=O.objects[d].object,qa=da.matrixWorld,
 i=0,da instanceof THREE.Mesh){xa=da.geometry;fa=xa.vertices;Ta=xa.faces;xa=xa.faceVertexUvs;Sa.getNormalMatrix(qa);ka=da.material instanceof THREE.MeshFaceMaterial;Ba=!0===ka?da.material:null;H=0;for(X=fa.length;H<X;H++){g=a();g.positionWorld.copy(fa[H]).applyMatrix4(qa);g.positionScreen.copy(g.positionWorld).applyMatrix4(L);var ea=1/g.positionScreen.w;g.positionScreen.x*=ea;g.positionScreen.y*=ea;g.positionScreen.z*=ea;g.visible=!(-1>g.positionScreen.x||1<g.positionScreen.x||-1>g.positionScreen.y||
 i=0,da instanceof THREE.Mesh){xa=da.geometry;fa=xa.vertices;Ta=xa.faces;xa=xa.faceVertexUvs;Sa.getNormalMatrix(qa);ka=da.material instanceof THREE.MeshFaceMaterial;Ba=!0===ka?da.material:null;H=0;for(X=fa.length;H<X;H++){g=a();g.positionWorld.copy(fa[H]).applyMatrix4(qa);g.positionScreen.copy(g.positionWorld).applyMatrix4(L);var ea=1/g.positionScreen.w;g.positionScreen.x*=ea;g.positionScreen.y*=ea;g.positionScreen.z*=ea;g.visible=!(-1>g.positionScreen.x||1<g.positionScreen.x||-1>g.positionScreen.y||
-1<g.positionScreen.y||-1>g.positionScreen.z||1<g.positionScreen.z)}fa=0;for(H=Ta.length;fa<H;fa++)if(X=Ta[fa],ea=!0===ka?Ba.materials[X.materialIndex]:da.material,void 0!==ea){oa=ea.side;if(X instanceof THREE.Face3)if(U=k[X.a],V=k[X.b],ha=k[X.c],J[0]=U.positionScreen,J[1]=V.positionScreen,J[2]=ha.positionScreen,!0===U.visible||!0===V.visible||!0===ha.visible||N.isIntersectionBox(y.setFromPoints(J)))if(C=0>(ha.positionScreen.x-U.positionScreen.x)*(V.positionScreen.y-U.positionScreen.y)-(ha.positionScreen.y-
-U.positionScreen.y)*(V.positionScreen.x-U.positionScreen.x),oa===THREE.DoubleSide||C===(oa===THREE.FrontSide))n===t?(la=new THREE.RenderableFace3,q.push(la),t++,n++,m=la):m=q[n++],m.id=da.id,m.v1.copy(U),m.v2.copy(V),m.v3.copy(ha);else continue;else continue;else if(X instanceof THREE.Face4)if(U=k[X.a],V=k[X.b],ha=k[X.c],la=k[X.d],w[0]=U.positionScreen,w[1]=V.positionScreen,w[2]=ha.positionScreen,w[3]=la.positionScreen,!0===U.visible||!0===V.visible||!0===ha.visible||!0===la.visible||N.isIntersectionBox(y.setFromPoints(w)))if(C=
-0>(la.positionScreen.x-U.positionScreen.x)*(V.positionScreen.y-U.positionScreen.y)-(la.positionScreen.y-U.positionScreen.y)*(V.positionScreen.x-U.positionScreen.x)||0>(V.positionScreen.x-ha.positionScreen.x)*(la.positionScreen.y-ha.positionScreen.y)-(V.positionScreen.y-ha.positionScreen.y)*(la.positionScreen.x-ha.positionScreen.x),oa===THREE.DoubleSide||C===(oa===THREE.FrontSide)){if(p===s){var na=new THREE.RenderableFace4;r.push(na);s++;p++;m=na}else m=r[p++];m.id=da.id;m.v1.copy(U);m.v2.copy(V);
-m.v3.copy(ha);m.v4.copy(la)}else continue;else continue;m.normalModel.copy(X.normal);!1===C&&(oa===THREE.BackSide||oa===THREE.DoubleSide)&&m.normalModel.negate();m.normalModel.applyMatrix3(Sa).normalize();m.normalModelView.copy(m.normalModel).applyMatrix3(Q);m.centroidModel.copy(X.centroid).applyMatrix4(qa);ha=X.vertexNormals;U=0;for(V=ha.length;U<V;U++)la=m.vertexNormalsModel[U],la.copy(ha[U]),!1===C&&(oa===THREE.BackSide||oa===THREE.DoubleSide)&&la.negate(),la.applyMatrix3(Sa).normalize(),m.vertexNormalsModelView[U].copy(la).applyMatrix3(Q);
+1<g.positionScreen.y||-1>g.positionScreen.z||1<g.positionScreen.z)}fa=0;for(H=Ta.length;fa<H;fa++)if(X=Ta[fa],ea=!0===ka?Ba.materials[X.materialIndex]:da.material,void 0!==ea){oa=ea.side;if(X instanceof THREE.Face3)if(U=k[X.a],V=k[X.b],ha=k[X.c],J[0]=U.positionScreen,J[1]=V.positionScreen,J[2]=ha.positionScreen,!0===U.visible||!0===V.visible||!0===ha.visible||N.isIntersectionBox(y.setFromPoints(J)))if(A=0>(ha.positionScreen.x-U.positionScreen.x)*(V.positionScreen.y-U.positionScreen.y)-(ha.positionScreen.y-
+U.positionScreen.y)*(V.positionScreen.x-U.positionScreen.x),oa===THREE.DoubleSide||A===(oa===THREE.FrontSide))n===s?(la=new THREE.RenderableFace3,t.push(la),s++,n++,m=la):m=t[n++],m.id=da.id,m.v1.copy(U),m.v2.copy(V),m.v3.copy(ha);else continue;else continue;else if(X instanceof THREE.Face4)if(U=k[X.a],V=k[X.b],ha=k[X.c],la=k[X.d],v[0]=U.positionScreen,v[1]=V.positionScreen,v[2]=ha.positionScreen,v[3]=la.positionScreen,!0===U.visible||!0===V.visible||!0===ha.visible||!0===la.visible||N.isIntersectionBox(y.setFromPoints(v)))if(A=
+0>(la.positionScreen.x-U.positionScreen.x)*(V.positionScreen.y-U.positionScreen.y)-(la.positionScreen.y-U.positionScreen.y)*(V.positionScreen.x-U.positionScreen.x)||0>(V.positionScreen.x-ha.positionScreen.x)*(la.positionScreen.y-ha.positionScreen.y)-(V.positionScreen.y-ha.positionScreen.y)*(la.positionScreen.x-ha.positionScreen.x),oa===THREE.DoubleSide||A===(oa===THREE.FrontSide)){if(q===r){var na=new THREE.RenderableFace4;p.push(na);r++;q++;m=na}else m=p[q++];m.id=da.id;m.v1.copy(U);m.v2.copy(V);
+m.v3.copy(ha);m.v4.copy(la)}else continue;else continue;m.normalModel.copy(X.normal);!1===A&&(oa===THREE.BackSide||oa===THREE.DoubleSide)&&m.normalModel.negate();m.normalModel.applyMatrix3(Sa).normalize();m.normalModelView.copy(m.normalModel).applyMatrix3(Q);m.centroidModel.copy(X.centroid).applyMatrix4(qa);ha=X.vertexNormals;U=0;for(V=ha.length;U<V;U++)la=m.vertexNormalsModel[U],la.copy(ha[U]),!1===A&&(oa===THREE.BackSide||oa===THREE.DoubleSide)&&la.negate(),la.applyMatrix3(Sa).normalize(),m.vertexNormalsModelView[U].copy(la).applyMatrix3(Q);
 m.vertexNormalsLength=ha.length;U=0;for(V=xa.length;U<V;U++)if(la=xa[U][fa],void 0!==la){oa=0;for(ha=la.length;oa<ha;oa++)m.uvs[U][oa]=la[oa]}m.color=X.color;m.material=ea;ia.copy(m.centroidModel).applyProjection(L);m.z=ia.z;O.elements.push(m)}}else if(da instanceof THREE.Line){Pa.multiplyMatrices(L,qa);fa=da.geometry.vertices;U=a();U.positionScreen.copy(fa[0]).applyMatrix4(Pa);Ta=da.type===THREE.LinePieces?2:1;H=1;for(X=fa.length;H<X;H++)U=a(),U.positionScreen.copy(fa[H]).applyMatrix4(Pa),0<(H+1)%
 m.vertexNormalsLength=ha.length;U=0;for(V=xa.length;U<V;U++)if(la=xa[U][fa],void 0!==la){oa=0;for(ha=la.length;oa<ha;oa++)m.uvs[U][oa]=la[oa]}m.color=X.color;m.material=ea;ia.copy(m.centroidModel).applyProjection(L);m.z=ia.z;O.elements.push(m)}}else if(da instanceof THREE.Line){Pa.multiplyMatrices(L,qa);fa=da.geometry.vertices;U=a();U.positionScreen.copy(fa[0]).applyMatrix4(Pa);Ta=da.type===THREE.LinePieces?2:1;H=1;for(X=fa.length;H<X;H++)U=a(),U.positionScreen.copy(fa[H]).applyMatrix4(Pa),0<(H+1)%
-Ta||(V=k[i-2],M.copy(U.positionScreen),sa.copy(V.positionScreen),!0===c(M,sa)&&(M.multiplyScalar(1/M.w),sa.multiplyScalar(1/sa.w),z===B?(xa=new THREE.RenderableLine,G.push(xa),B++,z++,u=xa):u=G[z++],u.id=da.id,u.v1.positionScreen.copy(M),u.v2.positionScreen.copy(sa),u.z=Math.max(M.z,sa.z),u.material=da.material,da.material.vertexColors===THREE.VertexColors&&(u.vertexColors[0].copy(da.geometry.colors[H]),u.vertexColors[1].copy(da.geometry.colors[H-1])),O.elements.push(u)))}d=0;for(h=O.sprites.length;d<
-h;d++)da=O.sprites[d].object,qa=da.matrixWorld,da instanceof THREE.Particle&&(K.set(qa.elements[12],qa.elements[13],qa.elements[14],1),K.applyMatrix4(L),ea=1/K.w,K.z*=ea,0<K.z&&1>K.z&&(I===A?(C=new THREE.RenderableParticle,E.push(C),A++,I++,F=C):F=E[I++],F.id=da.id,F.x=K.x*ea,F.y=K.y*ea,F.z=K.z,F.object=da,F.rotation=da.rotation.z,F.scale.x=da.scale.x*Math.abs(F.x-(K.x+f.projectionMatrix.elements[0])/(K.w+f.projectionMatrix.elements[12])),F.scale.y=da.scale.y*Math.abs(F.y-(K.y+f.projectionMatrix.elements[5])/
-(K.w+f.projectionMatrix.elements[13])),F.material=da.material,O.elements.push(F)));!0===l&&O.elements.sort(b);return O}};THREE.Face3=function(a,b,c,d,e,f){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!==f?f:0;this.centroid=new THREE.Vector3};
+Ta||(V=k[i-2],M.copy(U.positionScreen),sa.copy(V.positionScreen),!0===c(M,sa)&&(M.multiplyScalar(1/M.w),sa.multiplyScalar(1/sa.w),z===F?(xa=new THREE.RenderableLine,C.push(xa),F++,z++,w=xa):w=C[z++],w.id=da.id,w.v1.positionScreen.copy(M),w.v2.positionScreen.copy(sa),w.z=Math.max(M.z,sa.z),w.material=da.material,da.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(da.geometry.colors[H]),w.vertexColors[1].copy(da.geometry.colors[H-1])),O.elements.push(w)))}d=0;for(h=O.sprites.length;d<
+h;d++)da=O.sprites[d].object,qa=da.matrixWorld,da instanceof THREE.Particle&&(K.set(qa.elements[12],qa.elements[13],qa.elements[14],1),K.applyMatrix4(L),ea=1/K.w,K.z*=ea,0<K.z&&1>K.z&&(E===B?(A=new THREE.RenderableParticle,I.push(A),B++,E++,G=A):G=I[E++],G.id=da.id,G.x=K.x*ea,G.y=K.y*ea,G.z=K.z,G.object=da,G.rotation=da.rotation.z,G.scale.x=da.scale.x*Math.abs(G.x-(K.x+f.projectionMatrix.elements[0])/(K.w+f.projectionMatrix.elements[12])),G.scale.y=da.scale.y*Math.abs(G.y-(K.y+f.projectionMatrix.elements[5])/
+(K.w+f.projectionMatrix.elements[13])),G.material=da.material,O.elements.push(G)));!0===l&&O.elements.sort(b);return O}};THREE.Face3=function(a,b,c,d,e,f){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!==f?f:0;this.centroid=new THREE.Vector3};
 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.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(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();
 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.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
 return a}};THREE.Face4=function(a,b,c,d,e,f,h){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=void 0!==h?h:0;this.centroid=new THREE.Vector3};
 return a}};THREE.Face4=function(a,b,c,d,e,f,h){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=void 0!==h?h:0;this.centroid=new THREE.Vector3};
 THREE.Face4.prototype={constructor:THREE.Face4,clone:function(){var a=new THREE.Face4(this.a,this.b,this.c,this.d);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(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();
 THREE.Face4.prototype={constructor:THREE.Face4,clone:function(){var a=new THREE.Face4(this.a,this.b,this.c,this.d);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(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();
@@ -183,9 +182,9 @@ f=this.vertices[d.b],h=this.vertices[d.c],i.subVectors(h,f),k.subVectors(a,f),i.
 d.vertexNormals[3].copy(e[d.d]))},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++){e=this.faces[c];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone();e.__originalVertexNormals||(e.__originalVertexNormals=[]);a=0;for(b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone()}var f=new THREE.Geometry;f.faces=
 d.vertexNormals[3].copy(e[d.d]))},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++){e=this.faces[c];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone();e.__originalVertexNormals||(e.__originalVertexNormals=[]);a=0;for(b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone()}var f=new THREE.Geometry;f.faces=
 this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];var h=this.morphNormals[a].faceNormals,g=this.morphNormals[a].vertexNormals,i,k;c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],i=new THREE.Vector3,k=e instanceof THREE.Face3?{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3}:{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3,d:new THREE.Vector3},
 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=[];var h=this.morphNormals[a].faceNormals,g=this.morphNormals[a].vertexNormals,i,k;c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],i=new THREE.Vector3,k=e instanceof THREE.Face3?{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3}:{a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3,d:new THREE.Vector3},
 h.push(i),g.push(k)}h=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],i=h.faceNormals[c],k=h.vertexNormals[c],i.copy(e.normal),e instanceof THREE.Face3?(k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])):(k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2]),k.d.copy(e.vertexNormals[3]))}c=0;for(d=this.faces.length;c<
 h.push(i),g.push(k)}h=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],i=h.faceNormals[c],k=h.vertexNormals[c],i.copy(e.normal),e instanceof THREE.Face3?(k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])):(k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2]),k.d.copy(e.vertexNormals[3]))}c=0;for(d=this.faces.length;c<
-d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){function a(a,b,c,d,e,f,y){g=a.vertices[b];i=a.vertices[c];k=a.vertices[d];l=h[e];m=h[f];n=h[y];q=i.x-g.x;t=k.x-g.x;p=i.y-g.y;r=k.y-g.y;s=i.z-g.z;u=k.z-g.z;z=m.x-l.x;G=n.x-l.x;B=m.y-l.y;F=n.y-l.y;I=1/(z*F-G*B);C.set((F*q-B*t)*I,(F*p-B*r)*I,(F*s-B*u)*I);K.set((z*t-G*q)*I,(z*r-G*p)*I,(z*u-G*s)*I);A[b].add(C);A[c].add(C);A[d].add(C);O[b].add(K);O[c].add(K);O[d].add(K)}var b,c,d,
-e,f,h,g,i,k,l,m,n,q,t,p,r,s,u,z,G,B,F,I,E,A=[],O=[],C=new THREE.Vector3,K=new THREE.Vector3,N=new THREE.Vector3,y=new THREE.Vector3,J=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)A[b]=new THREE.Vector3,O[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)f=this.faces[b],h=this.faceVertexUvs[0][b],f instanceof THREE.Face3?a(this,f.a,f.b,f.c,0,1,2):f instanceof THREE.Face4&&(a(this,f.a,f.b,f.d,0,1,3),a(this,f.b,f.c,f.d,1,2,3));var w=["a","b","c","d"];b=0;for(c=this.faces.length;b<
-c;b++){f=this.faces[b];for(d=0;d<f.vertexNormals.length;d++)J.copy(f.vertexNormals[d]),e=f[w[d]],E=A[e],N.copy(E),N.sub(J.multiplyScalar(J.dot(E))).normalize(),y.crossVectors(f.vertexNormals[d],E),e=y.dot(O[e]),e=0>e?-1:1,f.vertexTangents[d]=new THREE.Vector4(N.x,N.y,N.z,e)}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=
+d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){function a(a,b,c,d,e,f,y){g=a.vertices[b];i=a.vertices[c];k=a.vertices[d];l=h[e];m=h[f];n=h[y];t=i.x-g.x;s=k.x-g.x;q=i.y-g.y;p=k.y-g.y;r=i.z-g.z;w=k.z-g.z;z=m.x-l.x;C=n.x-l.x;F=m.y-l.y;G=n.y-l.y;E=1/(z*G-C*F);A.set((G*t-F*s)*E,(G*q-F*p)*E,(G*r-F*w)*E);K.set((z*s-C*t)*E,(z*p-C*q)*E,(z*w-C*r)*E);B[b].add(A);B[c].add(A);B[d].add(A);O[b].add(K);O[c].add(K);O[d].add(K)}var b,c,d,
+e,f,h,g,i,k,l,m,n,t,s,q,p,r,w,z,C,F,G,E,I,B=[],O=[],A=new THREE.Vector3,K=new THREE.Vector3,N=new THREE.Vector3,y=new THREE.Vector3,J=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)B[b]=new THREE.Vector3,O[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)f=this.faces[b],h=this.faceVertexUvs[0][b],f instanceof THREE.Face3?a(this,f.a,f.b,f.c,0,1,2):f instanceof THREE.Face4&&(a(this,f.a,f.b,f.d,0,1,3),a(this,f.b,f.c,f.d,1,2,3));var v=["a","b","c","d"];b=0;for(c=this.faces.length;b<
+c;b++){f=this.faces[b];for(d=0;d<f.vertexNormals.length;d++)J.copy(f.vertexNormals[d]),e=f[v[d]],I=B[e],N.copy(I),N.sub(J.multiplyScalar(J.dot(I))).normalize(),y.crossVectors(f.vertexNormals[d],I),e=y.dot(O[e]),e=0>e?-1:1,f.vertexTangents[d]=new THREE.Vector4(N.x,N.y,N.z,e)}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)},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,h,g,i,k;this.__tmpVertices=void 0;f=0;for(h=this.vertices.length;f<h;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=
 new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,h,g,i,k;this.__tmpVertices=void 0;f=0;for(h=this.vertices.length;f<h;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=
 c[a[d]];e=[];f=0;for(h=this.faces.length;f<h;f++)if(a=this.faces[f],a instanceof THREE.Face3){a.a=c[a.a];a.b=c[a.b];a.c=c[a.c];g=[a.a,a.b,a.c];d=-1;for(i=0;3>i;i++)if(g[i]==g[(i+1)%3]){e.push(f);break}}else if(a instanceof THREE.Face4){a.a=c[a.a];a.b=c[a.b];a.c=c[a.c];a.d=c[a.d];g=[a.a,a.b,a.c,a.d];d=-1;for(i=0;4>i;i++)g[i]==g[(i+1)%4]&&(0<=d&&e.push(f),d=i);if(0<=d){g.splice(d,1);var l=new THREE.Face3(g[0],g[1],g[2],a.normal,a.color,a.materialIndex);g=0;for(i=this.faceVertexUvs.length;g<i;g++)(k=
 c[a[d]];e=[];f=0;for(h=this.faces.length;f<h;f++)if(a=this.faces[f],a instanceof THREE.Face3){a.a=c[a.a];a.b=c[a.b];a.c=c[a.c];g=[a.a,a.b,a.c];d=-1;for(i=0;3>i;i++)if(g[i]==g[(i+1)%3]){e.push(f);break}}else if(a instanceof THREE.Face4){a.a=c[a.a];a.b=c[a.b];a.c=c[a.c];a.d=c[a.d];g=[a.a,a.b,a.c,a.d];d=-1;for(i=0;4>i;i++)g[i]==g[(i+1)%4]&&(0<=d&&e.push(f),d=i);if(0<=d){g.splice(d,1);var l=new THREE.Face3(g[0],g[1],g[2],a.normal,a.color,a.materialIndex);g=0;for(i=this.faceVertexUvs.length;g<i;g++)(k=
 this.faceVertexUvs[g][f])&&k.splice(d,1);a.vertexNormals&&0<a.vertexNormals.length&&(l.vertexNormals=a.vertexNormals,l.vertexNormals.splice(d,1));a.vertexColors&&0<a.vertexColors.length&&(l.vertexColors=a.vertexColors,l.vertexColors.splice(d,1));this.faces[f]=l}}for(f=e.length-1;0<=f;f--){this.faces.splice(f,1);g=0;for(i=this.faceVertexUvs.length;g<i;g++)this.faceVertexUvs[g].splice(f,1)}c=this.vertices.length-b.length;this.vertices=b;return c},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,
 this.faceVertexUvs[g][f])&&k.splice(d,1);a.vertexNormals&&0<a.vertexNormals.length&&(l.vertexNormals=a.vertexNormals,l.vertexNormals.splice(d,1));a.vertexColors&&0<a.vertexColors.length&&(l.vertexColors=a.vertexColors,l.vertexColors.splice(d,1));this.faces[f]=l}}for(f=e.length-1;0<=f;f--){this.faces.splice(f,1);g=0;for(i=this.faceVertexUvs.length;g<i;g++)this.faceVertexUvs[g].splice(f,1)}c=this.vertices.length-b.length;this.vertices=b;return c},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,
@@ -193,12 +192,12 @@ c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.le
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,applyMatrix:function(a){var b,c;this.attributes.position&&(b=this.attributes.position.array);this.attributes.normal&&(c=this.attributes.normal.array);void 0!==b&&(a.multiplyVector3Array(b),this.verticesNeedUpdate=!0);void 0!==c&&((new THREE.Matrix3).getNormalMatrix(a).multiplyVector3Array(c),this.normalizeNormals(),this.normalsNeedUpdate=!0)},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var a=
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,applyMatrix:function(a){var b,c;this.attributes.position&&(b=this.attributes.position.array);this.attributes.normal&&(c=this.attributes.normal.array);void 0!==b&&(a.multiplyVector3Array(b),this.verticesNeedUpdate=!0);void 0!==c&&((new THREE.Matrix3).getNormalMatrix(a).multiplyVector3Array(c),this.normalizeNormals(),this.normalsNeedUpdate=!0)},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var a=
 this.attributes.position.array;if(a){var b=this.boundingBox,c,d,e;3<=a.length&&(b.min.x=b.max.x=a[0],b.min.y=b.max.y=a[1],b.min.z=b.max.z=a[2]);for(var f=3,h=a.length;f<h;f+=3)c=a[f],d=a[f+1],e=a[f+2],c<b.min.x?b.min.x=c:c>b.max.x&&(b.max.x=c),d<b.min.y?b.min.y=d:d>b.max.y&&(b.max.y=d),e<b.min.z?b.min.z=e:e>b.max.z&&(b.max.z=e)}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=
 this.attributes.position.array;if(a){var b=this.boundingBox,c,d,e;3<=a.length&&(b.min.x=b.max.x=a[0],b.min.y=b.max.y=a[1],b.min.z=b.max.z=a[2]);for(var f=3,h=a.length;f<h;f+=3)c=a[f],d=a[f+1],e=a[f+2],c<b.min.x?b.min.x=c:c>b.max.x&&(b.max.x=c),d<b.min.y?b.min.y=d:d>b.max.y&&(b.max.y=d),e<b.min.z?b.min.z=e:e>b.max.z&&(b.max.z=e)}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=
 new THREE.Sphere);var a=this.attributes.position.array;if(a){for(var b,c=0,d,e,f=0,h=a.length;f<h;f+=3)b=a[f],d=a[f+1],e=a[f+2],b=b*b+d*d+e*e,b>c&&(c=b);this.boundingSphere.radius=Math.sqrt(c)}},computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else{a=0;for(b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0}var e=
 new THREE.Sphere);var a=this.attributes.position.array;if(a){for(var b,c=0,d,e,f=0,h=a.length;f<h;f+=3)b=a[f],d=a[f+1],e=a[f+2],b=b*b+d*d+e*e,b>c&&(c=b);this.boundingSphere.radius=Math.sqrt(c)}},computeVertexNormals:function(){if(this.attributes.position){var a,b,c,d;a=this.attributes.position.array.length;if(void 0===this.attributes.normal)this.attributes.normal={itemSize:3,array:new Float32Array(a)};else{a=0;for(b=this.attributes.normal.array.length;a<b;a++)this.attributes.normal.array[a]=0}var e=
-this.attributes.position.array,f=this.attributes.normal.array,h,g,i,k,l,m,n=new THREE.Vector3,q=new THREE.Vector3,t=new THREE.Vector3,p=new THREE.Vector3,r=new THREE.Vector3;if(this.attributes.index){var s=this.attributes.index.array,u=this.offsets;c=0;for(d=u.length;c<d;++c){b=u[c].start;h=u[c].count;var z=u[c].index;a=b;for(b+=h;a<b;a+=3)h=z+s[a],g=z+s[a+1],i=z+s[a+2],k=e[3*h],l=e[3*h+1],m=e[3*h+2],n.set(k,l,m),k=e[3*g],l=e[3*g+1],m=e[3*g+2],q.set(k,l,m),k=e[3*i],l=e[3*i+1],m=e[3*i+2],t.set(k,l,
-m),p.subVectors(t,q),r.subVectors(n,q),p.cross(r),f[3*h]+=p.x,f[3*h+1]+=p.y,f[3*h+2]+=p.z,f[3*g]+=p.x,f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*i]+=p.x,f[3*i+1]+=p.y,f[3*i+2]+=p.z}}else{a=0;for(b=e.length;a<b;a+=9)k=e[a],l=e[a+1],m=e[a+2],n.set(k,l,m),k=e[a+3],l=e[a+4],m=e[a+5],q.set(k,l,m),k=e[a+6],l=e[a+7],m=e[a+8],t.set(k,l,m),p.subVectors(t,q),r.subVectors(n,q),p.cross(r),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z}this.normalizeNormals();this.normalsNeedUpdate=
+this.attributes.position.array,f=this.attributes.normal.array,h,g,i,k,l,m,n=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,q=new THREE.Vector3,p=new THREE.Vector3;if(this.attributes.index){var r=this.attributes.index.array,w=this.offsets;c=0;for(d=w.length;c<d;++c){b=w[c].start;h=w[c].count;var z=w[c].index;a=b;for(b+=h;a<b;a+=3)h=z+r[a],g=z+r[a+1],i=z+r[a+2],k=e[3*h],l=e[3*h+1],m=e[3*h+2],n.set(k,l,m),k=e[3*g],l=e[3*g+1],m=e[3*g+2],t.set(k,l,m),k=e[3*i],l=e[3*i+1],m=e[3*i+2],s.set(k,l,
+m),q.subVectors(s,t),p.subVectors(n,t),q.cross(p),f[3*h]+=q.x,f[3*h+1]+=q.y,f[3*h+2]+=q.z,f[3*g]+=q.x,f[3*g+1]+=q.y,f[3*g+2]+=q.z,f[3*i]+=q.x,f[3*i+1]+=q.y,f[3*i+2]+=q.z}}else{a=0;for(b=e.length;a<b;a+=9)k=e[a],l=e[a+1],m=e[a+2],n.set(k,l,m),k=e[a+3],l=e[a+4],m=e[a+5],t.set(k,l,m),k=e[a+6],l=e[a+7],m=e[a+8],s.set(k,l,m),q.subVectors(s,t),p.subVectors(n,t),q.cross(p),f[a]=q.x,f[a+1]=q.y,f[a+2]=q.z,f[a+3]=q.x,f[a+4]=q.y,f[a+5]=q.z,f[a+6]=q.x,f[a+7]=q.y,f[a+8]=q.z}this.normalizeNormals();this.normalsNeedUpdate=
 !0}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},computeTangents:function(){function a(a){Pa.x=d[3*a];Pa.y=d[3*a+1];Pa.z=d[3*a+2];Sa.copy(Pa);ia=g[a];L.copy(ia);L.sub(Pa.multiplyScalar(Pa.dot(ia))).normalize();qa.crossVectors(Sa,ia);Wa=qa.dot(i[a]);Q=0>Wa?-1:1;h[4*a]=L.x;h[4*a+1]=L.y;h[4*a+2]=L.z;h[4*a+3]=Q}if(void 0===this.attributes.index||void 0===this.attributes.position||
 !0}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},computeTangents:function(){function a(a){Pa.x=d[3*a];Pa.y=d[3*a+1];Pa.z=d[3*a+2];Sa.copy(Pa);ia=g[a];L.copy(ia);L.sub(Pa.multiplyScalar(Pa.dot(ia))).normalize();qa.crossVectors(Sa,ia);Wa=qa.dot(i[a]);Q=0>Wa?-1:1;h[4*a]=L.x;h[4*a+1]=L.y;h[4*a+2]=L.z;h[4*a+3]=Q}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 b=this.attributes.index.array,c=this.attributes.position.array,d=this.attributes.normal.array,e=this.attributes.uv.array,f=c.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent={itemSize:4,array:new Float32Array(4*f)});for(var h=this.attributes.tangent.array,g=[],i=[],k=0;k<f;k++)g[k]=new THREE.Vector3,
 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 b=this.attributes.index.array,c=this.attributes.position.array,d=this.attributes.normal.array,e=this.attributes.uv.array,f=c.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent={itemSize:4,array:new Float32Array(4*f)});for(var h=this.attributes.tangent.array,g=[],i=[],k=0;k<f;k++)g[k]=new THREE.Vector3,
-i[k]=new THREE.Vector3;var l,m,n,q,t,p,r,s,u,z,G,B,F,I,E,f=new THREE.Vector3,k=new THREE.Vector3,A,O,C,K,N,y,J,w=this.offsets;C=0;for(K=w.length;C<K;++C){O=w[C].start;N=w[C].count;var aa=w[C].index;A=O;for(O+=N;A<O;A+=3)N=aa+b[A],y=aa+b[A+1],J=aa+b[A+2],l=c[3*N],m=c[3*N+1],n=c[3*N+2],q=c[3*y],t=c[3*y+1],p=c[3*y+2],r=c[3*J],s=c[3*J+1],u=c[3*J+2],z=e[2*N],G=e[2*N+1],B=e[2*y],F=e[2*y+1],I=e[2*J],E=e[2*J+1],q-=l,l=r-l,t-=m,m=s-m,p-=n,n=u-n,B-=z,z=I-z,F-=G,G=E-G,E=1/(B*G-z*F),f.set((G*q-F*l)*E,(G*t-F*
-m)*E,(G*p-F*n)*E),k.set((B*l-z*q)*E,(B*m-z*t)*E,(B*n-z*p)*E),g[N].add(f),g[y].add(f),g[J].add(f),i[N].add(k),i[y].add(k),i[J].add(k)}var L=new THREE.Vector3,qa=new THREE.Vector3,Pa=new THREE.Vector3,Sa=new THREE.Vector3,Q,ia,Wa;C=0;for(K=w.length;C<K;++C){O=w[C].start;N=w[C].count;aa=w[C].index;A=O;for(O+=N;A<O;A+=3)N=aa+b[A],y=aa+b[A+1],J=aa+b[A+2],a(N),a(y),a(J)}this.tangentsNeedUpdate=this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=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.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
+i[k]=new THREE.Vector3;var l,m,n,t,s,q,p,r,w,z,C,F,G,E,I,f=new THREE.Vector3,k=new THREE.Vector3,B,O,A,K,N,y,J,v=this.offsets;A=0;for(K=v.length;A<K;++A){O=v[A].start;N=v[A].count;var aa=v[A].index;B=O;for(O+=N;B<O;B+=3)N=aa+b[B],y=aa+b[B+1],J=aa+b[B+2],l=c[3*N],m=c[3*N+1],n=c[3*N+2],t=c[3*y],s=c[3*y+1],q=c[3*y+2],p=c[3*J],r=c[3*J+1],w=c[3*J+2],z=e[2*N],C=e[2*N+1],F=e[2*y],G=e[2*y+1],E=e[2*J],I=e[2*J+1],t-=l,l=p-l,s-=m,m=r-m,q-=n,n=w-n,F-=z,z=E-z,G-=C,C=I-C,I=1/(F*C-z*G),f.set((C*t-G*l)*I,(C*s-G*
+m)*I,(C*q-G*n)*I),k.set((F*l-z*t)*I,(F*m-z*s)*I,(F*n-z*q)*I),g[N].add(f),g[y].add(f),g[J].add(f),i[N].add(k),i[y].add(k),i[J].add(k)}var L=new THREE.Vector3,qa=new THREE.Vector3,Pa=new THREE.Vector3,Sa=new THREE.Vector3,Q,ia,Wa;A=0;for(K=v.length;A<K;++A){O=v[A].start;N=v[A].count;aa=v[A].index;B=O;for(O+=N;B<O;B+=3)N=aa+b[B],y=aa+b[B+1],J=aa+b[B+2],a(N),a(y),a(J)}this.tangentsNeedUpdate=this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=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.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(THREE.Math.degToRad(0.5*this.fov))*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.Light.prototype.clone=function(a){void 0===a&&(a=new THREE.Light);THREE.Object3D.prototype.clone.call(this,a);a.color.copy(this.color);return a};THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;THREE.Light.prototype.clone.call(this,a);return a};THREE.AreaLight=function(a,b){THREE.Light.call(this,a);this.normal=new THREE.Vector3(0,-1,0);this.right=new THREE.Vector3(1,0,0);this.intensity=void 0!==b?b:1;this.height=this.width=1;this.constantAttenuation=1.5;this.linearAttenuation=0.5;this.quadraticAttenuation=0.1};THREE.AreaLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position.set(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=!1;this.shadowCascadeOffset=new THREE.Vector3(0,
 THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(THREE.Math.degToRad(0.5*this.fov))*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=Object.create(THREE.Object3D.prototype);THREE.Light.prototype.clone=function(a){void 0===a&&(a=new THREE.Light);THREE.Object3D.prototype.clone.call(this,a);a.color.copy(this.color);return a};THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype);THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;THREE.Light.prototype.clone.call(this,a);return a};THREE.AreaLight=function(a,b){THREE.Light.call(this,a);this.normal=new THREE.Vector3(0,-1,0);this.right=new THREE.Vector3(1,0,0);this.intensity=void 0!==b?b:1;this.height=this.width=1;this.constantAttenuation=1.5;this.linearAttenuation=0.5;this.quadraticAttenuation=0.1};THREE.AreaLight.prototype=Object.create(THREE.Light.prototype);THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position.set(0,1,0);this.target=new THREE.Object3D;this.intensity=void 0!==b?b:1;this.onlyShadow=this.castShadow=!1;this.shadowCameraNear=50;this.shadowCameraFar=5E3;this.shadowCameraLeft=-500;this.shadowCameraTop=this.shadowCameraRight=500;this.shadowCameraBottom=-500;this.shadowCameraVisible=!1;this.shadowBias=0;this.shadowDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCascade=!1;this.shadowCascadeOffset=new THREE.Vector3(0,
 0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);
 0,-1E3);this.shadowCascadeCount=2;this.shadowCascadeBias=[0,0,0];this.shadowCascadeWidth=[512,512,512];this.shadowCascadeHeight=[512,512,512];this.shadowCascadeNearZ=[-1,0.99,0.998];this.shadowCascadeFarZ=[0.99,0.998,1];this.shadowCascadeArray=[];this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null};THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype);
@@ -206,8 +205,8 @@ THREE.DirectionalLight.prototype.clone=function(){var a=new THREE.DirectionalLig
 this.shadowMap=null};THREE.SpotLight.prototype=Object.create(THREE.Light.prototype);THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;THREE.Light.prototype.clone.call(this,a);a.target=this.target.clone();a.intensity=this.intensity;a.distance=this.distance;a.angle=this.angle;a.exponent=this.exponent;a.castShadow=this.castShadow;a.onlyShadow=this.onlyShadow;return a};THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 this.shadowMap=null};THREE.SpotLight.prototype=Object.create(THREE.Light.prototype);THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;THREE.Light.prototype.clone.call(this,a);a.target=this.target.clone();a.intensity=this.intensity;a.distance=this.distance;a.angle=this.angle;a.exponent=this.exponent;a.castShadow=this.castShadow;a.onlyShadow=this.onlyShadow;return a};THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:"anonymous",addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/
 THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:"anonymous",addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/
 a.total).toFixed(0)+"%"):b+((a.loaded/1E3).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");a.pop();return(1>a.length?".":a.join("/"))+"/"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=THREE.Loader.prototype.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.floor(a)==
 a.total).toFixed(0)+"%"):b+((a.loaded/1E3).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");a.pop();return(1>a.length?".":a.join("/"))+"/"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=THREE.Loader.prototype.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.floor(a)==
-a}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function e(a,e,f,g,i,k,r){var s=/\.dds$/i.test(f),u=b+"/"+f;if(s){var z=THREE.ImageUtils.loadCompressedTexture(u);a[e]=z}else z=document.createElement("canvas"),a[e]=new THREE.Texture(z);a[e].sourceFile=f;g&&(a[e].repeat.set(g[0],g[1]),1!==g[0]&&(a[e].wrapS=THREE.RepeatWrapping),1!==g[1]&&(a[e].wrapT=THREE.RepeatWrapping));i&&a[e].offset.set(i[0],i[1]);k&&(f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==
-f[k[0]]&&(a[e].wrapS=f[k[0]]),void 0!==f[k[1]]&&(a[e].wrapT=f[k[1]]));r&&(a[e].anisotropy=r);if(!s){var G=a[e],a=new Image;a.onload=function(){if(!c(this.width)||!c(this.height)){var a=d(this.width),b=d(this.height);G.image.width=a;G.image.height=b;G.image.getContext("2d").drawImage(this,0,0,a,b)}else G.image=this;G.needsUpdate=!0};a.crossOrigin=h.crossOrigin;a.src=u}}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var h=this,g="MeshLambertMaterial",i={color:15658734,opacity:1,map:null,
+a}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function e(a,e,f,g,i,k,p){var r=/\.dds$/i.test(f),w=b+"/"+f;if(r){var z=THREE.ImageUtils.loadCompressedTexture(w);a[e]=z}else z=document.createElement("canvas"),a[e]=new THREE.Texture(z);a[e].sourceFile=f;g&&(a[e].repeat.set(g[0],g[1]),1!==g[0]&&(a[e].wrapS=THREE.RepeatWrapping),1!==g[1]&&(a[e].wrapT=THREE.RepeatWrapping));i&&a[e].offset.set(i[0],i[1]);k&&(f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==
+f[k[0]]&&(a[e].wrapS=f[k[0]]),void 0!==f[k[1]]&&(a[e].wrapT=f[k[1]]));p&&(a[e].anisotropy=p);if(!r){var C=a[e],a=new Image;a.onload=function(){if(!c(this.width)||!c(this.height)){var a=d(this.width),b=d(this.height);C.image.width=a;C.image.height=b;C.image.getContext("2d").drawImage(this,0,0,a,b)}else C.image=this;C.needsUpdate=!0};a.crossOrigin=h.crossOrigin;a.src=w}}function f(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var h=this,g="MeshLambertMaterial",i={color:15658734,opacity:1,map:null,
 lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":"basic"===k&&(g="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(i.blending=THREE[a.blending]);if(void 0!==a.transparent||1>a.opacity)i.transparent=a.transparent;void 0!==a.depthTest&&(i.depthTest=a.depthTest);void 0!==a.depthWrite&&(i.depthWrite=a.depthWrite);void 0!==a.visible&&(i.visible=a.visible);void 0!==a.flipSided&&(i.side=THREE.BackSide);
 lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?g="MeshPhongMaterial":"basic"===k&&(g="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(i.blending=THREE[a.blending]);if(void 0!==a.transparent||1>a.opacity)i.transparent=a.transparent;void 0!==a.depthTest&&(i.depthTest=a.depthTest);void 0!==a.depthWrite&&(i.depthWrite=a.depthWrite);void 0!==a.visible&&(i.visible=a.visible);void 0!==a.flipSided&&(i.side=THREE.BackSide);
 void 0!==a.doubleSided&&(i.side=THREE.DoubleSide);void 0!==a.wireframe&&(i.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"===a.vertexColors?i.vertexColors=THREE.FaceColors:a.vertexColors&&(i.vertexColors=THREE.VertexColors));a.colorDiffuse?i.color=f(a.colorDiffuse):a.DbgColor&&(i.color=a.DbgColor);a.colorSpecular&&(i.specular=f(a.colorSpecular));a.colorAmbient&&(i.ambient=f(a.colorAmbient));a.transparency&&(i.opacity=a.transparency);a.specularCoef&&(i.shininess=a.specularCoef);a.mapDiffuse&&
 void 0!==a.doubleSided&&(i.side=THREE.DoubleSide);void 0!==a.wireframe&&(i.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"===a.vertexColors?i.vertexColors=THREE.FaceColors:a.vertexColors&&(i.vertexColors=THREE.VertexColors));a.colorDiffuse?i.color=f(a.colorDiffuse):a.DbgColor&&(i.color=a.DbgColor);a.colorSpecular&&(i.specular=f(a.colorSpecular));a.colorAmbient&&(i.ambient=f(a.colorAmbient));a.transparency&&(i.opacity=a.transparency);a.specularCoef&&(i.shininess=a.specularCoef);a.mapDiffuse&&
 b&&e(i,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy);a.mapLight&&b&&e(i,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&e(i,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&e(i,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&e(i,"specularMap",a.mapSpecular,a.mapSpecularRepeat,
 b&&e(i,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy);a.mapLight&&b&&e(i,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&e(i,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&e(i,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&e(i,"specularMap",a.mapSpecular,a.mapSpecularRepeat,
@@ -217,11 +216,11 @@ THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){va
 THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=document.createElement("img");void 0!==b&&f.addEventListener("load",function(){e.manager.itemEnd(a);b(this)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);f.src=a;e.manager.itemStart(a)},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=document.createElement("img");void 0!==b&&f.addEventListener("load",function(){e.manager.itemEnd(a);b(this)},!1);void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1);void 0!==d&&f.addEventListener("error",function(a){d(a)},!1);void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin);f.src=a;e.manager.itemStart(a)},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,h=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var g=JSON.parse(f.responseText),g=a.parse(g,d);c(g.geometry,g.materials)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+f.status+"]");else f.readyState===f.LOADING?e&&(0===h&&
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,h=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var g=JSON.parse(f.responseText),g=a.parse(g,d);c(g.geometry,g.materials)}else console.warn("THREE.JSONLoader: ["+b+"] seems to be unreachable or file there is empty");a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load ["+b+"] ["+f.status+"]");else f.readyState===f.LOADING?e&&(0===h&&
 (h=f.getResponseHeader("Content-Length")),e({total:h,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(h=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
 (h=f.getResponseHeader("Content-Length")),e({total:h,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(h=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1,e,f,h,g,i,k,l,m,n,q,t,p,r,s,u,z=a.faces;q=a.vertices;var G=a.normals,B=a.colors,F=0;if(void 0!==a.uvs){for(e=0;e<a.uvs.length;e++)a.uvs[e].length&&F++;for(e=0;e<F;e++)c.faceUvs[e]=[],c.faceVertexUvs[e]=[]}g=0;for(i=q.length;g<i;)k=new THREE.Vector3,k.x=q[g++]*d,k.y=q[g++]*d,k.z=q[g++]*d,c.vertices.push(k);g=0;for(i=z.length;g<i;){q=z[g++];k=q&1;h=q&2;e=q&4;f=q&8;m=q&16;l=q&32;t=q&64;q&=128;k?(p=
-new THREE.Face4,p.a=z[g++],p.b=z[g++],p.c=z[g++],p.d=z[g++],k=4):(p=new THREE.Face3,p.a=z[g++],p.b=z[g++],p.c=z[g++],k=3);h&&(h=z[g++],p.materialIndex=h);h=c.faces.length;if(e)for(e=0;e<F;e++)r=a.uvs[e],n=z[g++],u=r[2*n],n=r[2*n+1],c.faceUvs[e][h]=new THREE.Vector2(u,n);if(f)for(e=0;e<F;e++){r=a.uvs[e];s=[];for(f=0;f<k;f++)n=z[g++],u=r[2*n],n=r[2*n+1],s[f]=new THREE.Vector2(u,n);c.faceVertexUvs[e][h]=s}m&&(m=3*z[g++],f=new THREE.Vector3,f.x=G[m++],f.y=G[m++],f.z=G[m],p.normal=f);if(l)for(e=0;e<k;e++)m=
-3*z[g++],f=new THREE.Vector3,f.x=G[m++],f.y=G[m++],f.z=G[m],p.vertexNormals.push(f);t&&(l=z[g++],l=new THREE.Color(B[l]),p.color=l);if(q)for(e=0;e<k;e++)l=z[g++],l=new THREE.Color(B[l]),p.vertexColors.push(l);c.faces.push(p)}if(a.skinWeights){g=0;for(i=a.skinWeights.length;g<i;g+=2)z=a.skinWeights[g],G=a.skinWeights[g+1],c.skinWeights.push(new THREE.Vector4(z,G,0,0))}if(a.skinIndices){g=0;for(i=a.skinIndices.length;g<i;g+=2)z=a.skinIndices[g],G=a.skinIndices[g+1],c.skinIndices.push(new THREE.Vector4(z,
-G,0,0))}c.bones=a.bones;c.animation=a.animation;if(void 0!==a.morphTargets){g=0;for(i=a.morphTargets.length;g<i;g++){c.morphTargets[g]={};c.morphTargets[g].name=a.morphTargets[g].name;c.morphTargets[g].vertices=[];B=c.morphTargets[g].vertices;F=a.morphTargets[g].vertices;z=0;for(G=F.length;z<G;z+=3)q=new THREE.Vector3,q.x=F[z]*d,q.y=F[z+1]*d,q.z=F[z+2]*d,B.push(q)}}if(void 0!==a.morphColors){g=0;for(i=a.morphColors.length;g<i;g++){c.morphColors[g]={};c.morphColors[g].name=a.morphColors[g].name;c.morphColors[g].colors=
-[];G=c.morphColors[g].colors;B=a.morphColors[g].colors;d=0;for(z=B.length;d<z;d+=3)F=new THREE.Color(16755200),F.setRGB(B[d],B[d+1],B[d+2]),G.push(F)}}c.computeCentroids();c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.GeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.GeometryLoader.prototype={constructor:THREE.GeometryLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader;d.setCrossOrigin(this.crossOrigin);d.load(a,function(a){b(c.parse(JSON.parse(a)))})},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(){}};THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1,e,f,h,g,i,k,l,m,n,t,s,q,p,r,w,z=a.faces;t=a.vertices;var C=a.normals,F=a.colors,G=0;if(void 0!==a.uvs){for(e=0;e<a.uvs.length;e++)a.uvs[e].length&&G++;for(e=0;e<G;e++)c.faceUvs[e]=[],c.faceVertexUvs[e]=[]}g=0;for(i=t.length;g<i;)k=new THREE.Vector3,k.x=t[g++]*d,k.y=t[g++]*d,k.z=t[g++]*d,c.vertices.push(k);g=0;for(i=z.length;g<i;){t=z[g++];k=t&1;h=t&2;e=t&4;f=t&8;m=t&16;l=t&32;s=t&64;t&=128;k?(q=
+new THREE.Face4,q.a=z[g++],q.b=z[g++],q.c=z[g++],q.d=z[g++],k=4):(q=new THREE.Face3,q.a=z[g++],q.b=z[g++],q.c=z[g++],k=3);h&&(h=z[g++],q.materialIndex=h);h=c.faces.length;if(e)for(e=0;e<G;e++)p=a.uvs[e],n=z[g++],w=p[2*n],n=p[2*n+1],c.faceUvs[e][h]=new THREE.Vector2(w,n);if(f)for(e=0;e<G;e++){p=a.uvs[e];r=[];for(f=0;f<k;f++)n=z[g++],w=p[2*n],n=p[2*n+1],r[f]=new THREE.Vector2(w,n);c.faceVertexUvs[e][h]=r}m&&(m=3*z[g++],f=new THREE.Vector3,f.x=C[m++],f.y=C[m++],f.z=C[m],q.normal=f);if(l)for(e=0;e<k;e++)m=
+3*z[g++],f=new THREE.Vector3,f.x=C[m++],f.y=C[m++],f.z=C[m],q.vertexNormals.push(f);s&&(l=z[g++],l=new THREE.Color(F[l]),q.color=l);if(t)for(e=0;e<k;e++)l=z[g++],l=new THREE.Color(F[l]),q.vertexColors.push(l);c.faces.push(q)}if(a.skinWeights){g=0;for(i=a.skinWeights.length;g<i;g+=2)z=a.skinWeights[g],C=a.skinWeights[g+1],c.skinWeights.push(new THREE.Vector4(z,C,0,0))}if(a.skinIndices){g=0;for(i=a.skinIndices.length;g<i;g+=2)z=a.skinIndices[g],C=a.skinIndices[g+1],c.skinIndices.push(new THREE.Vector4(z,
+C,0,0))}c.bones=a.bones;c.animation=a.animation;if(void 0!==a.morphTargets){g=0;for(i=a.morphTargets.length;g<i;g++){c.morphTargets[g]={};c.morphTargets[g].name=a.morphTargets[g].name;c.morphTargets[g].vertices=[];F=c.morphTargets[g].vertices;G=a.morphTargets[g].vertices;z=0;for(C=G.length;z<C;z+=3)t=new THREE.Vector3,t.x=G[z]*d,t.y=G[z+1]*d,t.z=G[z+2]*d,F.push(t)}}if(void 0!==a.morphColors){g=0;for(i=a.morphColors.length;g<i;g++){c.morphColors[g]={};c.morphColors[g].name=a.morphColors[g].name;c.morphColors[g].colors=
+[];C=c.morphColors[g].colors;F=a.morphColors[g].colors;d=0;for(z=F.length;d<z;d+=3)G=new THREE.Color(16755200),G.setRGB(F[d],F[d+1],F[d+2]),C.push(G)}}c.computeCentroids();c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.GeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.GeometryLoader.prototype={constructor:THREE.GeometryLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader;d.setCrossOrigin(this.crossOrigin);d.load(a,function(a){b(c.parse(JSON.parse(a)))})},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(){}};THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader;d.setCrossOrigin(this.crossOrigin);d.load(a,function(a){b(c.parse(JSON.parse(a)))})},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b;switch(a.type){case "MeshBasicMaterial":b=new THREE.MeshBasicMaterial({color:a.color,opacity:a.opacity,transparent:a.transparent,wireframe:a.wireframe});break;case "MeshLambertMaterial":b=new THREE.MeshLambertMaterial({color:a.color,
 THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader;d.setCrossOrigin(this.crossOrigin);d.load(a,function(a){b(c.parse(JSON.parse(a)))})},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b;switch(a.type){case "MeshBasicMaterial":b=new THREE.MeshBasicMaterial({color:a.color,opacity:a.opacity,transparent:a.transparent,wireframe:a.wireframe});break;case "MeshLambertMaterial":b=new THREE.MeshLambertMaterial({color:a.color,
 ambient:a.ambient,emissive:a.emissive,opacity:a.opacity,transparent:a.transparent,wireframe:a.wireframe});break;case "MeshPhongMaterial":b=new THREE.MeshPhongMaterial({color:a.color,ambient:a.ambient,emissive:a.emissive,specular:a.specular,shininess:a.shininess,opacity:a.opacity,transparent:a.transparent,wireframe:a.wireframe});break;case "MeshNormalMaterial":b=new THREE.MeshNormalMaterial({opacity:a.opacity,transparent:a.transparent,wireframe:a.wireframe});break;case "MeshDepthMaterial":b=new THREE.MeshDepthMaterial({opacity:a.opacity,
 ambient:a.ambient,emissive:a.emissive,opacity:a.opacity,transparent:a.transparent,wireframe:a.wireframe});break;case "MeshPhongMaterial":b=new THREE.MeshPhongMaterial({color:a.color,ambient:a.ambient,emissive:a.emissive,specular:a.specular,shininess:a.shininess,opacity:a.opacity,transparent:a.transparent,wireframe:a.wireframe});break;case "MeshNormalMaterial":b=new THREE.MeshNormalMaterial({opacity:a.opacity,transparent:a.transparent,wireframe:a.wireframe});break;case "MeshDepthMaterial":b=new THREE.MeshDepthMaterial({opacity:a.opacity,
 transparent:a.transparent,wireframe:a.wireframe})}void 0!==a.vertexColors&&(b.vertexColors=a.vertexColors);return b}};THREE.ObjectLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
 transparent:a.transparent,wireframe:a.wireframe})}void 0!==a.vertexColors&&(b.vertexColors=a.vertexColors);return b}};THREE.ObjectLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
@@ -232,28 +231,28 @@ h.thetaStart,h.thetaLength);break;case "IcosahedronGeometry":f=new THREE.Icosahe
 new THREE.AmbientLight(b.color);break;case "DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case "SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case "HemisphereLight":e=new THREE.HemisphereLight(b.color,b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var f=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+
 new THREE.AmbientLight(b.color);break;case "DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case "SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case "HemisphereLight":e=new THREE.HemisphereLight(b.color,b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var f=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+
 b.geometry);void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,f);break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&(e.name=b.name);void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&
 b.geometry);void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,f);break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&(e.name=b.name);void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&
 (e.userData=b.userData);if(void 0!==b.children)for(var h in b.children)e.add(this.parseObject(b.children[h],c,d));return e}}()};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){};this.geometryHandlers={};this.hierarchyHandlers={};this.addGeometryHandler("ascii",THREE.JSONLoader)};
 (e.userData=b.userData);if(void 0!==b.children)for(var h in b.children)e.add(this.parseObject(b.children[h],c,d));return e}}()};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){};this.geometryHandlers={};this.hierarchyHandlers={};this.addGeometryHandler("ascii",THREE.JSONLoader)};
-THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader(c.manager);d.setCrossOrigin(this.crossOrigin);d.load(a,function(d){c.parse(JSON.parse(d),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:n+"/"+a}function e(){f(A.scene,
-C.objects)}function f(a,b){var c,e,h,i,k,l,n;for(n in b){var r=A.objects[n],s=b[n];if(void 0===r){if(s.type&&s.type in m.hierarchyHandlers){if(void 0===s.loading){e={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};h={};for(var y in s)y in e||(h[y]=s[y]);t=A.materials[s.material];s.loading=!0;e=m.hierarchyHandlers[s.type].loaderObject;e.options?e.load(d(s.url,C.urlBaseType),g(n,a,t,s)):e.load(d(s.url,C.urlBaseType),g(n,
-a,t,s),h)}}else if(void 0!==s.geometry){if(q=A.geometries[s.geometry]){r=!1;t=A.materials[s.material];r=t instanceof THREE.ShaderMaterial;h=s.position;i=s.rotation;k=s.scale;c=s.matrix;l=s.quaternion;s.material||(t=new THREE.MeshFaceMaterial(A.face_materials[s.geometry]));t instanceof THREE.MeshFaceMaterial&&0===t.materials.length&&(t=new THREE.MeshFaceMaterial(A.face_materials[s.geometry]));if(t instanceof THREE.MeshFaceMaterial)for(e=0;e<t.materials.length;e++)r=r||t.materials[e]instanceof THREE.ShaderMaterial;
-r&&q.computeTangents();s.skin?r=new THREE.SkinnedMesh(q,t):s.morph?(r=new THREE.MorphAnimMesh(q,t),void 0!==s.duration&&(r.duration=s.duration),void 0!==s.time&&(r.time=s.time),void 0!==s.mirroredLoop&&(r.mirroredLoop=s.mirroredLoop),t.morphNormals&&q.computeMorphNormals()):r=new THREE.Mesh(q,t);r.name=n;c?(r.matrixAutoUpdate=!1,r.matrix.set(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])):(r.position.fromArray(h),l?r.quaternion.fromArray(l):r.rotation.fromArray(i),
-r.scale.fromArray(k));r.visible=s.visible;r.castShadow=s.castShadow;r.receiveShadow=s.receiveShadow;a.add(r);A.objects[n]=r}}else"DirectionalLight"===s.type||"PointLight"===s.type||"AmbientLight"===s.type?(z=void 0!==s.color?s.color:16777215,G=void 0!==s.intensity?s.intensity:1,"DirectionalLight"===s.type?(h=s.direction,u=new THREE.DirectionalLight(z,G),u.position.fromArray(h),s.target&&(O.push({object:u,targetName:s.target}),u.target=null)):"PointLight"===s.type?(h=s.position,e=s.distance,u=new THREE.PointLight(z,
-G,e),u.position.fromArray(h)):"AmbientLight"===s.type&&(u=new THREE.AmbientLight(z)),a.add(u),u.name=n,A.lights[n]=u,A.objects[n]=u):"PerspectiveCamera"===s.type||"OrthographicCamera"===s.type?(h=s.position,i=s.rotation,l=s.quaternion,"PerspectiveCamera"===s.type?p=new THREE.PerspectiveCamera(s.fov,s.aspect,s.near,s.far):"OrthographicCamera"===s.type&&(p=new THREE.OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.far)),p.name=n,p.position.fromArray(h),void 0!==l?p.quaternion.fromArray(l):
-void 0!==i&&p.rotation.fromArray(i),a.add(p),A.cameras[n]=p,A.objects[n]=p):(h=s.position,i=s.rotation,k=s.scale,l=s.quaternion,r=new THREE.Object3D,r.name=n,r.position.fromArray(h),l?r.quaternion.fromArray(l):r.rotation.fromArray(i),r.scale.fromArray(k),r.visible=void 0!==s.visible?s.visible:!1,a.add(r),A.objects[n]=r,A.empties[n]=r);if(r){if(void 0!==s.userData)for(var B in s.userData)r.userData[B]=s.userData[B];if(void 0!==s.groups)for(e=0;e<s.groups.length;e++)h=s.groups[e],void 0===A.groups[h]&&
-(A.groups[h]=[]),A.groups[h].push(n)}}void 0!==r&&void 0!==s.children&&f(r,s.children)}}function h(a){return function(b,c){b.name=a;A.geometries[a]=b;A.face_materials[a]=c;e();B-=1;m.onLoadComplete();k()}}function g(a,b,c,d){return function(f){var f=f.content?f.content:f.dae?f.scene:f,h=d.rotation,g=d.quaternion,i=d.scale;f.position.fromArray(d.position);g?f.quaternion.fromArray(g):f.rotation.fromArray(h);f.scale.fromArray(i);c&&f.traverse(function(a){a.material=c});var l=void 0!==d.visible?d.visible:
-!0;f.traverse(function(a){a.visible=l});b.add(f);f.name=a;A.objects[a]=f;e();B-=1;m.onLoadComplete();k()}}function i(a){return function(b,c){b.name=a;A.geometries[a]=b;A.face_materials[a]=c}}function k(){m.callbackProgress({totalModels:I,totalTextures:E,loadedModels:I-B,loadedTextures:E-F},A);m.onLoadProgress();if(0===B&&0===F){for(var a=0;a<O.length;a++){var c=O[a],d=A.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,A.scene.add(c.object.target));c.object.target.userData.targetInverse=
-c.object}b(A)}}function l(a,b){b(a);if(void 0!==a.children)for(var c in a.children)l(a.children[c],b)}var m=this,n=THREE.Loader.prototype.extractUrlBase(c),q,t,p,r,s,u,z,G,B,F,I,E,A,O=[],C=a,K;for(K in this.geometryHandlers)a=this.geometryHandlers[K].loaderClass,this.geometryHandlers[K].loaderObject=new a;for(K in this.hierarchyHandlers)a=this.hierarchyHandlers[K].loaderClass,this.hierarchyHandlers[K].loaderObject=new a;F=B=0;A={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},
-objects:{},cameras:{},lights:{},fogs:{},empties:{},groups:{}};if(C.transform&&(K=C.transform.position,a=C.transform.rotation,c=C.transform.scale,K&&A.scene.position.fromArray(K),a&&A.scene.rotation.fromArray(a),c&&A.scene.scale.fromArray(c),K||a||c))A.scene.updateMatrix(),A.scene.updateMatrixWorld();K=function(a){return function(){F-=a;k();m.onLoadComplete()}};for(var N in C.fogs)a=C.fogs[N],"linear"===a.type?r=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(r=new THREE.FogExp2(0,a.density)),a=a.color,
-r.color.setRGB(a[0],a[1],a[2]),A.fogs[N]=r;for(var y in C.geometries)r=C.geometries[y],r.type in this.geometryHandlers&&(B+=1,m.onLoadStart());for(var J in C.objects)l(C.objects[J],function(a){a.type&&a.type in m.hierarchyHandlers&&(B+=1,m.onLoadStart())});I=B;for(y in C.geometries)if(r=C.geometries[y],"cube"===r.type)q=new THREE.CubeGeometry(r.width,r.height,r.depth,r.widthSegments,r.heightSegments,r.depthSegments),q.name=y,A.geometries[y]=q;else if("plane"===r.type)q=new THREE.PlaneGeometry(r.width,
-r.height,r.widthSegments,r.heightSegments),q.name=y,A.geometries[y]=q;else if("sphere"===r.type)q=new THREE.SphereGeometry(r.radius,r.widthSegments,r.heightSegments),q.name=y,A.geometries[y]=q;else if("cylinder"===r.type)q=new THREE.CylinderGeometry(r.topRad,r.botRad,r.height,r.radSegs,r.heightSegs),q.name=y,A.geometries[y]=q;else if("torus"===r.type)q=new THREE.TorusGeometry(r.radius,r.tube,r.segmentsR,r.segmentsT),q.name=y,A.geometries[y]=q;else if("icosahedron"===r.type)q=new THREE.IcosahedronGeometry(r.radius,
-r.subdivisions),q.name=y,A.geometries[y]=q;else if(r.type in this.geometryHandlers){J={};for(s in r)"type"!==s&&"url"!==s&&(J[s]=r[s]);this.geometryHandlers[r.type].loaderObject.load(d(r.url,C.urlBaseType),h(y),J)}else"embedded"===r.type&&(J=C.embeds[r.id],J.metadata=C.metadata,J&&(J=this.geometryHandlers.ascii.loaderObject.parse(J,""),i(y)(J.geometry,J.materials)));for(var w in C.textures)if(y=C.textures[w],y.url instanceof Array){F+=y.url.length;for(s=0;s<y.url.length;s++)m.onLoadStart()}else F+=
-1,m.onLoadStart();E=F;for(w in C.textures){y=C.textures[w];void 0!==y.mapping&&void 0!==THREE[y.mapping]&&(y.mapping=new THREE[y.mapping]);if(y.url instanceof Array){J=y.url.length;r=[];for(s=0;s<J;s++)r[s]=d(y.url[s],C.urlBaseType);s=(s=/\.dds$/i.test(r[0]))?THREE.ImageUtils.loadCompressedTextureCube(r,y.mapping,K(J)):THREE.ImageUtils.loadTextureCube(r,y.mapping,K(J))}else s=/\.dds$/i.test(y.url),J=d(y.url,C.urlBaseType),r=K(1),s=s?THREE.ImageUtils.loadCompressedTexture(J,y.mapping,r):THREE.ImageUtils.loadTexture(J,
-y.mapping,r),void 0!==THREE[y.minFilter]&&(s.minFilter=THREE[y.minFilter]),void 0!==THREE[y.magFilter]&&(s.magFilter=THREE[y.magFilter]),y.anisotropy&&(s.anisotropy=y.anisotropy),y.repeat&&(s.repeat.set(y.repeat[0],y.repeat[1]),1!==y.repeat[0]&&(s.wrapS=THREE.RepeatWrapping),1!==y.repeat[1]&&(s.wrapT=THREE.RepeatWrapping)),y.offset&&s.offset.set(y.offset[0],y.offset[1]),y.wrap&&(J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==J[y.wrap[0]]&&(s.wrapS=J[y.wrap[0]]),void 0!==
-J[y.wrap[1]]&&(s.wrapT=J[y.wrap[1]]));A.textures[w]=s}var aa,L;for(aa in C.materials){w=C.materials[aa];for(L in w.parameters)"envMap"===L||"map"===L||"lightMap"===L||"bumpMap"===L?w.parameters[L]=A.textures[w.parameters[L]]:"shading"===L?w.parameters[L]="flat"===w.parameters[L]?THREE.FlatShading:THREE.SmoothShading:"side"===L?w.parameters[L]="double"==w.parameters[L]?THREE.DoubleSide:"back"==w.parameters[L]?THREE.BackSide:THREE.FrontSide:"blending"===L?w.parameters[L]=w.parameters[L]in THREE?THREE[w.parameters[L]]:
-THREE.NormalBlending:"combine"===L?w.parameters[L]=w.parameters[L]in THREE?THREE[w.parameters[L]]:THREE.MultiplyOperation:"vertexColors"===L?"face"==w.parameters[L]?w.parameters[L]=THREE.FaceColors:w.parameters[L]&&(w.parameters[L]=THREE.VertexColors):"wrapRGB"===L&&(K=w.parameters[L],w.parameters[L]=new THREE.Vector3(K[0],K[1],K[2]));void 0!==w.parameters.opacity&&1>w.parameters.opacity&&(w.parameters.transparent=!0);w.parameters.normalMap?(K=THREE.ShaderLib.normalmap,y=THREE.UniformsUtils.clone(K.uniforms),
-s=w.parameters.color,J=w.parameters.specular,r=w.parameters.ambient,N=w.parameters.shininess,y.tNormal.value=A.textures[w.parameters.normalMap],w.parameters.normalScale&&y.uNormalScale.value.set(w.parameters.normalScale[0],w.parameters.normalScale[1]),w.parameters.map&&(y.tDiffuse.value=w.parameters.map,y.enableDiffuse.value=!0),w.parameters.envMap&&(y.tCube.value=w.parameters.envMap,y.enableReflection.value=!0,y.uReflectivity.value=w.parameters.reflectivity),w.parameters.lightMap&&(y.tAO.value=w.parameters.lightMap,
-y.enableAO.value=!0),w.parameters.specularMap&&(y.tSpecular.value=A.textures[w.parameters.specularMap],y.enableSpecular.value=!0),w.parameters.displacementMap&&(y.tDisplacement.value=A.textures[w.parameters.displacementMap],y.enableDisplacement.value=!0,y.uDisplacementBias.value=w.parameters.displacementBias,y.uDisplacementScale.value=w.parameters.displacementScale),y.uDiffuseColor.value.setHex(s),y.uSpecularColor.value.setHex(J),y.uAmbientColor.value.setHex(r),y.uShininess.value=N,w.parameters.opacity&&
-(y.uOpacity.value=w.parameters.opacity),t=new THREE.ShaderMaterial({fragmentShader:K.fragmentShader,vertexShader:K.vertexShader,uniforms:y,lights:!0,fog:!0})):t=new THREE[w.type](w.parameters);t.name=aa;A.materials[aa]=t}for(aa in C.materials)if(w=C.materials[aa],w.parameters.materials){L=[];for(s=0;s<w.parameters.materials.length;s++)L.push(A.materials[w.parameters.materials[s]]);A.materials[aa].materials=L}e();A.cameras&&C.defaults.camera&&(A.currentCamera=A.cameras[C.defaults.camera]);A.fogs&&
-C.defaults.fog&&(A.scene.fog=A.fogs[C.defaults.fog]);m.callbackSync(A);k()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b){var c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
+THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader(c.manager);d.setCrossOrigin(this.crossOrigin);d.load(a,function(d){c.parse(JSON.parse(d),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:n+"/"+a}function e(){f(B.scene,
+A.objects)}function f(a,b){var c,e,h,i,k,l,n;for(n in b){var p=B.objects[n],r=b[n];if(void 0===p){if(r.type&&r.type in m.hierarchyHandlers){if(void 0===r.loading){e={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};h={};for(var y in r)y in e||(h[y]=r[y]);s=B.materials[r.material];r.loading=!0;e=m.hierarchyHandlers[r.type].loaderObject;e.options?e.load(d(r.url,A.urlBaseType),g(n,a,s,r)):e.load(d(r.url,A.urlBaseType),g(n,
+a,s,r),h)}}else if(void 0!==r.geometry){if(t=B.geometries[r.geometry]){p=!1;s=B.materials[r.material];p=s instanceof THREE.ShaderMaterial;h=r.position;i=r.rotation;k=r.scale;c=r.matrix;l=r.quaternion;r.material||(s=new THREE.MeshFaceMaterial(B.face_materials[r.geometry]));s instanceof THREE.MeshFaceMaterial&&0===s.materials.length&&(s=new THREE.MeshFaceMaterial(B.face_materials[r.geometry]));if(s instanceof THREE.MeshFaceMaterial)for(e=0;e<s.materials.length;e++)p=p||s.materials[e]instanceof THREE.ShaderMaterial;
+p&&t.computeTangents();r.skin?p=new THREE.SkinnedMesh(t,s):r.morph?(p=new THREE.MorphAnimMesh(t,s),void 0!==r.duration&&(p.duration=r.duration),void 0!==r.time&&(p.time=r.time),void 0!==r.mirroredLoop&&(p.mirroredLoop=r.mirroredLoop),s.morphNormals&&t.computeMorphNormals()):p=new THREE.Mesh(t,s);p.name=n;c?(p.matrixAutoUpdate=!1,p.matrix.set(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])):(p.position.fromArray(h),l?p.quaternion.fromArray(l):p.rotation.fromArray(i),
+p.scale.fromArray(k));p.visible=r.visible;p.castShadow=r.castShadow;p.receiveShadow=r.receiveShadow;a.add(p);B.objects[n]=p}}else"DirectionalLight"===r.type||"PointLight"===r.type||"AmbientLight"===r.type?(z=void 0!==r.color?r.color:16777215,C=void 0!==r.intensity?r.intensity:1,"DirectionalLight"===r.type?(h=r.direction,w=new THREE.DirectionalLight(z,C),w.position.fromArray(h),r.target&&(O.push({object:w,targetName:r.target}),w.target=null)):"PointLight"===r.type?(h=r.position,e=r.distance,w=new THREE.PointLight(z,
+C,e),w.position.fromArray(h)):"AmbientLight"===r.type&&(w=new THREE.AmbientLight(z)),a.add(w),w.name=n,B.lights[n]=w,B.objects[n]=w):"PerspectiveCamera"===r.type||"OrthographicCamera"===r.type?(h=r.position,i=r.rotation,l=r.quaternion,"PerspectiveCamera"===r.type?q=new THREE.PerspectiveCamera(r.fov,r.aspect,r.near,r.far):"OrthographicCamera"===r.type&&(q=new THREE.OrthographicCamera(r.left,r.right,r.top,r.bottom,r.near,r.far)),q.name=n,q.position.fromArray(h),void 0!==l?q.quaternion.fromArray(l):
+void 0!==i&&q.rotation.fromArray(i),a.add(q),B.cameras[n]=q,B.objects[n]=q):(h=r.position,i=r.rotation,k=r.scale,l=r.quaternion,p=new THREE.Object3D,p.name=n,p.position.fromArray(h),l?p.quaternion.fromArray(l):p.rotation.fromArray(i),p.scale.fromArray(k),p.visible=void 0!==r.visible?r.visible:!1,a.add(p),B.objects[n]=p,B.empties[n]=p);if(p){if(void 0!==r.userData)for(var F in r.userData)p.userData[F]=r.userData[F];if(void 0!==r.groups)for(e=0;e<r.groups.length;e++)h=r.groups[e],void 0===B.groups[h]&&
+(B.groups[h]=[]),B.groups[h].push(n)}}void 0!==p&&void 0!==r.children&&f(p,r.children)}}function h(a){return function(b,c){b.name=a;B.geometries[a]=b;B.face_materials[a]=c;e();F-=1;m.onLoadComplete();k()}}function g(a,b,c,d){return function(f){var f=f.content?f.content:f.dae?f.scene:f,h=d.rotation,g=d.quaternion,i=d.scale;f.position.fromArray(d.position);g?f.quaternion.fromArray(g):f.rotation.fromArray(h);f.scale.fromArray(i);c&&f.traverse(function(a){a.material=c});var l=void 0!==d.visible?d.visible:
+!0;f.traverse(function(a){a.visible=l});b.add(f);f.name=a;B.objects[a]=f;e();F-=1;m.onLoadComplete();k()}}function i(a){return function(b,c){b.name=a;B.geometries[a]=b;B.face_materials[a]=c}}function k(){m.callbackProgress({totalModels:E,totalTextures:I,loadedModels:E-F,loadedTextures:I-G},B);m.onLoadProgress();if(0===F&&0===G){for(var a=0;a<O.length;a++){var c=O[a],d=B.objects[c.targetName];d?c.object.target=d:(c.object.target=new THREE.Object3D,B.scene.add(c.object.target));c.object.target.userData.targetInverse=
+c.object}b(B)}}function l(a,b){b(a);if(void 0!==a.children)for(var c in a.children)l(a.children[c],b)}var m=this,n=THREE.Loader.prototype.extractUrlBase(c),t,s,q,p,r,w,z,C,F,G,E,I,B,O=[],A=a,K;for(K in this.geometryHandlers)a=this.geometryHandlers[K].loaderClass,this.geometryHandlers[K].loaderObject=new a;for(K in this.hierarchyHandlers)a=this.hierarchyHandlers[K].loaderClass,this.hierarchyHandlers[K].loaderObject=new a;G=F=0;B={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},
+objects:{},cameras:{},lights:{},fogs:{},empties:{},groups:{}};if(A.transform&&(K=A.transform.position,a=A.transform.rotation,c=A.transform.scale,K&&B.scene.position.fromArray(K),a&&B.scene.rotation.fromArray(a),c&&B.scene.scale.fromArray(c),K||a||c))B.scene.updateMatrix(),B.scene.updateMatrixWorld();K=function(a){return function(){G-=a;k();m.onLoadComplete()}};for(var N in A.fogs)a=A.fogs[N],"linear"===a.type?p=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(p=new THREE.FogExp2(0,a.density)),a=a.color,
+p.color.setRGB(a[0],a[1],a[2]),B.fogs[N]=p;for(var y in A.geometries)p=A.geometries[y],p.type in this.geometryHandlers&&(F+=1,m.onLoadStart());for(var J in A.objects)l(A.objects[J],function(a){a.type&&a.type in m.hierarchyHandlers&&(F+=1,m.onLoadStart())});E=F;for(y in A.geometries)if(p=A.geometries[y],"cube"===p.type)t=new THREE.CubeGeometry(p.width,p.height,p.depth,p.widthSegments,p.heightSegments,p.depthSegments),t.name=y,B.geometries[y]=t;else if("plane"===p.type)t=new THREE.PlaneGeometry(p.width,
+p.height,p.widthSegments,p.heightSegments),t.name=y,B.geometries[y]=t;else if("sphere"===p.type)t=new THREE.SphereGeometry(p.radius,p.widthSegments,p.heightSegments),t.name=y,B.geometries[y]=t;else if("cylinder"===p.type)t=new THREE.CylinderGeometry(p.topRad,p.botRad,p.height,p.radSegs,p.heightSegs),t.name=y,B.geometries[y]=t;else if("torus"===p.type)t=new THREE.TorusGeometry(p.radius,p.tube,p.segmentsR,p.segmentsT),t.name=y,B.geometries[y]=t;else if("icosahedron"===p.type)t=new THREE.IcosahedronGeometry(p.radius,
+p.subdivisions),t.name=y,B.geometries[y]=t;else if(p.type in this.geometryHandlers){J={};for(r in p)"type"!==r&&"url"!==r&&(J[r]=p[r]);this.geometryHandlers[p.type].loaderObject.load(d(p.url,A.urlBaseType),h(y),J)}else"embedded"===p.type&&(J=A.embeds[p.id],J.metadata=A.metadata,J&&(J=this.geometryHandlers.ascii.loaderObject.parse(J,""),i(y)(J.geometry,J.materials)));for(var v in A.textures)if(y=A.textures[v],y.url instanceof Array){G+=y.url.length;for(r=0;r<y.url.length;r++)m.onLoadStart()}else G+=
+1,m.onLoadStart();I=G;for(v in A.textures){y=A.textures[v];void 0!==y.mapping&&void 0!==THREE[y.mapping]&&(y.mapping=new THREE[y.mapping]);if(y.url instanceof Array){J=y.url.length;p=[];for(r=0;r<J;r++)p[r]=d(y.url[r],A.urlBaseType);r=(r=/\.dds$/i.test(p[0]))?THREE.ImageUtils.loadCompressedTextureCube(p,y.mapping,K(J)):THREE.ImageUtils.loadTextureCube(p,y.mapping,K(J))}else r=/\.dds$/i.test(y.url),J=d(y.url,A.urlBaseType),p=K(1),r=r?THREE.ImageUtils.loadCompressedTexture(J,y.mapping,p):THREE.ImageUtils.loadTexture(J,
+y.mapping,p),void 0!==THREE[y.minFilter]&&(r.minFilter=THREE[y.minFilter]),void 0!==THREE[y.magFilter]&&(r.magFilter=THREE[y.magFilter]),y.anisotropy&&(r.anisotropy=y.anisotropy),y.repeat&&(r.repeat.set(y.repeat[0],y.repeat[1]),1!==y.repeat[0]&&(r.wrapS=THREE.RepeatWrapping),1!==y.repeat[1]&&(r.wrapT=THREE.RepeatWrapping)),y.offset&&r.offset.set(y.offset[0],y.offset[1]),y.wrap&&(J={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==J[y.wrap[0]]&&(r.wrapS=J[y.wrap[0]]),void 0!==
+J[y.wrap[1]]&&(r.wrapT=J[y.wrap[1]]));B.textures[v]=r}var aa,L;for(aa in A.materials){v=A.materials[aa];for(L in v.parameters)"envMap"===L||"map"===L||"lightMap"===L||"bumpMap"===L?v.parameters[L]=B.textures[v.parameters[L]]:"shading"===L?v.parameters[L]="flat"===v.parameters[L]?THREE.FlatShading:THREE.SmoothShading:"side"===L?v.parameters[L]="double"==v.parameters[L]?THREE.DoubleSide:"back"==v.parameters[L]?THREE.BackSide:THREE.FrontSide:"blending"===L?v.parameters[L]=v.parameters[L]in THREE?THREE[v.parameters[L]]:
+THREE.NormalBlending:"combine"===L?v.parameters[L]=v.parameters[L]in THREE?THREE[v.parameters[L]]:THREE.MultiplyOperation:"vertexColors"===L?"face"==v.parameters[L]?v.parameters[L]=THREE.FaceColors:v.parameters[L]&&(v.parameters[L]=THREE.VertexColors):"wrapRGB"===L&&(K=v.parameters[L],v.parameters[L]=new THREE.Vector3(K[0],K[1],K[2]));void 0!==v.parameters.opacity&&1>v.parameters.opacity&&(v.parameters.transparent=!0);v.parameters.normalMap?(K=THREE.ShaderLib.normalmap,y=THREE.UniformsUtils.clone(K.uniforms),
+r=v.parameters.color,J=v.parameters.specular,p=v.parameters.ambient,N=v.parameters.shininess,y.tNormal.value=B.textures[v.parameters.normalMap],v.parameters.normalScale&&y.uNormalScale.value.set(v.parameters.normalScale[0],v.parameters.normalScale[1]),v.parameters.map&&(y.tDiffuse.value=v.parameters.map,y.enableDiffuse.value=!0),v.parameters.envMap&&(y.tCube.value=v.parameters.envMap,y.enableReflection.value=!0,y.uReflectivity.value=v.parameters.reflectivity),v.parameters.lightMap&&(y.tAO.value=v.parameters.lightMap,
+y.enableAO.value=!0),v.parameters.specularMap&&(y.tSpecular.value=B.textures[v.parameters.specularMap],y.enableSpecular.value=!0),v.parameters.displacementMap&&(y.tDisplacement.value=B.textures[v.parameters.displacementMap],y.enableDisplacement.value=!0,y.uDisplacementBias.value=v.parameters.displacementBias,y.uDisplacementScale.value=v.parameters.displacementScale),y.uDiffuseColor.value.setHex(r),y.uSpecularColor.value.setHex(J),y.uAmbientColor.value.setHex(p),y.uShininess.value=N,v.parameters.opacity&&
+(y.uOpacity.value=v.parameters.opacity),s=new THREE.ShaderMaterial({fragmentShader:K.fragmentShader,vertexShader:K.vertexShader,uniforms:y,lights:!0,fog:!0})):s=new THREE[v.type](v.parameters);s.name=aa;B.materials[aa]=s}for(aa in A.materials)if(v=A.materials[aa],v.parameters.materials){L=[];for(r=0;r<v.parameters.materials.length;r++)L.push(B.materials[v.parameters.materials[r]]);B.materials[aa].materials=L}e();B.cameras&&A.defaults.camera&&(B.currentCamera=B.cameras[A.defaults.camera]);B.fogs&&
+A.defaults.fog&&(B.scene.fog=B.fogs[A.defaults.fog]);m.callbackSync(B);k()}};THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b){var c=new THREE.ImageLoader(this.manager);c.setCrossOrigin(this.crossOrigin);c.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)})},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=!0};
 THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;
 THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;
 a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);
 a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor=this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);
 THREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);
 THREE.MaterialIdCount=0;THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);
@@ -295,37 +294,37 @@ THREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector
 THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__objects=[];this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__objects=[];this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&-1===this.__objects.indexOf(a)){this.__objects.push(a);this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};
 THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&-1===this.__objects.indexOf(a)){this.__objects.push(a);this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};
 THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);-1!==b&&this.__lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.__objects.indexOf(a),-1!==b&&(this.__objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1)));for(b=0;b<a.children.length;b++)this.__removeObject(a.children[b])};
 THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);-1!==b&&this.__lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.__objects.indexOf(a),-1!==b&&(this.__objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1)));for(b=0;b<a.children.length;b++)this.__removeObject(a.children[b])};
-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){for(var d=0,e=I.length;d<e;d++){var f=I[d];Lb.copy(f.color);if(f instanceof THREE.DirectionalLight){var h=Ua.getPositionFromMatrix(f.matrixWorld).normalize(),g=b.dot(h);0>=g||(g*=f.intensity,c.add(Lb.multiplyScalar(g)))}else f instanceof THREE.PointLight&&(h=Ua.getPositionFromMatrix(f.matrixWorld),g=b.dot(Ua.subVectors(h,a).normalize()),0>=g||(g*=0==f.distance?1:1-Math.min(a.distanceTo(h)/f.distance,1),0!=g&&(g*=f.intensity,c.add(Lb.multiplyScalar(g)))))}}
-function c(a,c,e,l,q,r,W,p){G.info.render.vertices+=3;G.info.render.faces++;m(p.opacity);n(p.blending);Fa=a.positionScreen.x;Oa=a.positionScreen.y;X=c.positionScreen.x;fa=c.positionScreen.y;U=e.positionScreen.x;V=e.positionScreen.y;d(Fa,Oa,X,fa,U,V);(p instanceof THREE.MeshLambertMaterial||p instanceof THREE.MeshPhongMaterial)&&null===p.map?(Qa.copy(p.color),hb.copy(p.emissive),p.vertexColors===THREE.FaceColors&&Qa.multiply(W.color),!1===p.wireframe&&p.shading==THREE.SmoothShading&&3==W.vertexNormalsLength?
+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){for(var d=0,e=E.length;d<e;d++){var f=E[d];Lb.copy(f.color);if(f instanceof THREE.DirectionalLight){var h=Ua.getPositionFromMatrix(f.matrixWorld).normalize(),g=b.dot(h);0>=g||(g*=f.intensity,c.add(Lb.multiplyScalar(g)))}else f instanceof THREE.PointLight&&(h=Ua.getPositionFromMatrix(f.matrixWorld),g=b.dot(Ua.subVectors(h,a).normalize()),0>=g||(g*=0==f.distance?1:1-Math.min(a.distanceTo(h)/f.distance,1),0!=g&&(g*=f.intensity,c.add(Lb.multiplyScalar(g)))))}}
+function c(a,c,e,l,q,t,W,p){C.info.render.vertices+=3;C.info.render.faces++;m(p.opacity);n(p.blending);Fa=a.positionScreen.x;Oa=a.positionScreen.y;X=c.positionScreen.x;fa=c.positionScreen.y;U=e.positionScreen.x;V=e.positionScreen.y;d(Fa,Oa,X,fa,U,V);(p instanceof THREE.MeshLambertMaterial||p instanceof THREE.MeshPhongMaterial)&&null===p.map?(Qa.copy(p.color),hb.copy(p.emissive),p.vertexColors===THREE.FaceColors&&Qa.multiply(W.color),!1===p.wireframe&&p.shading==THREE.SmoothShading&&3==W.vertexNormalsLength?
 (Ba.copy(kb),ea.copy(kb),na.copy(kb),b(W.v1.positionWorld,W.vertexNormalsModel[0],Ba),b(W.v2.positionWorld,W.vertexNormalsModel[1],ea),b(W.v3.positionWorld,W.vertexNormalsModel[2],na),Ba.multiply(Qa).add(hb),ea.multiply(Qa).add(hb),na.multiply(Qa).add(hb),Ia.addColors(ea,na).multiplyScalar(0.5),ra=k(Ba,ea,na,Ia),i(Fa,Oa,X,fa,U,V,0,0,1,0,0,1,ra)):(ka.copy(kb),b(W.centroidModel,W.normalModel,ka),ka.multiply(Qa).add(hb),!0===p.wireframe?f(ka,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):
 (Ba.copy(kb),ea.copy(kb),na.copy(kb),b(W.v1.positionWorld,W.vertexNormalsModel[0],Ba),b(W.v2.positionWorld,W.vertexNormalsModel[1],ea),b(W.v3.positionWorld,W.vertexNormalsModel[2],na),Ba.multiply(Qa).add(hb),ea.multiply(Qa).add(hb),na.multiply(Qa).add(hb),Ia.addColors(ea,na).multiplyScalar(0.5),ra=k(Ba,ea,na,Ia),i(Fa,Oa,X,fa,U,V,0,0,1,0,0,1,ra)):(ka.copy(kb),b(W.centroidModel,W.normalModel,ka),ka.multiply(Qa).add(hb),!0===p.wireframe?f(ka,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):
-h(ka))):p instanceof THREE.MeshBasicMaterial||p instanceof THREE.MeshLambertMaterial||p instanceof THREE.MeshPhongMaterial?null!==p.map?p.map.mapping instanceof THREE.UVMapping&&(ta=W.uvs[0],g(Fa,Oa,X,fa,U,V,ta[l].x,ta[l].y,ta[q].x,ta[q].y,ta[r].x,ta[r].y,p.map)):null!==p.envMap?p.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(Ua.copy(W.vertexNormalsModelView[l]),wb=0.5*Ua.x+0.5,Mb=0.5*Ua.y+0.5,Ua.copy(W.vertexNormalsModelView[q]),j=0.5*Ua.x+0.5,Tb=0.5*Ua.y+0.5,Ua.copy(W.vertexNormalsModelView[r]),
+h(ka))):p instanceof THREE.MeshBasicMaterial||p instanceof THREE.MeshLambertMaterial||p instanceof THREE.MeshPhongMaterial?null!==p.map?p.map.mapping instanceof THREE.UVMapping&&(ta=W.uvs[0],g(Fa,Oa,X,fa,U,V,ta[l].x,ta[l].y,ta[q].x,ta[q].y,ta[t].x,ta[t].y,p.map)):null!==p.envMap?p.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(Ua.copy(W.vertexNormalsModelView[l]),wb=0.5*Ua.x+0.5,Mb=0.5*Ua.y+0.5,Ua.copy(W.vertexNormalsModelView[q]),j=0.5*Ua.x+0.5,Tb=0.5*Ua.y+0.5,Ua.copy(W.vertexNormalsModelView[t]),
 Nb=0.5*Ua.x+0.5,xb=0.5*Ua.y+0.5,g(Fa,Oa,X,fa,U,V,wb,Mb,j,Tb,Nb,xb,p.envMap)):(ka.copy(p.color),p.vertexColors===THREE.FaceColors&&ka.multiply(W.color),!0===p.wireframe?f(ka,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):h(ka)):p instanceof THREE.MeshDepthMaterial?(vb=sa.near,yb=sa.far,Ba.r=Ba.g=Ba.b=1-z(a.positionScreen.z*a.positionScreen.w,vb,yb),ea.r=ea.g=ea.b=1-z(c.positionScreen.z*c.positionScreen.w,vb,yb),na.r=na.g=na.b=1-z(e.positionScreen.z*e.positionScreen.w,vb,yb),Ia.addColors(ea,
 Nb=0.5*Ua.x+0.5,xb=0.5*Ua.y+0.5,g(Fa,Oa,X,fa,U,V,wb,Mb,j,Tb,Nb,xb,p.envMap)):(ka.copy(p.color),p.vertexColors===THREE.FaceColors&&ka.multiply(W.color),!0===p.wireframe?f(ka,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):h(ka)):p instanceof THREE.MeshDepthMaterial?(vb=sa.near,yb=sa.far,Ba.r=Ba.g=Ba.b=1-z(a.positionScreen.z*a.positionScreen.w,vb,yb),ea.r=ea.g=ea.b=1-z(c.positionScreen.z*c.positionScreen.w,vb,yb),na.r=na.g=na.b=1-z(e.positionScreen.z*e.positionScreen.w,vb,yb),Ia.addColors(ea,
 na).multiplyScalar(0.5),ra=k(Ba,ea,na,Ia),i(Fa,Oa,X,fa,U,V,0,0,1,0,0,1,ra)):p instanceof THREE.MeshNormalMaterial&&(p.shading==THREE.FlatShading?(a=W.normalModelView,ka.setRGB(a.x,a.y,a.z).multiplyScalar(0.5).addScalar(0.5),!0===p.wireframe?f(ka,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):h(ka)):p.shading==THREE.SmoothShading&&(a=W.vertexNormalsModelView[l],Ba.setRGB(a.x,a.y,a.z).multiplyScalar(0.5).addScalar(0.5),a=W.vertexNormalsModelView[q],ea.setRGB(a.x,a.y,a.z).multiplyScalar(0.5).addScalar(0.5),
 na).multiplyScalar(0.5),ra=k(Ba,ea,na,Ia),i(Fa,Oa,X,fa,U,V,0,0,1,0,0,1,ra)):p instanceof THREE.MeshNormalMaterial&&(p.shading==THREE.FlatShading?(a=W.normalModelView,ka.setRGB(a.x,a.y,a.z).multiplyScalar(0.5).addScalar(0.5),!0===p.wireframe?f(ka,p.wireframeLinewidth,p.wireframeLinecap,p.wireframeLinejoin):h(ka)):p.shading==THREE.SmoothShading&&(a=W.vertexNormalsModelView[l],Ba.setRGB(a.x,a.y,a.z).multiplyScalar(0.5).addScalar(0.5),a=W.vertexNormalsModelView[q],ea.setRGB(a.x,a.y,a.z).multiplyScalar(0.5).addScalar(0.5),
-a=W.vertexNormalsModelView[r],na.setRGB(a.x,a.y,a.z).multiplyScalar(0.5).addScalar(0.5),Ia.addColors(ea,na).multiplyScalar(0.5),ra=k(Ba,ea,na,Ia),i(Fa,Oa,X,fa,U,V,0,0,1,0,0,1,ra)))}function d(a,b,c,d,e,f){y.beginPath();y.moveTo(a,b);y.lineTo(c,d);y.lineTo(e,f);y.closePath()}function e(a,b,c,d,e,f,h,g){y.beginPath();y.moveTo(a,b);y.lineTo(c,d);y.lineTo(e,f);y.lineTo(h,g);y.closePath()}function f(a,b,c,d){q(b);t(c);p(d);r(a.getStyle());y.stroke();ua.expandByScalar(2*b)}function h(a){s(a.getStyle());
-y.fill()}function g(a,b,c,d,e,f,g,j,i,k,m,l,n){if(!(n instanceof THREE.DataTexture||void 0===n.image||0==n.image.width)){if(!0===n.needsUpdate){var p=n.wrapS==THREE.RepeatWrapping,q=n.wrapT==THREE.RepeatWrapping;Ab[n.id]=y.createPattern(n.image,!0===p&&!0===q?"repeat":!0===p&&!1===q?"repeat-x":!1===p&&!0===q?"repeat-y":"no-repeat");n.needsUpdate=!1}void 0===Ab[n.id]?s("rgba(0,0,0,1)"):s(Ab[n.id]);var p=n.offset.x/n.repeat.x,q=n.offset.y/n.repeat.y,r=n.image.width*n.repeat.x,t=n.image.height*n.repeat.y,
-g=(g+p)*r,j=(1-j+q)*t,c=c-a,d=d-b,e=e-a,f=f-b,i=(i+p)*r-g,k=(1-k+q)*t-j,m=(m+p)*r-g,l=(1-l+q)*t-j,p=i*l-m*k;0===p?(void 0===Ub[n.id]&&(b=document.createElement("canvas"),b.width=n.image.width,b.height=n.image.height,b=b.getContext("2d"),b.drawImage(n.image,0,0),Ub[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=Ub[n.id],g=4*(Math.floor(g)+Math.floor(j)*n.image.width),ka.setRGB(b[g]/255,b[g+1]/255,b[g+2]/255),h(ka)):(p=1/p,n=(l*c-k*e)*p,k=(l*d-k*f)*p,c=(i*e-m*c)*p,d=(i*f-m*d)*p,a=a-
+a=W.vertexNormalsModelView[t],na.setRGB(a.x,a.y,a.z).multiplyScalar(0.5).addScalar(0.5),Ia.addColors(ea,na).multiplyScalar(0.5),ra=k(Ba,ea,na,Ia),i(Fa,Oa,X,fa,U,V,0,0,1,0,0,1,ra)))}function d(a,b,c,d,e,f){y.beginPath();y.moveTo(a,b);y.lineTo(c,d);y.lineTo(e,f);y.closePath()}function e(a,b,c,d,e,f,h,g){y.beginPath();y.moveTo(a,b);y.lineTo(c,d);y.lineTo(e,f);y.lineTo(h,g);y.closePath()}function f(a,b,c,d){t(b);s(c);q(d);p(a.getStyle());y.stroke();ua.expandByScalar(2*b)}function h(a){r(a.getStyle());
+y.fill()}function g(a,b,c,d,e,f,g,j,i,k,m,l,n){if(!(n instanceof THREE.DataTexture||void 0===n.image||0==n.image.width)){if(!0===n.needsUpdate){var p=n.wrapS==THREE.RepeatWrapping,q=n.wrapT==THREE.RepeatWrapping;Ab[n.id]=y.createPattern(n.image,!0===p&&!0===q?"repeat":!0===p&&!1===q?"repeat-x":!1===p&&!0===q?"repeat-y":"no-repeat");n.needsUpdate=!1}void 0===Ab[n.id]?r("rgba(0,0,0,1)"):r(Ab[n.id]);var p=n.offset.x/n.repeat.x,q=n.offset.y/n.repeat.y,t=n.image.width*n.repeat.x,s=n.image.height*n.repeat.y,
+g=(g+p)*t,j=(1-j+q)*s,c=c-a,d=d-b,e=e-a,f=f-b,i=(i+p)*t-g,k=(1-k+q)*s-j,m=(m+p)*t-g,l=(1-l+q)*s-j,p=i*l-m*k;0===p?(void 0===Ub[n.id]&&(b=document.createElement("canvas"),b.width=n.image.width,b.height=n.image.height,b=b.getContext("2d"),b.drawImage(n.image,0,0),Ub[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=Ub[n.id],g=4*(Math.floor(g)+Math.floor(j)*n.image.width),ka.setRGB(b[g]/255,b[g+1]/255,b[g+2]/255),h(ka)):(p=1/p,n=(l*c-k*e)*p,k=(l*d-k*f)*p,c=(i*e-m*c)*p,d=(i*f-m*d)*p,a=a-
 n*g-c*j,g=b-k*g-d*j,y.save(),y.transform(n,k,c,d,a,g),y.fill(),y.restore())}}function i(a,b,c,d,e,f,h,g,j,i,k,m,l){var n,p;n=l.width-1;p=l.height-1;h*=n;g*=p;c-=a;d-=b;e-=a;f-=b;j=j*n-h;i=i*p-g;k=k*n-h;m=m*p-g;p=1/(j*m-k*i);n=(m*c-i*e)*p;i=(m*d-i*f)*p;c=(j*e-k*c)*p;d=(j*f-k*d)*p;a=a-n*h-c*g;b=b-i*h-d*g;y.save();y.transform(n,i,c,d,a,b);y.clip();y.drawImage(l,0,0);y.restore()}function k(a,b,c,d){Ja[0]=255*a.r|0;Ja[1]=255*a.g|0;Ja[2]=255*a.b|0;Ja[4]=255*b.r|0;Ja[5]=255*b.g|0;Ja[6]=255*b.b|0;Ja[8]=255*
 n*g-c*j,g=b-k*g-d*j,y.save(),y.transform(n,k,c,d,a,g),y.fill(),y.restore())}}function i(a,b,c,d,e,f,h,g,j,i,k,m,l){var n,p;n=l.width-1;p=l.height-1;h*=n;g*=p;c-=a;d-=b;e-=a;f-=b;j=j*n-h;i=i*p-g;k=k*n-h;m=m*p-g;p=1/(j*m-k*i);n=(m*c-i*e)*p;i=(m*d-i*f)*p;c=(j*e-k*c)*p;d=(j*f-k*d)*p;a=a-n*h-c*g;b=b-i*h-d*g;y.save();y.transform(n,i,c,d,a,b);y.clip();y.drawImage(l,0,0);y.restore()}function k(a,b,c,d){Ja[0]=255*a.r|0;Ja[1]=255*a.g|0;Ja[2]=255*a.b|0;Ja[4]=255*b.r|0;Ja[5]=255*b.g|0;Ja[6]=255*b.b|0;Ja[8]=255*
 c.r|0;Ja[9]=255*c.g|0;Ja[10]=255*c.b|0;Ja[12]=255*d.r|0;Ja[13]=255*d.g|0;Ja[14]=255*d.b|0;Vb.putImageData(Hb,0,0);Ib.drawImage(Jb,0,0);return Wb}function l(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 m(a){aa!==a&&(aa=y.globalAlpha=a)}function n(a){L!==a&&(a===THREE.NormalBlending?y.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?y.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(y.globalCompositeOperation=
 c.r|0;Ja[9]=255*c.g|0;Ja[10]=255*c.b|0;Ja[12]=255*d.r|0;Ja[13]=255*d.g|0;Ja[14]=255*d.b|0;Vb.putImageData(Hb,0,0);Ib.drawImage(Jb,0,0);return Wb}function l(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 m(a){aa!==a&&(aa=y.globalAlpha=a)}function n(a){L!==a&&(a===THREE.NormalBlending?y.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?y.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(y.globalCompositeOperation=
-"darker"),L=a)}function q(a){Sa!==a&&(Sa=y.lineWidth=a)}function t(a){Q!==a&&(Q=y.lineCap=a)}function p(a){ia!==a&&(ia=y.lineJoin=a)}function r(a){qa!==a&&(qa=y.strokeStyle=a)}function s(a){Pa!==a&&(Pa=y.fillStyle=a)}function u(a,b){if(Wa!==a||M!==b)y.setLineDash([a,b]),Wa=a,M=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var z=THREE.Math.smoothstep,a=a||{},G=this,B,F,I,E=new THREE.Projector,A=void 0!==a.canvas?a.canvas:document.createElement("canvas"),O,C,K,N,y=A.getContext("2d"),J=new THREE.Color(0),
-w=0,aa=1,L=0,qa=null,Pa=null,Sa=null,Q=null,ia=null,Wa=null,M=0,sa,H,ja,pa,Ea,Za=new THREE.RenderableVertex,ob=new THREE.RenderableVertex,Fa,Oa,X,fa,U,V,oa,ha,da,xa,Ta,la,ka=new THREE.Color,Ba=new THREE.Color,ea=new THREE.Color,na=new THREE.Color,Ia=new THREE.Color,Qa=new THREE.Color,hb=new THREE.Color,Lb=new THREE.Color,Ab={},Ub={},vb,yb,ra,ta,wb,Mb,j,Tb,Nb,xb,eb=new THREE.Box2,Ya=new THREE.Box2,ua=new THREE.Box2,kb=new THREE.Color,Xb=new THREE.Color,Kb=new THREE.Color,Ua=new THREE.Vector3,Jb,Vb,
-Hb,Ja,Wb,Ib,Eb=16;Jb=document.createElement("canvas");Jb.width=Jb.height=2;Vb=Jb.getContext("2d");Vb.fillStyle="rgba(0,0,0,1)";Vb.fillRect(0,0,2,2);Hb=Vb.getImageData(0,0,2,2);Ja=Hb.data;Wb=document.createElement("canvas");Wb.width=Wb.height=Eb;Ib=Wb.getContext("2d");Ib.translate(-Eb/2,-Eb/2);Ib.scale(Eb,Eb);Eb--;void 0===y.setLineDash&&(y.setLineDash=void 0!==y.mozDash?function(a){y.mozDash=null!==a[0]?a:null}:function(){});this.domElement=A;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:
-void 0!==window.devicePixelRatio?window.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){O=a*this.devicePixelRatio;C=b*this.devicePixelRatio;K=Math.floor(O/2);N=Math.floor(C/2);A.width=O;A.height=C;1!==this.devicePixelRatio&&!1!==c&&(A.style.width=a+"px",A.style.height=b+"px");eb.set(new THREE.Vector2(-K,-N),new THREE.Vector2(K,N));Ya.set(new THREE.Vector2(-K,
--N),new THREE.Vector2(K,N));aa=1;L=0;ia=Q=Sa=Pa=qa=null};this.setClearColor=function(a,b){J.set(a);w=void 0!==b?b:1;Ya.set(new THREE.Vector2(-K,-N),new THREE.Vector2(K,N))};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){y.setTransform(1,0,0,-1,K,N);!1===Ya.empty()&&(Ya.intersect(eb),Ya.expandByScalar(2),1>w&&y.clearRect(Ya.min.x|
-0,Ya.min.y|0,Ya.max.x-Ya.min.x|0,Ya.max.y-Ya.min.y|0),0<w&&(n(THREE.NormalBlending),m(1),s("rgba("+Math.floor(255*J.r)+","+Math.floor(255*J.g)+","+Math.floor(255*J.b)+","+w+")"),y.fillRect(Ya.min.x|0,Ya.min.y|0,Ya.max.x-Ya.min.x|0,Ya.max.y-Ya.min.y|0)),Ya.makeEmpty())};this.render=function(a,g){if(!1===g instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");else{!0===this.autoClear&&this.clear();y.setTransform(1,0,0,-1,K,N);G.info.render.vertices=
-0;G.info.render.faces=0;B=E.projectScene(a,g,this.sortObjects,this.sortElements);F=B.elements;I=B.lights;sa=g;kb.setRGB(0,0,0);Xb.setRGB(0,0,0);Kb.setRGB(0,0,0);for(var j=0,A=I.length;j<A;j++){var w=I[j],C=w.color;w instanceof THREE.AmbientLight?kb.add(C):w instanceof THREE.DirectionalLight?Xb.add(C):w instanceof THREE.PointLight&&Kb.add(C)}j=0;for(A=F.length;j<A;j++){var W=F[j],w=W.material;if(!(void 0===w||!1===w.visible)){ua.makeEmpty();if(W instanceof THREE.RenderableParticle){H=W;H.x*=K;H.y*=
-N;C=H;m(w.opacity);n(w.blending);var lb=void 0,mb=void 0,tb=void 0,zb=void 0,$b=void 0,Jc=void 0,Kc=void 0;w instanceof THREE.ParticleBasicMaterial?null===w.map?(tb=W.object.scale.x,zb=W.object.scale.y,tb*=W.scale.x*K,zb*=W.scale.y*N,ua.min.set(C.x-tb,C.y-zb),ua.max.set(C.x+tb,C.y+zb),!1===eb.isIntersectionBox(ua)?ua.makeEmpty():(s(w.color.getStyle()),y.save(),y.translate(C.x,C.y),y.rotate(-W.rotation),y.scale(tb,zb),y.fillRect(-1,-1,2,2),y.restore())):($b=w.map.image,Jc=$b.width>>1,Kc=$b.height>>
-1,tb=W.scale.x*K,zb=W.scale.y*N,lb=tb*Jc,mb=zb*Kc,ua.min.set(C.x-lb,C.y-mb),ua.max.set(C.x+lb,C.y+mb),!1===eb.isIntersectionBox(ua)?ua.makeEmpty():(y.save(),y.translate(C.x,C.y),y.rotate(-W.rotation),y.scale(tb,-zb),y.translate(-Jc,-Kc),y.drawImage($b,0,0),y.restore())):w instanceof THREE.ParticleCanvasMaterial&&(lb=W.scale.x*K,mb=W.scale.y*N,ua.min.set(C.x-lb,C.y-mb),ua.max.set(C.x+lb,C.y+mb),!1===eb.isIntersectionBox(ua)?ua.makeEmpty():(r(w.color.getStyle()),s(w.color.getStyle()),y.save(),y.translate(C.x,
-C.y),y.rotate(-W.rotation),y.scale(lb,mb),w.program(y),y.restore()))}else if(W instanceof THREE.RenderableLine){if(H=W.v1,ja=W.v2,H.positionScreen.x*=K,H.positionScreen.y*=N,ja.positionScreen.x*=K,ja.positionScreen.y*=N,ua.setFromPoints([H.positionScreen,ja.positionScreen]),!0===eb.isIntersectionBox(ua))if(C=H,lb=ja,m(w.opacity),n(w.blending),y.beginPath(),y.moveTo(C.positionScreen.x,C.positionScreen.y),y.lineTo(lb.positionScreen.x,lb.positionScreen.y),w instanceof THREE.LineBasicMaterial){q(w.linewidth);
-t(w.linecap);p(w.linejoin);if(w.vertexColors!==THREE.VertexColors)r(w.color.getStyle());else if(mb=W.vertexColors[0].getStyle(),W=W.vertexColors[1].getStyle(),mb===W)r(mb);else{try{var vc=y.createLinearGradient(C.positionScreen.x,C.positionScreen.y,lb.positionScreen.x,lb.positionScreen.y);vc.addColorStop(0,mb);vc.addColorStop(1,W)}catch(fd){vc=mb}r(vc)}y.stroke();ua.expandByScalar(2*w.linewidth)}else w instanceof THREE.LineDashedMaterial&&(q(w.linewidth),t(w.linecap),p(w.linejoin),r(w.color.getStyle()),
-u(w.dashSize,w.gapSize),y.stroke(),ua.expandByScalar(2*w.linewidth),u(null,null))}else if(W instanceof THREE.RenderableFace3){H=W.v1;ja=W.v2;pa=W.v3;if(-1>H.positionScreen.z||1<H.positionScreen.z)continue;if(-1>ja.positionScreen.z||1<ja.positionScreen.z)continue;if(-1>pa.positionScreen.z||1<pa.positionScreen.z)continue;H.positionScreen.x*=K;H.positionScreen.y*=N;ja.positionScreen.x*=K;ja.positionScreen.y*=N;pa.positionScreen.x*=K;pa.positionScreen.y*=N;0<w.overdraw&&(l(H.positionScreen,ja.positionScreen,
-w.overdraw),l(ja.positionScreen,pa.positionScreen,w.overdraw),l(pa.positionScreen,H.positionScreen,w.overdraw));ua.setFromPoints([H.positionScreen,ja.positionScreen,pa.positionScreen]);!0===eb.isIntersectionBox(ua)&&c(H,ja,pa,0,1,2,W,w)}else if(W instanceof THREE.RenderableFace4){H=W.v1;ja=W.v2;pa=W.v3;Ea=W.v4;if(-1>H.positionScreen.z||1<H.positionScreen.z)continue;if(-1>ja.positionScreen.z||1<ja.positionScreen.z)continue;if(-1>pa.positionScreen.z||1<pa.positionScreen.z)continue;if(-1>Ea.positionScreen.z||
-1<Ea.positionScreen.z)continue;H.positionScreen.x*=K;H.positionScreen.y*=N;ja.positionScreen.x*=K;ja.positionScreen.y*=N;pa.positionScreen.x*=K;pa.positionScreen.y*=N;Ea.positionScreen.x*=K;Ea.positionScreen.y*=N;Za.positionScreen.copy(ja.positionScreen);ob.positionScreen.copy(Ea.positionScreen);0<w.overdraw&&(l(H.positionScreen,ja.positionScreen,w.overdraw),l(ja.positionScreen,Ea.positionScreen,w.overdraw),l(Ea.positionScreen,H.positionScreen,w.overdraw),l(pa.positionScreen,Za.positionScreen,w.overdraw),
-l(pa.positionScreen,ob.positionScreen,w.overdraw));ua.setFromPoints([H.positionScreen,ja.positionScreen,pa.positionScreen,Ea.positionScreen]);!0===eb.isIntersectionBox(ua)&&(C=H,lb=ja,mb=pa,tb=Ea,zb=Za,$b=ob,G.info.render.vertices+=4,G.info.render.faces++,m(w.opacity),n(w.blending),void 0!==w.map&&null!==w.map||void 0!==w.envMap&&null!==w.envMap?(c(C,lb,tb,0,1,3,W,w),c(zb,mb,$b,1,2,3,W,w)):(Fa=C.positionScreen.x,Oa=C.positionScreen.y,X=lb.positionScreen.x,fa=lb.positionScreen.y,U=mb.positionScreen.x,
-V=mb.positionScreen.y,oa=tb.positionScreen.x,ha=tb.positionScreen.y,da=zb.positionScreen.x,xa=zb.positionScreen.y,Ta=$b.positionScreen.x,la=$b.positionScreen.y,w instanceof THREE.MeshLambertMaterial||w instanceof THREE.MeshPhongMaterial?(Qa.copy(w.color),hb.copy(w.emissive),w.vertexColors===THREE.FaceColors&&Qa.multiply(W.color),!1===w.wireframe&&w.shading==THREE.SmoothShading&&4==W.vertexNormalsLength?(Ba.copy(kb),ea.copy(kb),na.copy(kb),Ia.copy(kb),b(W.v1.positionWorld,W.vertexNormalsModel[0],Ba),
-b(W.v2.positionWorld,W.vertexNormalsModel[1],ea),b(W.v4.positionWorld,W.vertexNormalsModel[3],na),b(W.v3.positionWorld,W.vertexNormalsModel[2],Ia),Ba.multiply(Qa).add(hb),ea.multiply(Qa).add(hb),na.multiply(Qa).add(hb),Ia.multiply(Qa).add(hb),ra=k(Ba,ea,na,Ia),d(Fa,Oa,X,fa,oa,ha),i(Fa,Oa,X,fa,oa,ha,0,0,1,0,0,1,ra),d(da,xa,U,V,Ta,la),i(da,xa,U,V,Ta,la,1,0,1,1,0,1,ra)):(ka.copy(kb),b(W.centroidModel,W.normalModel,ka),ka.multiply(Qa).add(hb),e(Fa,Oa,X,fa,U,V,oa,ha),!0===w.wireframe?f(ka,w.wireframeLinewidth,
-w.wireframeLinecap,w.wireframeLinejoin):h(ka))):w instanceof THREE.MeshBasicMaterial?(ka.copy(w.color),w.vertexColors===THREE.FaceColors&&ka.multiply(W.color),e(Fa,Oa,X,fa,U,V,oa,ha),!0===w.wireframe?f(ka,w.wireframeLinewidth,w.wireframeLinecap,w.wireframeLinejoin):h(ka)):w instanceof THREE.MeshNormalMaterial?(C=void 0,w.shading==THREE.FlatShading?(C=W.normalModelView,ka.setRGB(C.x,C.y,C.z).multiplyScalar(0.5).addScalar(0.5),e(Fa,Oa,X,fa,U,V,oa,ha),!0===w.wireframe?f(ka,w.wireframeLinewidth,w.wireframeLinecap,
-w.wireframeLinejoin):h(ka)):w.shading==THREE.SmoothShading&&(C=W.vertexNormalsModelView[0],Ba.setRGB(C.x,C.y,C.z).multiplyScalar(0.5).addScalar(0.5),C=W.vertexNormalsModelView[1],ea.setRGB(C.x,C.y,C.z).multiplyScalar(0.5).addScalar(0.5),C=W.vertexNormalsModelView[3],na.setRGB(C.x,C.y,C.z).multiplyScalar(0.5).addScalar(0.5),C=W.vertexNormalsModelView[2],Ia.setRGB(C.x,C.y,C.z).multiplyScalar(0.5).addScalar(0.5),ra=k(Ba,ea,na,Ia),d(Fa,Oa,X,fa,oa,ha),i(Fa,Oa,X,fa,oa,ha,0,0,1,0,0,1,ra),d(da,xa,U,V,Ta,
-la),i(da,xa,U,V,Ta,la,1,0,1,1,0,1,ra))):w instanceof THREE.MeshDepthMaterial&&(vb=sa.near,yb=sa.far,Ba.r=Ba.g=Ba.b=1-z(C.positionScreen.z*C.positionScreen.w,vb,yb),ea.r=ea.g=ea.b=1-z(lb.positionScreen.z*lb.positionScreen.w,vb,yb),na.r=na.g=na.b=1-z(tb.positionScreen.z*tb.positionScreen.w,vb,yb),Ia.r=Ia.g=Ia.b=1-z(mb.positionScreen.z*mb.positionScreen.w,vb,yb),ra=k(Ba,ea,na,Ia),d(Fa,Oa,X,fa,oa,ha),i(Fa,Oa,X,fa,oa,ha,0,0,1,0,0,1,ra),d(da,xa,U,V,Ta,la),i(da,xa,U,V,Ta,la,1,0,1,1,0,1,ra))))}Ya.union(ua)}}y.setTransform(1,
+"darker"),L=a)}function t(a){Sa!==a&&(Sa=y.lineWidth=a)}function s(a){Q!==a&&(Q=y.lineCap=a)}function q(a){ia!==a&&(ia=y.lineJoin=a)}function p(a){qa!==a&&(qa=y.strokeStyle=a)}function r(a){Pa!==a&&(Pa=y.fillStyle=a)}function w(a,b){if(Wa!==a||M!==b)y.setLineDash([a,b]),Wa=a,M=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var z=THREE.Math.smoothstep,a=a||{},C=this,F,G,E,I=new THREE.Projector,B=void 0!==a.canvas?a.canvas:document.createElement("canvas"),O,A,K,N,y=B.getContext("2d"),J=new THREE.Color(0),
+v=0,aa=1,L=0,qa=null,Pa=null,Sa=null,Q=null,ia=null,Wa=null,M=0,sa,H,ja,pa,Ea,Za=new THREE.RenderableVertex,ob=new THREE.RenderableVertex,Fa,Oa,X,fa,U,V,oa,ha,da,xa,Ta,la,ka=new THREE.Color,Ba=new THREE.Color,ea=new THREE.Color,na=new THREE.Color,Ia=new THREE.Color,Qa=new THREE.Color,hb=new THREE.Color,Lb=new THREE.Color,Ab={},Ub={},vb,yb,ra,ta,wb,Mb,j,Tb,Nb,xb,eb=new THREE.Box2,Ya=new THREE.Box2,ua=new THREE.Box2,kb=new THREE.Color,Xb=new THREE.Color,Kb=new THREE.Color,Ua=new THREE.Vector3,Jb,Vb,
+Hb,Ja,Wb,Ib,Eb=16;Jb=document.createElement("canvas");Jb.width=Jb.height=2;Vb=Jb.getContext("2d");Vb.fillStyle="rgba(0,0,0,1)";Vb.fillRect(0,0,2,2);Hb=Vb.getImageData(0,0,2,2);Ja=Hb.data;Wb=document.createElement("canvas");Wb.width=Wb.height=Eb;Ib=Wb.getContext("2d");Ib.translate(-Eb/2,-Eb/2);Ib.scale(Eb,Eb);Eb--;void 0===y.setLineDash&&(y.setLineDash=void 0!==y.mozDash?function(a){y.mozDash=null!==a[0]?a:null}:function(){});this.domElement=B;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:
+void 0!==window.devicePixelRatio?window.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){O=a*this.devicePixelRatio;A=b*this.devicePixelRatio;K=Math.floor(O/2);N=Math.floor(A/2);B.width=O;B.height=A;1!==this.devicePixelRatio&&!1!==c&&(B.style.width=a+"px",B.style.height=b+"px");eb.set(new THREE.Vector2(-K,-N),new THREE.Vector2(K,N));Ya.set(new THREE.Vector2(-K,
+-N),new THREE.Vector2(K,N));aa=1;L=0;ia=Q=Sa=Pa=qa=null};this.setClearColor=function(a,b){J.set(a);v=void 0!==b?b:1;Ya.set(new THREE.Vector2(-K,-N),new THREE.Vector2(K,N))};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){y.setTransform(1,0,0,-1,K,N);!1===Ya.empty()&&(Ya.intersect(eb),Ya.expandByScalar(2),1>v&&y.clearRect(Ya.min.x|
+0,Ya.min.y|0,Ya.max.x-Ya.min.x|0,Ya.max.y-Ya.min.y|0),0<v&&(n(THREE.NormalBlending),m(1),r("rgba("+Math.floor(255*J.r)+","+Math.floor(255*J.g)+","+Math.floor(255*J.b)+","+v+")"),y.fillRect(Ya.min.x|0,Ya.min.y|0,Ya.max.x-Ya.min.x|0,Ya.max.y-Ya.min.y|0)),Ya.makeEmpty())};this.render=function(a,g){if(!1===g instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");else{!0===this.autoClear&&this.clear();y.setTransform(1,0,0,-1,K,N);C.info.render.vertices=
+0;C.info.render.faces=0;F=I.projectScene(a,g,this.sortObjects,this.sortElements);G=F.elements;E=F.lights;sa=g;kb.setRGB(0,0,0);Xb.setRGB(0,0,0);Kb.setRGB(0,0,0);for(var j=0,B=E.length;j<B;j++){var v=E[j],A=v.color;v instanceof THREE.AmbientLight?kb.add(A):v instanceof THREE.DirectionalLight?Xb.add(A):v instanceof THREE.PointLight&&Kb.add(A)}j=0;for(B=G.length;j<B;j++){var W=G[j],v=W.material;if(!(void 0===v||!1===v.visible)){ua.makeEmpty();if(W instanceof THREE.RenderableParticle){H=W;H.x*=K;H.y*=
+N;A=H;m(v.opacity);n(v.blending);var lb=void 0,mb=void 0,tb=void 0,zb=void 0,$b=void 0,Jc=void 0,Kc=void 0;v instanceof THREE.ParticleBasicMaterial?null===v.map?(tb=W.object.scale.x,zb=W.object.scale.y,tb*=W.scale.x*K,zb*=W.scale.y*N,ua.min.set(A.x-tb,A.y-zb),ua.max.set(A.x+tb,A.y+zb),!1===eb.isIntersectionBox(ua)?ua.makeEmpty():(r(v.color.getStyle()),y.save(),y.translate(A.x,A.y),y.rotate(-W.rotation),y.scale(tb,zb),y.fillRect(-1,-1,2,2),y.restore())):($b=v.map.image,Jc=$b.width>>1,Kc=$b.height>>
+1,tb=W.scale.x*K,zb=W.scale.y*N,lb=tb*Jc,mb=zb*Kc,ua.min.set(A.x-lb,A.y-mb),ua.max.set(A.x+lb,A.y+mb),!1===eb.isIntersectionBox(ua)?ua.makeEmpty():(y.save(),y.translate(A.x,A.y),y.rotate(-W.rotation),y.scale(tb,-zb),y.translate(-Jc,-Kc),y.drawImage($b,0,0),y.restore())):v instanceof THREE.ParticleCanvasMaterial&&(lb=W.scale.x*K,mb=W.scale.y*N,ua.min.set(A.x-lb,A.y-mb),ua.max.set(A.x+lb,A.y+mb),!1===eb.isIntersectionBox(ua)?ua.makeEmpty():(p(v.color.getStyle()),r(v.color.getStyle()),y.save(),y.translate(A.x,
+A.y),y.rotate(-W.rotation),y.scale(lb,mb),v.program(y),y.restore()))}else if(W instanceof THREE.RenderableLine){if(H=W.v1,ja=W.v2,H.positionScreen.x*=K,H.positionScreen.y*=N,ja.positionScreen.x*=K,ja.positionScreen.y*=N,ua.setFromPoints([H.positionScreen,ja.positionScreen]),!0===eb.isIntersectionBox(ua))if(A=H,lb=ja,m(v.opacity),n(v.blending),y.beginPath(),y.moveTo(A.positionScreen.x,A.positionScreen.y),y.lineTo(lb.positionScreen.x,lb.positionScreen.y),v instanceof THREE.LineBasicMaterial){t(v.linewidth);
+s(v.linecap);q(v.linejoin);if(v.vertexColors!==THREE.VertexColors)p(v.color.getStyle());else if(mb=W.vertexColors[0].getStyle(),W=W.vertexColors[1].getStyle(),mb===W)p(mb);else{try{var vc=y.createLinearGradient(A.positionScreen.x,A.positionScreen.y,lb.positionScreen.x,lb.positionScreen.y);vc.addColorStop(0,mb);vc.addColorStop(1,W)}catch(fd){vc=mb}p(vc)}y.stroke();ua.expandByScalar(2*v.linewidth)}else v instanceof THREE.LineDashedMaterial&&(t(v.linewidth),s(v.linecap),q(v.linejoin),p(v.color.getStyle()),
+w(v.dashSize,v.gapSize),y.stroke(),ua.expandByScalar(2*v.linewidth),w(null,null))}else if(W instanceof THREE.RenderableFace3){H=W.v1;ja=W.v2;pa=W.v3;if(-1>H.positionScreen.z||1<H.positionScreen.z)continue;if(-1>ja.positionScreen.z||1<ja.positionScreen.z)continue;if(-1>pa.positionScreen.z||1<pa.positionScreen.z)continue;H.positionScreen.x*=K;H.positionScreen.y*=N;ja.positionScreen.x*=K;ja.positionScreen.y*=N;pa.positionScreen.x*=K;pa.positionScreen.y*=N;0<v.overdraw&&(l(H.positionScreen,ja.positionScreen,
+v.overdraw),l(ja.positionScreen,pa.positionScreen,v.overdraw),l(pa.positionScreen,H.positionScreen,v.overdraw));ua.setFromPoints([H.positionScreen,ja.positionScreen,pa.positionScreen]);!0===eb.isIntersectionBox(ua)&&c(H,ja,pa,0,1,2,W,v)}else if(W instanceof THREE.RenderableFace4){H=W.v1;ja=W.v2;pa=W.v3;Ea=W.v4;if(-1>H.positionScreen.z||1<H.positionScreen.z)continue;if(-1>ja.positionScreen.z||1<ja.positionScreen.z)continue;if(-1>pa.positionScreen.z||1<pa.positionScreen.z)continue;if(-1>Ea.positionScreen.z||
+1<Ea.positionScreen.z)continue;H.positionScreen.x*=K;H.positionScreen.y*=N;ja.positionScreen.x*=K;ja.positionScreen.y*=N;pa.positionScreen.x*=K;pa.positionScreen.y*=N;Ea.positionScreen.x*=K;Ea.positionScreen.y*=N;Za.positionScreen.copy(ja.positionScreen);ob.positionScreen.copy(Ea.positionScreen);0<v.overdraw&&(l(H.positionScreen,ja.positionScreen,v.overdraw),l(ja.positionScreen,Ea.positionScreen,v.overdraw),l(Ea.positionScreen,H.positionScreen,v.overdraw),l(pa.positionScreen,Za.positionScreen,v.overdraw),
+l(pa.positionScreen,ob.positionScreen,v.overdraw));ua.setFromPoints([H.positionScreen,ja.positionScreen,pa.positionScreen,Ea.positionScreen]);!0===eb.isIntersectionBox(ua)&&(A=H,lb=ja,mb=pa,tb=Ea,zb=Za,$b=ob,C.info.render.vertices+=4,C.info.render.faces++,m(v.opacity),n(v.blending),void 0!==v.map&&null!==v.map||void 0!==v.envMap&&null!==v.envMap?(c(A,lb,tb,0,1,3,W,v),c(zb,mb,$b,1,2,3,W,v)):(Fa=A.positionScreen.x,Oa=A.positionScreen.y,X=lb.positionScreen.x,fa=lb.positionScreen.y,U=mb.positionScreen.x,
+V=mb.positionScreen.y,oa=tb.positionScreen.x,ha=tb.positionScreen.y,da=zb.positionScreen.x,xa=zb.positionScreen.y,Ta=$b.positionScreen.x,la=$b.positionScreen.y,v instanceof THREE.MeshLambertMaterial||v instanceof THREE.MeshPhongMaterial?(Qa.copy(v.color),hb.copy(v.emissive),v.vertexColors===THREE.FaceColors&&Qa.multiply(W.color),!1===v.wireframe&&v.shading==THREE.SmoothShading&&4==W.vertexNormalsLength?(Ba.copy(kb),ea.copy(kb),na.copy(kb),Ia.copy(kb),b(W.v1.positionWorld,W.vertexNormalsModel[0],Ba),
+b(W.v2.positionWorld,W.vertexNormalsModel[1],ea),b(W.v4.positionWorld,W.vertexNormalsModel[3],na),b(W.v3.positionWorld,W.vertexNormalsModel[2],Ia),Ba.multiply(Qa).add(hb),ea.multiply(Qa).add(hb),na.multiply(Qa).add(hb),Ia.multiply(Qa).add(hb),ra=k(Ba,ea,na,Ia),d(Fa,Oa,X,fa,oa,ha),i(Fa,Oa,X,fa,oa,ha,0,0,1,0,0,1,ra),d(da,xa,U,V,Ta,la),i(da,xa,U,V,Ta,la,1,0,1,1,0,1,ra)):(ka.copy(kb),b(W.centroidModel,W.normalModel,ka),ka.multiply(Qa).add(hb),e(Fa,Oa,X,fa,U,V,oa,ha),!0===v.wireframe?f(ka,v.wireframeLinewidth,
+v.wireframeLinecap,v.wireframeLinejoin):h(ka))):v instanceof THREE.MeshBasicMaterial?(ka.copy(v.color),v.vertexColors===THREE.FaceColors&&ka.multiply(W.color),e(Fa,Oa,X,fa,U,V,oa,ha),!0===v.wireframe?f(ka,v.wireframeLinewidth,v.wireframeLinecap,v.wireframeLinejoin):h(ka)):v instanceof THREE.MeshNormalMaterial?(A=void 0,v.shading==THREE.FlatShading?(A=W.normalModelView,ka.setRGB(A.x,A.y,A.z).multiplyScalar(0.5).addScalar(0.5),e(Fa,Oa,X,fa,U,V,oa,ha),!0===v.wireframe?f(ka,v.wireframeLinewidth,v.wireframeLinecap,
+v.wireframeLinejoin):h(ka)):v.shading==THREE.SmoothShading&&(A=W.vertexNormalsModelView[0],Ba.setRGB(A.x,A.y,A.z).multiplyScalar(0.5).addScalar(0.5),A=W.vertexNormalsModelView[1],ea.setRGB(A.x,A.y,A.z).multiplyScalar(0.5).addScalar(0.5),A=W.vertexNormalsModelView[3],na.setRGB(A.x,A.y,A.z).multiplyScalar(0.5).addScalar(0.5),A=W.vertexNormalsModelView[2],Ia.setRGB(A.x,A.y,A.z).multiplyScalar(0.5).addScalar(0.5),ra=k(Ba,ea,na,Ia),d(Fa,Oa,X,fa,oa,ha),i(Fa,Oa,X,fa,oa,ha,0,0,1,0,0,1,ra),d(da,xa,U,V,Ta,
+la),i(da,xa,U,V,Ta,la,1,0,1,1,0,1,ra))):v instanceof THREE.MeshDepthMaterial&&(vb=sa.near,yb=sa.far,Ba.r=Ba.g=Ba.b=1-z(A.positionScreen.z*A.positionScreen.w,vb,yb),ea.r=ea.g=ea.b=1-z(lb.positionScreen.z*lb.positionScreen.w,vb,yb),na.r=na.g=na.b=1-z(tb.positionScreen.z*tb.positionScreen.w,vb,yb),Ia.r=Ia.g=Ia.b=1-z(mb.positionScreen.z*mb.positionScreen.w,vb,yb),ra=k(Ba,ea,na,Ia),d(Fa,Oa,X,fa,oa,ha),i(Fa,Oa,X,fa,oa,ha,0,0,1,0,0,1,ra),d(da,xa,U,V,Ta,la),i(da,xa,U,V,Ta,la,1,0,1,1,0,1,ra))))}Ya.union(ua)}}y.setTransform(1,
 0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
 0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
 envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
 envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
 envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
 envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
@@ -382,38 +381,38 @@ new Float32Array(2*i)}b.geometry.skinWeights.length&&b.geometry.skinIndices.leng
 i))}a.__webglFaceCount=3*k;a.__webglLineCount=2*g;if(h.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var p in h.attributes){var k=h.attributes[p],c={},q;for(q in k)c[q]=k[q];if(!c.__webglInitialized||c.createUniqueBuffers)c.__webglInitialized=!0,g=1,"v2"===c.type?g=2:"v3"===c.type?g=3:"v4"===c.type?g=4:"c"===c.type&&(g=3),c.size=g,c.array=new Float32Array(i*g),c.buffer=j.createBuffer(),c.buffer.belongsToAttribute=p,k.needsUpdate=!0,c.__original=k;a.__webglCustomAttributesList.push(c)}}a.__inittedArrays=
 i))}a.__webglFaceCount=3*k;a.__webglLineCount=2*g;if(h.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var p in h.attributes){var k=h.attributes[p],c={},q;for(q in k)c[q]=k[q];if(!c.__webglInitialized||c.createUniqueBuffers)c.__webglInitialized=!0,g=1,"v2"===c.type?g=2:"v3"===c.type?g=3:"v4"===c.type?g=4:"c"===c.type&&(g=3),c.size=g,c.array=new Float32Array(i*g),c.buffer=j.createBuffer(),c.buffer.belongsToAttribute=p,k.needsUpdate=!0,c.__original=k;a.__webglCustomAttributesList.push(c)}}a.__inittedArrays=
 !0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function h(a){Ab[a]||(j.enableVertexAttribArray(a),Ab[a]=!0)}
 !0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function h(a){Ab[a]||(j.enableVertexAttribArray(a),Ab[a]=!0)}
 function g(){for(var a in Ab)Ab[a]&&(j.disableVertexAttribArray(a),Ab[a]=!1)}function i(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function k(a,b){return b[0]-a[0]}function l(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)ob=ja=null,Ea=Za=fa=X=xa=da=U=-1,wb=!0,a[d].render(b,c,hb,Lb),ob=ja=null,Ea=Za=fa=X=xa=da=U=-1,wb=!0}function m(a,b,c,d,e,f,h,g){var j,i,k,m;b?(i=a.length-1,m=b=-1):(i=0,b=a.length,m=1);for(var l=i;l!==b;l+=m)if(j=a[l],j.render){i=j.object;k=j.buffer;if(g)j=g;else{j=j[c];if(!j)continue;
 function g(){for(var a in Ab)Ab[a]&&(j.disableVertexAttribArray(a),Ab[a]=!1)}function i(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function k(a,b){return b[0]-a[0]}function l(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)ob=ja=null,Ea=Za=fa=X=xa=da=U=-1,wb=!0,a[d].render(b,c,hb,Lb),ob=ja=null,Ea=Za=fa=X=xa=da=U=-1,wb=!0}function m(a,b,c,d,e,f,h,g){var j,i,k,m;b?(i=a.length-1,m=b=-1):(i=0,b=a.length,m=1);for(var l=i;l!==b;l+=m)if(j=a[l],j.render){i=j.object;k=j.buffer;if(g)j=g;else{j=j[c];if(!j)continue;
-h&&M.setBlending(j.blending,j.blendEquation,j.blendSrc,j.blendDst);M.setDepthTest(j.depthTest);M.setDepthWrite(j.depthWrite);A(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}M.setMaterialFaces(j);k instanceof THREE.BufferGeometry?M.renderBufferDirect(d,e,f,j,k,i):M.renderBuffer(d,e,f,j,k,i)}}function n(a,b,c,d,e,f,h){for(var g,j,i=0,k=a.length;i<k;i++)if(g=a[i],j=g.object,j.visible){if(h)g=h;else{g=g[b];if(!g)continue;f&&M.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);
-M.setDepthTest(g.depthTest);M.setDepthWrite(g.depthWrite);A(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}M.renderImmediateObject(c,d,e,g,j)}}function q(a,d){var e,f,h,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",lc)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry){var i,k;for(i in f.attributes)k=
-"index"===i?j.ELEMENT_ARRAY_BUFFER:j.ARRAY_BUFFER,g=f.attributes[i],void 0===g.numItems&&(g.numItems=g.array.length),g.buffer=j.createBuffer(),j.bindBuffer(k,g.buffer),j.bufferData(k,g.array,j.STATIC_DRAW)}else if(a instanceof THREE.Mesh){h=a.material;if(void 0===f.geometryGroups){i=f;var m,l,n,p,q;k={};var r=i.morphTargets.length,s=i.morphNormals.length,u=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(m=i.faces.length;h<m;h++)l=i.faces[h],n=u?l.materialIndex:0,void 0===k[n]&&(k[n]=
-{hash:n,counter:0}),q=k[n].hash+"_"+k[n].counter,void 0===i.geometryGroups[q]&&(i.geometryGroups[q]={faces3:[],faces4:[],materialIndex:n,vertices:0,numMorphTargets:r,numMorphNormals:s}),p=l instanceof THREE.Face3?3:4,65535<i.geometryGroups[q].vertices+p&&(k[n].counter+=1,q=k[n].hash+"_"+k[n].counter,void 0===i.geometryGroups[q]&&(i.geometryGroups[q]={faces3:[],faces4:[],materialIndex:n,vertices:0,numMorphTargets:r,numMorphNormals:s})),l instanceof THREE.Face3?i.geometryGroups[q].faces3.push(h):i.geometryGroups[q].faces4.push(h),
+h&&M.setBlending(j.blending,j.blendEquation,j.blendSrc,j.blendDst);M.setDepthTest(j.depthTest);M.setDepthWrite(j.depthWrite);B(j.polygonOffset,j.polygonOffsetFactor,j.polygonOffsetUnits)}M.setMaterialFaces(j);k instanceof THREE.BufferGeometry?M.renderBufferDirect(d,e,f,j,k,i):M.renderBuffer(d,e,f,j,k,i)}}function n(a,b,c,d,e,f,h){for(var g,j,i=0,k=a.length;i<k;i++)if(g=a[i],j=g.object,j.visible){if(h)g=h;else{g=g[b];if(!g)continue;f&&M.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);
+M.setDepthTest(g.depthTest);M.setDepthWrite(g.depthWrite);B(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}M.renderImmediateObject(c,d,e,g,j)}}function t(a,d){var e,f,h,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",lc)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry){var i,k;for(i in f.attributes)k=
+"index"===i?j.ELEMENT_ARRAY_BUFFER:j.ARRAY_BUFFER,g=f.attributes[i],void 0===g.numItems&&(g.numItems=g.array.length),g.buffer=j.createBuffer(),j.bindBuffer(k,g.buffer),j.bufferData(k,g.array,j.STATIC_DRAW)}else if(a instanceof THREE.Mesh){h=a.material;if(void 0===f.geometryGroups){i=f;var m,l,n,p,q;k={};var t=i.morphTargets.length,r=i.morphNormals.length,w=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(m=i.faces.length;h<m;h++)l=i.faces[h],n=w?l.materialIndex:0,void 0===k[n]&&(k[n]=
+{hash:n,counter:0}),q=k[n].hash+"_"+k[n].counter,void 0===i.geometryGroups[q]&&(i.geometryGroups[q]={faces3:[],faces4:[],materialIndex:n,vertices:0,numMorphTargets:t,numMorphNormals:r}),p=l instanceof THREE.Face3?3:4,65535<i.geometryGroups[q].vertices+p&&(k[n].counter+=1,q=k[n].hash+"_"+k[n].counter,void 0===i.geometryGroups[q]&&(i.geometryGroups[q]={faces3:[],faces4:[],materialIndex:n,vertices:0,numMorphTargets:t,numMorphNormals:r})),l instanceof THREE.Face3?i.geometryGroups[q].faces3.push(h):i.geometryGroups[q].faces4.push(h),
 i.geometryGroups[q].vertices+=p;i.geometryGroupsList=[];for(g in i.geometryGroups)i.geometryGroups[g].id=Fa++,i.geometryGroupsList.push(i.geometryGroups[g])}for(e in f.geometryGroups)if(g=f.geometryGroups[e],!g.__webglVertexBuffer){i=g;i.__webglVertexBuffer=j.createBuffer();i.__webglNormalBuffer=j.createBuffer();i.__webglTangentBuffer=j.createBuffer();i.__webglColorBuffer=j.createBuffer();i.__webglUVBuffer=j.createBuffer();i.__webglUV2Buffer=j.createBuffer();i.__webglSkinIndicesBuffer=j.createBuffer();
 i.geometryGroups[q].vertices+=p;i.geometryGroupsList=[];for(g in i.geometryGroups)i.geometryGroups[g].id=Fa++,i.geometryGroupsList.push(i.geometryGroups[g])}for(e in f.geometryGroups)if(g=f.geometryGroups[e],!g.__webglVertexBuffer){i=g;i.__webglVertexBuffer=j.createBuffer();i.__webglNormalBuffer=j.createBuffer();i.__webglTangentBuffer=j.createBuffer();i.__webglColorBuffer=j.createBuffer();i.__webglUVBuffer=j.createBuffer();i.__webglUV2Buffer=j.createBuffer();i.__webglSkinIndicesBuffer=j.createBuffer();
-i.__webglSkinWeightsBuffer=j.createBuffer();i.__webglFaceBuffer=j.createBuffer();i.__webglLineBuffer=j.createBuffer();r=k=void 0;if(i.numMorphTargets){i.__webglMorphTargetsBuffers=[];k=0;for(r=i.numMorphTargets;k<r;k++)i.__webglMorphTargetsBuffers.push(j.createBuffer())}if(i.numMorphNormals){i.__webglMorphNormalsBuffers=[];k=0;for(r=i.numMorphNormals;k<r;k++)i.__webglMorphNormalsBuffers.push(j.createBuffer())}M.info.memory.geometries++;c(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=
+i.__webglSkinWeightsBuffer=j.createBuffer();i.__webglFaceBuffer=j.createBuffer();i.__webglLineBuffer=j.createBuffer();t=k=void 0;if(i.numMorphTargets){i.__webglMorphTargetsBuffers=[];k=0;for(t=i.numMorphTargets;k<t;k++)i.__webglMorphTargetsBuffers.push(j.createBuffer())}if(i.numMorphNormals){i.__webglMorphNormalsBuffers=[];k=0;for(t=i.numMorphNormals;k<t;k++)i.__webglMorphNormalsBuffers.push(j.createBuffer())}M.info.memory.geometries++;c(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=
 !0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Ribbon?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=j.createBuffer(),g.__webglColorBuffer=j.createBuffer(),g.__webglNormalBuffer=j.createBuffer(),M.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__normalArray=new Float32Array(3*i),g.__webglVertexCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=
 !0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Ribbon?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=j.createBuffer(),g.__webglColorBuffer=j.createBuffer(),g.__webglNormalBuffer=j.createBuffer(),M.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__normalArray=new Float32Array(3*i),g.__webglVertexCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=
 !0,f.normalsNeedUpdate=!0):a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=j.createBuffer(),g.__webglColorBuffer=j.createBuffer(),g.__webglLineDistanceBuffer=j.createBuffer(),M.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__lineDistanceArray=new Float32Array(1*i),g.__webglLineCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.ParticleSystem&&
 !0,f.normalsNeedUpdate=!0):a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=j.createBuffer(),g.__webglColorBuffer=j.createBuffer(),g.__webglLineDistanceBuffer=j.createBuffer(),M.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__lineDistanceArray=new Float32Array(1*i),g.__webglLineCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.ParticleSystem&&
-!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=j.createBuffer(),g.__webglColorBuffer=j.createBuffer(),M.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__sortArray=[],g.__webglParticleCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)t(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=
-f.geometryGroups[e],t(d.__webglObjects,g,a)}else a instanceof THREE.Ribbon||a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,t(d.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function t(a,b,c){a.push({id:null,buffer:b,object:c,
-opaque:null,transparent:null,z:0})}function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function r(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function s(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Ribbon||a instanceof THREE.Line?u(b.__webglObjects,a):a instanceof THREE.Sprite?z(b.__webglSprites,a):a instanceof THREE.LensFlare?z(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&
-u(b.__webglObjectsImmediate,a);delete a.__webglActive}function u(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function z(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function G(a,b,c,d,e){Oa=0;d.needsUpdate&&(d.program&&uc(d),M.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(M.maxMorphTargets));var f=!1,h=d.program,g=h.uniforms,i=d.uniforms;h!==ja&&(j.useProgram(h),ja=h,f=!0);
-d.id!==Ea&&(Ea=d.id,f=!0);if(f||a!==ob)j.uniformMatrix4fv(g.projectionMatrix,!1,a.projectionMatrix.elements),a!==ob&&(ob=a);if(d.skinning)if(Jb&&e.useVertexTexture){if(null!==g.boneTexture){var k=B();j.uniform1i(g.boneTexture,k);M.setTexture(e.boneTexture,k)}}else null!==g.boneGlobalMatrices&&j.uniformMatrix4fv(g.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&(i.fogDensity.value=
-c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(wb){for(var m,l=k=0,n=0,p,q,r,s=Mb,t=s.directional.colors,u=s.directional.positions,z=s.point.colors,y=s.point.positions,A=s.point.distances,C=s.spot.colors,G=s.spot.positions,E=s.spot.distances,D=s.spot.directions,O=s.spot.anglesCos,H=s.spot.exponents,P=s.hemi.skyColors,L=s.hemi.groundColors,N=s.hemi.positions,Q=0,U=0,X=0,pa=0,aa=0,S=0,T=0,R=0,ba=m=0,c=r=ba=0,f=b.length;c<f;c++)m=b[c],m.onlyShadow||
-(p=m.color,q=m.intensity,r=m.distance,m instanceof THREE.AmbientLight?m.visible&&(M.gammaInput?(k+=p.r*p.r,l+=p.g*p.g,n+=p.b*p.b):(k+=p.r,l+=p.g,n+=p.b)):m instanceof THREE.DirectionalLight?(aa+=1,m.visible&&(ta.getPositionFromMatrix(m.matrixWorld),ra.getPositionFromMatrix(m.target.matrixWorld),ta.sub(ra),ta.normalize(),0===ta.x&&0===ta.y&&0===ta.z||(m=3*Q,u[m]=ta.x,u[m+1]=ta.y,u[m+2]=ta.z,M.gammaInput?F(t,m,p,q*q):I(t,m,p,q),Q+=1))):m instanceof THREE.PointLight?(S+=1,m.visible&&(ba=3*U,M.gammaInput?
-F(z,ba,p,q*q):I(z,ba,p,q),ra.getPositionFromMatrix(m.matrixWorld),y[ba]=ra.x,y[ba+1]=ra.y,y[ba+2]=ra.z,A[U]=r,U+=1)):m instanceof THREE.SpotLight?(T+=1,m.visible&&(ba=3*X,M.gammaInput?F(C,ba,p,q*q):I(C,ba,p,q),ra.getPositionFromMatrix(m.matrixWorld),G[ba]=ra.x,G[ba+1]=ra.y,G[ba+2]=ra.z,E[X]=r,ta.copy(ra),ra.getPositionFromMatrix(m.target.matrixWorld),ta.sub(ra),ta.normalize(),D[ba]=ta.x,D[ba+1]=ta.y,D[ba+2]=ta.z,O[X]=Math.cos(m.angle),H[X]=m.exponent,X+=1)):m instanceof THREE.HemisphereLight&&(R+=
-1,m.visible&&(ta.getPositionFromMatrix(m.matrixWorld),ta.normalize(),0===ta.x&&0===ta.y&&0===ta.z||(r=3*pa,N[r]=ta.x,N[r+1]=ta.y,N[r+2]=ta.z,p=m.color,m=m.groundColor,M.gammaInput?(q*=q,F(P,r,p,q),F(L,r,m,q)):(I(P,r,p,q),I(L,r,m,q)),pa+=1))));c=3*Q;for(f=Math.max(t.length,3*aa);c<f;c++)t[c]=0;c=3*U;for(f=Math.max(z.length,3*S);c<f;c++)z[c]=0;c=3*X;for(f=Math.max(C.length,3*T);c<f;c++)C[c]=0;c=3*pa;for(f=Math.max(P.length,3*R);c<f;c++)P[c]=0;c=3*pa;for(f=Math.max(L.length,3*R);c<f;c++)L[c]=0;s.directional.length=
-Q;s.point.length=U;s.spot.length=X;s.hemi.length=pa;s.ambient[0]=k;s.ambient[1]=l;s.ambient[2]=n;wb=!1}c=Mb;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=c.point.distances;i.spotLightColor.value=c.spot.colors;i.spotLightPosition.value=c.spot.positions;i.spotLightDistance.value=c.spot.distances;
+!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=j.createBuffer(),g.__webglColorBuffer=j.createBuffer(),M.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__sortArray=[],g.__webglParticleCount=i,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)s(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=
+f.geometryGroups[e],s(d.__webglObjects,g,a)}else a instanceof THREE.Ribbon||a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,s(d.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function s(a,b,c){a.push({id:null,buffer:b,object:c,
+opaque:null,transparent:null,z:0})}function q(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function p(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function r(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Ribbon||a instanceof THREE.Line?w(b.__webglObjects,a):a instanceof THREE.Sprite?z(b.__webglSprites,a):a instanceof THREE.LensFlare?z(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&
+w(b.__webglObjectsImmediate,a);delete a.__webglActive}function w(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function z(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function C(a,b,c,d,e){Oa=0;d.needsUpdate&&(d.program&&uc(d),M.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(M.maxMorphTargets));var f=!1,h=d.program,g=h.uniforms,i=d.uniforms;h!==ja&&(j.useProgram(h),ja=h,f=!0);
+d.id!==Ea&&(Ea=d.id,f=!0);if(f||a!==ob)j.uniformMatrix4fv(g.projectionMatrix,!1,a.projectionMatrix.elements),a!==ob&&(ob=a);if(d.skinning)if(Jb&&e.useVertexTexture){if(null!==g.boneTexture){var k=F();j.uniform1i(g.boneTexture,k);M.setTexture(e.boneTexture,k)}}else null!==g.boneGlobalMatrices&&j.uniformMatrix4fv(g.boneGlobalMatrices,!1,e.boneMatrices);if(f){c&&d.fog&&(i.fogColor.value=c.color,c instanceof THREE.Fog?(i.fogNear.value=c.near,i.fogFar.value=c.far):c instanceof THREE.FogExp2&&(i.fogDensity.value=
+c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(wb){for(var m,l=k=0,n=0,p,q,t,r=Mb,s=r.directional.colors,w=r.directional.positions,z=r.point.colors,y=r.point.positions,A=r.point.distances,B=r.spot.colors,C=r.spot.positions,I=r.spot.distances,D=r.spot.directions,O=r.spot.anglesCos,H=r.spot.exponents,P=r.hemi.skyColors,L=r.hemi.groundColors,N=r.hemi.positions,Q=0,U=0,X=0,pa=0,aa=0,S=0,T=0,R=0,ba=m=0,c=t=ba=0,f=b.length;c<f;c++)m=b[c],m.onlyShadow||
+(p=m.color,q=m.intensity,t=m.distance,m instanceof THREE.AmbientLight?m.visible&&(M.gammaInput?(k+=p.r*p.r,l+=p.g*p.g,n+=p.b*p.b):(k+=p.r,l+=p.g,n+=p.b)):m instanceof THREE.DirectionalLight?(aa+=1,m.visible&&(ta.getPositionFromMatrix(m.matrixWorld),ra.getPositionFromMatrix(m.target.matrixWorld),ta.sub(ra),ta.normalize(),0===ta.x&&0===ta.y&&0===ta.z||(m=3*Q,w[m]=ta.x,w[m+1]=ta.y,w[m+2]=ta.z,M.gammaInput?G(s,m,p,q*q):E(s,m,p,q),Q+=1))):m instanceof THREE.PointLight?(S+=1,m.visible&&(ba=3*U,M.gammaInput?
+G(z,ba,p,q*q):E(z,ba,p,q),ra.getPositionFromMatrix(m.matrixWorld),y[ba]=ra.x,y[ba+1]=ra.y,y[ba+2]=ra.z,A[U]=t,U+=1)):m instanceof THREE.SpotLight?(T+=1,m.visible&&(ba=3*X,M.gammaInput?G(B,ba,p,q*q):E(B,ba,p,q),ra.getPositionFromMatrix(m.matrixWorld),C[ba]=ra.x,C[ba+1]=ra.y,C[ba+2]=ra.z,I[X]=t,ta.copy(ra),ra.getPositionFromMatrix(m.target.matrixWorld),ta.sub(ra),ta.normalize(),D[ba]=ta.x,D[ba+1]=ta.y,D[ba+2]=ta.z,O[X]=Math.cos(m.angle),H[X]=m.exponent,X+=1)):m instanceof THREE.HemisphereLight&&(R+=
+1,m.visible&&(ta.getPositionFromMatrix(m.matrixWorld),ta.normalize(),0===ta.x&&0===ta.y&&0===ta.z||(t=3*pa,N[t]=ta.x,N[t+1]=ta.y,N[t+2]=ta.z,p=m.color,m=m.groundColor,M.gammaInput?(q*=q,G(P,t,p,q),G(L,t,m,q)):(E(P,t,p,q),E(L,t,m,q)),pa+=1))));c=3*Q;for(f=Math.max(s.length,3*aa);c<f;c++)s[c]=0;c=3*U;for(f=Math.max(z.length,3*S);c<f;c++)z[c]=0;c=3*X;for(f=Math.max(B.length,3*T);c<f;c++)B[c]=0;c=3*pa;for(f=Math.max(P.length,3*R);c<f;c++)P[c]=0;c=3*pa;for(f=Math.max(L.length,3*R);c<f;c++)L[c]=0;r.directional.length=
+Q;r.point.length=U;r.spot.length=X;r.hemi.length=pa;r.ambient[0]=k;r.ambient[1]=l;r.ambient[2]=n;wb=!1}c=Mb;i.ambientLightColor.value=c.ambient;i.directionalLightColor.value=c.directional.colors;i.directionalLightDirection.value=c.directional.positions;i.pointLightColor.value=c.point.colors;i.pointLightPosition.value=c.point.positions;i.pointLightDistance.value=c.point.distances;i.spotLightColor.value=c.spot.colors;i.spotLightPosition.value=c.spot.positions;i.spotLightDistance.value=c.spot.distances;
 i.spotLightDirection.value=c.spot.directions;i.spotLightAngleCos.value=c.spot.anglesCos;i.spotLightExponent.value=c.spot.exponents;i.hemisphereLightSkyColor.value=c.hemi.skyColors;i.hemisphereLightGroundColor.value=c.hemi.groundColors;i.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){i.opacity.value=d.opacity;M.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=
 i.spotLightDirection.value=c.spot.directions;i.spotLightAngleCos.value=c.spot.anglesCos;i.spotLightExponent.value=c.spot.exponents;i.hemisphereLightSkyColor.value=c.hemi.skyColors;i.hemisphereLightGroundColor.value=c.hemi.groundColors;i.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){i.opacity.value=d.opacity;M.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=
 d.color;i.map.value=d.map;i.lightMap.value=d.lightMap;i.specularMap.value=d.specularMap;d.bumpMap&&(i.bumpMap.value=d.bumpMap,i.bumpScale.value=d.bumpScale);d.normalMap&&(i.normalMap.value=d.normalMap,i.normalScale.value.copy(d.normalScale));var V;d.map?V=d.map:d.specularMap?V=d.specularMap:d.normalMap?V=d.normalMap:d.bumpMap&&(V=d.bumpMap);void 0!==V&&(c=V.offset,V=V.repeat,i.offsetRepeat.value.set(c.x,c.y,V.x,V.y));i.envMap.value=d.envMap;i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?
 d.color;i.map.value=d.map;i.lightMap.value=d.lightMap;i.specularMap.value=d.specularMap;d.bumpMap&&(i.bumpMap.value=d.bumpMap,i.bumpScale.value=d.bumpScale);d.normalMap&&(i.normalMap.value=d.normalMap,i.normalScale.value.copy(d.normalScale));var V;d.map?V=d.map:d.specularMap?V=d.specularMap:d.normalMap?V=d.normalMap:d.bumpMap&&(V=d.bumpMap);void 0!==V&&(c=V.offset,V=V.repeat,i.offsetRepeat.value.set(c.x,c.y,V.x,V.y));i.envMap.value=d.envMap;i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?
 1:-1;i.reflectivity.value=d.reflectivity;i.refractionRatio.value=d.refractionRatio;i.combine.value=d.combine;i.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity,i.dashSize.value=d.dashSize,i.totalSize.value=d.dashSize+d.gapSize,i.scale.value=d.scale):d instanceof THREE.ParticleBasicMaterial?
 1:-1;i.reflectivity.value=d.reflectivity;i.refractionRatio.value=d.refractionRatio;i.combine.value=d.combine;i.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(i.diffuse.value=d.color,i.opacity.value=d.opacity,i.dashSize.value=d.dashSize,i.totalSize.value=d.dashSize+d.gapSize,i.scale.value=d.scale):d instanceof THREE.ParticleBasicMaterial?
-(i.psColor.value=d.color,i.opacity.value=d.opacity,i.size.value=d.size,i.scale.value=w.height/2,i.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(i.shininess.value=d.shininess,M.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.emissive.value.copyGammaToLinear(d.emissive),i.specular.value.copyGammaToLinear(d.specular)):(i.ambient.value=d.ambient,i.emissive.value=d.emissive,i.specular.value=d.specular),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?
+(i.psColor.value=d.color,i.opacity.value=d.opacity,i.size.value=d.size,i.scale.value=v.height/2,i.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(i.shininess.value=d.shininess,M.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.emissive.value.copyGammaToLinear(d.emissive),i.specular.value.copyGammaToLinear(d.specular)):(i.ambient.value=d.ambient,i.emissive.value=d.emissive,i.specular.value=d.specular),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?
 (M.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.emissive.value.copyGammaToLinear(d.emissive)):(i.ambient.value=d.ambient,i.emissive.value=d.emissive),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(i.mNear.value=a.near,i.mFar.value=a.far,i.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(i.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&i.shadowMatrix){c=V=0;for(f=b.length;c<f;c++)if(k=b[c],k.castShadow&&(k instanceof
 (M.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.emissive.value.copyGammaToLinear(d.emissive)):(i.ambient.value=d.ambient,i.emissive.value=d.emissive),d.wrapAround&&i.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(i.mNear.value=a.near,i.mFar.value=a.far,i.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(i.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&i.shadowMatrix){c=V=0;for(f=b.length;c<f;c++)if(k=b[c],k.castShadow&&(k instanceof
 THREE.SpotLight||k instanceof THREE.DirectionalLight&&!k.shadowCascade))i.shadowMap.value[V]=k.shadowMap,i.shadowMapSize.value[V]=k.shadowMapSize,i.shadowMatrix.value[V]=k.shadowMatrix,i.shadowDarkness.value[V]=k.shadowDarkness,i.shadowBias.value[V]=k.shadowBias,V++}b=d.uniformsList;i=0;for(V=b.length;i<V;i++)if(f=h.uniforms[b[i][1]])if(c=b[i][0],l=c.type,k=c.value,"i"===l)j.uniform1i(f,k);else if("f"===l)j.uniform1f(f,k);else if("v2"===l)j.uniform2f(f,k.x,k.y);else if("v3"===l)j.uniform3f(f,k.x,
 THREE.SpotLight||k instanceof THREE.DirectionalLight&&!k.shadowCascade))i.shadowMap.value[V]=k.shadowMap,i.shadowMapSize.value[V]=k.shadowMapSize,i.shadowMatrix.value[V]=k.shadowMatrix,i.shadowDarkness.value[V]=k.shadowDarkness,i.shadowBias.value[V]=k.shadowBias,V++}b=d.uniformsList;i=0;for(V=b.length;i<V;i++)if(f=h.uniforms[b[i][1]])if(c=b[i][0],l=c.type,k=c.value,"i"===l)j.uniform1i(f,k);else if("f"===l)j.uniform1f(f,k);else if("v2"===l)j.uniform2f(f,k.x,k.y);else if("v3"===l)j.uniform3f(f,k.x,
-k.y,k.z);else if("v4"===l)j.uniform4f(f,k.x,k.y,k.z,k.w);else if("c"===l)j.uniform3f(f,k.r,k.g,k.b);else if("iv1"===l)j.uniform1iv(f,k);else if("iv"===l)j.uniform3iv(f,k);else if("fv1"===l)j.uniform1fv(f,k);else if("fv"===l)j.uniform3fv(f,k);else if("v2v"===l){void 0===c._array&&(c._array=new Float32Array(2*k.length));l=0;for(n=k.length;l<n;l++)s=2*l,c._array[s]=k[l].x,c._array[s+1]=k[l].y;j.uniform2fv(f,c._array)}else if("v3v"===l){void 0===c._array&&(c._array=new Float32Array(3*k.length));l=0;for(n=
-k.length;l<n;l++)s=3*l,c._array[s]=k[l].x,c._array[s+1]=k[l].y,c._array[s+2]=k[l].z;j.uniform3fv(f,c._array)}else if("v4v"===l){void 0===c._array&&(c._array=new Float32Array(4*k.length));l=0;for(n=k.length;l<n;l++)s=4*l,c._array[s]=k[l].x,c._array[s+1]=k[l].y,c._array[s+2]=k[l].z,c._array[s+3]=k[l].w;j.uniform4fv(f,c._array)}else if("m4"===l)void 0===c._array&&(c._array=new Float32Array(16)),k.flattenToArray(c._array),j.uniformMatrix4fv(f,!1,c._array);else if("m4v"===l){void 0===c._array&&(c._array=
-new Float32Array(16*k.length));l=0;for(n=k.length;l<n;l++)k[l].flattenToArrayOffset(c._array,16*l);j.uniformMatrix4fv(f,!1,c._array)}else if("t"===l){if(s=k,k=B(),j.uniform1i(f,k),s)if(s.image instanceof Array&&6===s.image.length){if(c=s,f=k,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",hc),c.image.__webglTextureCube=j.createTexture(),M.info.memory.textures++);j.activeTexture(j.TEXTURE0+f);j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);
-j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;k=[];for(l=0;6>l;l++)M.autoScaleCubemaps&&!f?(n=k,s=l,t=c.image[l],z=Xb,t.width<=z&&t.height<=z||(y=Math.max(t.width,t.height),u=Math.floor(t.width*z/y),z=Math.floor(t.height*z/y),y=document.createElement("canvas"),y.width=u,y.height=z,y.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,u,z),t=y),n[s]=t):k[l]=c.image[l];l=k[0];n=0===(l.width&l.width-1)&&0===(l.height&l.height-1);s=J(c.format);t=J(c.type);K(j.TEXTURE_CUBE_MAP,
-c,n);for(l=0;6>l;l++)if(f){z=k[l].mipmaps;y=0;for(A=z.length;y<A;y++)u=z[y],j.compressedTexImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,y,s,u.width,u.height,0,u.data)}else j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,s,s,t,k[l]);c.generateMipmaps&&n&&j.generateMipmap(j.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else j.activeTexture(j.TEXTURE0+f),j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else s instanceof THREE.WebGLRenderTargetCube?(c=s,j.activeTexture(j.TEXTURE0+
-k),j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture)):M.setTexture(s,k)}else if("tv"===l){void 0===c._array&&(c._array=[]);l=0;for(n=c.value.length;l<n;l++)c._array[l]=B();j.uniform1iv(f,c._array);l=0;for(n=c.value.length;l<n;l++)s=c.value[l],k=c._array[l],s&&M.setTexture(s,k)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+l);if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==g.cameraPosition)ra.getPositionFromMatrix(a.matrixWorld),j.uniform3f(g.cameraPosition,
-ra.x,ra.y,ra.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==g.viewMatrix&&j.uniformMatrix4fv(g.viewMatrix,!1,a.matrixWorldInverse.elements)}j.uniformMatrix4fv(g.modelViewMatrix,!1,e._modelViewMatrix.elements);g.normalMatrix&&j.uniformMatrix3fv(g.normalMatrix,!1,e._normalMatrix.elements);null!==g.modelMatrix&&j.uniformMatrix4fv(g.modelMatrix,!1,e.matrixWorld.elements);return h}function B(){var a=Oa;a>=ua&&console.warn("WebGLRenderer: trying to use "+
-a+" texture units while this GPU supports only "+ua);Oa+=1;return a}function F(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function I(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function E(a){a!==Ba&&(j.lineWidth(a),Ba=a)}function A(a,b,c){Ta!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),Ta=a);if(a&&(la!==b||ka!==c))j.polygonOffset(b,c),la=b,ka=c}function O(a){for(var a=a.split("\n"),b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function C(a,
+k.y,k.z);else if("v4"===l)j.uniform4f(f,k.x,k.y,k.z,k.w);else if("c"===l)j.uniform3f(f,k.r,k.g,k.b);else if("iv1"===l)j.uniform1iv(f,k);else if("iv"===l)j.uniform3iv(f,k);else if("fv1"===l)j.uniform1fv(f,k);else if("fv"===l)j.uniform3fv(f,k);else if("v2v"===l){void 0===c._array&&(c._array=new Float32Array(2*k.length));l=0;for(n=k.length;l<n;l++)r=2*l,c._array[r]=k[l].x,c._array[r+1]=k[l].y;j.uniform2fv(f,c._array)}else if("v3v"===l){void 0===c._array&&(c._array=new Float32Array(3*k.length));l=0;for(n=
+k.length;l<n;l++)r=3*l,c._array[r]=k[l].x,c._array[r+1]=k[l].y,c._array[r+2]=k[l].z;j.uniform3fv(f,c._array)}else if("v4v"===l){void 0===c._array&&(c._array=new Float32Array(4*k.length));l=0;for(n=k.length;l<n;l++)r=4*l,c._array[r]=k[l].x,c._array[r+1]=k[l].y,c._array[r+2]=k[l].z,c._array[r+3]=k[l].w;j.uniform4fv(f,c._array)}else if("m4"===l)void 0===c._array&&(c._array=new Float32Array(16)),k.flattenToArray(c._array),j.uniformMatrix4fv(f,!1,c._array);else if("m4v"===l){void 0===c._array&&(c._array=
+new Float32Array(16*k.length));l=0;for(n=k.length;l<n;l++)k[l].flattenToArrayOffset(c._array,16*l);j.uniformMatrix4fv(f,!1,c._array)}else if("t"===l){if(r=k,k=F(),j.uniform1i(f,k),r)if(r.image instanceof Array&&6===r.image.length){if(c=r,f=k,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",hc),c.image.__webglTextureCube=j.createTexture(),M.info.memory.textures++);j.activeTexture(j.TEXTURE0+f);j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);
+j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;k=[];for(l=0;6>l;l++)M.autoScaleCubemaps&&!f?(n=k,r=l,s=c.image[l],z=Xb,s.width<=z&&s.height<=z||(y=Math.max(s.width,s.height),w=Math.floor(s.width*z/y),z=Math.floor(s.height*z/y),y=document.createElement("canvas"),y.width=w,y.height=z,y.getContext("2d").drawImage(s,0,0,s.width,s.height,0,0,w,z),s=y),n[r]=s):k[l]=c.image[l];l=k[0];n=0===(l.width&l.width-1)&&0===(l.height&l.height-1);r=J(c.format);s=J(c.type);K(j.TEXTURE_CUBE_MAP,
+c,n);for(l=0;6>l;l++)if(f){z=k[l].mipmaps;y=0;for(A=z.length;y<A;y++)w=z[y],j.compressedTexImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,y,r,w.width,w.height,0,w.data)}else j.texImage2D(j.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,r,r,s,k[l]);c.generateMipmaps&&n&&j.generateMipmap(j.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else j.activeTexture(j.TEXTURE0+f),j.bindTexture(j.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else r instanceof THREE.WebGLRenderTargetCube?(c=r,j.activeTexture(j.TEXTURE0+
+k),j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture)):M.setTexture(r,k)}else if("tv"===l){void 0===c._array&&(c._array=[]);l=0;for(n=c.value.length;l<n;l++)c._array[l]=F();j.uniform1iv(f,c._array);l=0;for(n=c.value.length;l<n;l++)r=c.value[l],k=c._array[l],r&&M.setTexture(r,k)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+l);if((d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==g.cameraPosition)ra.getPositionFromMatrix(a.matrixWorld),j.uniform3f(g.cameraPosition,
+ra.x,ra.y,ra.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==g.viewMatrix&&j.uniformMatrix4fv(g.viewMatrix,!1,a.matrixWorldInverse.elements)}j.uniformMatrix4fv(g.modelViewMatrix,!1,e._modelViewMatrix.elements);g.normalMatrix&&j.uniformMatrix3fv(g.normalMatrix,!1,e._normalMatrix.elements);null!==g.modelMatrix&&j.uniformMatrix4fv(g.modelMatrix,!1,e.matrixWorld.elements);return h}function F(){var a=Oa;a>=ua&&console.warn("WebGLRenderer: trying to use "+
+a+" texture units while this GPU supports only "+ua);Oa+=1;return a}function G(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function E(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function I(a){a!==Ba&&(j.lineWidth(a),Ba=a)}function B(a,b,c){Ta!==a&&(a?j.enable(j.POLYGON_OFFSET_FILL):j.disable(j.POLYGON_OFFSET_FILL),Ta=a);if(a&&(la!==b||ka!==c))j.polygonOffset(b,c),la=b,ka=c}function O(a){for(var a=a.split("\n"),b=0,c=a.length;b<c;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function A(a,
 b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(O(b)),null):c}function K(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,J(b.wrapS)),j.texParameteri(a,j.TEXTURE_WRAP_T,J(b.wrapT)),j.texParameteri(a,j.TEXTURE_MAG_FILTER,J(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,J(b.minFilter))):(j.texParameteri(a,
 b){var c;"fragment"===a?c=j.createShader(j.FRAGMENT_SHADER):"vertex"===a&&(c=j.createShader(j.VERTEX_SHADER));j.shaderSource(c,b);j.compileShader(c);return!j.getShaderParameter(c,j.COMPILE_STATUS)?(console.error(j.getShaderInfoLog(c)),console.error(O(b)),null):c}function K(a,b,c){c?(j.texParameteri(a,j.TEXTURE_WRAP_S,J(b.wrapS)),j.texParameteri(a,j.TEXTURE_WRAP_T,J(b.wrapT)),j.texParameteri(a,j.TEXTURE_MAG_FILTER,J(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,J(b.minFilter))):(j.texParameteri(a,
 j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_MAG_FILTER,y(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,y(b.minFilter)));if(xb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy))j.texParameterf(a,xb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Kb)),b.__oldAnisotropy=b.anisotropy}function N(a,b){j.bindRenderbuffer(j.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_COMPONENT16,
 j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(a,j.TEXTURE_MAG_FILTER,y(b.magFilter)),j.texParameteri(a,j.TEXTURE_MIN_FILTER,y(b.minFilter)));if(xb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy))j.texParameterf(a,xb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Kb)),b.__oldAnisotropy=b.anisotropy}function N(a,b){j.bindRenderbuffer(j.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_COMPONENT16,
 b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_ATTACHMENT,j.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_STENCIL,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_STENCIL_ATTACHMENT,j.RENDERBUFFER,a)):j.renderbufferStorage(j.RENDERBUFFER,j.RGBA4,b.width,b.height)}function y(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?j.NEAREST:j.LINEAR}function J(a){if(a===
 b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_ATTACHMENT,j.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(j.renderbufferStorage(j.RENDERBUFFER,j.DEPTH_STENCIL,b.width,b.height),j.framebufferRenderbuffer(j.FRAMEBUFFER,j.DEPTH_STENCIL_ATTACHMENT,j.RENDERBUFFER,a)):j.renderbufferStorage(j.RENDERBUFFER,j.RGBA4,b.width,b.height)}function y(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?j.NEAREST:j.LINEAR}function J(a){if(a===
@@ -421,18 +420,18 @@ THREE.RepeatWrapping)return j.REPEAT;if(a===THREE.ClampToEdgeWrapping)return j.C
 if(a===THREE.UnsignedByteType)return j.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return j.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return j.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return j.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return j.BYTE;if(a===THREE.ShortType)return j.SHORT;if(a===THREE.UnsignedShortType)return j.UNSIGNED_SHORT;if(a===THREE.IntType)return j.INT;if(a===THREE.UnsignedIntType)return j.UNSIGNED_INT;if(a===THREE.FloatType)return j.FLOAT;
 if(a===THREE.UnsignedByteType)return j.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return j.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return j.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return j.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return j.BYTE;if(a===THREE.ShortType)return j.SHORT;if(a===THREE.UnsignedShortType)return j.UNSIGNED_SHORT;if(a===THREE.IntType)return j.INT;if(a===THREE.UnsignedIntType)return j.UNSIGNED_INT;if(a===THREE.FloatType)return j.FLOAT;
 if(a===THREE.AlphaFormat)return j.ALPHA;if(a===THREE.RGBFormat)return j.RGB;if(a===THREE.RGBAFormat)return j.RGBA;if(a===THREE.LuminanceFormat)return j.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return j.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return j.FUNC_ADD;if(a===THREE.SubtractEquation)return j.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return j.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return j.ZERO;if(a===THREE.OneFactor)return j.ONE;if(a===THREE.SrcColorFactor)return j.SRC_COLOR;
 if(a===THREE.AlphaFormat)return j.ALPHA;if(a===THREE.RGBFormat)return j.RGB;if(a===THREE.RGBAFormat)return j.RGBA;if(a===THREE.LuminanceFormat)return j.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return j.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return j.FUNC_ADD;if(a===THREE.SubtractEquation)return j.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return j.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return j.ZERO;if(a===THREE.OneFactor)return j.ONE;if(a===THREE.SrcColorFactor)return j.SRC_COLOR;
 if(a===THREE.OneMinusSrcColorFactor)return j.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return j.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return j.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return j.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return j.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return j.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return j.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return j.SRC_ALPHA_SATURATE;if(void 0!==eb){if(a===THREE.RGB_S3TC_DXT1_Format)return eb.COMPRESSED_RGB_S3TC_DXT1_EXT;
 if(a===THREE.OneMinusSrcColorFactor)return j.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return j.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return j.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return j.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return j.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return j.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return j.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return j.SRC_ALPHA_SATURATE;if(void 0!==eb){if(a===THREE.RGB_S3TC_DXT1_Format)return eb.COMPRESSED_RGB_S3TC_DXT1_EXT;
-if(a===THREE.RGBA_S3TC_DXT1_Format)return eb.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return eb.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return eb.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var a=a||{},w=void 0!==a.canvas?a.canvas:document.createElement("canvas"),aa=void 0!==a.precision?a.precision:"highp",L=void 0!==a.alpha?a.alpha:!0,qa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Pa=void 0!==
+if(a===THREE.RGBA_S3TC_DXT1_Format)return eb.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return eb.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return eb.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var a=a||{},v=void 0!==a.canvas?a.canvas:document.createElement("canvas"),aa=void 0!==a.precision?a.precision:"highp",L=void 0!==a.alpha?a.alpha:!0,qa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,Pa=void 0!==
 a.antialias?a.antialias:!1,Sa=void 0!==a.stencil?a.stencil:!0,Q=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,ia=new THREE.Color(0),Wa=0;void 0!==a.clearColor&&(console.warn("DEPRECATED: clearColor in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),ia.setHex(a.clearColor));void 0!==a.clearAlpha&&(console.warn("DEPRECATED: clearAlpha in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),Wa=a.clearAlpha);this.domElement=
 a.antialias?a.antialias:!1,Sa=void 0!==a.stencil?a.stencil:!0,Q=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,ia=new THREE.Color(0),Wa=0;void 0!==a.clearColor&&(console.warn("DEPRECATED: clearColor in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),ia.setHex(a.clearColor));void 0!==a.clearAlpha&&(console.warn("DEPRECATED: clearAlpha in WebGLRenderer constructor parameters is being removed. Use .setClearColor() instead."),Wa=a.clearAlpha);this.domElement=
-w;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=
+v;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==window.devicePixelRatio?window.devicePixelRatio:1;this.autoUpdateObjects=this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=
 !1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var M=this,sa=[],H=0,ja=null,pa=null,Ea=-1,Za=null,ob=null,Fa=0,Oa=0,X=-1,fa=-1,U=-1,V=-1,oa=-1,ha=-1,da=-1,xa=-1,Ta=null,la=null,ka=null,Ba=null,ea=0,na=0,Ia=0,Qa=0,hb=0,Lb=0,Ab={},Ub=new THREE.Frustum,vb=new THREE.Matrix4,yb=new THREE.Matrix4,ra=new THREE.Vector3,ta=new THREE.Vector3,
 !1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var M=this,sa=[],H=0,ja=null,pa=null,Ea=-1,Za=null,ob=null,Fa=0,Oa=0,X=-1,fa=-1,U=-1,V=-1,oa=-1,ha=-1,da=-1,xa=-1,Ta=null,la=null,ka=null,Ba=null,ea=0,na=0,Ia=0,Qa=0,hb=0,Lb=0,Ab={},Ub=new THREE.Frustum,vb=new THREE.Matrix4,yb=new THREE.Matrix4,ra=new THREE.Vector3,ta=new THREE.Vector3,
-wb=!0,Mb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},j,Tb,Nb,xb,eb;try{if(!(j=w.getContext("experimental-webgl",{alpha:L,premultipliedAlpha:qa,antialias:Pa,stencil:Sa,preserveDrawingBuffer:Q})))throw"Error creating WebGL context.";}catch(Ya){console.error(Ya)}Tb=j.getExtension("OES_texture_float");
+wb=!0,Mb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},j,Tb,Nb,xb,eb;try{if(!(j=v.getContext("experimental-webgl",{alpha:L,premultipliedAlpha:qa,antialias:Pa,stencil:Sa,preserveDrawingBuffer:Q})))throw"Error creating WebGL context.";}catch(Ya){console.error(Ya)}Tb=j.getExtension("OES_texture_float");
 j.getExtension("OES_texture_float_linear");Nb=j.getExtension("OES_standard_derivatives");xb=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");eb=j.getExtension("WEBGL_compressed_texture_s3tc")||j.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||j.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Tb||console.log("THREE.WebGLRenderer: Float textures not supported.");Nb||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");
 j.getExtension("OES_texture_float_linear");Nb=j.getExtension("OES_standard_derivatives");xb=j.getExtension("EXT_texture_filter_anisotropic")||j.getExtension("MOZ_EXT_texture_filter_anisotropic")||j.getExtension("WEBKIT_EXT_texture_filter_anisotropic");eb=j.getExtension("WEBGL_compressed_texture_s3tc")||j.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||j.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Tb||console.log("THREE.WebGLRenderer: Float textures not supported.");Nb||console.log("THREE.WebGLRenderer: Standard derivatives not supported.");
 xb||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");eb||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");void 0===j.getShaderPrecisionFormat&&(j.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,
 xb||console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");eb||console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");void 0===j.getShaderPrecisionFormat&&(j.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});j.clearColor(0,0,0,1);j.clearDepth(1);j.clearStencil(0);j.enable(j.DEPTH_TEST);j.depthFunc(j.LEQUAL);j.frontFace(j.CCW);j.cullFace(j.BACK);j.enable(j.CULL_FACE);j.enable(j.BLEND);j.blendEquation(j.FUNC_ADD);j.blendFunc(j.SRC_ALPHA,
 j.ONE_MINUS_SRC_ALPHA);j.clearColor(ia.r,ia.g,ia.b,Wa);this.context=j;var ua=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),kb=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var Xb=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),Kb=xb?j.getParameter(xb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Ua=0<kb,Jb=Ua&&Tb;eb&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var Vb=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),Hb=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);
 j.ONE_MINUS_SRC_ALPHA);j.clearColor(ia.r,ia.g,ia.b,Wa);this.context=j;var ua=j.getParameter(j.MAX_TEXTURE_IMAGE_UNITS),kb=j.getParameter(j.MAX_VERTEX_TEXTURE_IMAGE_UNITS);j.getParameter(j.MAX_TEXTURE_SIZE);var Xb=j.getParameter(j.MAX_CUBE_MAP_TEXTURE_SIZE),Kb=xb?j.getParameter(xb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Ua=0<kb,Jb=Ua&&Tb;eb&&j.getParameter(j.COMPRESSED_TEXTURE_FORMATS);var Vb=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_FLOAT),Hb=j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_FLOAT);
 j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var Ja=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),Wb=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,
 j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_FLOAT);var Ja=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_FLOAT),Wb=j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.MEDIUM_FLOAT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_FLOAT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.MEDIUM_INT);j.getShaderPrecisionFormat(j.VERTEX_SHADER,j.LOW_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.HIGH_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,
 j.MEDIUM_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_INT);var Ib=0<Vb.precision&&0<Ja.precision,Eb=0<Hb.precision&&0<Wb.precision;"highp"===aa&&!Ib&&(Eb?(aa="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(aa="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));"mediump"===aa&&!Eb&&(aa="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return Ua};
 j.MEDIUM_INT);j.getShaderPrecisionFormat(j.FRAGMENT_SHADER,j.LOW_INT);var Ib=0<Vb.precision&&0<Ja.precision,Eb=0<Hb.precision&&0<Wb.precision;"highp"===aa&&!Ib&&(Eb?(aa="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(aa="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp")));"mediump"===aa&&!Eb&&(aa="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp"));this.getContext=function(){return j};this.supportsVertexTextures=function(){return Ua};
-this.supportsFloatTextures=function(){return Tb};this.supportsStandardDerivatives=function(){return Nb};this.supportsCompressedTextureS3TC=function(){return eb};this.getMaxAnisotropy=function(){return Kb};this.getPrecision=function(){return aa};this.setSize=function(a,b,c){w.width=a*this.devicePixelRatio;w.height=b*this.devicePixelRatio;1!==this.devicePixelRatio&&!1!==c&&(w.style.width=a+"px",w.style.height=b+"px");this.setViewport(0,0,w.width,w.height)};this.setViewport=function(a,b,c,d){ea=void 0!==
-a?a:0;na=void 0!==b?b:0;Ia=void 0!==c?c:w.width;Qa=void 0!==d?d:w.height;j.viewport(ea,na,Ia,Qa)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColor=function(a,b){ia.set(a);Wa=void 0!==b?b:1;j.clearColor(ia.r,ia.g,ia.b,Wa)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=
+this.supportsFloatTextures=function(){return Tb};this.supportsStandardDerivatives=function(){return Nb};this.supportsCompressedTextureS3TC=function(){return eb};this.getMaxAnisotropy=function(){return Kb};this.getPrecision=function(){return aa};this.setSize=function(a,b,c){v.width=a*this.devicePixelRatio;v.height=b*this.devicePixelRatio;1!==this.devicePixelRatio&&!1!==c&&(v.style.width=a+"px",v.style.height=b+"px");this.setViewport(0,0,v.width,v.height)};this.setViewport=function(a,b,c,d){ea=void 0!==
+a?a:0;na=void 0!==b?b:0;Ia=void 0!==c?c:v.width;Qa=void 0!==d?d:v.height;j.viewport(ea,na,Ia,Qa)};this.setScissor=function(a,b,c,d){j.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?j.enable(j.SCISSOR_TEST):j.disable(j.SCISSOR_TEST)};this.setClearColor=function(a,b){ia.set(a);Wa=void 0!==b?b:1;j.clearColor(ia.r,ia.g,ia.b,Wa)};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=
 function(){return ia};this.getClearAlpha=function(){return Wa};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){ja=null;Ea=
 function(){return ia};this.getClearAlpha=function(){return Wa};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=j.COLOR_BUFFER_BIT;if(void 0===b||b)d|=j.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=j.STENCIL_BUFFER_BIT;j.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){ja=null;Ea=
 Za=xa=da=U=-1;wb=!0;fa=X=-1;this.shadowMapPlugin.update(a,b)};var lc=function(a){a=a.target;a.removeEventListener("dispose",lc);a.__webglInit=void 0;if(void 0!==a.geometryGroups)for(var b in a.geometryGroups){var c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)j.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals){d=0;for(e=c.numMorphNormals;d<e;d++)j.deleteBuffer(c.__webglMorphNormalsBuffers[d])}tc(c)}tc(a);M.info.memory.geometries--},
 Za=xa=da=U=-1;wb=!0;fa=X=-1;this.shadowMapPlugin.update(a,b)};var lc=function(a){a=a.target;a.removeEventListener("dispose",lc);a.__webglInit=void 0;if(void 0!==a.geometryGroups)for(var b in a.geometryGroups){var c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)j.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals){d=0;for(e=c.numMorphNormals;d<e;d++)j.deleteBuffer(c.__webglMorphNormalsBuffers[d])}tc(c)}tc(a);M.info.memory.geometries--},
 hc=function(a){a=a.target;a.removeEventListener("dispose",hc);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));M.info.memory.textures--},mc=function(a){a=a.target;a.removeEventListener("dispose",mc);if(a&&a.__webglTexture)if(j.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)j.deleteFramebuffer(a.__webglFramebuffer[b]),j.deleteRenderbuffer(a.__webglRenderbuffer[b]);
 hc=function(a){a=a.target;a.removeEventListener("dispose",hc);a.image&&a.image.__webglTextureCube?j.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,j.deleteTexture(a.__webglTexture));M.info.memory.textures--},mc=function(a){a=a.target;a.removeEventListener("dispose",mc);if(a&&a.__webglTexture)if(j.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)j.deleteFramebuffer(a.__webglFramebuffer[b]),j.deleteRenderbuffer(a.__webglRenderbuffer[b]);
@@ -442,81 +441,81 @@ uc=function(a){var b=a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1,a=0;
 a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=j.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=j.createBuffer());a.hasPositions&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormals){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,h,g,i,
 a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=j.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=j.createBuffer());a.hasPositions&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,a.positionArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.position),j.vertexAttribPointer(b.attributes.position,3,j.FLOAT,!1,0,0));if(a.hasNormals){j.bindBuffer(j.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,h,g,i,
 k,l,m,n,p,q=3*a.count;for(p=0;p<q;p+=9)n=a.normalArray,d=n[p],e=n[p+1],f=n[p+2],h=n[p+3],i=n[p+4],l=n[p+5],g=n[p+6],k=n[p+7],m=n[p+8],d=(d+h+g)/3,e=(e+i+k)/3,f=(f+l+m)/3,n[p]=d,n[p+1]=e,n[p+2]=f,n[p+3]=d,n[p+4]=e,n[p+5]=f,n[p+6]=d,n[p+7]=e,n[p+8]=f}j.bufferData(j.ARRAY_BUFFER,a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglUvBuffer),j.bufferData(j.ARRAY_BUFFER,
 k,l,m,n,p,q=3*a.count;for(p=0;p<q;p+=9)n=a.normalArray,d=n[p],e=n[p+1],f=n[p+2],h=n[p+3],i=n[p+4],l=n[p+5],g=n[p+6],k=n[p+7],m=n[p+8],d=(d+h+g)/3,e=(e+i+k)/3,f=(f+l+m)/3,n[p]=d,n[p+1]=e,n[p+2]=f,n[p+3]=d,n[p+4]=e,n[p+5]=f,n[p+6]=d,n[p+7]=e,n[p+8]=f}j.bufferData(j.ARRAY_BUFFER,a.normalArray,j.DYNAMIC_DRAW);j.enableVertexAttribArray(b.attributes.normal);j.vertexAttribPointer(b.attributes.normal,3,j.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglUvBuffer),j.bufferData(j.ARRAY_BUFFER,
 a.uvArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.uv),j.vertexAttribPointer(b.attributes.uv,2,j.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,a.colorArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.color),j.vertexAttribPointer(b.attributes.color,3,j.FLOAT,!1,0,0));j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var i,
 a.uvArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.uv),j.vertexAttribPointer(b.attributes.uv,2,j.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(j.bindBuffer(j.ARRAY_BUFFER,a.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,a.colorArray,j.DYNAMIC_DRAW),j.enableVertexAttribArray(b.attributes.color),j.vertexAttribPointer(b.attributes.color,3,j.FLOAT,!1,0,0));j.drawArrays(j.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var i,
-k,l,m;i=G(a,b,c,d,f);b=i.attributes;a=e.attributes;c=!1;i=16777215*e.id+2*i.id+(d.wireframe?1:0);i!==Za&&(Za=i,c=!0);c&&g();if(f instanceof THREE.Mesh)if(d=a.index){e=e.offsets;1<e.length&&(c=!0);for(var f=0,n=e.length;f<n;f++){var p=e[f].index;if(c){for(k in a)"index"!==k&&(l=b[k],i=a[k],m=i.itemSize,0<=l&&(j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,4*p*m)));j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,d.buffer)}j.drawElements(j.TRIANGLES,e[f].count,j.UNSIGNED_SHORT,
+k,l,m;i=C(a,b,c,d,f);b=i.attributes;a=e.attributes;c=!1;i=16777215*e.id+2*i.id+(d.wireframe?1:0);i!==Za&&(Za=i,c=!0);c&&g();if(f instanceof THREE.Mesh)if(d=a.index){e=e.offsets;1<e.length&&(c=!0);for(var f=0,n=e.length;f<n;f++){var p=e[f].index;if(c){for(k in a)"index"!==k&&(l=b[k],i=a[k],m=i.itemSize,0<=l&&(j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,4*p*m)));j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,d.buffer)}j.drawElements(j.TRIANGLES,e[f].count,j.UNSIGNED_SHORT,
 2*e[f].start);M.info.render.calls++;M.info.render.vertices+=e[f].count;M.info.render.faces+=e[f].count/3}}else{if(c)for(k in a)"index"!==k&&(l=b[k],i=a[k],m=i.itemSize,0<=l&&(j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)));a=e.attributes.position;j.drawArrays(j.TRIANGLES,0,a.numItems/3);M.info.render.calls++;M.info.render.vertices+=a.numItems/3;M.info.render.faces+=a.numItems/3/3}else if(f instanceof THREE.ParticleSystem){if(c){for(k in a)l=b[k],i=a[k],m=i.itemSize,
 2*e[f].start);M.info.render.calls++;M.info.render.vertices+=e[f].count;M.info.render.faces+=e[f].count/3}}else{if(c)for(k in a)"index"!==k&&(l=b[k],i=a[k],m=i.itemSize,0<=l&&(j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0)));a=e.attributes.position;j.drawArrays(j.TRIANGLES,0,a.numItems/3);M.info.render.calls++;M.info.render.vertices+=a.numItems/3;M.info.render.faces+=a.numItems/3/3}else if(f instanceof THREE.ParticleSystem){if(c){for(k in a)l=b[k],i=a[k],m=i.itemSize,
-0<=l&&(j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0));a=a.position;j.drawArrays(j.POINTS,0,a.numItems/3);M.info.render.calls++;M.info.render.points+=a.numItems/3}}else if(f instanceof THREE.Line&&c){for(k in a)l=b[k],i=a[k],m=i.itemSize,0<=l&&(j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0));k=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES;E(d.linewidth);a=a.position;j.drawArrays(k,0,a.numItems/3);M.info.render.calls++;M.info.render.points+=
-a.numItems}}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var i,l,c=G(a,b,c,d,f),a=c.attributes,b=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Za&&(Za=c,b=!0);b&&g();if(!d.morphTargets&&0<=a.position)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),j.vertexAttribPointer(a.position,3,j.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),
+0<=l&&(j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0));a=a.position;j.drawArrays(j.POINTS,0,a.numItems/3);M.info.render.calls++;M.info.render.points+=a.numItems/3}}else if(f instanceof THREE.Line&&c){for(k in a)l=b[k],i=a[k],m=i.itemSize,0<=l&&(j.bindBuffer(j.ARRAY_BUFFER,i.buffer),h(l),j.vertexAttribPointer(l,m,j.FLOAT,!1,0,0));k=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES;I(d.linewidth);a=a.position;j.drawArrays(k,0,a.numItems/3);M.info.render.calls++;M.info.render.points+=
+a.numItems}}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var i,l,c=C(a,b,c,d,f),a=c.attributes,b=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Za&&(Za=c,b=!0);b&&g();if(!d.morphTargets&&0<=a.position)b&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(a.position),j.vertexAttribPointer(a.position,3,j.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),
 h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0)):0<=c.position&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var m=0;l=f.morphTargetForcedOrder;for(i=f.morphTargetInfluences;m<d.numSupportedMorphTargets&&m<l.length;)0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l[m]]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,
 h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0)):0<=c.position&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglVertexBuffer),h(c.position),j.vertexAttribPointer(c.position,3,j.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var m=0;l=f.morphTargetForcedOrder;for(i=f.morphTargetInfluences;m<d.numSupportedMorphTargets&&m<l.length;)0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l[m]]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,
 !1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[m]]),h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=i[l[m]],m++}else{l=[];i=f.morphTargetInfluences;var n,p=i.length;for(n=0;n<p;n++)m=i[n],0<m&&l.push([m,n]);l.length>d.numSupportedMorphTargets?(l.sort(k),l.length=d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(k):0===l.length&&l.push([0,0]);for(m=0;m<
 !1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l[m]]),h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=i[l[m]],m++}else{l=[];i=f.morphTargetInfluences;var n,p=i.length;for(n=0;n<p;n++)m=i[n],0<m&&l.push([m,n]);l.length>d.numSupportedMorphTargets?(l.sort(k),l.length=d.numSupportedMorphTargets):l.length>d.numSupportedMorphNormals?l.sort(k):0===l.length&&l.push([0,0]);for(m=0;m<
 d.numSupportedMorphTargets;)l[m]?(n=l[m][1],0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[n]),h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=i[n]):f.__webglMorphTargetInfluences[m]=0,m++}null!==d.program.uniforms.morphTargetInfluences&&
 d.numSupportedMorphTargets;)l[m]?(n=l[m][1],0<=c["morphTarget"+m]&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n]),h(c["morphTarget"+m]),j.vertexAttribPointer(c["morphTarget"+m],3,j.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[n]),h(c["morphNormal"+m]),j.vertexAttribPointer(c["morphNormal"+m],3,j.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=i[n]):f.__webglMorphTargetInfluences[m]=0,m++}null!==d.program.uniforms.morphTargetInfluences&&
 j.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(b){if(e.__webglCustomAttributesList){i=0;for(l=e.__webglCustomAttributesList.length;i<l;i++)c=e.__webglCustomAttributesList[i],0<=a[c.buffer.belongsToAttribute]&&(j.bindBuffer(j.ARRAY_BUFFER,c.buffer),h(a[c.buffer.belongsToAttribute]),j.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,j.FLOAT,!1,0,0))}0<=a.color&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglColorBuffer),h(a.color),j.vertexAttribPointer(a.color,
 j.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(b){if(e.__webglCustomAttributesList){i=0;for(l=e.__webglCustomAttributesList.length;i<l;i++)c=e.__webglCustomAttributesList[i],0<=a[c.buffer.belongsToAttribute]&&(j.bindBuffer(j.ARRAY_BUFFER,c.buffer),h(a[c.buffer.belongsToAttribute]),j.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,j.FLOAT,!1,0,0))}0<=a.color&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglColorBuffer),h(a.color),j.vertexAttribPointer(a.color,
 3,j.FLOAT,!1,0,0));0<=a.normal&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglNormalBuffer),h(a.normal),j.vertexAttribPointer(a.normal,3,j.FLOAT,!1,0,0));0<=a.tangent&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglTangentBuffer),h(a.tangent),j.vertexAttribPointer(a.tangent,4,j.FLOAT,!1,0,0));0<=a.uv&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUVBuffer),h(a.uv),j.vertexAttribPointer(a.uv,2,j.FLOAT,!1,0,0));0<=a.uv2&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUV2Buffer),h(a.uv2),j.vertexAttribPointer(a.uv2,2,j.FLOAT,!1,0,0));
 3,j.FLOAT,!1,0,0));0<=a.normal&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglNormalBuffer),h(a.normal),j.vertexAttribPointer(a.normal,3,j.FLOAT,!1,0,0));0<=a.tangent&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglTangentBuffer),h(a.tangent),j.vertexAttribPointer(a.tangent,4,j.FLOAT,!1,0,0));0<=a.uv&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUVBuffer),h(a.uv),j.vertexAttribPointer(a.uv,2,j.FLOAT,!1,0,0));0<=a.uv2&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglUV2Buffer),h(a.uv2),j.vertexAttribPointer(a.uv2,2,j.FLOAT,!1,0,0));
-d.skinning&&(0<=a.skinIndex&&0<=a.skinWeight)&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),h(a.skinIndex),j.vertexAttribPointer(a.skinIndex,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),h(a.skinWeight),j.vertexAttribPointer(a.skinWeight,4,j.FLOAT,!1,0,0));0<=a.lineDistance&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglLineDistanceBuffer),h(a.lineDistance),j.vertexAttribPointer(a.lineDistance,1,j.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(E(d.wireframeLinewidth),
-b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,j.UNSIGNED_SHORT,0)),M.info.render.calls++,M.info.render.vertices+=e.__webglFaceCount,M.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES,E(d.linewidth),j.drawArrays(f,0,e.__webglLineCount),M.info.render.calls++):
+d.skinning&&(0<=a.skinIndex&&0<=a.skinWeight)&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),h(a.skinIndex),j.vertexAttribPointer(a.skinIndex,4,j.FLOAT,!1,0,0),j.bindBuffer(j.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),h(a.skinWeight),j.vertexAttribPointer(a.skinWeight,4,j.FLOAT,!1,0,0));0<=a.lineDistance&&(j.bindBuffer(j.ARRAY_BUFFER,e.__webglLineDistanceBuffer),h(a.lineDistance),j.vertexAttribPointer(a.lineDistance,1,j.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(I(d.wireframeLinewidth),
+b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),j.drawElements(j.LINES,e.__webglLineCount,j.UNSIGNED_SHORT,0)):(b&&j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),j.drawElements(j.TRIANGLES,e.__webglFaceCount,j.UNSIGNED_SHORT,0)),M.info.render.calls++,M.info.render.vertices+=e.__webglFaceCount,M.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?j.LINE_STRIP:j.LINES,I(d.linewidth),j.drawArrays(f,0,e.__webglLineCount),M.info.render.calls++):
 f instanceof THREE.ParticleSystem?(j.drawArrays(j.POINTS,0,e.__webglParticleCount),M.info.render.calls++,M.info.render.points+=e.__webglParticleCount):f instanceof THREE.Ribbon&&(j.drawArrays(j.TRIANGLE_STRIP,0,e.__webglVertexCount),M.info.render.calls++)}};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,h,g,k=a.__lights,p=a.fog;Ea=-1;wb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();
 f instanceof THREE.ParticleSystem?(j.drawArrays(j.POINTS,0,e.__webglParticleCount),M.info.render.calls++,M.info.render.points+=e.__webglParticleCount):f instanceof THREE.Ribbon&&(j.drawArrays(j.TRIANGLE_STRIP,0,e.__webglVertexCount),M.info.render.calls++)}};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,h,g,k=a.__lights,p=a.fog;Ea=-1;wb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();
 void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);vb.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ub.setFromMatrix(vb);this.autoUpdateObjects&&this.initWebGLObjects(a);l(this.renderPluginsPre,a,b);M.info.render.calls=0;M.info.render.vertices=0;M.info.render.faces=0;M.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);g=a.__webglObjects;d=0;for(e=g.length;d<e;d++)if(f=
 void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);vb.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ub.setFromMatrix(vb);this.autoUpdateObjects&&this.initWebGLObjects(a);l(this.renderPluginsPre,a,b);M.info.render.calls=0;M.info.render.vertices=0;M.info.render.faces=0;M.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);g=a.__webglObjects;d=0;for(e=g.length;d<e;d++)if(f=
-g[d],h=f.object,f.id=d,f.render=!1,h.visible&&(!(h instanceof THREE.Mesh||h instanceof THREE.ParticleSystem)||!h.frustumCulled||Ub.intersectsObject(h))){var q=h;q._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,q.matrixWorld);q._normalMatrix.getNormalMatrix(q._modelViewMatrix);var q=f,r=q.buffer,s=void 0,t=s=void 0,t=q.object.material;if(t instanceof THREE.MeshFaceMaterial)s=r.materialIndex,s=t.materials[s],s.transparent?(q.transparent=s,q.opaque=null):(q.opaque=s,q.transparent=null);else if(s=
-t)s.transparent?(q.transparent=s,q.opaque=null):(q.opaque=s,q.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==h.renderDepth?f.z=h.renderDepth:(ra.getPositionFromMatrix(h.matrixWorld),ra.applyProjection(vb),f.z=ra.z))}this.sortObjects&&g.sort(i);g=a.__webglObjectsImmediate;d=0;for(e=g.length;d<e;d++)f=g[d],h=f.object,h.visible&&(h._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,h.matrixWorld),h._normalMatrix.getNormalMatrix(h._modelViewMatrix),h=f.object.material,h.transparent?
-(f.transparent=h,f.opaque=null):(f.opaque=h,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),A(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(a.__webglObjects,!1,"",b,k,p,!0,d),n(a.__webglObjectsImmediate,"",b,k,p,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(a.__webglObjects,!0,"opaque",b,k,p,!1,d),n(a.__webglObjectsImmediate,"opaque",
+g[d],h=f.object,f.id=d,f.render=!1,h.visible&&(!(h instanceof THREE.Mesh||h instanceof THREE.ParticleSystem)||!h.frustumCulled||Ub.intersectsObject(h))){var q=h;q._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,q.matrixWorld);q._normalMatrix.getNormalMatrix(q._modelViewMatrix);var q=f,t=q.buffer,r=void 0,s=r=void 0,s=q.object.material;if(s instanceof THREE.MeshFaceMaterial)r=t.materialIndex,r=s.materials[r],r.transparent?(q.transparent=r,q.opaque=null):(q.opaque=r,q.transparent=null);else if(r=
+s)r.transparent?(q.transparent=r,q.opaque=null):(q.opaque=r,q.transparent=null);f.render=!0;!0===this.sortObjects&&(null!==h.renderDepth?f.z=h.renderDepth:(ra.getPositionFromMatrix(h.matrixWorld),ra.applyProjection(vb),f.z=ra.z))}this.sortObjects&&g.sort(i);g=a.__webglObjectsImmediate;d=0;for(e=g.length;d<e;d++)f=g[d],h=f.object,h.visible&&(h._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,h.matrixWorld),h._normalMatrix.getNormalMatrix(h._modelViewMatrix),h=f.object.material,h.transparent?
+(f.transparent=h,f.opaque=null):(f.opaque=h,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),B(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(a.__webglObjects,!1,"",b,k,p,!0,d),n(a.__webglObjectsImmediate,"",b,k,p,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(a.__webglObjects,!0,"opaque",b,k,p,!1,d),n(a.__webglObjectsImmediate,"opaque",
 b,k,p,!1,d),m(a.__webglObjects,!1,"transparent",b,k,p,!0,d),n(a.__webglObjectsImmediate,"transparent",b,k,p,!0,d));l(this.renderPluginsPost,a,b);c&&(c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter)&&(c instanceof THREE.WebGLRenderTargetCube?(j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture),j.generateMipmap(j.TEXTURE_CUBE_MAP),j.bindTexture(j.TEXTURE_CUBE_MAP,null)):(j.bindTexture(j.TEXTURE_2D,c.__webglTexture),j.generateMipmap(j.TEXTURE_2D),j.bindTexture(j.TEXTURE_2D,
 b,k,p,!1,d),m(a.__webglObjects,!1,"transparent",b,k,p,!0,d),n(a.__webglObjectsImmediate,"transparent",b,k,p,!0,d));l(this.renderPluginsPost,a,b);c&&(c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter)&&(c instanceof THREE.WebGLRenderTargetCube?(j.bindTexture(j.TEXTURE_CUBE_MAP,c.__webglTexture),j.generateMipmap(j.TEXTURE_CUBE_MAP),j.bindTexture(j.TEXTURE_CUBE_MAP,null)):(j.bindTexture(j.TEXTURE_2D,c.__webglTexture),j.generateMipmap(j.TEXTURE_2D),j.bindTexture(j.TEXTURE_2D,
-null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=G(a,b,c,d,e);Za=-1;M.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,Ub):e.render(function(a){M.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)q(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)s(a.__objectsRemoved[0],
-a),a.__objectsRemoved.splice(0,1);for(var b=0,h=a.__webglObjects.length;b<h;b++){var g=a.__webglObjects[b].object;void 0===g.__webglInit&&(void 0!==g.__webglActive&&s(g,a),q(g,a));var i=g,l=i.geometry,m=void 0,n=void 0,t=void 0;if(l instanceof THREE.BufferGeometry){var u=j.DYNAMIC_DRAW,z=!l.dynamic,w=l.attributes,y=void 0,A=void 0;for(y in w)A=w[y],A.needsUpdate&&("index"===y?(j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,A.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,A.array,u)):(j.bindBuffer(j.ARRAY_BUFFER,
-A.buffer),j.bufferData(j.ARRAY_BUFFER,A.array,u)),A.needsUpdate=!1),z&&!A.dynamic&&(A.array=null)}else if(i instanceof THREE.Mesh){for(var C=0,G=l.geometryGroupsList.length;C<G;C++)if(m=l.geometryGroupsList[C],t=d(i,m),l.buffersNeedUpdate&&c(m,i),n=t.attributes&&p(t),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||n){var B=m,E=i,F=j.DYNAMIC_DRAW,I=!l.dynamic,J=t;if(B.__inittedArrays){var K=e(J),M=
+null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=C(a,b,c,d,e);Za=-1;M.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,j,Ub):e.render(function(a){M.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)t(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)r(a.__objectsRemoved[0],
+a),a.__objectsRemoved.splice(0,1);for(var b=0,h=a.__webglObjects.length;b<h;b++){var g=a.__webglObjects[b].object;void 0===g.__webglInit&&(void 0!==g.__webglActive&&r(g,a),t(g,a));var i=g,m=i.geometry,l=void 0,n=void 0,s=void 0;if(m instanceof THREE.BufferGeometry){var w=j.DYNAMIC_DRAW,v=!m.dynamic,z=m.attributes,y=void 0,A=void 0;for(y in z)A=z[y],A.needsUpdate&&("index"===y?(j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,A.buffer),j.bufferData(j.ELEMENT_ARRAY_BUFFER,A.array,w)):(j.bindBuffer(j.ARRAY_BUFFER,
+A.buffer),j.bufferData(j.ARRAY_BUFFER,A.array,w)),A.needsUpdate=!1),v&&!A.dynamic&&(A.array=null)}else if(i instanceof THREE.Mesh){for(var B=0,F=m.geometryGroupsList.length;B<F;B++)if(l=m.geometryGroupsList[B],s=d(i,l),m.buffersNeedUpdate&&c(l,i),n=s.attributes&&q(s),m.verticesNeedUpdate||m.morphTargetsNeedUpdate||m.elementsNeedUpdate||m.uvsNeedUpdate||m.normalsNeedUpdate||m.colorsNeedUpdate||m.tangentsNeedUpdate||n){var C=l,G=i,E=j.DYNAMIC_DRAW,I=!m.dynamic,J=s;if(C.__inittedArrays){var K=e(J),M=
 J.vertexColors?J.vertexColors:!1,O=f(J),L=K===THREE.SmoothShading,D=void 0,H=void 0,N=void 0,P=void 0,Q=void 0,U=void 0,X=void 0,ja=void 0,V=void 0,pa=void 0,aa=void 0,S=void 0,T=void 0,R=void 0,ba=void 0,da=void 0,fa=void 0,Fa=void 0,ia=void 0,ea=void 0,ha=void 0,Ea=void 0,Oa=void 0,ka=void 0,oa=void 0,la=void 0,ta=void 0,na=void 0,qa=void 0,sa=void 0,Ba=void 0,ua=void 0,Za=void 0,xa=void 0,Pa=void 0,ya=void 0,Ya=void 0,Ia=void 0,ob=void 0,Wa=void 0,bb=void 0,eb=void 0,$a=void 0,ab=void 0,Sa=void 0,
 J.vertexColors?J.vertexColors:!1,O=f(J),L=K===THREE.SmoothShading,D=void 0,H=void 0,N=void 0,P=void 0,Q=void 0,U=void 0,X=void 0,ja=void 0,V=void 0,pa=void 0,aa=void 0,S=void 0,T=void 0,R=void 0,ba=void 0,da=void 0,fa=void 0,Fa=void 0,ia=void 0,ea=void 0,ha=void 0,Ea=void 0,Oa=void 0,ka=void 0,oa=void 0,la=void 0,ta=void 0,na=void 0,qa=void 0,sa=void 0,Ba=void 0,ua=void 0,Za=void 0,xa=void 0,Pa=void 0,ya=void 0,Ya=void 0,Ia=void 0,ob=void 0,Wa=void 0,bb=void 0,eb=void 0,$a=void 0,ab=void 0,Sa=void 0,
-Qa=void 0,Ra=0,Xa=0,Ta=0,Ua=0,Ja=0,ib=0,Ca=0,nb=0,Va=0,Z=0,ga=0,x=0,za=void 0,cb=B.__vertexArray,hb=B.__uvArray,kb=B.__uv2Array,Bb=B.__normalArray,Ka=B.__tangentArray,db=B.__colorArray,La=B.__skinIndexArray,Ma=B.__skinWeightArray,wb=B.__morphTargetsArrays,xb=B.__morphNormalsArrays,Ab=B.__webglCustomAttributesList,v=void 0,Ob=B.__faceArray,ub=B.__lineArray,pb=E.geometry,Jb=pb.elementsNeedUpdate,Eb=pb.uvsNeedUpdate,Tb=pb.normalsNeedUpdate,Ub=pb.tangentsNeedUpdate,Vb=pb.colorsNeedUpdate,Wb=pb.morphTargetsNeedUpdate,
-dc=pb.vertices,va=B.faces3,wa=B.faces4,jb=pb.faces,Lb=pb.faceVertexUvs[0],Nb=pb.faceVertexUvs[1],ec=pb.skinIndices,ac=pb.skinWeights,bc=pb.morphTargets,Ib=pb.morphNormals;if(pb.verticesNeedUpdate){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],S=dc[P.a],T=dc[P.b],R=dc[P.c],cb[Xa]=S.x,cb[Xa+1]=S.y,cb[Xa+2]=S.z,cb[Xa+3]=T.x,cb[Xa+4]=T.y,cb[Xa+5]=T.z,cb[Xa+6]=R.x,cb[Xa+7]=R.y,cb[Xa+8]=R.z,Xa+=9;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],S=dc[P.a],T=dc[P.b],R=dc[P.c],ba=dc[P.d],cb[Xa]=S.x,cb[Xa+1]=S.y,cb[Xa+2]=
-S.z,cb[Xa+3]=T.x,cb[Xa+4]=T.y,cb[Xa+5]=T.z,cb[Xa+6]=R.x,cb[Xa+7]=R.y,cb[Xa+8]=R.z,cb[Xa+9]=ba.x,cb[Xa+10]=ba.y,cb[Xa+11]=ba.z,Xa+=12;j.bindBuffer(j.ARRAY_BUFFER,B.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,cb,F)}if(Wb){bb=0;for(eb=bc.length;bb<eb;bb++){D=ga=0;for(H=va.length;D<H;D++)Sa=va[D],P=jb[Sa],S=bc[bb].vertices[P.a],T=bc[bb].vertices[P.b],R=bc[bb].vertices[P.c],$a=wb[bb],$a[ga]=S.x,$a[ga+1]=S.y,$a[ga+2]=S.z,$a[ga+3]=T.x,$a[ga+4]=T.y,$a[ga+5]=T.z,$a[ga+6]=R.x,$a[ga+7]=R.y,$a[ga+8]=R.z,
+Qa=void 0,Ra=0,Xa=0,Ta=0,Ua=0,Ja=0,ib=0,Ca=0,nb=0,Va=0,Z=0,ga=0,x=0,za=void 0,cb=C.__vertexArray,hb=C.__uvArray,kb=C.__uv2Array,Bb=C.__normalArray,Ka=C.__tangentArray,db=C.__colorArray,La=C.__skinIndexArray,Ma=C.__skinWeightArray,wb=C.__morphTargetsArrays,xb=C.__morphNormalsArrays,Ab=C.__webglCustomAttributesList,u=void 0,Ob=C.__faceArray,ub=C.__lineArray,pb=G.geometry,Jb=pb.elementsNeedUpdate,Eb=pb.uvsNeedUpdate,Tb=pb.normalsNeedUpdate,Ub=pb.tangentsNeedUpdate,Vb=pb.colorsNeedUpdate,Wb=pb.morphTargetsNeedUpdate,
+dc=pb.vertices,va=C.faces3,wa=C.faces4,jb=pb.faces,Lb=pb.faceVertexUvs[0],Nb=pb.faceVertexUvs[1],ec=pb.skinIndices,ac=pb.skinWeights,bc=pb.morphTargets,Ib=pb.morphNormals;if(pb.verticesNeedUpdate){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],S=dc[P.a],T=dc[P.b],R=dc[P.c],cb[Xa]=S.x,cb[Xa+1]=S.y,cb[Xa+2]=S.z,cb[Xa+3]=T.x,cb[Xa+4]=T.y,cb[Xa+5]=T.z,cb[Xa+6]=R.x,cb[Xa+7]=R.y,cb[Xa+8]=R.z,Xa+=9;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],S=dc[P.a],T=dc[P.b],R=dc[P.c],ba=dc[P.d],cb[Xa]=S.x,cb[Xa+1]=S.y,cb[Xa+2]=
+S.z,cb[Xa+3]=T.x,cb[Xa+4]=T.y,cb[Xa+5]=T.z,cb[Xa+6]=R.x,cb[Xa+7]=R.y,cb[Xa+8]=R.z,cb[Xa+9]=ba.x,cb[Xa+10]=ba.y,cb[Xa+11]=ba.z,Xa+=12;j.bindBuffer(j.ARRAY_BUFFER,C.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,cb,E)}if(Wb){bb=0;for(eb=bc.length;bb<eb;bb++){D=ga=0;for(H=va.length;D<H;D++)Sa=va[D],P=jb[Sa],S=bc[bb].vertices[P.a],T=bc[bb].vertices[P.b],R=bc[bb].vertices[P.c],$a=wb[bb],$a[ga]=S.x,$a[ga+1]=S.y,$a[ga+2]=S.z,$a[ga+3]=T.x,$a[ga+4]=T.y,$a[ga+5]=T.z,$a[ga+6]=R.x,$a[ga+7]=R.y,$a[ga+8]=R.z,
 J.morphNormals&&(L?(Qa=Ib[bb].vertexNormals[Sa],ea=Qa.a,ha=Qa.b,Ea=Qa.c):Ea=ha=ea=Ib[bb].faceNormals[Sa],ab=xb[bb],ab[ga]=ea.x,ab[ga+1]=ea.y,ab[ga+2]=ea.z,ab[ga+3]=ha.x,ab[ga+4]=ha.y,ab[ga+5]=ha.z,ab[ga+6]=Ea.x,ab[ga+7]=Ea.y,ab[ga+8]=Ea.z),ga+=9;D=0;for(H=wa.length;D<H;D++)Sa=wa[D],P=jb[Sa],S=bc[bb].vertices[P.a],T=bc[bb].vertices[P.b],R=bc[bb].vertices[P.c],ba=bc[bb].vertices[P.d],$a=wb[bb],$a[ga]=S.x,$a[ga+1]=S.y,$a[ga+2]=S.z,$a[ga+3]=T.x,$a[ga+4]=T.y,$a[ga+5]=T.z,$a[ga+6]=R.x,$a[ga+7]=R.y,$a[ga+
 J.morphNormals&&(L?(Qa=Ib[bb].vertexNormals[Sa],ea=Qa.a,ha=Qa.b,Ea=Qa.c):Ea=ha=ea=Ib[bb].faceNormals[Sa],ab=xb[bb],ab[ga]=ea.x,ab[ga+1]=ea.y,ab[ga+2]=ea.z,ab[ga+3]=ha.x,ab[ga+4]=ha.y,ab[ga+5]=ha.z,ab[ga+6]=Ea.x,ab[ga+7]=Ea.y,ab[ga+8]=Ea.z),ga+=9;D=0;for(H=wa.length;D<H;D++)Sa=wa[D],P=jb[Sa],S=bc[bb].vertices[P.a],T=bc[bb].vertices[P.b],R=bc[bb].vertices[P.c],ba=bc[bb].vertices[P.d],$a=wb[bb],$a[ga]=S.x,$a[ga+1]=S.y,$a[ga+2]=S.z,$a[ga+3]=T.x,$a[ga+4]=T.y,$a[ga+5]=T.z,$a[ga+6]=R.x,$a[ga+7]=R.y,$a[ga+
-8]=R.z,$a[ga+9]=ba.x,$a[ga+10]=ba.y,$a[ga+11]=ba.z,J.morphNormals&&(L?(Qa=Ib[bb].vertexNormals[Sa],ea=Qa.a,ha=Qa.b,Ea=Qa.c,Oa=Qa.d):Oa=Ea=ha=ea=Ib[bb].faceNormals[Sa],ab=xb[bb],ab[ga]=ea.x,ab[ga+1]=ea.y,ab[ga+2]=ea.z,ab[ga+3]=ha.x,ab[ga+4]=ha.y,ab[ga+5]=ha.z,ab[ga+6]=Ea.x,ab[ga+7]=Ea.y,ab[ga+8]=Ea.z,ab[ga+9]=Oa.x,ab[ga+10]=Oa.y,ab[ga+11]=Oa.z),ga+=12;j.bindBuffer(j.ARRAY_BUFFER,B.__webglMorphTargetsBuffers[bb]);j.bufferData(j.ARRAY_BUFFER,wb[bb],F);J.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,B.__webglMorphNormalsBuffers[bb]),
-j.bufferData(j.ARRAY_BUFFER,xb[bb],F))}}if(ac.length){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],na=ac[P.a],qa=ac[P.b],sa=ac[P.c],Ma[Z]=na.x,Ma[Z+1]=na.y,Ma[Z+2]=na.z,Ma[Z+3]=na.w,Ma[Z+4]=qa.x,Ma[Z+5]=qa.y,Ma[Z+6]=qa.z,Ma[Z+7]=qa.w,Ma[Z+8]=sa.x,Ma[Z+9]=sa.y,Ma[Z+10]=sa.z,Ma[Z+11]=sa.w,ua=ec[P.a],Za=ec[P.b],xa=ec[P.c],La[Z]=ua.x,La[Z+1]=ua.y,La[Z+2]=ua.z,La[Z+3]=ua.w,La[Z+4]=Za.x,La[Z+5]=Za.y,La[Z+6]=Za.z,La[Z+7]=Za.w,La[Z+8]=xa.x,La[Z+9]=xa.y,La[Z+10]=xa.z,La[Z+11]=xa.w,Z+=12;D=0;for(H=wa.length;D<H;D++)P=
+8]=R.z,$a[ga+9]=ba.x,$a[ga+10]=ba.y,$a[ga+11]=ba.z,J.morphNormals&&(L?(Qa=Ib[bb].vertexNormals[Sa],ea=Qa.a,ha=Qa.b,Ea=Qa.c,Oa=Qa.d):Oa=Ea=ha=ea=Ib[bb].faceNormals[Sa],ab=xb[bb],ab[ga]=ea.x,ab[ga+1]=ea.y,ab[ga+2]=ea.z,ab[ga+3]=ha.x,ab[ga+4]=ha.y,ab[ga+5]=ha.z,ab[ga+6]=Ea.x,ab[ga+7]=Ea.y,ab[ga+8]=Ea.z,ab[ga+9]=Oa.x,ab[ga+10]=Oa.y,ab[ga+11]=Oa.z),ga+=12;j.bindBuffer(j.ARRAY_BUFFER,C.__webglMorphTargetsBuffers[bb]);j.bufferData(j.ARRAY_BUFFER,wb[bb],E);J.morphNormals&&(j.bindBuffer(j.ARRAY_BUFFER,C.__webglMorphNormalsBuffers[bb]),
+j.bufferData(j.ARRAY_BUFFER,xb[bb],E))}}if(ac.length){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],na=ac[P.a],qa=ac[P.b],sa=ac[P.c],Ma[Z]=na.x,Ma[Z+1]=na.y,Ma[Z+2]=na.z,Ma[Z+3]=na.w,Ma[Z+4]=qa.x,Ma[Z+5]=qa.y,Ma[Z+6]=qa.z,Ma[Z+7]=qa.w,Ma[Z+8]=sa.x,Ma[Z+9]=sa.y,Ma[Z+10]=sa.z,Ma[Z+11]=sa.w,ua=ec[P.a],Za=ec[P.b],xa=ec[P.c],La[Z]=ua.x,La[Z+1]=ua.y,La[Z+2]=ua.z,La[Z+3]=ua.w,La[Z+4]=Za.x,La[Z+5]=Za.y,La[Z+6]=Za.z,La[Z+7]=Za.w,La[Z+8]=xa.x,La[Z+9]=xa.y,La[Z+10]=xa.z,La[Z+11]=xa.w,Z+=12;D=0;for(H=wa.length;D<H;D++)P=
 jb[wa[D]],na=ac[P.a],qa=ac[P.b],sa=ac[P.c],Ba=ac[P.d],Ma[Z]=na.x,Ma[Z+1]=na.y,Ma[Z+2]=na.z,Ma[Z+3]=na.w,Ma[Z+4]=qa.x,Ma[Z+5]=qa.y,Ma[Z+6]=qa.z,Ma[Z+7]=qa.w,Ma[Z+8]=sa.x,Ma[Z+9]=sa.y,Ma[Z+10]=sa.z,Ma[Z+11]=sa.w,Ma[Z+12]=Ba.x,Ma[Z+13]=Ba.y,Ma[Z+14]=Ba.z,Ma[Z+15]=Ba.w,ua=ec[P.a],Za=ec[P.b],xa=ec[P.c],Pa=ec[P.d],La[Z]=ua.x,La[Z+1]=ua.y,La[Z+2]=ua.z,La[Z+3]=ua.w,La[Z+4]=Za.x,La[Z+5]=Za.y,La[Z+6]=Za.z,La[Z+7]=Za.w,La[Z+8]=xa.x,La[Z+9]=xa.y,La[Z+10]=xa.z,La[Z+11]=xa.w,La[Z+12]=Pa.x,La[Z+13]=Pa.y,La[Z+14]=
 jb[wa[D]],na=ac[P.a],qa=ac[P.b],sa=ac[P.c],Ba=ac[P.d],Ma[Z]=na.x,Ma[Z+1]=na.y,Ma[Z+2]=na.z,Ma[Z+3]=na.w,Ma[Z+4]=qa.x,Ma[Z+5]=qa.y,Ma[Z+6]=qa.z,Ma[Z+7]=qa.w,Ma[Z+8]=sa.x,Ma[Z+9]=sa.y,Ma[Z+10]=sa.z,Ma[Z+11]=sa.w,Ma[Z+12]=Ba.x,Ma[Z+13]=Ba.y,Ma[Z+14]=Ba.z,Ma[Z+15]=Ba.w,ua=ec[P.a],Za=ec[P.b],xa=ec[P.c],Pa=ec[P.d],La[Z]=ua.x,La[Z+1]=ua.y,La[Z+2]=ua.z,La[Z+3]=ua.w,La[Z+4]=Za.x,La[Z+5]=Za.y,La[Z+6]=Za.z,La[Z+7]=Za.w,La[Z+8]=xa.x,La[Z+9]=xa.y,La[Z+10]=xa.z,La[Z+11]=xa.w,La[Z+12]=Pa.x,La[Z+13]=Pa.y,La[Z+14]=
-Pa.z,La[Z+15]=Pa.w,Z+=16;0<Z&&(j.bindBuffer(j.ARRAY_BUFFER,B.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,La,F),j.bindBuffer(j.ARRAY_BUFFER,B.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,Ma,F))}if(Vb&&M){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],X=P.vertexColors,ja=P.color,3===X.length&&M===THREE.VertexColors?(ka=X[0],oa=X[1],la=X[2]):la=oa=ka=ja,db[Va]=ka.r,db[Va+1]=ka.g,db[Va+2]=ka.b,db[Va+3]=oa.r,db[Va+4]=oa.g,db[Va+5]=oa.b,db[Va+6]=la.r,db[Va+7]=la.g,db[Va+8]=la.b,Va+=9;D=0;for(H=
-wa.length;D<H;D++)P=jb[wa[D]],X=P.vertexColors,ja=P.color,4===X.length&&M===THREE.VertexColors?(ka=X[0],oa=X[1],la=X[2],ta=X[3]):ta=la=oa=ka=ja,db[Va]=ka.r,db[Va+1]=ka.g,db[Va+2]=ka.b,db[Va+3]=oa.r,db[Va+4]=oa.g,db[Va+5]=oa.b,db[Va+6]=la.r,db[Va+7]=la.g,db[Va+8]=la.b,db[Va+9]=ta.r,db[Va+10]=ta.g,db[Va+11]=ta.b,Va+=12;0<Va&&(j.bindBuffer(j.ARRAY_BUFFER,B.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,db,F))}if(Ub&&pb.hasTangents){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],V=P.vertexTangents,da=V[0],
+Pa.z,La[Z+15]=Pa.w,Z+=16;0<Z&&(j.bindBuffer(j.ARRAY_BUFFER,C.__webglSkinIndicesBuffer),j.bufferData(j.ARRAY_BUFFER,La,E),j.bindBuffer(j.ARRAY_BUFFER,C.__webglSkinWeightsBuffer),j.bufferData(j.ARRAY_BUFFER,Ma,E))}if(Vb&&M){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],X=P.vertexColors,ja=P.color,3===X.length&&M===THREE.VertexColors?(ka=X[0],oa=X[1],la=X[2]):la=oa=ka=ja,db[Va]=ka.r,db[Va+1]=ka.g,db[Va+2]=ka.b,db[Va+3]=oa.r,db[Va+4]=oa.g,db[Va+5]=oa.b,db[Va+6]=la.r,db[Va+7]=la.g,db[Va+8]=la.b,Va+=9;D=0;for(H=
+wa.length;D<H;D++)P=jb[wa[D]],X=P.vertexColors,ja=P.color,4===X.length&&M===THREE.VertexColors?(ka=X[0],oa=X[1],la=X[2],ta=X[3]):ta=la=oa=ka=ja,db[Va]=ka.r,db[Va+1]=ka.g,db[Va+2]=ka.b,db[Va+3]=oa.r,db[Va+4]=oa.g,db[Va+5]=oa.b,db[Va+6]=la.r,db[Va+7]=la.g,db[Va+8]=la.b,db[Va+9]=ta.r,db[Va+10]=ta.g,db[Va+11]=ta.b,Va+=12;0<Va&&(j.bindBuffer(j.ARRAY_BUFFER,C.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,db,E))}if(Ub&&pb.hasTangents){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],V=P.vertexTangents,da=V[0],
 fa=V[1],Fa=V[2],Ka[Ca]=da.x,Ka[Ca+1]=da.y,Ka[Ca+2]=da.z,Ka[Ca+3]=da.w,Ka[Ca+4]=fa.x,Ka[Ca+5]=fa.y,Ka[Ca+6]=fa.z,Ka[Ca+7]=fa.w,Ka[Ca+8]=Fa.x,Ka[Ca+9]=Fa.y,Ka[Ca+10]=Fa.z,Ka[Ca+11]=Fa.w,Ca+=12;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],V=P.vertexTangents,da=V[0],fa=V[1],Fa=V[2],ia=V[3],Ka[Ca]=da.x,Ka[Ca+1]=da.y,Ka[Ca+2]=da.z,Ka[Ca+3]=da.w,Ka[Ca+4]=fa.x,Ka[Ca+5]=fa.y,Ka[Ca+6]=fa.z,Ka[Ca+7]=fa.w,Ka[Ca+8]=Fa.x,Ka[Ca+9]=Fa.y,Ka[Ca+10]=Fa.z,Ka[Ca+11]=Fa.w,Ka[Ca+12]=ia.x,Ka[Ca+13]=ia.y,Ka[Ca+14]=ia.z,Ka[Ca+
 fa=V[1],Fa=V[2],Ka[Ca]=da.x,Ka[Ca+1]=da.y,Ka[Ca+2]=da.z,Ka[Ca+3]=da.w,Ka[Ca+4]=fa.x,Ka[Ca+5]=fa.y,Ka[Ca+6]=fa.z,Ka[Ca+7]=fa.w,Ka[Ca+8]=Fa.x,Ka[Ca+9]=Fa.y,Ka[Ca+10]=Fa.z,Ka[Ca+11]=Fa.w,Ca+=12;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],V=P.vertexTangents,da=V[0],fa=V[1],Fa=V[2],ia=V[3],Ka[Ca]=da.x,Ka[Ca+1]=da.y,Ka[Ca+2]=da.z,Ka[Ca+3]=da.w,Ka[Ca+4]=fa.x,Ka[Ca+5]=fa.y,Ka[Ca+6]=fa.z,Ka[Ca+7]=fa.w,Ka[Ca+8]=Fa.x,Ka[Ca+9]=Fa.y,Ka[Ca+10]=Fa.z,Ka[Ca+11]=Fa.w,Ka[Ca+12]=ia.x,Ka[Ca+13]=ia.y,Ka[Ca+14]=ia.z,Ka[Ca+
-15]=ia.w,Ca+=16;j.bindBuffer(j.ARRAY_BUFFER,B.__webglTangentBuffer);j.bufferData(j.ARRAY_BUFFER,Ka,F)}if(Tb&&K){D=0;for(H=va.length;D<H;D++)if(P=jb[va[D]],Q=P.vertexNormals,U=P.normal,3===Q.length&&L)for(ya=0;3>ya;ya++)Ia=Q[ya],Bb[ib]=Ia.x,Bb[ib+1]=Ia.y,Bb[ib+2]=Ia.z,ib+=3;else for(ya=0;3>ya;ya++)Bb[ib]=U.x,Bb[ib+1]=U.y,Bb[ib+2]=U.z,ib+=3;D=0;for(H=wa.length;D<H;D++)if(P=jb[wa[D]],Q=P.vertexNormals,U=P.normal,4===Q.length&&L)for(ya=0;4>ya;ya++)Ia=Q[ya],Bb[ib]=Ia.x,Bb[ib+1]=Ia.y,Bb[ib+2]=Ia.z,ib+=
-3;else for(ya=0;4>ya;ya++)Bb[ib]=U.x,Bb[ib+1]=U.y,Bb[ib+2]=U.z,ib+=3;j.bindBuffer(j.ARRAY_BUFFER,B.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Bb,F)}if(Eb&&Lb&&O){D=0;for(H=va.length;D<H;D++)if(N=va[D],pa=Lb[N],void 0!==pa)for(ya=0;3>ya;ya++)ob=pa[ya],hb[Ta]=ob.x,hb[Ta+1]=ob.y,Ta+=2;D=0;for(H=wa.length;D<H;D++)if(N=wa[D],pa=Lb[N],void 0!==pa)for(ya=0;4>ya;ya++)ob=pa[ya],hb[Ta]=ob.x,hb[Ta+1]=ob.y,Ta+=2;0<Ta&&(j.bindBuffer(j.ARRAY_BUFFER,B.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,hb,F))}if(Eb&&
-Nb&&O){D=0;for(H=va.length;D<H;D++)if(N=va[D],aa=Nb[N],void 0!==aa)for(ya=0;3>ya;ya++)Wa=aa[ya],kb[Ua]=Wa.x,kb[Ua+1]=Wa.y,Ua+=2;D=0;for(H=wa.length;D<H;D++)if(N=wa[D],aa=Nb[N],void 0!==aa)for(ya=0;4>ya;ya++)Wa=aa[ya],kb[Ua]=Wa.x,kb[Ua+1]=Wa.y,Ua+=2;0<Ua&&(j.bindBuffer(j.ARRAY_BUFFER,B.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,kb,F))}if(Jb){D=0;for(H=va.length;D<H;D++)Ob[Ja]=Ra,Ob[Ja+1]=Ra+1,Ob[Ja+2]=Ra+2,Ja+=3,ub[nb]=Ra,ub[nb+1]=Ra+1,ub[nb+2]=Ra,ub[nb+3]=Ra+2,ub[nb+4]=Ra+1,ub[nb+5]=Ra+2,nb+=6,
-Ra+=3;D=0;for(H=wa.length;D<H;D++)Ob[Ja]=Ra,Ob[Ja+1]=Ra+1,Ob[Ja+2]=Ra+3,Ob[Ja+3]=Ra+1,Ob[Ja+4]=Ra+2,Ob[Ja+5]=Ra+3,Ja+=6,ub[nb]=Ra,ub[nb+1]=Ra+1,ub[nb+2]=Ra,ub[nb+3]=Ra+3,ub[nb+4]=Ra+1,ub[nb+5]=Ra+2,ub[nb+6]=Ra+2,ub[nb+7]=Ra+3,nb+=8,Ra+=4;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,B.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Ob,F);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,B.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,ub,F)}if(Ab){ya=0;for(Ya=Ab.length;ya<Ya;ya++)if(v=Ab[ya],v.__original.needsUpdate){x=
-0;if(1===v.size)if(void 0===v.boundTo||"vertices"===v.boundTo){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],v.array[x]=v.value[P.a],v.array[x+1]=v.value[P.b],v.array[x+2]=v.value[P.c],x+=3;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],v.array[x]=v.value[P.a],v.array[x+1]=v.value[P.b],v.array[x+2]=v.value[P.c],v.array[x+3]=v.value[P.d],x+=4}else{if("faces"===v.boundTo){D=0;for(H=va.length;D<H;D++)za=v.value[va[D]],v.array[x]=za,v.array[x+1]=za,v.array[x+2]=za,x+=3;D=0;for(H=wa.length;D<H;D++)za=v.value[wa[D]],
-v.array[x]=za,v.array[x+1]=za,v.array[x+2]=za,v.array[x+3]=za,x+=4}}else if(2===v.size)if(void 0===v.boundTo||"vertices"===v.boundTo){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],S=v.value[P.a],T=v.value[P.b],R=v.value[P.c],v.array[x]=S.x,v.array[x+1]=S.y,v.array[x+2]=T.x,v.array[x+3]=T.y,v.array[x+4]=R.x,v.array[x+5]=R.y,x+=6;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],S=v.value[P.a],T=v.value[P.b],R=v.value[P.c],ba=v.value[P.d],v.array[x]=S.x,v.array[x+1]=S.y,v.array[x+2]=T.x,v.array[x+3]=T.y,v.array[x+
-4]=R.x,v.array[x+5]=R.y,v.array[x+6]=ba.x,v.array[x+7]=ba.y,x+=8}else{if("faces"===v.boundTo){D=0;for(H=va.length;D<H;D++)R=T=S=za=v.value[va[D]],v.array[x]=S.x,v.array[x+1]=S.y,v.array[x+2]=T.x,v.array[x+3]=T.y,v.array[x+4]=R.x,v.array[x+5]=R.y,x+=6;D=0;for(H=wa.length;D<H;D++)ba=R=T=S=za=v.value[wa[D]],v.array[x]=S.x,v.array[x+1]=S.y,v.array[x+2]=T.x,v.array[x+3]=T.y,v.array[x+4]=R.x,v.array[x+5]=R.y,v.array[x+6]=ba.x,v.array[x+7]=ba.y,x+=8}}else if(3===v.size){var Y;Y="c"===v.type?["r","g","b"]:
-["x","y","z"];if(void 0===v.boundTo||"vertices"===v.boundTo){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],S=v.value[P.a],T=v.value[P.b],R=v.value[P.c],v.array[x]=S[Y[0]],v.array[x+1]=S[Y[1]],v.array[x+2]=S[Y[2]],v.array[x+3]=T[Y[0]],v.array[x+4]=T[Y[1]],v.array[x+5]=T[Y[2]],v.array[x+6]=R[Y[0]],v.array[x+7]=R[Y[1]],v.array[x+8]=R[Y[2]],x+=9;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],S=v.value[P.a],T=v.value[P.b],R=v.value[P.c],ba=v.value[P.d],v.array[x]=S[Y[0]],v.array[x+1]=S[Y[1]],v.array[x+2]=S[Y[2]],v.array[x+
-3]=T[Y[0]],v.array[x+4]=T[Y[1]],v.array[x+5]=T[Y[2]],v.array[x+6]=R[Y[0]],v.array[x+7]=R[Y[1]],v.array[x+8]=R[Y[2]],v.array[x+9]=ba[Y[0]],v.array[x+10]=ba[Y[1]],v.array[x+11]=ba[Y[2]],x+=12}else if("faces"===v.boundTo){D=0;for(H=va.length;D<H;D++)R=T=S=za=v.value[va[D]],v.array[x]=S[Y[0]],v.array[x+1]=S[Y[1]],v.array[x+2]=S[Y[2]],v.array[x+3]=T[Y[0]],v.array[x+4]=T[Y[1]],v.array[x+5]=T[Y[2]],v.array[x+6]=R[Y[0]],v.array[x+7]=R[Y[1]],v.array[x+8]=R[Y[2]],x+=9;D=0;for(H=wa.length;D<H;D++)ba=R=T=S=za=
-v.value[wa[D]],v.array[x]=S[Y[0]],v.array[x+1]=S[Y[1]],v.array[x+2]=S[Y[2]],v.array[x+3]=T[Y[0]],v.array[x+4]=T[Y[1]],v.array[x+5]=T[Y[2]],v.array[x+6]=R[Y[0]],v.array[x+7]=R[Y[1]],v.array[x+8]=R[Y[2]],v.array[x+9]=ba[Y[0]],v.array[x+10]=ba[Y[1]],v.array[x+11]=ba[Y[2]],x+=12}else if("faceVertices"===v.boundTo){D=0;for(H=va.length;D<H;D++)za=v.value[va[D]],S=za[0],T=za[1],R=za[2],v.array[x]=S[Y[0]],v.array[x+1]=S[Y[1]],v.array[x+2]=S[Y[2]],v.array[x+3]=T[Y[0]],v.array[x+4]=T[Y[1]],v.array[x+5]=T[Y[2]],
-v.array[x+6]=R[Y[0]],v.array[x+7]=R[Y[1]],v.array[x+8]=R[Y[2]],x+=9;D=0;for(H=wa.length;D<H;D++)za=v.value[wa[D]],S=za[0],T=za[1],R=za[2],ba=za[3],v.array[x]=S[Y[0]],v.array[x+1]=S[Y[1]],v.array[x+2]=S[Y[2]],v.array[x+3]=T[Y[0]],v.array[x+4]=T[Y[1]],v.array[x+5]=T[Y[2]],v.array[x+6]=R[Y[0]],v.array[x+7]=R[Y[1]],v.array[x+8]=R[Y[2]],v.array[x+9]=ba[Y[0]],v.array[x+10]=ba[Y[1]],v.array[x+11]=ba[Y[2]],x+=12}}else if(4===v.size)if(void 0===v.boundTo||"vertices"===v.boundTo){D=0;for(H=va.length;D<H;D++)P=
-jb[va[D]],S=v.value[P.a],T=v.value[P.b],R=v.value[P.c],v.array[x]=S.x,v.array[x+1]=S.y,v.array[x+2]=S.z,v.array[x+3]=S.w,v.array[x+4]=T.x,v.array[x+5]=T.y,v.array[x+6]=T.z,v.array[x+7]=T.w,v.array[x+8]=R.x,v.array[x+9]=R.y,v.array[x+10]=R.z,v.array[x+11]=R.w,x+=12;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],S=v.value[P.a],T=v.value[P.b],R=v.value[P.c],ba=v.value[P.d],v.array[x]=S.x,v.array[x+1]=S.y,v.array[x+2]=S.z,v.array[x+3]=S.w,v.array[x+4]=T.x,v.array[x+5]=T.y,v.array[x+6]=T.z,v.array[x+7]=T.w,v.array[x+
-8]=R.x,v.array[x+9]=R.y,v.array[x+10]=R.z,v.array[x+11]=R.w,v.array[x+12]=ba.x,v.array[x+13]=ba.y,v.array[x+14]=ba.z,v.array[x+15]=ba.w,x+=16}else if("faces"===v.boundTo){D=0;for(H=va.length;D<H;D++)R=T=S=za=v.value[va[D]],v.array[x]=S.x,v.array[x+1]=S.y,v.array[x+2]=S.z,v.array[x+3]=S.w,v.array[x+4]=T.x,v.array[x+5]=T.y,v.array[x+6]=T.z,v.array[x+7]=T.w,v.array[x+8]=R.x,v.array[x+9]=R.y,v.array[x+10]=R.z,v.array[x+11]=R.w,x+=12;D=0;for(H=wa.length;D<H;D++)ba=R=T=S=za=v.value[wa[D]],v.array[x]=S.x,
-v.array[x+1]=S.y,v.array[x+2]=S.z,v.array[x+3]=S.w,v.array[x+4]=T.x,v.array[x+5]=T.y,v.array[x+6]=T.z,v.array[x+7]=T.w,v.array[x+8]=R.x,v.array[x+9]=R.y,v.array[x+10]=R.z,v.array[x+11]=R.w,v.array[x+12]=ba.x,v.array[x+13]=ba.y,v.array[x+14]=ba.z,v.array[x+15]=ba.w,x+=16}else if("faceVertices"===v.boundTo){D=0;for(H=va.length;D<H;D++)za=v.value[va[D]],S=za[0],T=za[1],R=za[2],v.array[x]=S.x,v.array[x+1]=S.y,v.array[x+2]=S.z,v.array[x+3]=S.w,v.array[x+4]=T.x,v.array[x+5]=T.y,v.array[x+6]=T.z,v.array[x+
-7]=T.w,v.array[x+8]=R.x,v.array[x+9]=R.y,v.array[x+10]=R.z,v.array[x+11]=R.w,x+=12;D=0;for(H=wa.length;D<H;D++)za=v.value[wa[D]],S=za[0],T=za[1],R=za[2],ba=za[3],v.array[x]=S.x,v.array[x+1]=S.y,v.array[x+2]=S.z,v.array[x+3]=S.w,v.array[x+4]=T.x,v.array[x+5]=T.y,v.array[x+6]=T.z,v.array[x+7]=T.w,v.array[x+8]=R.x,v.array[x+9]=R.y,v.array[x+10]=R.z,v.array[x+11]=R.w,v.array[x+12]=ba.x,v.array[x+13]=ba.y,v.array[x+14]=ba.z,v.array[x+15]=ba.w,x+=16}j.bindBuffer(j.ARRAY_BUFFER,v.buffer);j.bufferData(j.ARRAY_BUFFER,
-v.array,F)}}I&&(delete B.__inittedArrays,delete B.__colorArray,delete B.__normalArray,delete B.__tangentArray,delete B.__uvArray,delete B.__uv2Array,delete B.__faceArray,delete B.__vertexArray,delete B.__lineArray,delete B.__skinIndexArray,delete B.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;t.attributes&&r(t)}else if(i instanceof THREE.Ribbon){t=
-d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.normalsNeedUpdate||n){var Cb=l,Mb=j.DYNAMIC_DRAW,Hb=void 0,Kb=void 0,oc=void 0,Xb=void 0,Aa=void 0,wc=void 0,xc=void 0,yc=void 0,hc=void 0,fb=void 0,ic=void 0,Ga=void 0,qb=void 0,lc=Cb.vertices,mc=Cb.colors,nc=Cb.normals,tc=lc.length,uc=mc.length,Yc=nc.length,zc=Cb.__vertexArray,Ac=Cb.__colorArray,Bc=Cb.__normalArray,Zc=Cb.colorsNeedUpdate,$c=Cb.normalsNeedUpdate,Lc=Cb.__webglCustomAttributesList;if(Cb.verticesNeedUpdate){for(Hb=
+15]=ia.w,Ca+=16;j.bindBuffer(j.ARRAY_BUFFER,C.__webglTangentBuffer);j.bufferData(j.ARRAY_BUFFER,Ka,E)}if(Tb&&K){D=0;for(H=va.length;D<H;D++)if(P=jb[va[D]],Q=P.vertexNormals,U=P.normal,3===Q.length&&L)for(ya=0;3>ya;ya++)Ia=Q[ya],Bb[ib]=Ia.x,Bb[ib+1]=Ia.y,Bb[ib+2]=Ia.z,ib+=3;else for(ya=0;3>ya;ya++)Bb[ib]=U.x,Bb[ib+1]=U.y,Bb[ib+2]=U.z,ib+=3;D=0;for(H=wa.length;D<H;D++)if(P=jb[wa[D]],Q=P.vertexNormals,U=P.normal,4===Q.length&&L)for(ya=0;4>ya;ya++)Ia=Q[ya],Bb[ib]=Ia.x,Bb[ib+1]=Ia.y,Bb[ib+2]=Ia.z,ib+=
+3;else for(ya=0;4>ya;ya++)Bb[ib]=U.x,Bb[ib+1]=U.y,Bb[ib+2]=U.z,ib+=3;j.bindBuffer(j.ARRAY_BUFFER,C.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Bb,E)}if(Eb&&Lb&&O){D=0;for(H=va.length;D<H;D++)if(N=va[D],pa=Lb[N],void 0!==pa)for(ya=0;3>ya;ya++)ob=pa[ya],hb[Ta]=ob.x,hb[Ta+1]=ob.y,Ta+=2;D=0;for(H=wa.length;D<H;D++)if(N=wa[D],pa=Lb[N],void 0!==pa)for(ya=0;4>ya;ya++)ob=pa[ya],hb[Ta]=ob.x,hb[Ta+1]=ob.y,Ta+=2;0<Ta&&(j.bindBuffer(j.ARRAY_BUFFER,C.__webglUVBuffer),j.bufferData(j.ARRAY_BUFFER,hb,E))}if(Eb&&
+Nb&&O){D=0;for(H=va.length;D<H;D++)if(N=va[D],aa=Nb[N],void 0!==aa)for(ya=0;3>ya;ya++)Wa=aa[ya],kb[Ua]=Wa.x,kb[Ua+1]=Wa.y,Ua+=2;D=0;for(H=wa.length;D<H;D++)if(N=wa[D],aa=Nb[N],void 0!==aa)for(ya=0;4>ya;ya++)Wa=aa[ya],kb[Ua]=Wa.x,kb[Ua+1]=Wa.y,Ua+=2;0<Ua&&(j.bindBuffer(j.ARRAY_BUFFER,C.__webglUV2Buffer),j.bufferData(j.ARRAY_BUFFER,kb,E))}if(Jb){D=0;for(H=va.length;D<H;D++)Ob[Ja]=Ra,Ob[Ja+1]=Ra+1,Ob[Ja+2]=Ra+2,Ja+=3,ub[nb]=Ra,ub[nb+1]=Ra+1,ub[nb+2]=Ra,ub[nb+3]=Ra+2,ub[nb+4]=Ra+1,ub[nb+5]=Ra+2,nb+=6,
+Ra+=3;D=0;for(H=wa.length;D<H;D++)Ob[Ja]=Ra,Ob[Ja+1]=Ra+1,Ob[Ja+2]=Ra+3,Ob[Ja+3]=Ra+1,Ob[Ja+4]=Ra+2,Ob[Ja+5]=Ra+3,Ja+=6,ub[nb]=Ra,ub[nb+1]=Ra+1,ub[nb+2]=Ra,ub[nb+3]=Ra+3,ub[nb+4]=Ra+1,ub[nb+5]=Ra+2,ub[nb+6]=Ra+2,ub[nb+7]=Ra+3,nb+=8,Ra+=4;j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,C.__webglFaceBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,Ob,E);j.bindBuffer(j.ELEMENT_ARRAY_BUFFER,C.__webglLineBuffer);j.bufferData(j.ELEMENT_ARRAY_BUFFER,ub,E)}if(Ab){ya=0;for(Ya=Ab.length;ya<Ya;ya++)if(u=Ab[ya],u.__original.needsUpdate){x=
+0;if(1===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],u.array[x]=u.value[P.a],u.array[x+1]=u.value[P.b],u.array[x+2]=u.value[P.c],x+=3;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],u.array[x]=u.value[P.a],u.array[x+1]=u.value[P.b],u.array[x+2]=u.value[P.c],u.array[x+3]=u.value[P.d],x+=4}else{if("faces"===u.boundTo){D=0;for(H=va.length;D<H;D++)za=u.value[va[D]],u.array[x]=za,u.array[x+1]=za,u.array[x+2]=za,x+=3;D=0;for(H=wa.length;D<H;D++)za=u.value[wa[D]],
+u.array[x]=za,u.array[x+1]=za,u.array[x+2]=za,u.array[x+3]=za,x+=4}}else if(2===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],S=u.value[P.a],T=u.value[P.b],R=u.value[P.c],u.array[x]=S.x,u.array[x+1]=S.y,u.array[x+2]=T.x,u.array[x+3]=T.y,u.array[x+4]=R.x,u.array[x+5]=R.y,x+=6;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],S=u.value[P.a],T=u.value[P.b],R=u.value[P.c],ba=u.value[P.d],u.array[x]=S.x,u.array[x+1]=S.y,u.array[x+2]=T.x,u.array[x+3]=T.y,u.array[x+
+4]=R.x,u.array[x+5]=R.y,u.array[x+6]=ba.x,u.array[x+7]=ba.y,x+=8}else{if("faces"===u.boundTo){D=0;for(H=va.length;D<H;D++)R=T=S=za=u.value[va[D]],u.array[x]=S.x,u.array[x+1]=S.y,u.array[x+2]=T.x,u.array[x+3]=T.y,u.array[x+4]=R.x,u.array[x+5]=R.y,x+=6;D=0;for(H=wa.length;D<H;D++)ba=R=T=S=za=u.value[wa[D]],u.array[x]=S.x,u.array[x+1]=S.y,u.array[x+2]=T.x,u.array[x+3]=T.y,u.array[x+4]=R.x,u.array[x+5]=R.y,u.array[x+6]=ba.x,u.array[x+7]=ba.y,x+=8}}else if(3===u.size){var Y;Y="c"===u.type?["r","g","b"]:
+["x","y","z"];if(void 0===u.boundTo||"vertices"===u.boundTo){D=0;for(H=va.length;D<H;D++)P=jb[va[D]],S=u.value[P.a],T=u.value[P.b],R=u.value[P.c],u.array[x]=S[Y[0]],u.array[x+1]=S[Y[1]],u.array[x+2]=S[Y[2]],u.array[x+3]=T[Y[0]],u.array[x+4]=T[Y[1]],u.array[x+5]=T[Y[2]],u.array[x+6]=R[Y[0]],u.array[x+7]=R[Y[1]],u.array[x+8]=R[Y[2]],x+=9;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],S=u.value[P.a],T=u.value[P.b],R=u.value[P.c],ba=u.value[P.d],u.array[x]=S[Y[0]],u.array[x+1]=S[Y[1]],u.array[x+2]=S[Y[2]],u.array[x+
+3]=T[Y[0]],u.array[x+4]=T[Y[1]],u.array[x+5]=T[Y[2]],u.array[x+6]=R[Y[0]],u.array[x+7]=R[Y[1]],u.array[x+8]=R[Y[2]],u.array[x+9]=ba[Y[0]],u.array[x+10]=ba[Y[1]],u.array[x+11]=ba[Y[2]],x+=12}else if("faces"===u.boundTo){D=0;for(H=va.length;D<H;D++)R=T=S=za=u.value[va[D]],u.array[x]=S[Y[0]],u.array[x+1]=S[Y[1]],u.array[x+2]=S[Y[2]],u.array[x+3]=T[Y[0]],u.array[x+4]=T[Y[1]],u.array[x+5]=T[Y[2]],u.array[x+6]=R[Y[0]],u.array[x+7]=R[Y[1]],u.array[x+8]=R[Y[2]],x+=9;D=0;for(H=wa.length;D<H;D++)ba=R=T=S=za=
+u.value[wa[D]],u.array[x]=S[Y[0]],u.array[x+1]=S[Y[1]],u.array[x+2]=S[Y[2]],u.array[x+3]=T[Y[0]],u.array[x+4]=T[Y[1]],u.array[x+5]=T[Y[2]],u.array[x+6]=R[Y[0]],u.array[x+7]=R[Y[1]],u.array[x+8]=R[Y[2]],u.array[x+9]=ba[Y[0]],u.array[x+10]=ba[Y[1]],u.array[x+11]=ba[Y[2]],x+=12}else if("faceVertices"===u.boundTo){D=0;for(H=va.length;D<H;D++)za=u.value[va[D]],S=za[0],T=za[1],R=za[2],u.array[x]=S[Y[0]],u.array[x+1]=S[Y[1]],u.array[x+2]=S[Y[2]],u.array[x+3]=T[Y[0]],u.array[x+4]=T[Y[1]],u.array[x+5]=T[Y[2]],
+u.array[x+6]=R[Y[0]],u.array[x+7]=R[Y[1]],u.array[x+8]=R[Y[2]],x+=9;D=0;for(H=wa.length;D<H;D++)za=u.value[wa[D]],S=za[0],T=za[1],R=za[2],ba=za[3],u.array[x]=S[Y[0]],u.array[x+1]=S[Y[1]],u.array[x+2]=S[Y[2]],u.array[x+3]=T[Y[0]],u.array[x+4]=T[Y[1]],u.array[x+5]=T[Y[2]],u.array[x+6]=R[Y[0]],u.array[x+7]=R[Y[1]],u.array[x+8]=R[Y[2]],u.array[x+9]=ba[Y[0]],u.array[x+10]=ba[Y[1]],u.array[x+11]=ba[Y[2]],x+=12}}else if(4===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){D=0;for(H=va.length;D<H;D++)P=
+jb[va[D]],S=u.value[P.a],T=u.value[P.b],R=u.value[P.c],u.array[x]=S.x,u.array[x+1]=S.y,u.array[x+2]=S.z,u.array[x+3]=S.w,u.array[x+4]=T.x,u.array[x+5]=T.y,u.array[x+6]=T.z,u.array[x+7]=T.w,u.array[x+8]=R.x,u.array[x+9]=R.y,u.array[x+10]=R.z,u.array[x+11]=R.w,x+=12;D=0;for(H=wa.length;D<H;D++)P=jb[wa[D]],S=u.value[P.a],T=u.value[P.b],R=u.value[P.c],ba=u.value[P.d],u.array[x]=S.x,u.array[x+1]=S.y,u.array[x+2]=S.z,u.array[x+3]=S.w,u.array[x+4]=T.x,u.array[x+5]=T.y,u.array[x+6]=T.z,u.array[x+7]=T.w,u.array[x+
+8]=R.x,u.array[x+9]=R.y,u.array[x+10]=R.z,u.array[x+11]=R.w,u.array[x+12]=ba.x,u.array[x+13]=ba.y,u.array[x+14]=ba.z,u.array[x+15]=ba.w,x+=16}else if("faces"===u.boundTo){D=0;for(H=va.length;D<H;D++)R=T=S=za=u.value[va[D]],u.array[x]=S.x,u.array[x+1]=S.y,u.array[x+2]=S.z,u.array[x+3]=S.w,u.array[x+4]=T.x,u.array[x+5]=T.y,u.array[x+6]=T.z,u.array[x+7]=T.w,u.array[x+8]=R.x,u.array[x+9]=R.y,u.array[x+10]=R.z,u.array[x+11]=R.w,x+=12;D=0;for(H=wa.length;D<H;D++)ba=R=T=S=za=u.value[wa[D]],u.array[x]=S.x,
+u.array[x+1]=S.y,u.array[x+2]=S.z,u.array[x+3]=S.w,u.array[x+4]=T.x,u.array[x+5]=T.y,u.array[x+6]=T.z,u.array[x+7]=T.w,u.array[x+8]=R.x,u.array[x+9]=R.y,u.array[x+10]=R.z,u.array[x+11]=R.w,u.array[x+12]=ba.x,u.array[x+13]=ba.y,u.array[x+14]=ba.z,u.array[x+15]=ba.w,x+=16}else if("faceVertices"===u.boundTo){D=0;for(H=va.length;D<H;D++)za=u.value[va[D]],S=za[0],T=za[1],R=za[2],u.array[x]=S.x,u.array[x+1]=S.y,u.array[x+2]=S.z,u.array[x+3]=S.w,u.array[x+4]=T.x,u.array[x+5]=T.y,u.array[x+6]=T.z,u.array[x+
+7]=T.w,u.array[x+8]=R.x,u.array[x+9]=R.y,u.array[x+10]=R.z,u.array[x+11]=R.w,x+=12;D=0;for(H=wa.length;D<H;D++)za=u.value[wa[D]],S=za[0],T=za[1],R=za[2],ba=za[3],u.array[x]=S.x,u.array[x+1]=S.y,u.array[x+2]=S.z,u.array[x+3]=S.w,u.array[x+4]=T.x,u.array[x+5]=T.y,u.array[x+6]=T.z,u.array[x+7]=T.w,u.array[x+8]=R.x,u.array[x+9]=R.y,u.array[x+10]=R.z,u.array[x+11]=R.w,u.array[x+12]=ba.x,u.array[x+13]=ba.y,u.array[x+14]=ba.z,u.array[x+15]=ba.w,x+=16}j.bindBuffer(j.ARRAY_BUFFER,u.buffer);j.bufferData(j.ARRAY_BUFFER,
+u.array,E)}}I&&(delete C.__inittedArrays,delete C.__colorArray,delete C.__normalArray,delete C.__tangentArray,delete C.__uvArray,delete C.__uv2Array,delete C.__faceArray,delete C.__vertexArray,delete C.__lineArray,delete C.__skinIndexArray,delete C.__skinWeightArray)}}m.verticesNeedUpdate=!1;m.morphTargetsNeedUpdate=!1;m.elementsNeedUpdate=!1;m.uvsNeedUpdate=!1;m.normalsNeedUpdate=!1;m.colorsNeedUpdate=!1;m.tangentsNeedUpdate=!1;m.buffersNeedUpdate=!1;s.attributes&&p(s)}else if(i instanceof THREE.Ribbon){s=
+d(i,m);n=s.attributes&&q(s);if(m.verticesNeedUpdate||m.colorsNeedUpdate||m.normalsNeedUpdate||n){var Cb=m,Mb=j.DYNAMIC_DRAW,Hb=void 0,Kb=void 0,oc=void 0,Xb=void 0,Aa=void 0,wc=void 0,xc=void 0,yc=void 0,hc=void 0,fb=void 0,ic=void 0,Ga=void 0,qb=void 0,lc=Cb.vertices,mc=Cb.colors,nc=Cb.normals,tc=lc.length,uc=mc.length,Yc=nc.length,zc=Cb.__vertexArray,Ac=Cb.__colorArray,Bc=Cb.__normalArray,Zc=Cb.colorsNeedUpdate,$c=Cb.normalsNeedUpdate,Lc=Cb.__webglCustomAttributesList;if(Cb.verticesNeedUpdate){for(Hb=
 0;Hb<tc;Hb++)Xb=lc[Hb],Aa=3*Hb,zc[Aa]=Xb.x,zc[Aa+1]=Xb.y,zc[Aa+2]=Xb.z;j.bindBuffer(j.ARRAY_BUFFER,Cb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,zc,Mb)}if(Zc){for(Kb=0;Kb<uc;Kb++)wc=mc[Kb],Aa=3*Kb,Ac[Aa]=wc.r,Ac[Aa+1]=wc.g,Ac[Aa+2]=wc.b;j.bindBuffer(j.ARRAY_BUFFER,Cb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Ac,Mb)}if($c){for(oc=0;oc<Yc;oc++)xc=nc[oc],Aa=3*oc,Bc[Aa]=xc.x,Bc[Aa+1]=xc.y,Bc[Aa+2]=xc.z;j.bindBuffer(j.ARRAY_BUFFER,Cb.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Bc,Mb)}if(Lc){yc=
 0;Hb<tc;Hb++)Xb=lc[Hb],Aa=3*Hb,zc[Aa]=Xb.x,zc[Aa+1]=Xb.y,zc[Aa+2]=Xb.z;j.bindBuffer(j.ARRAY_BUFFER,Cb.__webglVertexBuffer);j.bufferData(j.ARRAY_BUFFER,zc,Mb)}if(Zc){for(Kb=0;Kb<uc;Kb++)wc=mc[Kb],Aa=3*Kb,Ac[Aa]=wc.r,Ac[Aa+1]=wc.g,Ac[Aa+2]=wc.b;j.bindBuffer(j.ARRAY_BUFFER,Cb.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Ac,Mb)}if($c){for(oc=0;oc<Yc;oc++)xc=nc[oc],Aa=3*oc,Bc[Aa]=xc.x,Bc[Aa+1]=xc.y,Bc[Aa+2]=xc.z;j.bindBuffer(j.ARRAY_BUFFER,Cb.__webglNormalBuffer);j.bufferData(j.ARRAY_BUFFER,Bc,Mb)}if(Lc){yc=
 0;for(hc=Lc.length;yc<hc;yc++)if(Ga=Lc[yc],Ga.needsUpdate&&(void 0===Ga.boundTo||"vertices"===Ga.boundTo)){Aa=0;ic=Ga.value.length;if(1===Ga.size)for(fb=0;fb<ic;fb++)Ga.array[fb]=Ga.value[fb];else if(2===Ga.size)for(fb=0;fb<ic;fb++)qb=Ga.value[fb],Ga.array[Aa]=qb.x,Ga.array[Aa+1]=qb.y,Aa+=2;else if(3===Ga.size)if("c"===Ga.type)for(fb=0;fb<ic;fb++)qb=Ga.value[fb],Ga.array[Aa]=qb.r,Ga.array[Aa+1]=qb.g,Ga.array[Aa+2]=qb.b,Aa+=3;else for(fb=0;fb<ic;fb++)qb=Ga.value[fb],Ga.array[Aa]=qb.x,Ga.array[Aa+1]=
 0;for(hc=Lc.length;yc<hc;yc++)if(Ga=Lc[yc],Ga.needsUpdate&&(void 0===Ga.boundTo||"vertices"===Ga.boundTo)){Aa=0;ic=Ga.value.length;if(1===Ga.size)for(fb=0;fb<ic;fb++)Ga.array[fb]=Ga.value[fb];else if(2===Ga.size)for(fb=0;fb<ic;fb++)qb=Ga.value[fb],Ga.array[Aa]=qb.x,Ga.array[Aa+1]=qb.y,Aa+=2;else if(3===Ga.size)if("c"===Ga.type)for(fb=0;fb<ic;fb++)qb=Ga.value[fb],Ga.array[Aa]=qb.r,Ga.array[Aa+1]=qb.g,Ga.array[Aa+2]=qb.b,Aa+=3;else for(fb=0;fb<ic;fb++)qb=Ga.value[fb],Ga.array[Aa]=qb.x,Ga.array[Aa+1]=
-qb.y,Ga.array[Aa+2]=qb.z,Aa+=3;else if(4===Ga.size)for(fb=0;fb<ic;fb++)qb=Ga.value[fb],Ga.array[Aa]=qb.x,Ga.array[Aa+1]=qb.y,Ga.array[Aa+2]=qb.z,Ga.array[Aa+3]=qb.w,Aa+=4;j.bindBuffer(j.ARRAY_BUFFER,Ga.buffer);j.bufferData(j.ARRAY_BUFFER,Ga.array,Mb)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.normalsNeedUpdate=!1;t.attributes&&r(t)}else if(i instanceof THREE.Line){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||n){var Db=l,Cc=j.DYNAMIC_DRAW,
+qb.y,Ga.array[Aa+2]=qb.z,Aa+=3;else if(4===Ga.size)for(fb=0;fb<ic;fb++)qb=Ga.value[fb],Ga.array[Aa]=qb.x,Ga.array[Aa+1]=qb.y,Ga.array[Aa+2]=qb.z,Ga.array[Aa+3]=qb.w,Aa+=4;j.bindBuffer(j.ARRAY_BUFFER,Ga.buffer);j.bufferData(j.ARRAY_BUFFER,Ga.array,Mb)}}}m.verticesNeedUpdate=!1;m.colorsNeedUpdate=!1;m.normalsNeedUpdate=!1;s.attributes&&p(s)}else if(i instanceof THREE.Line){s=d(i,m);n=s.attributes&&q(s);if(m.verticesNeedUpdate||m.colorsNeedUpdate||m.lineDistancesNeedUpdate||n){var Db=m,Cc=j.DYNAMIC_DRAW,
 pc=void 0,qc=void 0,rc=void 0,Dc=void 0,Na=void 0,Ec=void 0,Qc=Db.vertices,Rc=Db.colors,Sc=Db.lineDistances,ad=Qc.length,bd=Rc.length,cd=Sc.length,Fc=Db.__vertexArray,Gc=Db.__colorArray,Tc=Db.__lineDistanceArray,dd=Db.colorsNeedUpdate,ed=Db.lineDistancesNeedUpdate,Mc=Db.__webglCustomAttributesList,Hc=void 0,Uc=void 0,gb=void 0,jc=void 0,rb=void 0,Ha=void 0;if(Db.verticesNeedUpdate){for(pc=0;pc<ad;pc++)Dc=Qc[pc],Na=3*pc,Fc[Na]=Dc.x,Fc[Na+1]=Dc.y,Fc[Na+2]=Dc.z;j.bindBuffer(j.ARRAY_BUFFER,Db.__webglVertexBuffer);
 pc=void 0,qc=void 0,rc=void 0,Dc=void 0,Na=void 0,Ec=void 0,Qc=Db.vertices,Rc=Db.colors,Sc=Db.lineDistances,ad=Qc.length,bd=Rc.length,cd=Sc.length,Fc=Db.__vertexArray,Gc=Db.__colorArray,Tc=Db.__lineDistanceArray,dd=Db.colorsNeedUpdate,ed=Db.lineDistancesNeedUpdate,Mc=Db.__webglCustomAttributesList,Hc=void 0,Uc=void 0,gb=void 0,jc=void 0,rb=void 0,Ha=void 0;if(Db.verticesNeedUpdate){for(pc=0;pc<ad;pc++)Dc=Qc[pc],Na=3*pc,Fc[Na]=Dc.x,Fc[Na+1]=Dc.y,Fc[Na+2]=Dc.z;j.bindBuffer(j.ARRAY_BUFFER,Db.__webglVertexBuffer);
 j.bufferData(j.ARRAY_BUFFER,Fc,Cc)}if(dd){for(qc=0;qc<bd;qc++)Ec=Rc[qc],Na=3*qc,Gc[Na]=Ec.r,Gc[Na+1]=Ec.g,Gc[Na+2]=Ec.b;j.bindBuffer(j.ARRAY_BUFFER,Db.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Gc,Cc)}if(ed){for(rc=0;rc<cd;rc++)Tc[rc]=Sc[rc];j.bindBuffer(j.ARRAY_BUFFER,Db.__webglLineDistanceBuffer);j.bufferData(j.ARRAY_BUFFER,Tc,Cc)}if(Mc){Hc=0;for(Uc=Mc.length;Hc<Uc;Hc++)if(Ha=Mc[Hc],Ha.needsUpdate&&(void 0===Ha.boundTo||"vertices"===Ha.boundTo)){Na=0;jc=Ha.value.length;if(1===Ha.size)for(gb=
 j.bufferData(j.ARRAY_BUFFER,Fc,Cc)}if(dd){for(qc=0;qc<bd;qc++)Ec=Rc[qc],Na=3*qc,Gc[Na]=Ec.r,Gc[Na+1]=Ec.g,Gc[Na+2]=Ec.b;j.bindBuffer(j.ARRAY_BUFFER,Db.__webglColorBuffer);j.bufferData(j.ARRAY_BUFFER,Gc,Cc)}if(ed){for(rc=0;rc<cd;rc++)Tc[rc]=Sc[rc];j.bindBuffer(j.ARRAY_BUFFER,Db.__webglLineDistanceBuffer);j.bufferData(j.ARRAY_BUFFER,Tc,Cc)}if(Mc){Hc=0;for(Uc=Mc.length;Hc<Uc;Hc++)if(Ha=Mc[Hc],Ha.needsUpdate&&(void 0===Ha.boundTo||"vertices"===Ha.boundTo)){Na=0;jc=Ha.value.length;if(1===Ha.size)for(gb=
 0;gb<jc;gb++)Ha.array[gb]=Ha.value[gb];else if(2===Ha.size)for(gb=0;gb<jc;gb++)rb=Ha.value[gb],Ha.array[Na]=rb.x,Ha.array[Na+1]=rb.y,Na+=2;else if(3===Ha.size)if("c"===Ha.type)for(gb=0;gb<jc;gb++)rb=Ha.value[gb],Ha.array[Na]=rb.r,Ha.array[Na+1]=rb.g,Ha.array[Na+2]=rb.b,Na+=3;else for(gb=0;gb<jc;gb++)rb=Ha.value[gb],Ha.array[Na]=rb.x,Ha.array[Na+1]=rb.y,Ha.array[Na+2]=rb.z,Na+=3;else if(4===Ha.size)for(gb=0;gb<jc;gb++)rb=Ha.value[gb],Ha.array[Na]=rb.x,Ha.array[Na+1]=rb.y,Ha.array[Na+2]=rb.z,Ha.array[Na+
 0;gb<jc;gb++)Ha.array[gb]=Ha.value[gb];else if(2===Ha.size)for(gb=0;gb<jc;gb++)rb=Ha.value[gb],Ha.array[Na]=rb.x,Ha.array[Na+1]=rb.y,Na+=2;else if(3===Ha.size)if("c"===Ha.type)for(gb=0;gb<jc;gb++)rb=Ha.value[gb],Ha.array[Na]=rb.r,Ha.array[Na+1]=rb.g,Ha.array[Na+2]=rb.b,Na+=3;else for(gb=0;gb<jc;gb++)rb=Ha.value[gb],Ha.array[Na]=rb.x,Ha.array[Na+1]=rb.y,Ha.array[Na+2]=rb.z,Na+=3;else if(4===Ha.size)for(gb=0;gb<jc;gb++)rb=Ha.value[gb],Ha.array[Na]=rb.x,Ha.array[Na+1]=rb.y,Ha.array[Na+2]=rb.z,Ha.array[Na+
-3]=rb.w,Na+=4;j.bindBuffer(j.ARRAY_BUFFER,Ha.buffer);j.bufferData(j.ARRAY_BUFFER,Ha.array,Cc)}}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;t.attributes&&r(t)}else if(i instanceof THREE.ParticleSystem){t=d(i,l);n=t.attributes&&p(t);if(l.verticesNeedUpdate||l.colorsNeedUpdate||i.sortParticles||n){var Pb=l,Nc=j.DYNAMIC_DRAW,sc=i,sb=void 0,Qb=void 0,Rb=void 0,ca=void 0,Sb=void 0,cc=void 0,Ic=Pb.vertices,Oc=Ic.length,Pc=Pb.colors,Vc=Pc.length,fc=Pb.__vertexArray,gc=Pb.__colorArray,
+3]=rb.w,Na+=4;j.bindBuffer(j.ARRAY_BUFFER,Ha.buffer);j.bufferData(j.ARRAY_BUFFER,Ha.array,Cc)}}}m.verticesNeedUpdate=!1;m.colorsNeedUpdate=!1;m.lineDistancesNeedUpdate=!1;s.attributes&&p(s)}else if(i instanceof THREE.ParticleSystem){s=d(i,m);n=s.attributes&&q(s);if(m.verticesNeedUpdate||m.colorsNeedUpdate||i.sortParticles||n){var Pb=m,Nc=j.DYNAMIC_DRAW,sc=i,sb=void 0,Qb=void 0,Rb=void 0,ca=void 0,Sb=void 0,cc=void 0,Ic=Pb.vertices,Oc=Ic.length,Pc=Pb.colors,Vc=Pc.length,fc=Pb.__vertexArray,gc=Pb.__colorArray,
 Yb=Pb.__sortArray,Wc=Pb.verticesNeedUpdate,Xc=Pb.colorsNeedUpdate,Zb=Pb.__webglCustomAttributesList,Fb=void 0,kc=void 0,ma=void 0,Gb=void 0,Da=void 0,$=void 0;if(sc.sortParticles){yb.copy(vb);yb.multiply(sc.matrixWorld);for(sb=0;sb<Oc;sb++)Rb=Ic[sb],ra.copy(Rb),ra.applyProjection(yb),Yb[sb]=[ra.z,sb];Yb.sort(k);for(sb=0;sb<Oc;sb++)Rb=Ic[Yb[sb][1]],ca=3*sb,fc[ca]=Rb.x,fc[ca+1]=Rb.y,fc[ca+2]=Rb.z;for(Qb=0;Qb<Vc;Qb++)ca=3*Qb,cc=Pc[Yb[Qb][1]],gc[ca]=cc.r,gc[ca+1]=cc.g,gc[ca+2]=cc.b;if(Zb){Fb=0;for(kc=
 Yb=Pb.__sortArray,Wc=Pb.verticesNeedUpdate,Xc=Pb.colorsNeedUpdate,Zb=Pb.__webglCustomAttributesList,Fb=void 0,kc=void 0,ma=void 0,Gb=void 0,Da=void 0,$=void 0;if(sc.sortParticles){yb.copy(vb);yb.multiply(sc.matrixWorld);for(sb=0;sb<Oc;sb++)Rb=Ic[sb],ra.copy(Rb),ra.applyProjection(yb),Yb[sb]=[ra.z,sb];Yb.sort(k);for(sb=0;sb<Oc;sb++)Rb=Ic[Yb[sb][1]],ca=3*sb,fc[ca]=Rb.x,fc[ca+1]=Rb.y,fc[ca+2]=Rb.z;for(Qb=0;Qb<Vc;Qb++)ca=3*Qb,cc=Pc[Yb[Qb][1]],gc[ca]=cc.r,gc[ca+1]=cc.g,gc[ca+2]=cc.b;if(Zb){Fb=0;for(kc=
 Zb.length;Fb<kc;Fb++)if($=Zb[Fb],void 0===$.boundTo||"vertices"===$.boundTo)if(ca=0,Gb=$.value.length,1===$.size)for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],$.array[ma]=$.value[Sb];else if(2===$.size)for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],Da=$.value[Sb],$.array[ca]=Da.x,$.array[ca+1]=Da.y,ca+=2;else if(3===$.size)if("c"===$.type)for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],Da=$.value[Sb],$.array[ca]=Da.r,$.array[ca+1]=Da.g,$.array[ca+2]=Da.b,ca+=3;else for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],Da=$.value[Sb],$.array[ca]=Da.x,$.array[ca+
 Zb.length;Fb<kc;Fb++)if($=Zb[Fb],void 0===$.boundTo||"vertices"===$.boundTo)if(ca=0,Gb=$.value.length,1===$.size)for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],$.array[ma]=$.value[Sb];else if(2===$.size)for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],Da=$.value[Sb],$.array[ca]=Da.x,$.array[ca+1]=Da.y,ca+=2;else if(3===$.size)if("c"===$.type)for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],Da=$.value[Sb],$.array[ca]=Da.r,$.array[ca+1]=Da.g,$.array[ca+2]=Da.b,ca+=3;else for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],Da=$.value[Sb],$.array[ca]=Da.x,$.array[ca+
 1]=Da.y,$.array[ca+2]=Da.z,ca+=3;else if(4===$.size)for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],Da=$.value[Sb],$.array[ca]=Da.x,$.array[ca+1]=Da.y,$.array[ca+2]=Da.z,$.array[ca+3]=Da.w,ca+=4}}else{if(Wc)for(sb=0;sb<Oc;sb++)Rb=Ic[sb],ca=3*sb,fc[ca]=Rb.x,fc[ca+1]=Rb.y,fc[ca+2]=Rb.z;if(Xc)for(Qb=0;Qb<Vc;Qb++)cc=Pc[Qb],ca=3*Qb,gc[ca]=cc.r,gc[ca+1]=cc.g,gc[ca+2]=cc.b;if(Zb){Fb=0;for(kc=Zb.length;Fb<kc;Fb++)if($=Zb[Fb],$.needsUpdate&&(void 0===$.boundTo||"vertices"===$.boundTo))if(Gb=$.value.length,ca=0,1===$.size)for(ma=
 1]=Da.y,$.array[ca+2]=Da.z,ca+=3;else if(4===$.size)for(ma=0;ma<Gb;ma++)Sb=Yb[ma][1],Da=$.value[Sb],$.array[ca]=Da.x,$.array[ca+1]=Da.y,$.array[ca+2]=Da.z,$.array[ca+3]=Da.w,ca+=4}}else{if(Wc)for(sb=0;sb<Oc;sb++)Rb=Ic[sb],ca=3*sb,fc[ca]=Rb.x,fc[ca+1]=Rb.y,fc[ca+2]=Rb.z;if(Xc)for(Qb=0;Qb<Vc;Qb++)cc=Pc[Qb],ca=3*Qb,gc[ca]=cc.r,gc[ca+1]=cc.g,gc[ca+2]=cc.b;if(Zb){Fb=0;for(kc=Zb.length;Fb<kc;Fb++)if($=Zb[Fb],$.needsUpdate&&(void 0===$.boundTo||"vertices"===$.boundTo))if(Gb=$.value.length,ca=0,1===$.size)for(ma=
 0;ma<Gb;ma++)$.array[ma]=$.value[ma];else if(2===$.size)for(ma=0;ma<Gb;ma++)Da=$.value[ma],$.array[ca]=Da.x,$.array[ca+1]=Da.y,ca+=2;else if(3===$.size)if("c"===$.type)for(ma=0;ma<Gb;ma++)Da=$.value[ma],$.array[ca]=Da.r,$.array[ca+1]=Da.g,$.array[ca+2]=Da.b,ca+=3;else for(ma=0;ma<Gb;ma++)Da=$.value[ma],$.array[ca]=Da.x,$.array[ca+1]=Da.y,$.array[ca+2]=Da.z,ca+=3;else if(4===$.size)for(ma=0;ma<Gb;ma++)Da=$.value[ma],$.array[ca]=Da.x,$.array[ca+1]=Da.y,$.array[ca+2]=Da.z,$.array[ca+3]=Da.w,ca+=4}}if(Wc||
 0;ma<Gb;ma++)$.array[ma]=$.value[ma];else if(2===$.size)for(ma=0;ma<Gb;ma++)Da=$.value[ma],$.array[ca]=Da.x,$.array[ca+1]=Da.y,ca+=2;else if(3===$.size)if("c"===$.type)for(ma=0;ma<Gb;ma++)Da=$.value[ma],$.array[ca]=Da.r,$.array[ca+1]=Da.g,$.array[ca+2]=Da.b,ca+=3;else for(ma=0;ma<Gb;ma++)Da=$.value[ma],$.array[ca]=Da.x,$.array[ca+1]=Da.y,$.array[ca+2]=Da.z,ca+=3;else if(4===$.size)for(ma=0;ma<Gb;ma++)Da=$.value[ma],$.array[ca]=Da.x,$.array[ca+1]=Da.y,$.array[ca+2]=Da.z,$.array[ca+3]=Da.w,ca+=4}}if(Wc||
-sc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,Pb.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,fc,Nc);if(Xc||sc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,Pb.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,gc,Nc);if(Zb){Fb=0;for(kc=Zb.length;Fb<kc;Fb++)if($=Zb[Fb],$.needsUpdate||sc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,$.buffer),j.bufferData(j.ARRAY_BUFFER,$.array,Nc)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;t.attributes&&r(t)}}};this.initMaterial=function(a,b,c,d){var e,f,h,g;a.addEventListener("dispose",
-nc);var i,k,l,m,n;a instanceof THREE.MeshDepthMaterial?n="depth":a instanceof THREE.MeshNormalMaterial?n="normal":a instanceof THREE.MeshBasicMaterial?n="basic":a instanceof THREE.MeshLambertMaterial?n="lambert":a instanceof THREE.MeshPhongMaterial?n="phong":a instanceof THREE.LineBasicMaterial?n="basic":a instanceof THREE.LineDashedMaterial?n="dashed":a instanceof THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var p=THREE.ShaderLib[n];a.uniforms=THREE.UniformsUtils.clone(p.uniforms);a.vertexShader=
-p.vertexShader;a.fragmentShader=p.fragmentShader}var q=e=0,r=0;f=p=0;for(var s=b.length;f<s;f++)h=b[f],h.onlyShadow||(h instanceof THREE.DirectionalLight&&e++,h instanceof THREE.PointLight&&q++,h instanceof THREE.SpotLight&&r++,h instanceof THREE.HemisphereLight&&p++);f=q;h=r;g=p;r=p=0;for(q=b.length;r<q;r++)s=b[r],s.castShadow&&(s instanceof THREE.SpotLight&&p++,s instanceof THREE.DirectionalLight&&!s.shadowCascade&&p++);m=p;Jb&&d&&d.useVertexTexture?l=1024:(b=j.getParameter(j.MAX_VERTEX_UNIFORM_VECTORS),
-b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),l=b);a:{var r=a.fragmentShader,q=a.vertexShader,p=a.uniforms,b=a.attributes,s=a.defines,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,
-fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:l,useVertexTexture:Jb&&d&&d.useVertexTexture,boneTextureWidth:d&&d.boneTextureWidth,boneTextureHeight:d&&d.boneTextureHeight,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:h,maxHemiLights:g,maxShadows:m,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapType:this.shadowMapType,
-shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},t,u,z,d=[];n?d.push(n):(d.push(r),d.push(q));for(u in s)d.push(u),d.push(s[u]);for(t in c)d.push(t),d.push(c[t]);n=d.join();t=0;for(u=sa.length;t<u;t++)if(d=sa[t],d.code===n){d.usedTimes++;k=d.program;break a}t="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?t="SHADOWMAP_TYPE_PCF":
-c.shadowMapType===THREE.PCFSoftShadowMap&&(t="SHADOWMAP_TYPE_PCF_SOFT");u=[];for(z in s)d=s[z],!1!==d&&(d="#define "+z+" "+d,u.push(d));d=u.join("\n");z=j.createProgram();u=["precision "+aa+" float;","precision "+aa+" int;",d,Ua?"#define VERTEX_TEXTURES":"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?"#define GAMMA_OUTPUT":"",M.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+
+sc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,Pb.__webglVertexBuffer),j.bufferData(j.ARRAY_BUFFER,fc,Nc);if(Xc||sc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,Pb.__webglColorBuffer),j.bufferData(j.ARRAY_BUFFER,gc,Nc);if(Zb){Fb=0;for(kc=Zb.length;Fb<kc;Fb++)if($=Zb[Fb],$.needsUpdate||sc.sortParticles)j.bindBuffer(j.ARRAY_BUFFER,$.buffer),j.bufferData(j.ARRAY_BUFFER,$.array,Nc)}}m.verticesNeedUpdate=!1;m.colorsNeedUpdate=!1;s.attributes&&p(s)}}};this.initMaterial=function(a,b,c,d){var e,f,h,g;a.addEventListener("dispose",
+nc);var i,k,m,l,n;a instanceof THREE.MeshDepthMaterial?n="depth":a instanceof THREE.MeshNormalMaterial?n="normal":a instanceof THREE.MeshBasicMaterial?n="basic":a instanceof THREE.MeshLambertMaterial?n="lambert":a instanceof THREE.MeshPhongMaterial?n="phong":a instanceof THREE.LineBasicMaterial?n="basic":a instanceof THREE.LineDashedMaterial?n="dashed":a instanceof THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var p=THREE.ShaderLib[n];a.uniforms=THREE.UniformsUtils.clone(p.uniforms);a.vertexShader=
+p.vertexShader;a.fragmentShader=p.fragmentShader}var q=e=0,t=0;f=p=0;for(var r=b.length;f<r;f++)h=b[f],h.onlyShadow||(h instanceof THREE.DirectionalLight&&e++,h instanceof THREE.PointLight&&q++,h instanceof THREE.SpotLight&&t++,h instanceof THREE.HemisphereLight&&p++);f=q;h=t;g=p;t=p=0;for(q=b.length;t<q;t++)r=b[t],r.castShadow&&(r instanceof THREE.SpotLight&&p++,r instanceof THREE.DirectionalLight&&!r.shadowCascade&&p++);l=p;Jb&&d&&d.useVertexTexture?m=1024:(b=j.getParameter(j.MAX_VERTEX_UNIFORM_VECTORS),
+b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),m=b);a:{var t=a.fragmentShader,q=a.vertexShader,p=a.uniforms,b=a.attributes,r=a.defines,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,
+fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:m,useVertexTexture:Jb&&d&&d.useVertexTexture,boneTextureWidth:d&&d.boneTextureWidth,boneTextureHeight:d&&d.boneTextureHeight,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:h,maxHemiLights:g,maxShadows:l,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapType:this.shadowMapType,
+shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},s,w,v,d=[];n?d.push(n):(d.push(t),d.push(q));for(w in r)d.push(w),d.push(r[w]);for(s in c)d.push(s),d.push(c[s]);n=d.join();s=0;for(w=sa.length;s<w;s++)if(d=sa[s],d.code===n){d.usedTimes++;k=d.program;break a}s="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?s="SHADOWMAP_TYPE_PCF":
+c.shadowMapType===THREE.PCFSoftShadowMap&&(s="SHADOWMAP_TYPE_PCF_SOFT");w=[];for(v in r)d=r[v],!1!==d&&(d="#define "+v+" "+d,w.push(d));d=w.join("\n");v=j.createProgram();w=["precision "+aa+" float;","precision "+aa+" int;",d,Ua?"#define VERTEX_TEXTURES":"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?"#define GAMMA_OUTPUT":"",M.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+
 c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.boneTextureWidth?"#define N_BONE_PIXEL_X "+
 c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.boneTextureWidth?"#define N_BONE_PIXEL_X "+
-c.boneTextureWidth.toFixed(1):"",c.boneTextureHeight?"#define N_BONE_PIXEL_Y "+c.boneTextureHeight.toFixed(1):"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?
+c.boneTextureWidth.toFixed(1):"",c.boneTextureHeight?"#define N_BONE_PIXEL_Y "+c.boneTextureHeight.toFixed(1):"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+s:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?
 "#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","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\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
 "#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","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\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
-t=["precision "+aa+" float;","precision "+aa+" int;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",d,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?"#define GAMMA_OUTPUT":"",M.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":
+s=["precision "+aa+" float;","precision "+aa+" int;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_derivatives : enable":"",d,"#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",M.gammaInput?"#define GAMMA_INPUT":"",M.gammaOutput?"#define GAMMA_OUTPUT":"",M.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":
 "",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
 "",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
-"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");u=C("vertex",u+q);t=C("fragment",t+r);j.attachShader(z,u);j.attachShader(z,t);j.linkProgram(z);j.getProgramParameter(z,j.LINK_STATUS)||(console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(z,j.VALIDATE_STATUS)+", gl error ["+
-j.getError()+"]"),console.error("Program Info Log: "+j.getProgramInfoLog(z)));j.deleteShader(t);j.deleteShader(u);z.uniforms={};z.attributes={};var w;t="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?t.push("boneTexture"):t.push("boneGlobalMatrices");for(w in p)t.push(w);w=t;t=0;for(u=w.length;t<u;t++)p=w[t],z.uniforms[p]=j.getUniformLocation(z,p);t="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");
-for(w=0;w<c.maxMorphTargets;w++)t.push("morphTarget"+w);for(w=0;w<c.maxMorphNormals;w++)t.push("morphNormal"+w);for(k in b)t.push(k);k=t;w=0;for(b=k.length;w<b;w++)t=k[w],z.attributes[t]=j.getAttribLocation(z,t);z.id=H++;sa.push({program:z,code:n,usedTimes:1});M.info.memory.programs=sa.length;k=z}a.program=k;w=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(k=0;k<this.maxMorphTargets;k++)z=b+k,0<=w[z]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=
-0;b="morphNormal";for(k=0;k<this.maxMorphNormals;k++)z=b+k,0<=w[z]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?j.disable(j.CULL_FACE):(b===THREE.FrontFaceDirectionCW?j.frontFace(j.CW):j.frontFace(j.CCW),a===THREE.CullFaceBack?j.cullFace(j.BACK):a===THREE.CullFaceFront?j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE))};this.setMaterialFaces=function(a){var b=
+"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+s:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");w=A("vertex",w+q);s=A("fragment",s+t);j.attachShader(v,w);j.attachShader(v,s);j.linkProgram(v);j.getProgramParameter(v,j.LINK_STATUS)||(console.error("Could not initialise shader\nVALIDATE_STATUS: "+j.getProgramParameter(v,j.VALIDATE_STATUS)+", gl error ["+
+j.getError()+"]"),console.error("Program Info Log: "+j.getProgramInfoLog(v)));j.deleteShader(s);j.deleteShader(w);v.uniforms={};v.attributes={};var z;s="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?s.push("boneTexture"):s.push("boneGlobalMatrices");for(z in p)s.push(z);z=s;s=0;for(w=z.length;s<w;s++)p=z[s],v.uniforms[p]=j.getUniformLocation(v,p);s="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");
+for(z=0;z<c.maxMorphTargets;z++)s.push("morphTarget"+z);for(z=0;z<c.maxMorphNormals;z++)s.push("morphNormal"+z);for(k in b)s.push(k);k=s;z=0;for(b=k.length;z<b;z++)s=k[z],v.attributes[s]=j.getAttribLocation(v,s);v.id=H++;sa.push({program:v,code:n,usedTimes:1});M.info.memory.programs=sa.length;k=v}a.program=k;z=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(k=0;k<this.maxMorphTargets;k++)v=b+k,0<=z[v]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=
+0;b="morphNormal";for(k=0;k<this.maxMorphNormals;k++)v=b+k,0<=z[v]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?j.disable(j.CULL_FACE):(b===THREE.FrontFaceDirectionCW?j.frontFace(j.CW):j.frontFace(j.CCW),a===THREE.CullFaceBack?j.cullFace(j.BACK):a===THREE.CullFaceFront?j.cullFace(j.FRONT):j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE))};this.setMaterialFaces=function(a){var b=
 a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;X!==b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),X=b);fa!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),fa=a)};this.setDepthTest=function(a){da!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),da=a)};this.setDepthWrite=function(a){xa!==a&&(j.depthMask(a),xa=a)};this.setBlending=function(a,b,c,d){a!==U&&(a===THREE.NoBlending?j.disable(j.BLEND):a===THREE.AdditiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.SRC_ALPHA,
 a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;X!==b&&(b?j.disable(j.CULL_FACE):j.enable(j.CULL_FACE),X=b);fa!==a&&(a?j.frontFace(j.CW):j.frontFace(j.CCW),fa=a)};this.setDepthTest=function(a){da!==a&&(a?j.enable(j.DEPTH_TEST):j.disable(j.DEPTH_TEST),da=a)};this.setDepthWrite=function(a){xa!==a&&(j.depthMask(a),xa=a)};this.setBlending=function(a,b,c,d){a!==U&&(a===THREE.NoBlending?j.disable(j.BLEND):a===THREE.AdditiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.SRC_ALPHA,
 j.ONE)):a===THREE.SubtractiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.SRC_COLOR)):a===THREE.CustomBlending?j.enable(j.BLEND):(j.enable(j.BLEND),j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,j.ONE_MINUS_SRC_ALPHA)),U=a);if(a===THREE.CustomBlending){if(b!==V&&(j.blendEquation(J(b)),V=b),c!==
 j.ONE)):a===THREE.SubtractiveBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(j.enable(j.BLEND),j.blendEquation(j.FUNC_ADD),j.blendFunc(j.ZERO,j.SRC_COLOR)):a===THREE.CustomBlending?j.enable(j.BLEND):(j.enable(j.BLEND),j.blendEquationSeparate(j.FUNC_ADD,j.FUNC_ADD),j.blendFuncSeparate(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA,j.ONE,j.ONE_MINUS_SRC_ALPHA)),U=a);if(a===THREE.CustomBlending){if(b!==V&&(j.blendEquation(J(b)),V=b),c!==
 oa||d!==ha)j.blendFunc(J(c),J(d)),oa=c,ha=d}else ha=oa=V=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",hc),a.__webglTexture=j.createTexture(),M.info.memory.textures++);j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,a.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=0===(c.width&
 oa||d!==ha)j.blendFunc(J(c),J(d)),oa=c,ha=d}else ha=oa=V=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",hc),a.__webglTexture=j.createTexture(),M.info.memory.textures++);j.activeTexture(j.TEXTURE0+b);j.bindTexture(j.TEXTURE_2D,a.__webglTexture);j.pixelStorei(j.UNPACK_FLIP_Y_WEBGL,a.flipY);j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);j.pixelStorei(j.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=0===(c.width&
@@ -530,12 +529,12 @@ THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.de
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,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;
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,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.RenderableVertex=function(){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)};THREE.RenderableFace3=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidModel=new THREE.Vector3;this.normalModel=new THREE.Vector3;this.normalModelView=new THREE.Vector3;this.vertexNormalsLength=0;this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.vertexNormalsModelView=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.material=this.color=null;this.uvs=[[]];this.z=
 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.RenderableVertex=function(){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)};THREE.RenderableFace3=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidModel=new THREE.Vector3;this.normalModel=new THREE.Vector3;this.normalModelView=new THREE.Vector3;this.vertexNormalsLength=0;this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.vertexNormalsModelView=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.material=this.color=null;this.uvs=[[]];this.z=
 0};THREE.RenderableFace4=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidModel=new THREE.Vector3;this.normalModel=new THREE.Vector3;this.normalModelView=new THREE.Vector3;this.vertexNormalsLength=0;this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.vertexNormalsModelView=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,
 0};THREE.RenderableFace4=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidModel=new THREE.Vector3;this.normalModel=new THREE.Vector3;this.normalModelView=new THREE.Vector3;this.vertexNormalsLength=0;this.vertexNormalsModel=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.vertexNormalsModelView=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,
-new THREE.Vector3];this.material=this.color=null;this.uvs=[[]];this.z=0};THREE.RenderableObject=function(){this.id=0;this.object=null;this.z=0};THREE.RenderableParticle=function(){this.id=0;this.object=null;this.z=this.y=this.x=0;this.rotation=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.vertexColors=[new THREE.Color,new THREE.Color];this.material=null;this.z=0};THREE.GeometryUtils={merge:function(a,b,c){var d,e,f=a.vertices.length,h=b instanceof THREE.Mesh?b.geometry:b,g=a.vertices,i=h.vertices,k=a.faces,l=h.faces,a=a.faceVertexUvs[0],h=h.faceVertexUvs[0];void 0===c&&(c=0);b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,e=(new THREE.Matrix3).getNormalMatrix(d));for(var b=0,m=i.length;b<m;b++){var n=i[b].clone();d&&n.applyMatrix4(d);g.push(n)}b=0;for(m=l.length;b<m;b++){var n=l[b],q,t,p=n.vertexNormals,r=n.vertexColors;n instanceof
-THREE.Face3?q=new THREE.Face3(n.a+f,n.b+f,n.c+f):n instanceof THREE.Face4&&(q=new THREE.Face4(n.a+f,n.b+f,n.c+f,n.d+f));q.normal.copy(n.normal);e&&q.normal.applyMatrix3(e).normalize();g=0;for(i=p.length;g<i;g++)t=p[g].clone(),e&&t.applyMatrix3(e).normalize(),q.vertexNormals.push(t);q.color.copy(n.color);g=0;for(i=r.length;g<i;g++)t=r[g],q.vertexColors.push(t.clone());q.materialIndex=n.materialIndex+c;q.centroid.copy(n.centroid);d&&q.centroid.applyMatrix4(d);k.push(q)}b=0;for(m=h.length;b<m;b++){c=
+new THREE.Vector3];this.material=this.color=null;this.uvs=[[]];this.z=0};THREE.RenderableObject=function(){this.id=0;this.object=null;this.z=0};THREE.RenderableParticle=function(){this.id=0;this.object=null;this.z=this.y=this.x=0;this.rotation=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.id=0;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.vertexColors=[new THREE.Color,new THREE.Color];this.material=null;this.z=0};THREE.GeometryUtils={merge:function(a,b,c){var d,e,f=a.vertices.length,h=b instanceof THREE.Mesh?b.geometry:b,g=a.vertices,i=h.vertices,k=a.faces,l=h.faces,a=a.faceVertexUvs[0],h=h.faceVertexUvs[0];void 0===c&&(c=0);b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,e=(new THREE.Matrix3).getNormalMatrix(d));for(var b=0,m=i.length;b<m;b++){var n=i[b].clone();d&&n.applyMatrix4(d);g.push(n)}b=0;for(m=l.length;b<m;b++){var n=l[b],t,s,q=n.vertexNormals,p=n.vertexColors;n instanceof
+THREE.Face3?t=new THREE.Face3(n.a+f,n.b+f,n.c+f):n instanceof THREE.Face4&&(t=new THREE.Face4(n.a+f,n.b+f,n.c+f,n.d+f));t.normal.copy(n.normal);e&&t.normal.applyMatrix3(e).normalize();g=0;for(i=q.length;g<i;g++)s=q[g].clone(),e&&s.applyMatrix3(e).normalize(),t.vertexNormals.push(s);t.color.copy(n.color);g=0;for(i=p.length;g<i;g++)s=p[g],t.vertexColors.push(s.clone());t.materialIndex=n.materialIndex+c;t.centroid.copy(n.centroid);d&&t.centroid.applyMatrix4(d);k.push(t)}b=0;for(m=h.length;b<m;b++){c=
 h[b];d=[];g=0;for(i=c.length;g<i;g++)d.push(new THREE.Vector2(c[g].x,c[g].y));a.push(d)}},removeMaterials:function(a,b){for(var c={},d=0,e=b.length;d<e;d++)c[b[d]]=!0;for(var f,h=[],d=0,e=a.faces.length;d<e;d++)f=a.faces[d],f.materialIndex in c||h.push(f);a.faces=h},randomPointInTriangle:function(){var a=new THREE.Vector3;return function(b,c,d){var e=new THREE.Vector3,f=THREE.Math.random16(),h=THREE.Math.random16();1<f+h&&(f=1-f,h=1-h);var g=1-f-h;e.copy(b);e.multiplyScalar(f);a.copy(c);a.multiplyScalar(h);
 h[b];d=[];g=0;for(i=c.length;g<i;g++)d.push(new THREE.Vector2(c[g].x,c[g].y));a.push(d)}},removeMaterials:function(a,b){for(var c={},d=0,e=b.length;d<e;d++)c[b[d]]=!0;for(var f,h=[],d=0,e=a.faces.length;d<e;d++)f=a.faces[d],f.materialIndex in c||h.push(f);a.faces=h},randomPointInTriangle:function(){var a=new THREE.Vector3;return function(b,c,d){var e=new THREE.Vector3,f=THREE.Math.random16(),h=THREE.Math.random16();1<f+h&&(f=1-f,h=1-h);var g=1-f-h;e.copy(b);e.multiplyScalar(f);a.copy(c);a.multiplyScalar(h);
 e.add(a);a.copy(d);a.multiplyScalar(g);e.add(a);return e}}(),randomPointInFace:function(a,b,c){var d,e,f;if(a instanceof THREE.Face3)return d=b.vertices[a.a],e=b.vertices[a.b],f=b.vertices[a.c],THREE.GeometryUtils.randomPointInTriangle(d,e,f);if(a instanceof THREE.Face4){d=b.vertices[a.a];e=b.vertices[a.b];f=b.vertices[a.c];var b=b.vertices[a.d],h;c?a._area1&&a._area2?(c=a._area1,h=a._area2):(c=THREE.GeometryUtils.triangleArea(d,e,b),h=THREE.GeometryUtils.triangleArea(e,f,b),a._area1=c,a._area2=h):
 e.add(a);a.copy(d);a.multiplyScalar(g);e.add(a);return e}}(),randomPointInFace:function(a,b,c){var d,e,f;if(a instanceof THREE.Face3)return d=b.vertices[a.a],e=b.vertices[a.b],f=b.vertices[a.c],THREE.GeometryUtils.randomPointInTriangle(d,e,f);if(a instanceof THREE.Face4){d=b.vertices[a.a];e=b.vertices[a.b];f=b.vertices[a.c];var b=b.vertices[a.d],h;c?a._area1&&a._area2?(c=a._area1,h=a._area2):(c=THREE.GeometryUtils.triangleArea(d,e,b),h=THREE.GeometryUtils.triangleArea(e,f,b),a._area1=c,a._area2=h):
-(c=THREE.GeometryUtils.triangleArea(d,e,b),h=THREE.GeometryUtils.triangleArea(e,f,b));return THREE.Math.random16()*(c+h)<c?THREE.GeometryUtils.randomPointInTriangle(d,e,b):THREE.GeometryUtils.randomPointInTriangle(e,f,b)}},randomPointsInGeometry:function(a,b){function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2);return k[e]>a?b(c,e-1):k[e]<a?b(e+1,d):e}return b(0,k.length-1)}var d,e,f=a.faces,h=a.vertices,g=f.length,i=0,k=[],l,m,n,q;for(e=0;e<g;e++)d=f[e],d instanceof THREE.Face3?
-(l=h[d.a],m=h[d.b],n=h[d.c],d._area=THREE.GeometryUtils.triangleArea(l,m,n)):d instanceof THREE.Face4&&(l=h[d.a],m=h[d.b],n=h[d.c],q=h[d.d],d._area1=THREE.GeometryUtils.triangleArea(l,m,q),d._area2=THREE.GeometryUtils.triangleArea(m,n,q),d._area=d._area1+d._area2),i+=d._area,k[e]=i;d=[];for(e=0;e<b;e++)h=THREE.Math.random16()*i,h=c(h),d[e]=THREE.GeometryUtils.randomPointInFace(f[h],a,!0);return d},triangleArea:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){a.subVectors(d,
+(c=THREE.GeometryUtils.triangleArea(d,e,b),h=THREE.GeometryUtils.triangleArea(e,f,b));return THREE.Math.random16()*(c+h)<c?THREE.GeometryUtils.randomPointInTriangle(d,e,b):THREE.GeometryUtils.randomPointInTriangle(e,f,b)}},randomPointsInGeometry:function(a,b){function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2);return k[e]>a?b(c,e-1):k[e]<a?b(e+1,d):e}return b(0,k.length-1)}var d,e,f=a.faces,h=a.vertices,g=f.length,i=0,k=[],l,m,n,t;for(e=0;e<g;e++)d=f[e],d instanceof THREE.Face3?
+(l=h[d.a],m=h[d.b],n=h[d.c],d._area=THREE.GeometryUtils.triangleArea(l,m,n)):d instanceof THREE.Face4&&(l=h[d.a],m=h[d.b],n=h[d.c],t=h[d.d],d._area1=THREE.GeometryUtils.triangleArea(l,m,t),d._area2=THREE.GeometryUtils.triangleArea(m,n,t),d._area=d._area1+d._area2),i+=d._area,k[e]=i;d=[];for(e=0;e<b;e++)h=THREE.Math.random16()*i,h=c(h),d[e]=THREE.GeometryUtils.randomPointInFace(f[h],a,!0);return d},triangleArea:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){a.subVectors(d,
 c);b.subVectors(e,c);a.cross(b);return 0.5*a.length()}}(),center:function(a){a.computeBoundingBox();var b=a.boundingBox,c=new THREE.Vector3;c.addVectors(b.min,b.max);c.multiplyScalar(-0.5);a.applyMatrix((new THREE.Matrix4).makeTranslation(c.x,c.y,c.z));a.computeBoundingBox();return c},triangulateQuads:function(a){var b,c,d,e,f=[],h=[],g=[];b=0;for(c=a.faceUvs.length;b<c;b++)h[b]=[];b=0;for(c=a.faceVertexUvs.length;b<c;b++)g[b]=[];b=0;for(c=a.faces.length;b<c;b++)if(d=a.faces[b],d instanceof THREE.Face4){e=
 c);b.subVectors(e,c);a.cross(b);return 0.5*a.length()}}(),center:function(a){a.computeBoundingBox();var b=a.boundingBox,c=new THREE.Vector3;c.addVectors(b.min,b.max);c.multiplyScalar(-0.5);a.applyMatrix((new THREE.Matrix4).makeTranslation(c.x,c.y,c.z));a.computeBoundingBox();return c},triangulateQuads:function(a){var b,c,d,e,f=[],h=[],g=[];b=0;for(c=a.faceUvs.length;b<c;b++)h[b]=[];b=0;for(c=a.faceVertexUvs.length;b<c;b++)g[b]=[];b=0;for(c=a.faces.length;b<c;b++)if(d=a.faces[b],d instanceof THREE.Face4){e=
 d.a;var i=d.b,k=d.c,l=d.d,m=new THREE.Face3,n=new THREE.Face3;m.color.copy(d.color);n.color.copy(d.color);m.materialIndex=d.materialIndex;n.materialIndex=d.materialIndex;m.a=e;m.b=i;m.c=l;n.a=i;n.b=k;n.c=l;4===d.vertexColors.length&&(m.vertexColors[0]=d.vertexColors[0].clone(),m.vertexColors[1]=d.vertexColors[1].clone(),m.vertexColors[2]=d.vertexColors[3].clone(),n.vertexColors[0]=d.vertexColors[1].clone(),n.vertexColors[1]=d.vertexColors[2].clone(),n.vertexColors[2]=d.vertexColors[3].clone());f.push(m,
 d.a;var i=d.b,k=d.c,l=d.d,m=new THREE.Face3,n=new THREE.Face3;m.color.copy(d.color);n.color.copy(d.color);m.materialIndex=d.materialIndex;n.materialIndex=d.materialIndex;m.a=e;m.b=i;m.c=l;n.a=i;n.b=k;n.c=l;4===d.vertexColors.length&&(m.vertexColors[0]=d.vertexColors[0].clone(),m.vertexColors[1]=d.vertexColors[1].clone(),m.vertexColors[2]=d.vertexColors[3].clone(),n.vertexColors[0]=d.vertexColors[1].clone(),n.vertexColors[1]=d.vertexColors[2].clone(),n.vertexColors[2]=d.vertexColors[3].clone());f.push(m,
 n);d=0;for(e=a.faceVertexUvs.length;d<e;d++)a.faceVertexUvs[d].length&&(m=a.faceVertexUvs[d][b],i=m[1],k=m[2],l=m[3],m=[m[0].clone(),i.clone(),l.clone()],i=[i.clone(),k.clone(),l.clone()],g[d].push(m,i));d=0;for(e=a.faceUvs.length;d<e;d++)a.faceUvs[d].length&&(i=a.faceUvs[d][b],h[d].push(i,i))}else{f.push(d);d=0;for(e=a.faceUvs.length;d<e;d++)h[d].push(a.faceUvs[d][b]);d=0;for(e=a.faceVertexUvs.length;d<e;d++)g[d].push(a.faceVertexUvs[d][b])}a.faces=f;a.faceUvs=h;a.faceVertexUvs=g;a.computeCentroids();
 n);d=0;for(e=a.faceVertexUvs.length;d<e;d++)a.faceVertexUvs[d].length&&(m=a.faceVertexUvs[d][b],i=m[1],k=m[2],l=m[3],m=[m[0].clone(),i.clone(),l.clone()],i=[i.clone(),k.clone(),l.clone()],g[d].push(m,i));d=0;for(e=a.faceUvs.length;d<e;d++)a.faceUvs[d].length&&(i=a.faceUvs[d][b],h[d].push(i,i))}else{f.push(d);d=0;for(e=a.faceUvs.length;d<e;d++)h[d].push(a.faceUvs[d][b]);d=0;for(e=a.faceVertexUvs.length;d<e;d++)g[d].push(a.faceVertexUvs[d][b])}a.faces=f;a.faceUvs=h;a.faceVertexUvs=g;a.computeCentroids();
@@ -546,14 +545,14 @@ i,!0);k.responseType="arraybuffer";k.send(null)}else k=new XMLHttpRequest,k.onlo
 b){function c(a){return a.charCodeAt(0)+(a.charCodeAt(1)<<8)+(a.charCodeAt(2)<<16)+(a.charCodeAt(3)<<24)}var d={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},e=c("DXT1"),f=c("DXT3"),h=c("DXT5"),g=new Int32Array(a,0,31);if(542327876!==g[0])return console.error("ImageUtils.parseDDS(): Invalid magic number in DDS header"),d;if(!g[20]&4)return console.error("ImageUtils.parseDDS(): Unsupported format, must contain a FourCC code"),d;var i=g[21];switch(i){case e:e=8;d.format=THREE.RGB_S3TC_DXT1_Format;
 b){function c(a){return a.charCodeAt(0)+(a.charCodeAt(1)<<8)+(a.charCodeAt(2)<<16)+(a.charCodeAt(3)<<24)}var d={mipmaps:[],width:0,height:0,format:null,mipmapCount:1},e=c("DXT1"),f=c("DXT3"),h=c("DXT5"),g=new Int32Array(a,0,31);if(542327876!==g[0])return console.error("ImageUtils.parseDDS(): Invalid magic number in DDS header"),d;if(!g[20]&4)return console.error("ImageUtils.parseDDS(): Unsupported format, must contain a FourCC code"),d;var i=g[21];switch(i){case e:e=8;d.format=THREE.RGB_S3TC_DXT1_Format;
 break;case f:e=16;d.format=THREE.RGBA_S3TC_DXT3_Format;break;case h:e=16;d.format=THREE.RGBA_S3TC_DXT5_Format;break;default:return console.error("ImageUtils.parseDDS(): Unsupported FourCC code: ",String.fromCharCode(i&255,i>>8&255,i>>16&255,i>>24&255)),d}d.mipmapCount=1;g[2]&131072&&!1!==b&&(d.mipmapCount=Math.max(1,g[7]));d.isCubemap=g[28]&512?!0:!1;d.width=g[4];d.height=g[3];for(var g=g[1]+4,f=d.width,h=d.height,i=d.isCubemap?6:1,k=0;k<i;k++){for(var l=0;l<d.mipmapCount;l++){var m=Math.max(4,f)/
 break;case f:e=16;d.format=THREE.RGBA_S3TC_DXT3_Format;break;case h:e=16;d.format=THREE.RGBA_S3TC_DXT5_Format;break;default:return console.error("ImageUtils.parseDDS(): Unsupported FourCC code: ",String.fromCharCode(i&255,i>>8&255,i>>16&255,i>>24&255)),d}d.mipmapCount=1;g[2]&131072&&!1!==b&&(d.mipmapCount=Math.max(1,g[7]));d.isCubemap=g[28]&512?!0:!1;d.width=g[4];d.height=g[3];for(var g=g[1]+4,f=d.width,h=d.height,i=d.isCubemap?6:1,k=0;k<i;k++){for(var l=0;l<d.mipmapCount;l++){var m=Math.max(4,f)/
 4*Math.max(4,h)/4*e,n={data:new Uint8Array(a,g,m),width:f,height:h};d.mipmaps.push(n);g+=m;f=Math.max(0.5*f,1);h=Math.max(0.5*h,1)}f=d.width;h=d.height}return d},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=b|1,d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var h=f.getContext("2d");h.drawImage(a,0,0);for(var g=h.getImageData(0,0,d,e).data,i=h.createImageData(d,e),k=i.data,l=0;l<d;l++)for(var m=
 4*Math.max(4,h)/4*e,n={data:new Uint8Array(a,g,m),width:f,height:h};d.mipmaps.push(n);g+=m;f=Math.max(0.5*f,1);h=Math.max(0.5*h,1)}f=d.width;h=d.height}return d},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=b|1,d=a.width,e=a.height,f=document.createElement("canvas");f.width=d;f.height=e;var h=f.getContext("2d");h.drawImage(a,0,0);for(var g=h.getImageData(0,0,d,e).data,i=h.createImageData(d,e),k=i.data,l=0;l<d;l++)for(var m=
-0;m<e;m++){var n=0>m-1?0:m-1,q=m+1>e-1?e-1:m+1,t=0>l-1?0:l-1,p=l+1>d-1?d-1:l+1,r=[],s=[0,0,g[4*(m*d+l)]/255*b];r.push([-1,0,g[4*(m*d+t)]/255*b]);r.push([-1,-1,g[4*(n*d+t)]/255*b]);r.push([0,-1,g[4*(n*d+l)]/255*b]);r.push([1,-1,g[4*(n*d+p)]/255*b]);r.push([1,0,g[4*(m*d+p)]/255*b]);r.push([1,1,g[4*(q*d+p)]/255*b]);r.push([0,1,g[4*(q*d+l)]/255*b]);r.push([-1,1,g[4*(q*d+t)]/255*b]);n=[];t=r.length;for(q=0;q<t;q++){var p=r[q],u=r[(q+1)%t],p=[p[0]-s[0],p[1]-s[1],p[2]-s[2]],u=[u[0]-s[0],u[1]-s[1],u[2]-s[2]];
-n.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]]))}r=[0,0,0];for(q=0;q<n.length;q++)r[0]+=n[q][0],r[1]+=n[q][1],r[2]+=n[q][2];r[0]/=n.length;r[1]/=n.length;r[2]/=n.length;s=4*(m*d+l);k[s]=255*((r[0]+1)/2)|0;k[s+1]=255*((r[1]+1)/2)|0;k[s+2]=255*r[2]|0;k[s+3]=255}h.putImageData(i,0,0);return f},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),h=Math.floor(255*c.g),c=Math.floor(255*c.b),g=0;g<d;g++)e[3*g]=f,e[3*g+1]=h,e[3*g+2]=c;a=new THREE.DataTexture(e,
+0;m<e;m++){var n=0>m-1?0:m-1,t=m+1>e-1?e-1:m+1,s=0>l-1?0:l-1,q=l+1>d-1?d-1:l+1,p=[],r=[0,0,g[4*(m*d+l)]/255*b];p.push([-1,0,g[4*(m*d+s)]/255*b]);p.push([-1,-1,g[4*(n*d+s)]/255*b]);p.push([0,-1,g[4*(n*d+l)]/255*b]);p.push([1,-1,g[4*(n*d+q)]/255*b]);p.push([1,0,g[4*(m*d+q)]/255*b]);p.push([1,1,g[4*(t*d+q)]/255*b]);p.push([0,1,g[4*(t*d+l)]/255*b]);p.push([-1,1,g[4*(t*d+s)]/255*b]);n=[];s=p.length;for(t=0;t<s;t++){var q=p[t],w=p[(t+1)%s],q=[q[0]-r[0],q[1]-r[1],q[2]-r[2]],w=[w[0]-r[0],w[1]-r[1],w[2]-r[2]];
+n.push(c([q[1]*w[2]-q[2]*w[1],q[2]*w[0]-q[0]*w[2],q[0]*w[1]-q[1]*w[0]]))}p=[0,0,0];for(t=0;t<n.length;t++)p[0]+=n[t][0],p[1]+=n[t][1],p[2]+=n[t][2];p[0]/=n.length;p[1]/=n.length;p[2]/=n.length;r=4*(m*d+l);k[r]=255*((p[0]+1)/2)|0;k[r+1]=255*((p[1]+1)/2)|0;k[r+2]=255*p[2]|0;k[r+3]=255}h.putImageData(i,0,0);return f},generateDataTexture:function(a,b,c){for(var d=a*b,e=new Uint8Array(3*d),f=Math.floor(255*c.r),h=Math.floor(255*c.g),c=Math.floor(255*c.b),g=0;g<d;g++)e[3*g]=f,e[3*g+1]=h,e[3*g+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(){return this.faces[this.face][this.weight][this.style]},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){for(var b=this.getFace(),c=this.size/b.resolution,d=
 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(){return this.faces[this.face][this.weight][this.style]},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){for(var b=this.getFace(),c=this.size/b.resolution,d=
-0,e=String(a).split(""),f=e.length,h=[],a=0;a<f;a++){var g=new THREE.Path,g=this.extractGlyphPoints(e[a],b,c,d,g),d=d+g.offset;h.push(g.path)}return{paths:h,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],h,g,i,k,l,m,n,q,t,p,r,s=b.glyphs[a]||b.glyphs["?"];if(s){if(s.o){b=s._cachedOutline||(s._cachedOutline=s.o.split(" "));k=b.length;for(a=0;a<k;)switch(i=b[a++],i){case "m":i=b[a++]*c+d;l=b[a++]*c;e.moveTo(i,l);break;case "l":i=b[a++]*c+d;l=b[a++]*c;e.lineTo(i,l);break;case "q":i=b[a++]*
-c+d;l=b[a++]*c;q=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(q,t,i,l);if(h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++){var u=h/g;THREE.Shape.Utils.b2(u,m,q,i);THREE.Shape.Utils.b2(u,n,t,l)}}break;case "b":if(i=b[a++]*c+d,l=b[a++]*c,q=b[a++]*c+d,t=b[a++]*-c,p=b[a++]*c+d,r=b[a++]*-c,e.bezierCurveTo(i,l,q,t,p,r),h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++)u=h/g,THREE.Shape.Utils.b3(u,m,q,p,i),THREE.Shape.Utils.b3(u,n,t,r,l)}}}return{offset:s.ha*c,path:e}}}};
+0,e=String(a).split(""),f=e.length,h=[],a=0;a<f;a++){var g=new THREE.Path,g=this.extractGlyphPoints(e[a],b,c,d,g),d=d+g.offset;h.push(g.path)}return{paths:h,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],h,g,i,k,l,m,n,t,s,q,p,r=b.glyphs[a]||b.glyphs["?"];if(r){if(r.o){b=r._cachedOutline||(r._cachedOutline=r.o.split(" "));k=b.length;for(a=0;a<k;)switch(i=b[a++],i){case "m":i=b[a++]*c+d;l=b[a++]*c;e.moveTo(i,l);break;case "l":i=b[a++]*c+d;l=b[a++]*c;e.lineTo(i,l);break;case "q":i=b[a++]*
+c+d;l=b[a++]*c;t=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(t,s,i,l);if(h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++){var w=h/g;THREE.Shape.Utils.b2(w,m,t,i);THREE.Shape.Utils.b2(w,n,s,l)}}break;case "b":if(i=b[a++]*c+d,l=b[a++]*c,t=b[a++]*c+d,s=b[a++]*-c,q=b[a++]*c+d,p=b[a++]*-c,e.bezierCurveTo(i,l,t,s,q,p),h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++)w=h/g,THREE.Shape.Utils.b3(w,m,t,q,i),THREE.Shape.Utils.b3(w,n,s,p,l)}}}return{offset:r.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){var b=b||{},c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
 THREE.FontUtils.generateShapes=function(a,b){var b=b||{},c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,h=0;h<b;f=h++)e+=a[f].x*a[h].y-a[h].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],h=[],g=[],i,k,l;if(0<b(a))for(k=0;k<e;k++)h[k]=k;else for(k=0;k<e;k++)h[k]=e-1-k;var m=2*e;for(k=e-1;2<e;){if(0>=m--){console.log("Warning, unable to triangulate polygon!");break}i=k;e<=i&&(i=0);k=i+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var n;a:{var q=n=void 0,t=void 0,p=void 0,r=void 0,s=void 0,u=void 0,z=void 0,G=
-void 0,q=a[h[i]].x,t=a[h[i]].y,p=a[h[k]].x,r=a[h[k]].y,s=a[h[l]].x,u=a[h[l]].y;if(1E-10>(p-q)*(u-t)-(r-t)*(s-q))n=!1;else{var B=void 0,F=void 0,I=void 0,E=void 0,A=void 0,O=void 0,C=void 0,K=void 0,N=void 0,y=void 0,N=K=C=G=z=void 0,B=s-p,F=u-r,I=q-s,E=t-u,A=p-q,O=r-t;for(n=0;n<e;n++)if(!(n===i||n===k||n===l))if(z=a[h[n]].x,G=a[h[n]].y,C=z-q,K=G-t,N=z-p,y=G-r,z-=s,G-=u,N=B*y-F*N,C=A*K-O*C,K=I*G-E*z,0<=N&&0<=K&&0<=C){n=!1;break a}n=!0}}if(n){f.push([a[h[i]],a[h[k]],a[h[l]]]);g.push([h[i],h[k],h[l]]);
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,h=0;h<b;f=h++)e+=a[f].x*a[h].y-a[h].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],h=[],g=[],i,k,l;if(0<b(a))for(k=0;k<e;k++)h[k]=k;else for(k=0;k<e;k++)h[k]=e-1-k;var m=2*e;for(k=e-1;2<e;){if(0>=m--){console.log("Warning, unable to triangulate polygon!");break}i=k;e<=i&&(i=0);k=i+1;e<=k&&(k=0);l=k+1;e<=l&&(l=0);var n;a:{var t=n=void 0,s=void 0,q=void 0,p=void 0,r=void 0,w=void 0,z=void 0,C=
+void 0,t=a[h[i]].x,s=a[h[i]].y,q=a[h[k]].x,p=a[h[k]].y,r=a[h[l]].x,w=a[h[l]].y;if(1E-10>(q-t)*(w-s)-(p-s)*(r-t))n=!1;else{var F=void 0,G=void 0,E=void 0,I=void 0,B=void 0,O=void 0,A=void 0,K=void 0,N=void 0,y=void 0,N=K=A=C=z=void 0,F=r-q,G=w-p,E=t-r,I=s-w,B=q-t,O=p-s;for(n=0;n<e;n++)if(!(n===i||n===k||n===l))if(z=a[h[n]].x,C=a[h[n]].y,A=z-t,K=C-s,N=z-q,y=C-p,z-=r,C-=w,N=F*y-G*N,A=B*K-O*A,K=E*C-I*z,0<=N&&0<=K&&0<=A){n=!1;break a}n=!0}}if(n){f.push([a[h[i]],a[h[k]],a[h[l]]]);g.push([h[i],h[k],h[l]]);
 i=k;for(l=k+1;l<e;i++,l++)h[i]=h[l];e--;m=2*e}}return d?g:f};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(){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};
 i=k;for(l=k+1;l<e;i++,l++)h[i]=h[l];e--;m=2*e}}return d?g:f};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(){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,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};
 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,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),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,f;f=b?b:a*c[e-1];for(var h=0,g=e-1,i;h<=g;)if(d=Math.floor(h+(g-h)/2),i=c[d]-f,0>i)h=d+1;else if(0<i)g=d-1;else{g=d;break}d=g;if(c[d]==f)return d/(e-1);h=c[d];return c=(d+(f-h)/(c[d+1]-h))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4,a=a+1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
 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,f;f=b?b:a*c[e-1];for(var h=0,g=e-1,i;h<=g;)if(d=Math.floor(h+(g-h)/2),i=c[d]-f,0>i)h=d+1;else if(0<i)g=d-1;else{g=d;break}d=g;if(c[d]==f)return d/(e-1);h=c[d];return c=(d+(f-h)/(c[d+1]-h))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4,a=a+1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
@@ -574,17 +573,17 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var h=Array.prototype.s
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var h=this.actions[this.actions.length-1].args;this.absarc(a+h[h.length-2],b+h[h.length-1],c,d,e,f)};
 THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,f){var h=this.actions[this.actions.length-1].args;this.absarc(a+h[h.length-2],b+h[h.length-1],c,d,e,f)};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,h){var g=this.actions[this.actions.length-1].args;this.absellipse(a+g[g.length-2],b+g[g.length-1],c,d,e,f,h)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,h){var g=Array.prototype.slice.call(arguments),i=new THREE.EllipseCurve(a,b,c,d,e,f,h);this.curves.push(i);i=i.getPoint(h?1:0);g.push(i.x);g.push(i.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:g})};
 THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,h){var g=this.actions[this.actions.length-1].args;this.absellipse(a+g[g.length-2],b+g[g.length-1],c,d,e,f,h)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,h){var g=Array.prototype.slice.call(arguments),i=new THREE.EllipseCurve(a,b,c,d,e,f,h);this.curves.push(i);i=i.getPoint(h?1:0);g.push(i.x);g.push(i.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:g})};
 THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;c<a;c++)b.push(this.getPoint(c/a));return b};
 THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;c<a;c++)b.push(this.getPoint(c/a));return b};
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);var a=a||12,c=[],d,e,f,h,g,i,k,l,m,n,q,t,p;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],h=f.action,f=f.args,h){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:g=f[2];i=f[3];m=f[0];n=f[1];0<c.length?(h=c[c.length-1],q=h.x,
-t=h.y):(h=this.actions[d-1].args,q=h[h.length-2],t=h[h.length-1]);for(f=1;f<=a;f++)p=f/a,h=THREE.Shape.Utils.b2(p,q,m,g),p=THREE.Shape.Utils.b2(p,t,n,i),c.push(new THREE.Vector2(h,p));break;case THREE.PathActions.BEZIER_CURVE_TO:g=f[4];i=f[5];m=f[0];n=f[1];k=f[2];l=f[3];0<c.length?(h=c[c.length-1],q=h.x,t=h.y):(h=this.actions[d-1].args,q=h[h.length-2],t=h[h.length-1]);for(f=1;f<=a;f++)p=f/a,h=THREE.Shape.Utils.b3(p,q,m,k,g),p=THREE.Shape.Utils.b3(p,t,n,l,i),c.push(new THREE.Vector2(h,p));break;case THREE.PathActions.CSPLINE_THRU:h=
-this.actions[d-1].args;p=[new THREE.Vector2(h[h.length-2],h[h.length-1])];h=a*f[0].length;p=p.concat(f[0]);p=new THREE.SplineCurve(p);for(f=1;f<=h;f++)c.push(p.getPointAt(f/h));break;case THREE.PathActions.ARC:g=f[0];i=f[1];n=f[2];k=f[3];h=f[4];m=!!f[5];q=h-k;t=2*a;for(f=1;f<=t;f++)p=f/t,m||(p=1-p),p=k+p*q,h=g+n*Math.cos(p),p=i+n*Math.sin(p),c.push(new THREE.Vector2(h,p));break;case THREE.PathActions.ELLIPSE:g=f[0];i=f[1];n=f[2];l=f[3];k=f[4];h=f[5];m=!!f[6];q=h-k;t=2*a;for(f=1;f<=t;f++)p=f/t,m||
-(p=1-p),p=k+p*q,h=g+n*Math.cos(p),p=i+l*Math.sin(p),c.push(new THREE.Vector2(h,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.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);var a=a||12,c=[],d,e,f,h,g,i,k,l,m,n,t,s,q;d=0;for(e=this.actions.length;d<e;d++)switch(f=this.actions[d],h=f.action,f=f.args,h){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(f[0],f[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:g=f[2];i=f[3];m=f[0];n=f[1];0<c.length?(h=c[c.length-1],t=h.x,
+s=h.y):(h=this.actions[d-1].args,t=h[h.length-2],s=h[h.length-1]);for(f=1;f<=a;f++)q=f/a,h=THREE.Shape.Utils.b2(q,t,m,g),q=THREE.Shape.Utils.b2(q,s,n,i),c.push(new THREE.Vector2(h,q));break;case THREE.PathActions.BEZIER_CURVE_TO:g=f[4];i=f[5];m=f[0];n=f[1];k=f[2];l=f[3];0<c.length?(h=c[c.length-1],t=h.x,s=h.y):(h=this.actions[d-1].args,t=h[h.length-2],s=h[h.length-1]);for(f=1;f<=a;f++)q=f/a,h=THREE.Shape.Utils.b3(q,t,m,k,g),q=THREE.Shape.Utils.b3(q,s,n,l,i),c.push(new THREE.Vector2(h,q));break;case THREE.PathActions.CSPLINE_THRU:h=
+this.actions[d-1].args;q=[new THREE.Vector2(h[h.length-2],h[h.length-1])];h=a*f[0].length;q=q.concat(f[0]);q=new THREE.SplineCurve(q);for(f=1;f<=h;f++)c.push(q.getPointAt(f/h));break;case THREE.PathActions.ARC:g=f[0];i=f[1];n=f[2];k=f[3];h=f[4];m=!!f[5];t=h-k;s=2*a;for(f=1;f<=s;f++)q=f/s,m||(q=1-q),q=k+q*t,h=g+n*Math.cos(q),q=i+n*Math.sin(q),c.push(new THREE.Vector2(h,q));break;case THREE.PathActions.ELLIPSE:g=f[0];i=f[1];n=f[2];l=f[3];k=f[4];h=f[5];m=!!f[6];t=h-k;s=2*a;for(f=1;f<=s;f++)q=f/s,m||
+(q=1-q),q=k+q*t,h=g+n*Math.cos(q),q=i+l*Math.sin(q),c.push(new THREE.Vector2(h,q))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
 THREE.Path.prototype.toShapes=function(a){var b,c,d,e,f=[],h=new THREE.Path;b=0;for(c=this.actions.length;b<c;b++)d=this.actions[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=h.actions.length&&(f.push(h),h=new THREE.Path),h[d].apply(h,e);0!=h.actions.length&&f.push(h);if(0==f.length)return[];var g;e=[];if(1==f.length)return d=f[0],g=new THREE.Shape,g.actions=d.actions,g.curves=d.curves,e.push(g),e;b=!THREE.Shape.Utils.isClockWise(f[0].getPoints());if(a?!b:b){g=new THREE.Shape;b=0;for(c=
 THREE.Path.prototype.toShapes=function(a){var b,c,d,e,f=[],h=new THREE.Path;b=0;for(c=this.actions.length;b<c;b++)d=this.actions[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=h.actions.length&&(f.push(h),h=new THREE.Path),h[d].apply(h,e);0!=h.actions.length&&f.push(h);if(0==f.length)return[];var g;e=[];if(1==f.length)return d=f[0],g=new THREE.Shape,g.actions=d.actions,g.curves=d.curves,e.push(g),e;b=!THREE.Shape.Utils.isClockWise(f[0].getPoints());if(a?!b:b){g=new THREE.Shape;b=0;for(c=
 f.length;b<c;b++)d=f[b],h=THREE.Shape.Utils.isClockWise(d.getPoints()),(h=a?!h:h)?(g.actions=d.actions,g.curves=d.curves,e.push(g),g=new THREE.Shape):g.holes.push(d)}else{g=void 0;b=0;for(c=f.length;b<c;b++)d=f[b],h=THREE.Shape.Utils.isClockWise(d.getPoints()),(h=a?!h:h)?(g&&e.push(g),g=new THREE.Shape,g.actions=d.actions,g.curves=d.curves):g.holes.push(d);e.push(g)}return e};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};
 f.length;b<c;b++)d=f[b],h=THREE.Shape.Utils.isClockWise(d.getPoints()),(h=a?!h:h)?(g.actions=d.actions,g.curves=d.curves,e.push(g),g=new THREE.Shape):g.holes.push(d)}else{g=void 0;b=0;for(c=f.length;b<c;b++)d=f[b],h=THREE.Shape.Utils.isClockWise(d.getPoints()),(h=a?!h:h)?(g&&e.push(g),g=new THREE.Shape,g.actions=d.actions,g.curves=d.curves):g.holes.push(d);e.push(g)}return e};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.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};
 THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
 THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),d=c.concat(),e,f,h,g,i,k,l,m,n,q,t=[];for(i=0;i<b.length;i++){k=b[i];Array.prototype.push.apply(d,k);f=Number.POSITIVE_INFINITY;for(e=0;e<k.length;e++){n=k[e];q=[];for(m=0;m<c.length;m++)l=c[m],l=n.distanceToSquared(l),q.push(l),l<f&&(f=l,h=e,g=m)}e=0<=g-1?g-1:c.length-1;f=0<=h-1?h-1:k.length-1;var p=[k[h],c[g],c[e]];m=THREE.FontUtils.Triangulate.area(p);var r=[k[h],k[f],c[g]];n=THREE.FontUtils.Triangulate.area(r);q=g;l=h;g+=1;h+=-1;0>
-g&&(g+=c.length);g%=c.length;0>h&&(h+=k.length);h%=k.length;e=0<=g-1?g-1:c.length-1;f=0<=h-1?h-1:k.length-1;p=[k[h],c[g],c[e]];p=THREE.FontUtils.Triangulate.area(p);r=[k[h],k[f],c[g]];r=THREE.FontUtils.Triangulate.area(r);m+n>p+r&&(g=q,h=l,0>g&&(g+=c.length),g%=c.length,0>h&&(h+=k.length),h%=k.length,e=0<=g-1?g-1:c.length-1,f=0<=h-1?h-1:k.length-1);m=c.slice(0,g);n=c.slice(g);q=k.slice(h);l=k.slice(0,h);f=[k[h],k[f],c[g]];t.push([k[h],c[g],c[e]]);t.push(f);c=m.concat(q).concat(l).concat(n)}return{shape:c,
-isolatedPts:t,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),f,h,g,i,k={};f=0;for(h=d.length;f<h;f++)i=d[f].x+":"+d[f].y,void 0!==k[i]&&console.log("Duplicate point",i),k[i]=f;f=0;for(h=c.length;f<h;f++){g=c[f];for(d=0;3>d;d++)i=g[d].x+":"+g[d].y,i=k[i],void 0!==i&&(g[d]=i)}f=0;for(h=e.length;f<h;f++){g=e[f];for(d=0;3>d;d++)i=g[d].x+":"+g[d].y,i=k[i],void 0!==i&&(g[d]=i)}return c.concat(e)},
+THREE.Shape.Utils={removeHoles:function(a,b){var c=a.concat(),d=c.concat(),e,f,h,g,i,k,l,m,n,t,s=[];for(i=0;i<b.length;i++){k=b[i];Array.prototype.push.apply(d,k);f=Number.POSITIVE_INFINITY;for(e=0;e<k.length;e++){n=k[e];t=[];for(m=0;m<c.length;m++)l=c[m],l=n.distanceToSquared(l),t.push(l),l<f&&(f=l,h=e,g=m)}e=0<=g-1?g-1:c.length-1;f=0<=h-1?h-1:k.length-1;var q=[k[h],c[g],c[e]];m=THREE.FontUtils.Triangulate.area(q);var p=[k[h],k[f],c[g]];n=THREE.FontUtils.Triangulate.area(p);t=g;l=h;g+=1;h+=-1;0>
+g&&(g+=c.length);g%=c.length;0>h&&(h+=k.length);h%=k.length;e=0<=g-1?g-1:c.length-1;f=0<=h-1?h-1:k.length-1;q=[k[h],c[g],c[e]];q=THREE.FontUtils.Triangulate.area(q);p=[k[h],k[f],c[g]];p=THREE.FontUtils.Triangulate.area(p);m+n>q+p&&(g=t,h=l,0>g&&(g+=c.length),g%=c.length,0>h&&(h+=k.length),h%=k.length,e=0<=g-1?g-1:c.length-1,f=0<=h-1?h-1:k.length-1);m=c.slice(0,g);n=c.slice(g);t=k.slice(h);l=k.slice(0,h);f=[k[h],k[f],c[g]];s.push([k[h],c[g],c[e]]);s.push(f);c=m.concat(t).concat(l).concat(n)}return{shape:c,
+isolatedPts:s,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),f,h,g,i,k={};f=0;for(h=d.length;f<h;f++)i=d[f].x+":"+d[f].y,void 0!==k[i]&&console.log("Duplicate point",i),k[i]=f;f=0;for(h=c.length;f<h;f++){g=c[f];for(d=0;3>d;d++)i=g[d].x+":"+g[d].y,i=k[i],void 0!==i&&(g[d]=i)}f=0;for(h=e.length;f<h;f++){g=e[f];for(d=0;3>d;d++)i=g[d].x+":"+g[d].y,i=k[i],void 0!==i&&(g[d]=i)}return c.concat(e)},
 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)+
 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(){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)};
 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(){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);THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.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);THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};
@@ -597,7 +596,7 @@ b)};c.LINEAR=0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=2;return c}();THREE.Animation
 THREE.Animation.prototype.play=function(a,b){if(!1===this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];e.matrixAutoUpdate=!0;void 0===e.animationCache&&(e.animationCache={},e.animationCache.prevKey={pos:0,rot:0,scl:0},e.animationCache.nextKey={pos:0,rot:0,scl:0},e.animationCache.originalMatrix=e instanceof THREE.Bone?e.skinMatrix:e.matrix);var f=e.animationCache.prevKey;e=e.animationCache.nextKey;
 THREE.Animation.prototype.play=function(a,b){if(!1===this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;var c,d=this.hierarchy.length,e;for(c=0;c<d;c++){e=this.hierarchy[c];e.matrixAutoUpdate=!0;void 0===e.animationCache&&(e.animationCache={},e.animationCache.prevKey={pos:0,rot:0,scl:0},e.animationCache.nextKey={pos:0,rot:0,scl:0},e.animationCache.originalMatrix=e instanceof THREE.Bone?e.skinMatrix:e.matrix);var f=e.animationCache.prevKey;e=e.animationCache.nextKey;
 f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.Animation.prototype.pause=function(){!0===this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 f.pos=this.data.hierarchy[c].keys[0];f.rot=this.data.hierarchy[c].keys[0];f.scl=this.data.hierarchy[c].keys[0];e.pos=this.getNextKeyWith("pos",c,1);e.rot=this.getNextKeyWith("rot",c,1);e.scl=this.getNextKeyWith("scl",c,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.Animation.prototype.pause=function(){!0===this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this)};
 THREE.Animation.prototype.stop=function(){this.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this)};
-THREE.Animation.prototype.update=function(a){if(!1!==this.isPlaying){var b=["pos","rot","scl"],c,d,e,f,h,g,i,k,l;l=this.currentTime+=a*this.timeScale;k=this.currentTime%=this.data.length;parseInt(Math.min(k*this.data.fps,this.data.length*this.data.fps),10);for(var m=0,n=this.hierarchy.length;m<n;m++){a=this.hierarchy[m];i=a.animationCache;for(var q=0;3>q;q++){c=b[q];h=i.prevKey[c];g=i.nextKey[c];if(g.time<=l){if(k<l)if(this.loop){h=this.data.hierarchy[m].keys[0];for(g=this.getNextKeyWith(c,m,1);g.time<
+THREE.Animation.prototype.update=function(a){if(!1!==this.isPlaying){var b=["pos","rot","scl"],c,d,e,f,h,g,i,k,l;l=this.currentTime+=a*this.timeScale;k=this.currentTime%=this.data.length;parseInt(Math.min(k*this.data.fps,this.data.length*this.data.fps),10);for(var m=0,n=this.hierarchy.length;m<n;m++){a=this.hierarchy[m];i=a.animationCache;for(var t=0;3>t;t++){c=b[t];h=i.prevKey[c];g=i.nextKey[c];if(g.time<=l){if(k<l)if(this.loop){h=this.data.hierarchy[m].keys[0];for(g=this.getNextKeyWith(c,m,1);g.time<
 k;)h=g,g=this.getNextKeyWith(c,m,g.index+1)}else{this.stop();return}else{do h=g,g=this.getNextKeyWith(c,m,g.index+1);while(g.time<k)}i.prevKey[c]=h;i.nextKey[c]=g}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(k-h.time)/(g.time-h.time);e=h[c];f=g[c];if(0>d||1<d)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+m),d=0>d?0:1;if("pos"===c)if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+
 k;)h=g,g=this.getNextKeyWith(c,m,g.index+1)}else{this.stop();return}else{do h=g,g=this.getNextKeyWith(c,m,g.index+1);while(g.time<k)}i.prevKey[c]=h;i.nextKey[c]=g}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(k-h.time)/(g.time-h.time);e=h[c];f=g[c];if(0>d||1<d)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+m),d=0>d?0:1;if("pos"===c)if(c=a.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+
 (f[2]-e[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)this.points[0]=this.getPrevKeyWith("pos",m,h.index-1).pos,this.points[1]=e,this.points[2]=f,this.points[3]=this.getNextKeyWith("pos",m,g.index+1).pos,d=0.33*d+0.33,e=this.interpolateCatmullRom(this.points,d),c.x=e[0],c.y=e[1],c.z=e[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(d=this.interpolateCatmullRom(this.points,1.01*d),
 (f[2]-e[2])*d;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)this.points[0]=this.getPrevKeyWith("pos",m,h.index-1).pos,this.points[1]=e,this.points[2]=f,this.points[3]=this.getNextKeyWith("pos",m,g.index+1).pos,d=0.33*d+0.33,e=this.interpolateCatmullRom(this.points,d),c.x=e[0],c.y=e[1],c.z=e[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(d=this.interpolateCatmullRom(this.points,1.01*d),
 this.target.set(d[0],d[1],d[2]),this.target.sub(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0))}else"rot"===c?THREE.Quaternion.slerp(e,f,a.quaternion,d):"scl"===c&&(c=a.scale,c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d)}}}};
 this.target.set(d[0],d[1],d[2]),this.target.sub(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0))}else"rot"===c?THREE.Quaternion.slerp(e,f,a.quaternion,d):"scl"===c&&(c=a.scale,c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d)}}}};
@@ -620,30 +619,30 @@ THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;thi
 THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);var a=a||50,c=void 0!==c?c:0,d=void 0!==d?d:2*Math.PI,b=void 0!==b?Math.max(3,b):8,e,f=[];e=new THREE.Vector3;var h=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(h);for(e=0;e<=b;e++){var g=new THREE.Vector3,i=c+e/b*d;g.x=a*Math.cos(i);g.y=a*Math.sin(i);this.vertices.push(g);f.push(new THREE.Vector2((g.x/a+1)/2,(g.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,c,c])),this.faceVertexUvs[0].push([f[e],
 THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);var a=a||50,c=void 0!==c?c:0,d=void 0!==d?d:2*Math.PI,b=void 0!==b?Math.max(3,b):8,e,f=[];e=new THREE.Vector3;var h=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(h);for(e=0;e<=b;e++){var g=new THREE.Vector3,i=c+e/b*d;g.x=a*Math.cos(i);g.y=a*Math.sin(i);this.vertices.push(g);f.push(new THREE.Vector2((g.x/a+1)/2,(g.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,c,c])),this.faceVertexUvs[0].push([f[e],
-f[e+1],h]);this.computeCentroids();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,f){function h(a,b,c,d,e,f,h,p){var r,s=g.widthSegments,u=g.heightSegments,z=e/2,G=f/2,B=g.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)r="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)r="y",u=g.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)r="x",s=g.depthSegments;var F=s+1,I=u+1,E=e/s,A=f/u,O=new THREE.Vector3;O[r]=0<h?1:-1;for(e=0;e<I;e++)for(f=0;f<F;f++){var C=new THREE.Vector3;C[a]=(f*E-z)*c;C[b]=(e*A-G)*d;C[r]=h;g.vertices.push(C)}for(e=
-0;e<u;e++)for(f=0;f<s;f++)a=new THREE.Face4(f+F*e+B,f+F*(e+1)+B,f+1+F*(e+1)+B,f+1+F*e+B),a.normal.copy(O),a.vertexNormals.push(O.clone(),O.clone(),O.clone(),O.clone()),a.materialIndex=p,g.faces.push(a),g.faceVertexUvs[0].push([new THREE.Vector2(f/s,1-e/u),new THREE.Vector2(f/s,1-(e+1)/u),new THREE.Vector2((f+1)/s,1-(e+1)/u),new THREE.Vector2((f+1)/s,1-e/u)])}THREE.Geometry.call(this);var g=this;this.width=a;this.height=b;this.depth=c;this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=
-f||1;a=this.width/2;b=this.height/2;c=this.depth/2;h("z","y",-1,-1,this.depth,this.height,a,0);h("z","y",1,-1,this.depth,this.height,-a,1);h("x","z",1,1,this.width,this.depth,b,2);h("x","z",1,-1,this.width,this.depth,-b,3);h("x","y",1,-1,this.width,this.height,c,4);h("x","y",-1,-1,this.width,this.height,-c,5);this.computeCentroids();this.mergeVertices()};THREE.CubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.radiusTop=a=void 0!==a?a:20;this.radiusBottom=b=void 0!==b?b:20;this.height=c=void 0!==c?c:100;this.radialSegments=d=d||8;this.heightSegments=e=e||1;this.openEnded=f=void 0!==f?f:!1;var h=c/2,g,i,k=[],l=[];for(i=0;i<=e;i++){var m=[],n=[],q=i/e,t=q*(b-a)+a;for(g=0;g<=d;g++){var p=g/d,r=new THREE.Vector3;r.x=t*Math.sin(2*p*Math.PI);r.y=-q*c+h;r.z=t*Math.cos(2*p*Math.PI);this.vertices.push(r);m.push(this.vertices.length-1);n.push(new THREE.Vector2(p,
-1-q))}k.push(m);l.push(n)}c=(b-a)/c;for(g=0;g<d;g++){0!==a?(m=this.vertices[k[0][g]].clone(),n=this.vertices[k[0][g+1]].clone()):(m=this.vertices[k[1][g]].clone(),n=this.vertices[k[1][g+1]].clone());m.setY(Math.sqrt(m.x*m.x+m.z*m.z)*c).normalize();n.setY(Math.sqrt(n.x*n.x+n.z*n.z)*c).normalize();for(i=0;i<e;i++){var q=k[i][g],t=k[i+1][g],p=k[i+1][g+1],r=k[i][g+1],s=m.clone(),u=m.clone(),z=n.clone(),G=n.clone(),B=l[i][g].clone(),F=l[i+1][g].clone(),I=l[i+1][g+1].clone(),E=l[i][g+1].clone();this.faces.push(new THREE.Face4(q,
-t,p,r,[s,u,z,G]));this.faceVertexUvs[0].push([B,F,I,E])}}if(!1===f&&0<a){this.vertices.push(new THREE.Vector3(0,h,0));for(g=0;g<d;g++)q=k[0][g],t=k[0][g+1],p=this.vertices.length-1,s=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),B=l[0][g].clone(),F=l[0][g+1].clone(),I=new THREE.Vector2(F.u,0),this.faces.push(new THREE.Face3(q,t,p,[s,u,z])),this.faceVertexUvs[0].push([B,F,I])}if(!1===f&&0<b){this.vertices.push(new THREE.Vector3(0,-h,0));for(g=0;g<d;g++)q=k[i][g+1],
-t=k[i][g],p=this.vertices.length-1,s=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),B=l[i][g+1].clone(),F=l[i][g].clone(),I=new THREE.Vector2(F.u,1),this.faces.push(new THREE.Face3(q,t,p,[s,u,z])),this.faceVertexUvs[0].push([B,F,I])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),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)};
+f[e+1],h]);this.computeCentroids();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,f){function h(a,b,c,d,e,f,h,q){var p,r=g.widthSegments,w=g.heightSegments,z=e/2,C=f/2,F=g.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)p="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)p="y",w=g.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)p="x",r=g.depthSegments;var G=r+1,E=w+1,I=e/r,B=f/w,O=new THREE.Vector3;O[p]=0<h?1:-1;for(e=0;e<E;e++)for(f=0;f<G;f++){var A=new THREE.Vector3;A[a]=(f*I-z)*c;A[b]=(e*B-C)*d;A[p]=h;g.vertices.push(A)}for(e=
+0;e<w;e++)for(f=0;f<r;f++)a=new THREE.Face4(f+G*e+F,f+G*(e+1)+F,f+1+G*(e+1)+F,f+1+G*e+F),a.normal.copy(O),a.vertexNormals.push(O.clone(),O.clone(),O.clone(),O.clone()),a.materialIndex=q,g.faces.push(a),g.faceVertexUvs[0].push([new THREE.Vector2(f/r,1-e/w),new THREE.Vector2(f/r,1-(e+1)/w),new THREE.Vector2((f+1)/r,1-(e+1)/w),new THREE.Vector2((f+1)/r,1-e/w)])}THREE.Geometry.call(this);var g=this;this.width=a;this.height=b;this.depth=c;this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=
+f||1;a=this.width/2;b=this.height/2;c=this.depth/2;h("z","y",-1,-1,this.depth,this.height,a,0);h("z","y",1,-1,this.depth,this.height,-a,1);h("x","z",1,1,this.width,this.depth,b,2);h("x","z",1,-1,this.width,this.depth,-b,3);h("x","y",1,-1,this.width,this.height,c,4);h("x","y",-1,-1,this.width,this.height,-c,5);this.computeCentroids();this.mergeVertices()};THREE.CubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.radiusTop=a=void 0!==a?a:20;this.radiusBottom=b=void 0!==b?b:20;this.height=c=void 0!==c?c:100;this.radialSegments=d=d||8;this.heightSegments=e=e||1;this.openEnded=f=void 0!==f?f:!1;var h=c/2,g,i,k=[],l=[];for(i=0;i<=e;i++){var m=[],n=[],t=i/e,s=t*(b-a)+a;for(g=0;g<=d;g++){var q=g/d,p=new THREE.Vector3;p.x=s*Math.sin(2*q*Math.PI);p.y=-t*c+h;p.z=s*Math.cos(2*q*Math.PI);this.vertices.push(p);m.push(this.vertices.length-1);n.push(new THREE.Vector2(q,
+1-t))}k.push(m);l.push(n)}c=(b-a)/c;for(g=0;g<d;g++){0!==a?(m=this.vertices[k[0][g]].clone(),n=this.vertices[k[0][g+1]].clone()):(m=this.vertices[k[1][g]].clone(),n=this.vertices[k[1][g+1]].clone());m.setY(Math.sqrt(m.x*m.x+m.z*m.z)*c).normalize();n.setY(Math.sqrt(n.x*n.x+n.z*n.z)*c).normalize();for(i=0;i<e;i++){var t=k[i][g],s=k[i+1][g],q=k[i+1][g+1],p=k[i][g+1],r=m.clone(),w=m.clone(),z=n.clone(),C=n.clone(),F=l[i][g].clone(),G=l[i+1][g].clone(),E=l[i+1][g+1].clone(),I=l[i][g+1].clone();this.faces.push(new THREE.Face4(t,
+s,q,p,[r,w,z,C]));this.faceVertexUvs[0].push([F,G,E,I])}}if(!1===f&&0<a){this.vertices.push(new THREE.Vector3(0,h,0));for(g=0;g<d;g++)t=k[0][g],s=k[0][g+1],q=this.vertices.length-1,r=new THREE.Vector3(0,1,0),w=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),F=l[0][g].clone(),G=l[0][g+1].clone(),E=new THREE.Vector2(G.u,0),this.faces.push(new THREE.Face3(t,s,q,[r,w,z])),this.faceVertexUvs[0].push([F,G,E])}if(!1===f&&0<b){this.vertices.push(new THREE.Vector3(0,-h,0));for(g=0;g<d;g++)t=k[i][g+1],
+s=k[i][g],q=this.vertices.length-1,r=new THREE.Vector3(0,-1,0),w=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),F=l[i][g+1].clone(),G=l[i][g].clone(),E=new THREE.Vector2(G.u,1),this.faces.push(new THREE.Face3(t,s,q,[r,w,z])),this.faceVertexUvs[0].push([F,G,E])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),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=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).add(f);i.copy(a).add(g);if(h.equals(i))return g.clone();
 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=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).add(f);i.copy(a).add(g);if(h.equals(i))return g.clone();
-h.copy(b).add(f);i.copy(c).add(g);f=d.dot(g);g=i.sub(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).add(h).sub(a).clone()}function e(c,d){var e,f;for(Q=c.length;0<=--Q;){e=Q;f=Q-1;0>f&&(f=c.length-1);for(var g=0,h=q+2*l,
-g=0;g<h;g++){var i=qa*g,k=qa*(g+1),m=d+e+i,i=d+f+i,n=d+f+k,k=d+e+k,p=c,r=g,s=h,t=e,w=f,m=m+K,i=i+K,n=n+K,k=k+K;C.faces.push(new THREE.Face4(m,i,n,k,null,null,u));m=z.generateSideWallUV(C,a,p,b,m,i,n,k,r,s,t,w);C.faceVertexUvs[0].push(m)}}}function f(a,b,c){C.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=K;d+=K;e+=K;C.faces.push(new THREE.Face3(c,d,e,null,null,s));c=f?z.generateBottomUV(C,a,b,c,d,e):z.generateTopUV(C,a,b,c,d,e);C.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:
-100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,l=void 0!==b.bevelSegments?b.bevelSegments:3,m=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,p,r=!1,s=b.material,u=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,G,B,F,I;t&&(p=t.getSpacedPoints(q),r=!0,m=!1,G=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,
-!1),B=new THREE.Vector3,F=new THREE.Vector3,I=new THREE.Vector3);m||(k=i=l=0);var E,A,O,C=this,K=this.vertices.length,n=a.extractPoints(n),N=n.shape,n=n.holes;if(t=!THREE.Shape.Utils.isClockWise(N)){N=N.reverse();A=0;for(O=n.length;A<O;A++)E=n[A],THREE.Shape.Utils.isClockWise(E)&&(n[A]=E.reverse());t=!1}var y=THREE.Shape.Utils.triangulateShape(N,n),t=N;A=0;for(O=n.length;A<O;A++)E=n[A],N=N.concat(E);var J,w,aa,L,qa=N.length,Pa=y.length,Sa=[],Q=0,ia=t.length;J=ia-1;for(w=Q+1;Q<ia;Q++,J++,w++)J===ia&&
-(J=0),w===ia&&(w=0),Sa[Q]=d(t[Q],t[J],t[w]);var Wa=[],M,sa=Sa.concat();A=0;for(O=n.length;A<O;A++){E=n[A];M=[];Q=0;ia=E.length;J=ia-1;for(w=Q+1;Q<ia;Q++,J++,w++)J===ia&&(J=0),w===ia&&(w=0),M[Q]=d(E[Q],E[J],E[w]);Wa.push(M);sa=sa.concat(M)}for(J=0;J<l;J++){E=J/l;aa=i*(1-E);w=k*Math.sin(E*Math.PI/2);Q=0;for(ia=t.length;Q<ia;Q++)L=c(t[Q],Sa[Q],w),f(L.x,L.y,-aa);A=0;for(O=n.length;A<O;A++){E=n[A];M=Wa[A];Q=0;for(ia=E.length;Q<ia;Q++)L=c(E[Q],M[Q],w),f(L.x,L.y,-aa)}}w=k;for(Q=0;Q<qa;Q++)L=m?c(N[Q],sa[Q],
-w):N[Q],r?(F.copy(G.normals[0]).multiplyScalar(L.x),B.copy(G.binormals[0]).multiplyScalar(L.y),I.copy(p[0]).add(F).add(B),f(I.x,I.y,I.z)):f(L.x,L.y,0);for(E=1;E<=q;E++)for(Q=0;Q<qa;Q++)L=m?c(N[Q],sa[Q],w):N[Q],r?(F.copy(G.normals[E]).multiplyScalar(L.x),B.copy(G.binormals[E]).multiplyScalar(L.y),I.copy(p[E]).add(F).add(B),f(I.x,I.y,I.z)):f(L.x,L.y,g/q*E);for(J=l-1;0<=J;J--){E=J/l;aa=i*(1-E);w=k*Math.sin(E*Math.PI/2);Q=0;for(ia=t.length;Q<ia;Q++)L=c(t[Q],Sa[Q],w),f(L.x,L.y,g+aa);A=0;for(O=n.length;A<
-O;A++){E=n[A];M=Wa[A];Q=0;for(ia=E.length;Q<ia;Q++)L=c(E[Q],M[Q],w),r?f(L.x,L.y+p[q-1].y,p[q-1].x+aa):f(L.x,L.y,g+aa)}}if(m){i=0*qa;for(Q=0;Q<Pa;Q++)g=y[Q],h(g[2]+i,g[1]+i,g[0]+i,!0);i=qa*(q+2*l);for(Q=0;Q<Pa;Q++)g=y[Q],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(Q=0;Q<Pa;Q++)g=y[Q],h(g[2],g[1],g[0],!0);for(Q=0;Q<Pa;Q++)g=y[Q],h(g[0]+qa*q,g[1]+qa*q,g[2]+qa*q,!1)}g=0;e(t,g);g+=t.length;A=0;for(O=n.length;A<O;A++)E=n[A],e(E,g),g+=E.length};
+h.copy(b).add(f);i.copy(c).add(g);f=d.dot(g);g=i.sub(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).add(h).sub(a).clone()}function e(c,d){var e,f;for(Q=c.length;0<=--Q;){e=Q;f=Q-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*l,
+g=0;g<h;g++){var i=qa*g,k=qa*(g+1),m=d+e+i,i=d+f+i,n=d+f+k,k=d+e+k,p=c,q=g,r=h,s=e,v=f,m=m+K,i=i+K,n=n+K,k=k+K;A.faces.push(new THREE.Face4(m,i,n,k,null,null,w));m=z.generateSideWallUV(A,a,p,b,m,i,n,k,q,r,s,v);A.faceVertexUvs[0].push(m)}}}function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=K;d+=K;e+=K;A.faces.push(new THREE.Face3(c,d,e,null,null,r));c=f?z.generateBottomUV(A,a,b,c,d,e):z.generateTopUV(A,a,b,c,d,e);A.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:
+100,i=void 0!==b.bevelThickness?b.bevelThickness:6,k=void 0!==b.bevelSize?b.bevelSize:i-2,l=void 0!==b.bevelSegments?b.bevelSegments:3,m=void 0!==b.bevelEnabled?b.bevelEnabled:!0,n=void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,q,p=!1,r=b.material,w=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,C,F,G,E;s&&(q=s.getSpacedPoints(t),p=!0,m=!1,C=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,
+!1),F=new THREE.Vector3,G=new THREE.Vector3,E=new THREE.Vector3);m||(k=i=l=0);var I,B,O,A=this,K=this.vertices.length,n=a.extractPoints(n),N=n.shape,n=n.holes;if(s=!THREE.Shape.Utils.isClockWise(N)){N=N.reverse();B=0;for(O=n.length;B<O;B++)I=n[B],THREE.Shape.Utils.isClockWise(I)&&(n[B]=I.reverse());s=!1}var y=THREE.Shape.Utils.triangulateShape(N,n),s=N;B=0;for(O=n.length;B<O;B++)I=n[B],N=N.concat(I);var J,v,aa,L,qa=N.length,Pa=y.length,Sa=[],Q=0,ia=s.length;J=ia-1;for(v=Q+1;Q<ia;Q++,J++,v++)J===ia&&
+(J=0),v===ia&&(v=0),Sa[Q]=d(s[Q],s[J],s[v]);var Wa=[],M,sa=Sa.concat();B=0;for(O=n.length;B<O;B++){I=n[B];M=[];Q=0;ia=I.length;J=ia-1;for(v=Q+1;Q<ia;Q++,J++,v++)J===ia&&(J=0),v===ia&&(v=0),M[Q]=d(I[Q],I[J],I[v]);Wa.push(M);sa=sa.concat(M)}for(J=0;J<l;J++){I=J/l;aa=i*(1-I);v=k*Math.sin(I*Math.PI/2);Q=0;for(ia=s.length;Q<ia;Q++)L=c(s[Q],Sa[Q],v),f(L.x,L.y,-aa);B=0;for(O=n.length;B<O;B++){I=n[B];M=Wa[B];Q=0;for(ia=I.length;Q<ia;Q++)L=c(I[Q],M[Q],v),f(L.x,L.y,-aa)}}v=k;for(Q=0;Q<qa;Q++)L=m?c(N[Q],sa[Q],
+v):N[Q],p?(G.copy(C.normals[0]).multiplyScalar(L.x),F.copy(C.binormals[0]).multiplyScalar(L.y),E.copy(q[0]).add(G).add(F),f(E.x,E.y,E.z)):f(L.x,L.y,0);for(I=1;I<=t;I++)for(Q=0;Q<qa;Q++)L=m?c(N[Q],sa[Q],v):N[Q],p?(G.copy(C.normals[I]).multiplyScalar(L.x),F.copy(C.binormals[I]).multiplyScalar(L.y),E.copy(q[I]).add(G).add(F),f(E.x,E.y,E.z)):f(L.x,L.y,g/t*I);for(J=l-1;0<=J;J--){I=J/l;aa=i*(1-I);v=k*Math.sin(I*Math.PI/2);Q=0;for(ia=s.length;Q<ia;Q++)L=c(s[Q],Sa[Q],v),f(L.x,L.y,g+aa);B=0;for(O=n.length;B<
+O;B++){I=n[B];M=Wa[B];Q=0;for(ia=I.length;Q<ia;Q++)L=c(I[Q],M[Q],v),p?f(L.x,L.y+q[t-1].y,q[t-1].x+aa):f(L.x,L.y,g+aa)}}if(m){i=0*qa;for(Q=0;Q<Pa;Q++)g=y[Q],h(g[2]+i,g[1]+i,g[0]+i,!0);i=qa*(t+2*l);for(Q=0;Q<Pa;Q++)g=y[Q],h(g[0]+i,g[1]+i,g[2]+i,!1)}else{for(Q=0;Q<Pa;Q++)g=y[Q],h(g[2],g[1],g[0],!0);for(Q=0;Q<Pa;Q++)g=y[Q],h(g[0]+qa*t,g[1]+qa*t,g[2]+qa*t,!1)}g=0;e(s,g);g+=s.length;B=0;for(O=n.length;B<O;B++)I=n[B],e(I,g),g+=I.length};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,h,g){var b=a.vertices[e].x,c=a.vertices[e].y,e=a.vertices[e].z,d=a.vertices[f].x,i=a.vertices[f].y,f=a.vertices[f].z,k=a.vertices[h].x,
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,h,g){var b=a.vertices[e].x,c=a.vertices[e].y,e=a.vertices[e].z,d=a.vertices[f].x,i=a.vertices[f].y,f=a.vertices[f].z,k=a.vertices[h].x,
 l=a.vertices[h].y,h=a.vertices[h].z,m=a.vertices[g].x,n=a.vertices[g].y,a=a.vertices[g].z;return 0.01>Math.abs(c-i)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(k,1-h),new THREE.Vector2(m,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(i,1-f),new THREE.Vector2(l,1-h),new THREE.Vector2(n,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;
 l=a.vertices[h].y,h=a.vertices[h].z,m=a.vertices[g].x,n=a.vertices[g].y,a=a.vertices[g].z;return 0.01>Math.abs(c-i)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(k,1-h),new THREE.Vector2(m,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(i,1-f),new THREE.Vector2(l,1-h),new THREE.Vector2(n,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);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeCentroids();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.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.shapebb=a[a.length-1].getBoundingBox();this.addShapeList(a,b);this.computeCentroids();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,f,h,g=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var i=e.shape,k=e.holes;if(!THREE.Shape.Utils.isClockWise(i)){i=i.reverse();e=0;for(f=k.length;e<f;e++)h=k[e],THREE.Shape.Utils.isClockWise(h)&&(k[e]=h.reverse())}var l=THREE.Shape.Utils.triangulateShape(i,k);e=0;for(f=k.length;e<f;e++)h=k[e],
 THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,f,h,g=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var i=e.shape,k=e.holes;if(!THREE.Shape.Utils.isClockWise(i)){i=i.reverse();e=0;for(f=k.length;e<f;e++)h=k[e],THREE.Shape.Utils.isClockWise(h)&&(k[e]=h.reverse())}var l=THREE.Shape.Utils.triangulateShape(i,k);e=0;for(f=k.length;e<f;e++)h=k[e],
-i=i.concat(h);k=i.length;f=l.length;for(e=0;e<k;e++)h=i[e],this.vertices.push(new THREE.Vector3(h.x,h.y,0));for(e=0;e<f;e++)k=l[e],i=k[0]+g,h=k[1]+g,k=k[2]+g,this.faces.push(new THREE.Face3(i,h,k,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,i,h,k))};THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var b=b||12,c=c||0,d=d||2*Math.PI,e=1/(a.length-1),f=1/b,h=0,g=b;h<=g;h++)for(var i=c+h*f*d,k=Math.cos(i),l=Math.sin(i),i=0,m=a.length;i<m;i++){var n=a[i],q=new THREE.Vector3;q.x=k*n.x-l*n.y;q.y=l*n.x+k*n.y;q.z=n.z;this.vertices.push(q)}c=a.length;h=0;for(g=b;h<g;h++){i=0;for(m=a.length-1;i<m;i++)d=b=i+c*h,l=b+c,k=b+1+c,this.faces.push(new THREE.Face4(d,l,k,b+1)),k=h*f,b=i*e,d=k+f,l=b+e,this.faceVertexUvs[0].push([new THREE.Vector2(k,
+i=i.concat(h);k=i.length;f=l.length;for(e=0;e<k;e++)h=i[e],this.vertices.push(new THREE.Vector3(h.x,h.y,0));for(e=0;e<f;e++)k=l[e],i=k[0]+g,h=k[1]+g,k=k[2]+g,this.faces.push(new THREE.Face3(i,h,k,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,i,h,k))};THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);for(var b=b||12,c=c||0,d=d||2*Math.PI,e=1/(a.length-1),f=1/b,h=0,g=b;h<=g;h++)for(var i=c+h*f*d,k=Math.cos(i),l=Math.sin(i),i=0,m=a.length;i<m;i++){var n=a[i],t=new THREE.Vector3;t.x=k*n.x-l*n.y;t.y=l*n.x+k*n.y;t.z=n.z;this.vertices.push(t)}c=a.length;h=0;for(g=b;h<g;h++){i=0;for(m=a.length-1;i<m;i++)d=b=i+c*h,l=b+c,k=b+1+c,this.faces.push(new THREE.Face4(d,l,k,b+1)),k=h*f,b=i*e,d=k+f,l=b+e,this.faceVertexUvs[0].push([new THREE.Vector2(k,
 b),new THREE.Vector2(d,b),new THREE.Vector2(d,l),new THREE.Vector2(k,l)])}this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.width=a;this.height=b;this.widthSegments=c||1;this.heightSegments=d||1;for(var c=a/2,e=b/2,d=this.widthSegments,f=this.heightSegments,h=d+1,g=f+1,i=this.width/d,k=this.height/f,l=new THREE.Vector3(0,0,1),a=0;a<g;a++)for(b=0;b<h;b++)this.vertices.push(new THREE.Vector3(b*i-c,-(a*k-e),0));for(a=0;a<f;a++)for(b=0;b<d;b++)c=new THREE.Face4(b+h*a,b+h*(a+1),b+1+h*(a+1),b+1+h*a),c.normal.copy(l),c.vertexNormals.push(l.clone(),l.clone(),
 b),new THREE.Vector2(d,b),new THREE.Vector2(d,l),new THREE.Vector2(k,l)])}this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.width=a;this.height=b;this.widthSegments=c||1;this.heightSegments=d||1;for(var c=a/2,e=b/2,d=this.widthSegments,f=this.heightSegments,h=d+1,g=f+1,i=this.width/d,k=this.height/f,l=new THREE.Vector3(0,0,1),a=0;a<g;a++)for(b=0;b<h;b++)this.vertices.push(new THREE.Vector3(b*i-c,-(a*k-e),0));for(a=0;a<f;a++)for(b=0;b<d;b++)c=new THREE.Face4(b+h*a,b+h*(a+1),b+1+h*(a+1),b+1+h*a),c.normal.copy(l),c.vertexNormals.push(l.clone(),l.clone(),
 l.clone(),l.clone()),this.faces.push(c),this.faceVertexUvs[0].push([new THREE.Vector2(b/d,1-a/f),new THREE.Vector2(b/d,1-(a+1)/f),new THREE.Vector2((b+1)/d,1-(a+1)/f),new THREE.Vector2((b+1)/d,1-a/f)]);this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);for(var a=a||0,b=b||50,e=void 0!==e?e:0,f=void 0!==f?f:2*Math.PI,c=void 0!==c?Math.max(3,c):8,d=void 0!==d?Math.max(3,d):8,h=[],g=a,i=(b-a)/d,a=0;a<=d;a++){for(b=0;b<=c;b++){var k=new THREE.Vector3,l=e+b/c*f;k.x=g*Math.cos(l);k.y=g*Math.sin(l);this.vertices.push(k);h.push(new THREE.Vector2((k.x/g+1)/2,-(k.y/g+1)/2+1))}g+=i}e=new THREE.Vector3(0,0,1);for(a=0;a<d;a++){f=a*c;for(b=0;b<=c;b++){var l=b+f,i=l+a,k=l+c+a,m=l+c+1+a;this.faces.push(new THREE.Face3(i,
 l.clone(),l.clone()),this.faces.push(c),this.faceVertexUvs[0].push([new THREE.Vector2(b/d,1-a/f),new THREE.Vector2(b/d,1-(a+1)/f),new THREE.Vector2((b+1)/d,1-(a+1)/f),new THREE.Vector2((b+1)/d,1-a/f)]);this.computeCentroids()};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);for(var a=a||0,b=b||50,e=void 0!==e?e:0,f=void 0!==f?f:2*Math.PI,c=void 0!==c?Math.max(3,c):8,d=void 0!==d?Math.max(3,d):8,h=[],g=a,i=(b-a)/d,a=0;a<=d;a++){for(b=0;b<=c;b++){var k=new THREE.Vector3,l=e+b/c*f;k.x=g*Math.cos(l);k.y=g*Math.sin(l);this.vertices.push(k);h.push(new THREE.Vector2((k.x/g+1)/2,-(k.y/g+1)/2+1))}g+=i}e=new THREE.Vector3(0,0,1);for(a=0;a<d;a++){f=a*c;for(b=0;b<=c;b++){var l=b+f,i=l+a,k=l+c+a,m=l+c+1+a;this.faces.push(new THREE.Face3(i,
-k,m,[e,e,e]));this.faceVertexUvs[0].push([h[i],h[k],h[m]]);i=l+a;k=l+c+1+a;m=l+1+a;this.faces.push(new THREE.Face3(i,k,m,[e,e,e]));this.faceVertexUvs[0].push([h[i],h[k],h[m]])}}this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,g)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry=function(a,b,c,d,e,f,h){THREE.Geometry.call(this);this.radius=a=a||50;this.widthSegments=b=Math.max(3,Math.floor(b)||8);this.heightSegments=c=Math.max(2,Math.floor(c)||6);this.phiStart=d=void 0!==d?d:0;this.phiLength=e=void 0!==e?e:2*Math.PI;this.thetaStart=f=void 0!==f?f:0;this.thetaLength=h=void 0!==h?h:Math.PI;var g,i,k=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(g=0;g<=b;g++){var q=g/b,t=i/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+q*e)*Math.sin(f+t*h);p.y=a*Math.cos(f+t*h);
-p.z=a*Math.sin(d+q*e)*Math.sin(f+t*h);this.vertices.push(p);m.push(this.vertices.length-1);n.push(new THREE.Vector2(q,1-t))}k.push(m);l.push(n)}for(i=0;i<this.heightSegments;i++)for(g=0;g<this.widthSegments;g++){var b=k[i][g+1],c=k[i][g],d=k[i+1][g],e=k[i+1][g+1],f=this.vertices[b].clone().normalize(),h=this.vertices[c].clone().normalize(),m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),q=l[i][g+1].clone(),t=l[i][g].clone(),p=l[i+1][g].clone(),r=l[i+1][g+1].clone();Math.abs(this.vertices[b].y)===
-this.radius?(this.faces.push(new THREE.Face3(b,d,e,[f,m,n])),this.faceVertexUvs[0].push([q,p,r])):Math.abs(this.vertices[d].y)===this.radius?(this.faces.push(new THREE.Face3(b,c,d,[f,h,m])),this.faceVertexUvs[0].push([q,t,p])):(this.faces.push(new THREE.Face4(b,c,d,e,[f,h,m,n])),this.faceVertexUvs[0].push([q,t,p,r]))}this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TextGeometry=function(a,b){var b=b||{},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)};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.radialSegments=c||8;this.tubularSegments=d||6;this.arc=e||2*Math.PI;e=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.radialSegments;c++)for(d=0;d<=this.tubularSegments;d++){var f=d/this.tubularSegments*this.arc,h=2*c/this.radialSegments*Math.PI;e.x=this.radius*Math.cos(f);e.y=this.radius*Math.sin(f);var g=new THREE.Vector3;g.x=(this.radius+this.tube*Math.cos(h))*Math.cos(f);g.y=(this.radius+this.tube*
+k,m,[e,e,e]));this.faceVertexUvs[0].push([h[i],h[k],h[m]]);i=l+a;k=l+c+1+a;m=l+1+a;this.faces.push(new THREE.Face3(i,k,m,[e,e,e]));this.faceVertexUvs[0].push([h[i],h[k],h[m]])}}this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,g)};THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry=function(a,b,c,d,e,f,h){THREE.Geometry.call(this);this.radius=a=a||50;this.widthSegments=b=Math.max(3,Math.floor(b)||8);this.heightSegments=c=Math.max(2,Math.floor(c)||6);this.phiStart=d=void 0!==d?d:0;this.phiLength=e=void 0!==e?e:2*Math.PI;this.thetaStart=f=void 0!==f?f:0;this.thetaLength=h=void 0!==h?h:Math.PI;var g,i,k=[],l=[];for(i=0;i<=c;i++){var m=[],n=[];for(g=0;g<=b;g++){var t=g/b,s=i/c,q=new THREE.Vector3;q.x=-a*Math.cos(d+t*e)*Math.sin(f+s*h);q.y=a*Math.cos(f+s*h);
+q.z=a*Math.sin(d+t*e)*Math.sin(f+s*h);this.vertices.push(q);m.push(this.vertices.length-1);n.push(new THREE.Vector2(t,1-s))}k.push(m);l.push(n)}for(i=0;i<this.heightSegments;i++)for(g=0;g<this.widthSegments;g++){var b=k[i][g+1],c=k[i][g],d=k[i+1][g],e=k[i+1][g+1],f=this.vertices[b].clone().normalize(),h=this.vertices[c].clone().normalize(),m=this.vertices[d].clone().normalize(),n=this.vertices[e].clone().normalize(),t=l[i][g+1].clone(),s=l[i][g].clone(),q=l[i+1][g].clone(),p=l[i+1][g+1].clone();Math.abs(this.vertices[b].y)===
+this.radius?(this.faces.push(new THREE.Face3(b,d,e,[f,m,n])),this.faceVertexUvs[0].push([t,q,p])):Math.abs(this.vertices[d].y)===this.radius?(this.faces.push(new THREE.Face3(b,c,d,[f,h,m])),this.faceVertexUvs[0].push([t,s,q])):(this.faces.push(new THREE.Face4(b,c,d,e,[f,h,m,n])),this.faceVertexUvs[0].push([t,s,q,p]))}this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TextGeometry=function(a,b){var b=b||{},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)};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.radialSegments=c||8;this.tubularSegments=d||6;this.arc=e||2*Math.PI;e=new THREE.Vector3;a=[];b=[];for(c=0;c<=this.radialSegments;c++)for(d=0;d<=this.tubularSegments;d++){var f=d/this.tubularSegments*this.arc,h=2*c/this.radialSegments*Math.PI;e.x=this.radius*Math.cos(f);e.y=this.radius*Math.sin(f);var g=new THREE.Vector3;g.x=(this.radius+this.tube*Math.cos(h))*Math.cos(f);g.y=(this.radius+this.tube*
 Math.cos(h))*Math.sin(f);g.z=this.tube*Math.sin(h);this.vertices.push(g);a.push(new THREE.Vector2(d/this.tubularSegments,c/this.radialSegments));b.push(g.clone().sub(e).normalize())}for(c=1;c<=this.radialSegments;c++)for(d=1;d<=this.tubularSegments;d++){var e=(this.tubularSegments+1)*c+d-1,f=(this.tubularSegments+1)*(c-1)+d-1,h=(this.tubularSegments+1)*(c-1)+d,g=(this.tubularSegments+1)*c+d,i=new THREE.Face4(e,f,h,g,[b[e],b[f],b[h],b[g]]);i.normal.add(b[e]);i.normal.add(b[f]);i.normal.add(b[h]);i.normal.add(b[g]);
 Math.cos(h))*Math.sin(f);g.z=this.tube*Math.sin(h);this.vertices.push(g);a.push(new THREE.Vector2(d/this.tubularSegments,c/this.radialSegments));b.push(g.clone().sub(e).normalize())}for(c=1;c<=this.radialSegments;c++)for(d=1;d<=this.tubularSegments;d++){var e=(this.tubularSegments+1)*c+d-1,f=(this.tubularSegments+1)*(c-1)+d-1,h=(this.tubularSegments+1)*(c-1)+d,g=(this.tubularSegments+1)*c+d,i=new THREE.Face4(e,f,h,g,[b[e],b[f],b[h],b[g]]);i.normal.add(b[e]);i.normal.add(b[f]);i.normal.add(b[h]);i.normal.add(b[g]);
 i.normal.normalize();this.faces.push(i);this.faceVertexUvs[0].push([a[e].clone(),a[f].clone(),a[h].clone(),a[g].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry=function(a,b,c,d,e,f,h){function g(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a),a=b/c*a,b=Math.cos(a),f=0.5*(d*(2+b))*f,g=0.5*d*(2+b)*g,d=0.5*e*d*Math.sin(a);return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.radialSegments=c||64;this.tubularSegments=d||8;this.p=e||2;this.q=f||3;this.heightScale=h||1;this.grid=Array(this.radialSegments);c=new THREE.Vector3;d=new THREE.Vector3;e=new THREE.Vector3;for(a=0;a<this.radialSegments;++a){this.grid[a]=
 i.normal.normalize();this.faces.push(i);this.faceVertexUvs[0].push([a[e].clone(),a[f].clone(),a[h].clone(),a[g].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry=function(a,b,c,d,e,f,h){function g(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a),a=b/c*a,b=Math.cos(a),f=0.5*(d*(2+b))*f,g=0.5*d*(2+b)*g,d=0.5*e*d*Math.sin(a);return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.radius=a||100;this.tube=b||40;this.radialSegments=c||64;this.tubularSegments=d||8;this.p=e||2;this.q=f||3;this.heightScale=h||1;this.grid=Array(this.radialSegments);c=new THREE.Vector3;d=new THREE.Vector3;e=new THREE.Vector3;for(a=0;a<this.radialSegments;++a){this.grid[a]=
 Array(this.tubularSegments);b=2*(a/this.radialSegments)*this.p*Math.PI;f=g(b,this.q,this.p,this.radius,this.heightScale);b=g(b+0.01,this.q,this.p,this.radius,this.heightScale);c.subVectors(b,f);d.addVectors(b,f);e.crossVectors(c,d);d.crossVectors(e,c);e.normalize();d.normalize();for(b=0;b<this.tubularSegments;++b){var i=2*(b/this.tubularSegments)*Math.PI,h=-this.tube*Math.cos(i),i=this.tube*Math.sin(i),k=new THREE.Vector3;k.x=f.x+h*d.x+i*e.x;k.y=f.y+h*d.y+i*e.y;k.z=f.z+h*d.z+i*e.z;this.grid[a][b]=
 Array(this.tubularSegments);b=2*(a/this.radialSegments)*this.p*Math.PI;f=g(b,this.q,this.p,this.radius,this.heightScale);b=g(b+0.01,this.q,this.p,this.radius,this.heightScale);c.subVectors(b,f);d.addVectors(b,f);e.crossVectors(c,d);d.crossVectors(e,c);e.normalize();d.normalize();for(b=0;b<this.tubularSegments;++b){var i=2*(b/this.tubularSegments)*Math.PI,h=-this.tube*Math.cos(i),i=this.tube*Math.sin(i),k=new THREE.Vector3;k.x=f.x+h*d.x+i*e.x;k.y=f.y+h*d.y+i*e.y;k.z=f.z+h*d.z+i*e.z;this.grid[a][b]=
@@ -654,10 +653,10 @@ h=new THREE.Vector2((b+1)/this.segments,(c+1)/this.radialSegments),i=new THREE.V
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],h=[],g=new THREE.Vector3,i=new THREE.Matrix4,b=b+1,k,l,m;this.tangents=e;this.normals=f;this.binormals=h;for(k=0;k<b;k++)l=k/(b-1),e[k]=a.getTangentAt(l),e[k].normalize();f[0]=new THREE.Vector3;h[0]=new THREE.Vector3;a=Number.MAX_VALUE;k=Math.abs(e[0].x);l=Math.abs(e[0].y);m=Math.abs(e[0].z);k<=a&&(a=k,d.set(1,0,0));l<=a&&(a=l,d.set(0,1,0));m<=a&&d.set(0,0,1);g.crossVectors(e[0],
 THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],f=[],h=[],g=new THREE.Vector3,i=new THREE.Matrix4,b=b+1,k,l,m;this.tangents=e;this.normals=f;this.binormals=h;for(k=0;k<b;k++)l=k/(b-1),e[k]=a.getTangentAt(l),e[k].normalize();f[0]=new THREE.Vector3;h[0]=new THREE.Vector3;a=Number.MAX_VALUE;k=Math.abs(e[0].x);l=Math.abs(e[0].y);m=Math.abs(e[0].z);k<=a&&(a=k,d.set(1,0,0));l<=a&&(a=l,d.set(0,1,0));m<=a&&d.set(0,0,1);g.crossVectors(e[0],
 d).normalize();f[0].crossVectors(e[0],g);h[0].crossVectors(e[0],f[0]);for(k=1;k<b;k++)f[k]=f[k-1].clone(),h[k]=h[k-1].clone(),g.crossVectors(e[k-1],e[k]),1E-4<g.length()&&(g.normalize(),d=Math.acos(THREE.Math.clamp(e[k-1].dot(e[k]),-1,1)),f[k].applyMatrix4(i.makeRotationAxis(g,d))),h[k].crossVectors(e[k],f[k]);if(c){d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1));d/=b-1;0<e[0].dot(g.crossVectors(f[0],f[b-1]))&&(d=-d);for(k=1;k<b;k++)f[k].applyMatrix4(i.makeRotationAxis(e[k],d*k)),h[k].crossVectors(e[k],
 d).normalize();f[0].crossVectors(e[0],g);h[0].crossVectors(e[0],f[0]);for(k=1;k<b;k++)f[k]=f[k-1].clone(),h[k]=h[k-1].clone(),g.crossVectors(e[k-1],e[k]),1E-4<g.length()&&(g.normalize(),d=Math.acos(THREE.Math.clamp(e[k-1].dot(e[k]),-1,1)),f[k].applyMatrix4(i.makeRotationAxis(g,d))),h[k].crossVectors(e[k],f[k]);if(c){d=Math.acos(THREE.Math.clamp(f[0].dot(f[b-1]),-1,1));d/=b-1;0<e[0].dot(g.crossVectors(f[0],f[b-1]))&&(d=-d);for(k=1;k<b;k++)f[k].applyMatrix4(i.makeRotationAxis(e[k],d*k)),h[k].crossVectors(e[k],
 f[k])}};THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=g.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 f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);d.centroid.add(a).add(b).add(c).divideScalar(3);g.faces.push(d);d=Math.atan2(d.centroid.z,-d.centroid.x);g.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),
 f[k])}};THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=g.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 f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);d.centroid.add(a).add(b).add(c).divideScalar(3);g.faces.push(d);d=Math.atan2(d.centroid.z,-d.centroid.x);g.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),
-h(c.uv,c,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);for(var c=c||1,d=d||0,g=this,i=0,k=a.length;i<k;i++)e(new THREE.Vector3(a[i][0],a[i][1],a[i][2]));for(var l=this.vertices,a=[],i=0,k=b.length;i<k;i++){var m=l[b[i][0]],n=l[b[i][1]],q=l[b[i][2]];a[i]=new THREE.Face3(m.index,n.index,q.index,[m.clone(),n.clone(),q.clone()])}i=0;for(k=a.length;i<k;i++){n=a[i];l=d;b=Math.pow(2,
-l);Math.pow(4,l);for(var l=e(g.vertices[n.a]),m=e(g.vertices[n.b]),t=e(g.vertices[n.c]),n=[],q=0;q<=b;q++){n[q]=[];for(var p=e(l.clone().lerp(t,q/b)),r=e(m.clone().lerp(t,q/b)),s=b-q,u=0;u<=s;u++)n[q][u]=0==u&&q==b?p:e(p.clone().lerp(r,u/s))}for(q=0;q<b;q++)for(u=0;u<2*(b-q)-1;u++)l=Math.floor(u/2),0==u%2?f(n[q][l+1],n[q+1][l],n[q][l]):f(n[q][l+1],n[q+1][l+1],n[q+1][l])}i=0;for(k=this.faceVertexUvs[0].length;i<k;i++)d=this.faceVertexUvs[0][i],a=d[0].x,b=d[1].x,l=d[2].x,m=Math.max(a,Math.max(b,l)),
-n=Math.min(a,Math.min(b,l)),0.9<m&&0.1>n&&(0.2>a&&(d[0].x+=1),0.2>b&&(d[1].x+=1),0.2>l&&(d[2].x+=1));i=0;for(k=this.vertices.length;i<k;i++)this.vertices[i].multiplyScalar(c);this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.IcosahedronGeometry=function(a,b){this.radius=a;this.detail=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)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry=function(a,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)};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)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry=function(a,b,c,d){THREE.Geometry.call(this);var e=this.vertices,f=this.faces,h=this.faceVertexUvs[0],d=void 0===d?!1:d,g,i,k,l,m=b+1;for(g=0;g<=c;g++){l=g/c;for(i=0;i<=b;i++)k=i/b,k=a(k,l),e.push(k)}var n,q,t,p;for(g=0;g<c;g++)for(i=0;i<b;i++)a=g*m+i,e=g*m+i+1,l=(g+1)*m+i,k=(g+1)*m+i+1,n=new THREE.Vector2(i/b,g/c),q=new THREE.Vector2((i+1)/b,g/c),t=new THREE.Vector2(i/b,(g+1)/c),p=new THREE.Vector2((i+1)/b,(g+1)/c),d?(f.push(new THREE.Face3(a,e,l)),f.push(new THREE.Face3(e,
-k,l)),h.push([n,q,t]),h.push([q,p,t])):(f.push(new THREE.Face4(a,e,k,l)),h.push([n,q,p,t]));this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.AxisHelper=function(a){var a=a||1,b=new THREE.Geometry;b.vertices.push(new THREE.Vector3,new THREE.Vector3(a,0,0),new THREE.Vector3,new THREE.Vector3(0,a,0),new THREE.Vector3,new THREE.Vector3(0,0,a));b.colors.push(new THREE.Color(16711680),new THREE.Color(16755200),new THREE.Color(65280),new THREE.Color(11206400),new THREE.Color(255),new THREE.Color(43775));a=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,b,a,THREE.LinePieces)};
+h(c.uv,c,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);for(var c=c||1,d=d||0,g=this,i=0,k=a.length;i<k;i++)e(new THREE.Vector3(a[i][0],a[i][1],a[i][2]));for(var l=this.vertices,a=[],i=0,k=b.length;i<k;i++){var m=l[b[i][0]],n=l[b[i][1]],t=l[b[i][2]];a[i]=new THREE.Face3(m.index,n.index,t.index,[m.clone(),n.clone(),t.clone()])}i=0;for(k=a.length;i<k;i++){n=a[i];l=d;b=Math.pow(2,
+l);Math.pow(4,l);for(var l=e(g.vertices[n.a]),m=e(g.vertices[n.b]),s=e(g.vertices[n.c]),n=[],t=0;t<=b;t++){n[t]=[];for(var q=e(l.clone().lerp(s,t/b)),p=e(m.clone().lerp(s,t/b)),r=b-t,w=0;w<=r;w++)n[t][w]=0==w&&t==b?q:e(q.clone().lerp(p,w/r))}for(t=0;t<b;t++)for(w=0;w<2*(b-t)-1;w++)l=Math.floor(w/2),0==w%2?f(n[t][l+1],n[t+1][l],n[t][l]):f(n[t][l+1],n[t+1][l+1],n[t+1][l])}i=0;for(k=this.faceVertexUvs[0].length;i<k;i++)d=this.faceVertexUvs[0][i],a=d[0].x,b=d[1].x,l=d[2].x,m=Math.max(a,Math.max(b,l)),
+n=Math.min(a,Math.min(b,l)),0.9<m&&0.1>n&&(0.2>a&&(d[0].x+=1),0.2>b&&(d[1].x+=1),0.2>l&&(d[2].x+=1));i=0;for(k=this.vertices.length;i<k;i++)this.vertices[i].multiplyScalar(c);this.mergeVertices();this.computeCentroids();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.IcosahedronGeometry=function(a,b){this.radius=a;this.detail=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)};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.OctahedronGeometry=function(a,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)};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)};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ParametricGeometry=function(a,b,c,d){THREE.Geometry.call(this);var e=this.vertices,f=this.faces,h=this.faceVertexUvs[0],d=void 0===d?!1:d,g,i,k,l,m=b+1;for(g=0;g<=c;g++){l=g/c;for(i=0;i<=b;i++)k=i/b,k=a(k,l),e.push(k)}var n,t,s,q;for(g=0;g<c;g++)for(i=0;i<b;i++)a=g*m+i,e=g*m+i+1,l=(g+1)*m+i,k=(g+1)*m+i+1,n=new THREE.Vector2(i/b,g/c),t=new THREE.Vector2((i+1)/b,g/c),s=new THREE.Vector2(i/b,(g+1)/c),q=new THREE.Vector2((i+1)/b,(g+1)/c),d?(f.push(new THREE.Face3(a,e,l)),f.push(new THREE.Face3(e,
+k,l)),h.push([n,t,s]),h.push([t,q,s])):(f.push(new THREE.Face4(a,e,k,l)),h.push([n,t,q,s]));this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.AxisHelper=function(a){var a=a||1,b=new THREE.Geometry;b.vertices.push(new THREE.Vector3,new THREE.Vector3(a,0,0),new THREE.Vector3,new THREE.Vector3(0,a,0),new THREE.Vector3,new THREE.Vector3(0,0,a));b.colors.push(new THREE.Color(16711680),new THREE.Color(16755200),new THREE.Color(65280),new THREE.Color(11206400),new THREE.Color(255),new THREE.Color(43775));a=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,b,a,THREE.LinePieces)};
 THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);THREE.ArrowHelper=function(a,b,c,d){THREE.Object3D.call(this);void 0===d&&(d=16776960);void 0===c&&(c=1);this.position=b;b=new THREE.Geometry;b.vertices.push(new THREE.Vector3(0,0,0));b.vertices.push(new THREE.Vector3(0,1,0));this.line=new THREE.Line(b,new THREE.LineBasicMaterial({color:d}));this.line.matrixAutoUpdate=!1;this.add(this.line);b=new THREE.CylinderGeometry(0,0.05,0.25,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,0.875,0));this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:d}));
 THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);THREE.ArrowHelper=function(a,b,c,d){THREE.Object3D.call(this);void 0===d&&(d=16776960);void 0===c&&(c=1);this.position=b;b=new THREE.Geometry;b.vertices.push(new THREE.Vector3(0,0,0));b.vertices.push(new THREE.Vector3(0,1,0));this.line=new THREE.Line(b,new THREE.LineBasicMaterial({color:d}));this.line.matrixAutoUpdate=!1;this.add(this.line);b=new THREE.CylinderGeometry(0,0.05,0.25,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,0.875,0));this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:d}));
 this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(a);this.setLength(c)};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))}}();THREE.ArrowHelper.prototype.setLength=function(a){this.scale.set(a,a,a)};
 this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(a);this.setLength(c)};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))}}();THREE.ArrowHelper.prototype.setLength=function(a){this.scale.set(a,a,a)};
 THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.setHex(a);this.cone.material.color.setHex(a)};THREE.BoxHelper=function(a){var b=[new THREE.Vector3(1,1,1),new THREE.Vector3(-1,1,1),new THREE.Vector3(-1,-1,1),new THREE.Vector3(1,-1,1),new THREE.Vector3(1,1,-1),new THREE.Vector3(-1,1,-1),new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,-1,-1)];this.vertices=b;var c=new THREE.Geometry;c.vertices.push(b[0],b[1],b[1],b[2],b[2],b[3],b[3],b[0],b[4],b[5],b[5],b[6],b[6],b[7],b[7],b[4],b[0],b[4],b[1],b[5],b[2],b[6],b[3],b[7]);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);
 THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.setHex(a);this.cone.material.color.setHex(a)};THREE.BoxHelper=function(a){var b=[new THREE.Vector3(1,1,1),new THREE.Vector3(-1,1,1),new THREE.Vector3(-1,-1,1),new THREE.Vector3(1,-1,1),new THREE.Vector3(1,1,-1),new THREE.Vector3(-1,1,-1),new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,-1,-1)];this.vertices=b;var c=new THREE.Geometry;c.vertices.push(b[0],b[1],b[1],b[2],b[2],b[3],b[3],b[0],b[4],b[5],b[5],b[6],b[6],b[7],b[7],b[4],b[0],b[4],b[1],b[5],b[2],b[6],b[3],b[7]);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);
@@ -677,7 +676,7 @@ THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3;return
 THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,h=0,g=0,i=e.length;g<i;g++)for(var k=e[g],l=0,m=k.vertexNormals.length;l<m;l++){var n=k.vertexNormals[l];c[h].copy(d[k[b[l]]]).applyMatrix4(f);a.copy(n).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
 THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,h=0,g=0,i=e.length;g<i;g++)for(var k=e[g],l=0,m=k.vertexNormals.length;l<m;l++){var n=k.vertexNormals[l];c[h].copy(d[k[b[l]]]).applyMatrix4(f);a.copy(n).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
 a.add(c[h]);h+=1;c[h].copy(a);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var b=c||255,d=d||1,c=new THREE.Geometry,a=a.geometry.faces,e=0,f=a.length;e<f;e++)for(var h=0,g=a[e].vertexTangents.length;h<g;h++)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);
 a.add(c[h]);h+=1;c[h].copy(a);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var b=c||255,d=d||1,c=new THREE.Geometry,a=a.geometry.faces,e=0,f=a.length;e<f;e++)for(var h=0,g=a[e].vertexTangents.length;h<g;h++)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(){var a=new THREE.Vector3;return function(){var b=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,h=0,g=0,i=e.length;g<i;g++)for(var k=e[g],l=0,m=k.vertexTangents.length;l<m;l++){var n=k.vertexTangents[l];c[h].copy(d[k[b[l]]]).applyMatrix4(f);a.copy(n).transformDirection(f).multiplyScalar(this.size);a.add(c[h]);h+=1;c[h].copy(a);
 THREE.VertexTangentsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,h=0,g=0,i=e.length;g<i;g++)for(var k=e[g],l=0,m=k.vertexTangents.length;l<m;l++){var n=k.vertexTangents[l];c[h].copy(d[k[b[l]]]).applyMatrix4(f);a.copy(n).transformDirection(f).multiplyScalar(this.size);a.add(c[h]);h+=1;c[h].copy(a);
-h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.WireframeHelper=function(a){for(var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c","d"],f=new THREE.Geometry,h=a.geometry.vertices,g=a.geometry.faces,i=0,k=g.length;i<k;i++)for(var l=g[i],m=l instanceof THREE.Face4?4:3,n=0;n<m;n++){b[0]=l[e[n]];b[1]=l[e[(n+1)%m]];b.sort(d);var q=b.toString();void 0===c[q]&&(f.vertices.push(h[b[0]]),f.vertices.push(h[b[1]]),c[q]=!0)}THREE.Line.call(this,f,new THREE.LineBasicMaterial({color:16777215}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=
+h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.WireframeHelper=function(a){for(var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c","d"],f=new THREE.Geometry,h=a.geometry.vertices,g=a.geometry.faces,i=0,k=g.length;i<k;i++)for(var l=g[i],m=l instanceof THREE.Face4?4:3,n=0;n<m;n++){b[0]=l[e[n]];b[1]=l[e[(n+1)%m]];b.sort(d);var t=b.toString();void 0===c[t]&&(f.vertices.push(h[b[0]]),f.vertices.push(h[b[1]]),c[t]=!0)}THREE.Line.call(this,f,new THREE.LineBasicMaterial({color:16777215}),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(){}};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);
 a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(){}};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,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=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:f,color:e,blending:d})};
 THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=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:f,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=0.25*c.x*Math.PI,c.rotation+=0.25*(c.wantedRotation-c.rotation)};THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);
 THREE.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=0.25*c.x*Math.PI,c.rotation+=0.25*(c.wantedRotation-c.rotation)};THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);
@@ -687,38 +686,38 @@ THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=thi
 THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b};
 THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b};
 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.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 f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),h=d.weight;
 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 f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),h=d.weight;
-f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*h,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*h;this.morphTargetInfluences[d.lastFrame]=(1-e)*h}}};THREE.LensFlarePlugin=function(){function a(a,c){var d=b.createProgram(),e=b.createShader(b.FRAGMENT_SHADER),f=b.createShader(b.VERTEX_SHADER),g="precision "+c+" float;\n";b.shaderSource(e,g+a.fragmentShader);b.shaderSource(f,g+a.vertexShader);b.compileShader(e);b.compileShader(f);b.attachShader(d,e);b.attachShader(d,f);b.linkProgram(d);return d}var b,c,d,e,f,h,g,i,k,l,m,n,q;this.init=function(t){b=t.context;c=t;d=t.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);t=0;e[t++]=-1;e[t++]=-1;
-e[t++]=0;e[t++]=0;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=1;e[t++]=-1;e[t++]=1;e[t++]=0;e[t++]=1;t=0;f[t++]=0;f[t++]=1;f[t++]=2;f[t++]=0;f[t++]=2;f[t++]=3;h=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,h);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);i=b.createTexture();k=b.createTexture();b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
+f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*h,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*h;this.morphTargetInfluences[d.lastFrame]=(1-e)*h}}};THREE.LensFlarePlugin=function(){function a(a,c){var d=b.createProgram(),e=b.createShader(b.FRAGMENT_SHADER),f=b.createShader(b.VERTEX_SHADER),g="precision "+c+" float;\n";b.shaderSource(e,g+a.fragmentShader);b.shaderSource(f,g+a.vertexShader);b.compileShader(e);b.compileShader(f);b.attachShader(d,e);b.attachShader(d,f);b.linkProgram(d);return d}var b,c,d,e,f,h,g,i,k,l,m,n,t;this.init=function(s){b=s.context;c=s;d=s.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);s=0;e[s++]=-1;e[s++]=-1;
+e[s++]=0;e[s++]=0;e[s++]=1;e[s++]=-1;e[s++]=1;e[s++]=0;e[s++]=1;e[s++]=1;e[s++]=1;e[s++]=1;e[s++]=-1;e[s++]=1;e[s++]=0;e[s++]=1;s=0;f[s++]=0;f[s++]=1;f[s++]=2;f[s++]=0;f[s++]=2;f[s++]=3;h=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,h);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);i=b.createTexture();k=b.createTexture();b.bindTexture(b.TEXTURE_2D,i);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
 0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);
 0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);
-b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(l=!1,m=a(THREE.ShaderFlares.lensFlare,d)):(l=!0,m=a(THREE.ShaderFlares.lensFlareVertexTexture,d));n={};q={};n.vertex=b.getAttribLocation(m,"position");n.uv=b.getAttribLocation(m,"uv");q.renderType=b.getUniformLocation(m,"renderType");q.map=b.getUniformLocation(m,"map");q.occlusionMap=b.getUniformLocation(m,"occlusionMap");q.opacity=
-b.getUniformLocation(m,"opacity");q.color=b.getUniformLocation(m,"color");q.scale=b.getUniformLocation(m,"scale");q.rotation=b.getUniformLocation(m,"rotation");q.screenPosition=b.getUniformLocation(m,"screenPosition")};this.render=function(a,d,e,f){var a=a.__webglFlares,u=a.length;if(u){var z=new THREE.Vector3,G=f/e,B=0.5*e,F=0.5*f,I=16/f,E=new THREE.Vector2(I*G,I),A=new THREE.Vector3(1,1,0),O=new THREE.Vector2(1,1),C=q,I=n;b.useProgram(m);b.enableVertexAttribArray(n.vertex);b.enableVertexAttribArray(n.uv);
-b.uniform1i(C.occlusionMap,0);b.uniform1i(C.map,1);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(I.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(I.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(!1);var K,N,y,J,w;for(K=0;K<u;K++)if(I=16/f,E.set(I*G,I),J=a[K],z.set(J.matrixWorld.elements[12],J.matrixWorld.elements[13],J.matrixWorld.elements[14]),z.applyMatrix4(d.matrixWorldInverse),z.applyProjection(d.projectionMatrix),A.copy(z),O.x=A.x*B+B,
-O.y=A.y*F+F,l||0<O.x&&O.x<e&&0<O.y&&O.y<f){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,O.x-8,O.y-8,16,16,0);b.uniform1i(C.renderType,0);b.uniform2f(C.scale,E.x,E.y);b.uniform3f(C.screenPosition,A.x,A.y,A.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,k);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,O.x-8,O.y-8,16,16,0);b.uniform1i(C.renderType,1);b.disable(b.DEPTH_TEST);
-b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);J.positionScreen.copy(A);J.customUpdateCallback?J.customUpdateCallback(J):J.updateLensFlares();b.uniform1i(C.renderType,2);b.enable(b.BLEND);N=0;for(y=J.lensFlares.length;N<y;N++)w=J.lensFlares[N],0.001<w.opacity&&0.001<w.scale&&(A.x=w.x,A.y=w.y,A.z=w.z,I=w.size*w.scale/f,E.x=I*G,E.y=I,b.uniform3f(C.screenPosition,A.x,A.y,A.z),b.uniform2f(C.scale,E.x,E.y),b.uniform1f(C.rotation,w.rotation),b.uniform1f(C.opacity,
-w.opacity),b.uniform3f(C.color,w.color.r,w.color.g,w.color.b),c.setBlending(w.blending,w.blendEquation,w.blendSrc,w.blendDst),c.setTexture(w.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0))}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4,i=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
-vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(m,n){var q,t,p,r,s,u,z,G,B,F=[];r=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
-a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);q=0;for(t=m.__lights.length;q<t;q++)if(p=m.__lights[q],p.castShadow)if(p instanceof THREE.DirectionalLight&&p.shadowCascade)for(s=0;s<p.shadowCascadeCount;s++){var I;if(p.shadowCascadeArray[s])I=p.shadowCascadeArray[s];else{B=p;z=s;I=new THREE.DirectionalLight;I.isVirtual=!0;I.onlyShadow=!0;I.castShadow=!0;I.shadowCameraNear=B.shadowCameraNear;I.shadowCameraFar=B.shadowCameraFar;I.shadowCameraLeft=B.shadowCameraLeft;I.shadowCameraRight=B.shadowCameraRight;
-I.shadowCameraBottom=B.shadowCameraBottom;I.shadowCameraTop=B.shadowCameraTop;I.shadowCameraVisible=B.shadowCameraVisible;I.shadowDarkness=B.shadowDarkness;I.shadowBias=B.shadowCascadeBias[z];I.shadowMapWidth=B.shadowCascadeWidth[z];I.shadowMapHeight=B.shadowCascadeHeight[z];I.pointsWorld=[];I.pointsFrustum=[];G=I.pointsWorld;u=I.pointsFrustum;for(var E=0;8>E;E++)G[E]=new THREE.Vector3,u[E]=new THREE.Vector3;G=B.shadowCascadeNearZ[z];B=B.shadowCascadeFarZ[z];u[0].set(-1,-1,G);u[1].set(1,-1,G);u[2].set(-1,
-1,G);u[3].set(1,1,G);u[4].set(-1,-1,B);u[5].set(1,-1,B);u[6].set(-1,1,B);u[7].set(1,1,B);I.originalCamera=n;u=new THREE.Gyroscope;u.position=p.shadowCascadeOffset;u.add(I);u.add(I.target);n.add(u);p.shadowCascadeArray[s]=I;console.log("Created virtualLight",I)}z=p;G=s;B=z.shadowCascadeArray[G];B.position.copy(z.position);B.target.position.copy(z.target.position);B.lookAt(B.target);B.shadowCameraVisible=z.shadowCameraVisible;B.shadowDarkness=z.shadowDarkness;B.shadowBias=z.shadowCascadeBias[G];u=z.shadowCascadeNearZ[G];
-z=z.shadowCascadeFarZ[G];B=B.pointsFrustum;B[0].z=u;B[1].z=u;B[2].z=u;B[3].z=u;B[4].z=z;B[5].z=z;B[6].z=z;B[7].z=z;F[r]=I;r++}else F[r]=p,r++;q=0;for(t=F.length;q<t;q++){p=F[q];p.shadowMap||(s=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(s=THREE.NearestFilter),p.shadowMap=new THREE.WebGLRenderTarget(p.shadowMapWidth,p.shadowMapHeight,{minFilter:s,magFilter:s,format:THREE.RGBAFormat}),p.shadowMapSize=new THREE.Vector2(p.shadowMapWidth,p.shadowMapHeight),p.shadowMatrix=new THREE.Matrix4);
-if(!p.shadowCamera){if(p instanceof THREE.SpotLight)p.shadowCamera=new THREE.PerspectiveCamera(p.shadowCameraFov,p.shadowMapWidth/p.shadowMapHeight,p.shadowCameraNear,p.shadowCameraFar);else if(p instanceof THREE.DirectionalLight)p.shadowCamera=new THREE.OrthographicCamera(p.shadowCameraLeft,p.shadowCameraRight,p.shadowCameraTop,p.shadowCameraBottom,p.shadowCameraNear,p.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}m.add(p.shadowCamera);!0===m.autoUpdate&&m.updateMatrixWorld()}p.shadowCameraVisible&&
-!p.cameraHelper&&(p.cameraHelper=new THREE.CameraHelper(p.shadowCamera),p.shadowCamera.add(p.cameraHelper));if(p.isVirtual&&I.originalCamera==n){s=n;r=p.shadowCamera;u=p.pointsFrustum;B=p.pointsWorld;i.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(z=0;8>z;z++)G=B[z],G.copy(u[z]),THREE.ShadowMapPlugin.__projector.unprojectVector(G,s),G.applyMatrix4(r.matrixWorldInverse),G.x<i.x&&(i.x=G.x),G.x>k.x&&(k.x=G.x),G.y<i.y&&(i.y=G.y),G.y>k.y&&(k.y=G.y),G.z<i.z&&(i.z=G.z),G.z>k.z&&
-(k.z=G.z);r.left=i.x;r.right=k.x;r.top=k.y;r.bottom=i.y;r.updateProjectionMatrix()}r=p.shadowMap;u=p.shadowMatrix;s=p.shadowCamera;s.position.getPositionFromMatrix(p.matrixWorld);l.getPositionFromMatrix(p.target.matrixWorld);s.lookAt(l);s.updateMatrixWorld();s.matrixWorldInverse.getInverse(s.matrixWorld);p.cameraHelper&&(p.cameraHelper.visible=p.shadowCameraVisible);p.shadowCameraVisible&&p.cameraHelper.update();u.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);u.multiply(s.projectionMatrix);u.multiply(s.matrixWorldInverse);
-g.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(r);b.clear();B=m.__webglObjects;p=0;for(r=B.length;p<r;p++)if(z=B[p],u=z.object,z.render=!1,u.visible&&u.castShadow&&(!(u instanceof THREE.Mesh||u instanceof THREE.ParticleSystem)||!u.frustumCulled||h.intersectsObject(u)))u._modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,u.matrixWorld),z.render=!0;p=0;for(r=B.length;p<r;p++)z=B[p],z.render&&(u=z.object,z=z.buffer,E=u.material instanceof THREE.MeshFaceMaterial?
-u.material.materials[0]:u.material,G=0<u.geometry.morphTargets.length&&E.morphTargets,E=u instanceof THREE.SkinnedMesh&&E.skinning,G=u.customDepthMaterial?u.customDepthMaterial:E?G?f:e:G?d:c,z instanceof THREE.BufferGeometry?b.renderBufferDirect(s,m.__lights,null,G,z,u):b.renderBuffer(s,m.__lights,null,G,z,u));B=m.__webglObjectsImmediate;p=0;for(r=B.length;p<r;p++)z=B[p],u=z.object,u.visible&&u.castShadow&&(u._modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,u.matrixWorld),b.renderImmediateObject(s,
-m.__lights,null,c,u))}q=b.getClearColor();t=b.getClearAlpha();a.clearColor(q.r,q.g,q.b,t);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){function a(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var b,c,d,e,f,h,g,i,k,l;this.init=function(a){b=a.context;c=a;d=a.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);a=0;e[a++]=-1;e[a++]=-1;e[a++]=0;e[a++]=0;e[a++]=1;e[a++]=-1;e[a++]=1;e[a++]=0;e[a++]=1;e[a++]=1;e[a++]=1;e[a++]=1;e[a++]=-1;e[a++]=1;e[a++]=0;e[a++]=1;a=0;f[a++]=0;f[a++]=1;f[a++]=2;f[a++]=0;f[a++]=2;f[a++]=3;h=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,h);b.bufferData(b.ARRAY_BUFFER,
-e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);var a=THREE.ShaderSprite.sprite,n=b.createProgram(),q=b.createShader(b.FRAGMENT_SHADER),t=b.createShader(b.VERTEX_SHADER),p="precision "+d+" float;\n";b.shaderSource(q,p+a.fragmentShader);b.shaderSource(t,p+a.vertexShader);b.compileShader(q);b.compileShader(t);b.attachShader(n,q);b.attachShader(n,t);b.linkProgram(n);i=n;k={};l={};k.position=b.getAttribLocation(i,"position");k.uv=b.getAttribLocation(i,
+b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(l=!1,m=a(THREE.ShaderFlares.lensFlare,d)):(l=!0,m=a(THREE.ShaderFlares.lensFlareVertexTexture,d));n={};t={};n.vertex=b.getAttribLocation(m,"position");n.uv=b.getAttribLocation(m,"uv");t.renderType=b.getUniformLocation(m,"renderType");t.map=b.getUniformLocation(m,"map");t.occlusionMap=b.getUniformLocation(m,"occlusionMap");t.opacity=
+b.getUniformLocation(m,"opacity");t.color=b.getUniformLocation(m,"color");t.scale=b.getUniformLocation(m,"scale");t.rotation=b.getUniformLocation(m,"rotation");t.screenPosition=b.getUniformLocation(m,"screenPosition")};this.render=function(a,d,e,f){var a=a.__webglFlares,w=a.length;if(w){var z=new THREE.Vector3,C=f/e,F=0.5*e,G=0.5*f,E=16/f,I=new THREE.Vector2(E*C,E),B=new THREE.Vector3(1,1,0),O=new THREE.Vector2(1,1),A=t,E=n;b.useProgram(m);b.enableVertexAttribArray(n.vertex);b.enableVertexAttribArray(n.uv);
+b.uniform1i(A.occlusionMap,0);b.uniform1i(A.map,1);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(E.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(E.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(!1);var K,N,y,J,v;for(K=0;K<w;K++)if(E=16/f,I.set(E*C,E),J=a[K],z.set(J.matrixWorld.elements[12],J.matrixWorld.elements[13],J.matrixWorld.elements[14]),z.applyMatrix4(d.matrixWorldInverse),z.applyProjection(d.projectionMatrix),B.copy(z),O.x=B.x*F+F,
+O.y=B.y*G+G,l||0<O.x&&O.x<e&&0<O.y&&O.y<f){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,O.x-8,O.y-8,16,16,0);b.uniform1i(A.renderType,0);b.uniform2f(A.scale,I.x,I.y);b.uniform3f(A.screenPosition,B.x,B.y,B.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,k);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,O.x-8,O.y-8,16,16,0);b.uniform1i(A.renderType,1);b.disable(b.DEPTH_TEST);
+b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);J.positionScreen.copy(B);J.customUpdateCallback?J.customUpdateCallback(J):J.updateLensFlares();b.uniform1i(A.renderType,2);b.enable(b.BLEND);N=0;for(y=J.lensFlares.length;N<y;N++)v=J.lensFlares[N],0.001<v.opacity&&0.001<v.scale&&(B.x=v.x,B.y=v.y,B.z=v.z,E=v.size*v.scale/f,I.x=E*C,I.y=E,b.uniform3f(A.screenPosition,B.x,B.y,B.z),b.uniform2f(A.scale,I.x,I.y),b.uniform1f(A.rotation,v.rotation),b.uniform1f(A.opacity,
+v.opacity),b.uniform3f(A.color,v.color.r,v.color.g,v.color.b),c.setBlending(v.blending,v.blendEquation,v.blendSrc,v.blendDst),c.setTexture(v.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0))}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4,i=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(m,n){var t,s,q,p,r,w,z,C,F,G=[];p=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
+a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);t=0;for(s=m.__lights.length;t<s;t++)if(q=m.__lights[t],q.castShadow)if(q instanceof THREE.DirectionalLight&&q.shadowCascade)for(r=0;r<q.shadowCascadeCount;r++){var E;if(q.shadowCascadeArray[r])E=q.shadowCascadeArray[r];else{F=q;z=r;E=new THREE.DirectionalLight;E.isVirtual=!0;E.onlyShadow=!0;E.castShadow=!0;E.shadowCameraNear=F.shadowCameraNear;E.shadowCameraFar=F.shadowCameraFar;E.shadowCameraLeft=F.shadowCameraLeft;E.shadowCameraRight=F.shadowCameraRight;
+E.shadowCameraBottom=F.shadowCameraBottom;E.shadowCameraTop=F.shadowCameraTop;E.shadowCameraVisible=F.shadowCameraVisible;E.shadowDarkness=F.shadowDarkness;E.shadowBias=F.shadowCascadeBias[z];E.shadowMapWidth=F.shadowCascadeWidth[z];E.shadowMapHeight=F.shadowCascadeHeight[z];E.pointsWorld=[];E.pointsFrustum=[];C=E.pointsWorld;w=E.pointsFrustum;for(var I=0;8>I;I++)C[I]=new THREE.Vector3,w[I]=new THREE.Vector3;C=F.shadowCascadeNearZ[z];F=F.shadowCascadeFarZ[z];w[0].set(-1,-1,C);w[1].set(1,-1,C);w[2].set(-1,
+1,C);w[3].set(1,1,C);w[4].set(-1,-1,F);w[5].set(1,-1,F);w[6].set(-1,1,F);w[7].set(1,1,F);E.originalCamera=n;w=new THREE.Gyroscope;w.position=q.shadowCascadeOffset;w.add(E);w.add(E.target);n.add(w);q.shadowCascadeArray[r]=E;console.log("Created virtualLight",E)}z=q;C=r;F=z.shadowCascadeArray[C];F.position.copy(z.position);F.target.position.copy(z.target.position);F.lookAt(F.target);F.shadowCameraVisible=z.shadowCameraVisible;F.shadowDarkness=z.shadowDarkness;F.shadowBias=z.shadowCascadeBias[C];w=z.shadowCascadeNearZ[C];
+z=z.shadowCascadeFarZ[C];F=F.pointsFrustum;F[0].z=w;F[1].z=w;F[2].z=w;F[3].z=w;F[4].z=z;F[5].z=z;F[6].z=z;F[7].z=z;G[p]=E;p++}else G[p]=q,p++;t=0;for(s=G.length;t<s;t++){q=G[t];q.shadowMap||(r=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(r=THREE.NearestFilter),q.shadowMap=new THREE.WebGLRenderTarget(q.shadowMapWidth,q.shadowMapHeight,{minFilter:r,magFilter:r,format:THREE.RGBAFormat}),q.shadowMapSize=new THREE.Vector2(q.shadowMapWidth,q.shadowMapHeight),q.shadowMatrix=new THREE.Matrix4);
+if(!q.shadowCamera){if(q instanceof THREE.SpotLight)q.shadowCamera=new THREE.PerspectiveCamera(q.shadowCameraFov,q.shadowMapWidth/q.shadowMapHeight,q.shadowCameraNear,q.shadowCameraFar);else if(q instanceof THREE.DirectionalLight)q.shadowCamera=new THREE.OrthographicCamera(q.shadowCameraLeft,q.shadowCameraRight,q.shadowCameraTop,q.shadowCameraBottom,q.shadowCameraNear,q.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}m.add(q.shadowCamera);!0===m.autoUpdate&&m.updateMatrixWorld()}q.shadowCameraVisible&&
+!q.cameraHelper&&(q.cameraHelper=new THREE.CameraHelper(q.shadowCamera),q.shadowCamera.add(q.cameraHelper));if(q.isVirtual&&E.originalCamera==n){r=n;p=q.shadowCamera;w=q.pointsFrustum;F=q.pointsWorld;i.set(Infinity,Infinity,Infinity);k.set(-Infinity,-Infinity,-Infinity);for(z=0;8>z;z++)C=F[z],C.copy(w[z]),THREE.ShadowMapPlugin.__projector.unprojectVector(C,r),C.applyMatrix4(p.matrixWorldInverse),C.x<i.x&&(i.x=C.x),C.x>k.x&&(k.x=C.x),C.y<i.y&&(i.y=C.y),C.y>k.y&&(k.y=C.y),C.z<i.z&&(i.z=C.z),C.z>k.z&&
+(k.z=C.z);p.left=i.x;p.right=k.x;p.top=k.y;p.bottom=i.y;p.updateProjectionMatrix()}p=q.shadowMap;w=q.shadowMatrix;r=q.shadowCamera;r.position.getPositionFromMatrix(q.matrixWorld);l.getPositionFromMatrix(q.target.matrixWorld);r.lookAt(l);r.updateMatrixWorld();r.matrixWorldInverse.getInverse(r.matrixWorld);q.cameraHelper&&(q.cameraHelper.visible=q.shadowCameraVisible);q.shadowCameraVisible&&q.cameraHelper.update();w.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);w.multiply(r.projectionMatrix);w.multiply(r.matrixWorldInverse);
+g.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(p);b.clear();F=m.__webglObjects;q=0;for(p=F.length;q<p;q++)if(z=F[q],w=z.object,z.render=!1,w.visible&&w.castShadow&&(!(w instanceof THREE.Mesh||w instanceof THREE.ParticleSystem)||!w.frustumCulled||h.intersectsObject(w)))w._modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,w.matrixWorld),z.render=!0;q=0;for(p=F.length;q<p;q++)z=F[q],z.render&&(w=z.object,z=z.buffer,I=w.material instanceof THREE.MeshFaceMaterial?
+w.material.materials[0]:w.material,C=0<w.geometry.morphTargets.length&&I.morphTargets,I=w instanceof THREE.SkinnedMesh&&I.skinning,C=w.customDepthMaterial?w.customDepthMaterial:I?C?f:e:C?d:c,z instanceof THREE.BufferGeometry?b.renderBufferDirect(r,m.__lights,null,C,z,w):b.renderBuffer(r,m.__lights,null,C,z,w));F=m.__webglObjectsImmediate;q=0;for(p=F.length;q<p;q++)z=F[q],w=z.object,w.visible&&w.castShadow&&(w._modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,w.matrixWorld),b.renderImmediateObject(r,
+m.__lights,null,c,w))}t=b.getClearColor();s=b.getClearAlpha();a.clearColor(t.r,t.g,t.b,s);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){function a(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var b,c,d,e,f,h,g,i,k,l;this.init=function(a){b=a.context;c=a;d=a.getPrecision();e=new Float32Array(16);f=new Uint16Array(6);a=0;e[a++]=-1;e[a++]=-1;e[a++]=0;e[a++]=0;e[a++]=1;e[a++]=-1;e[a++]=1;e[a++]=0;e[a++]=1;e[a++]=1;e[a++]=1;e[a++]=1;e[a++]=-1;e[a++]=1;e[a++]=0;e[a++]=1;a=0;f[a++]=0;f[a++]=1;f[a++]=2;f[a++]=0;f[a++]=2;f[a++]=3;h=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,h);b.bufferData(b.ARRAY_BUFFER,
+e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);var a=THREE.ShaderSprite.sprite,n=b.createProgram(),t=b.createShader(b.FRAGMENT_SHADER),s=b.createShader(b.VERTEX_SHADER),q="precision "+d+" float;\n";b.shaderSource(t,q+a.fragmentShader);b.shaderSource(s,q+a.vertexShader);b.compileShader(t);b.compileShader(s);b.attachShader(n,t);b.attachShader(n,s);b.linkProgram(n);i=n;k={};l={};k.position=b.getAttribLocation(i,"position");k.uv=b.getAttribLocation(i,
 "uv");l.uvOffset=b.getUniformLocation(i,"uvOffset");l.uvScale=b.getUniformLocation(i,"uvScale");l.rotation=b.getUniformLocation(i,"rotation");l.scale=b.getUniformLocation(i,"scale");l.alignment=b.getUniformLocation(i,"alignment");l.color=b.getUniformLocation(i,"color");l.map=b.getUniformLocation(i,"map");l.opacity=b.getUniformLocation(i,"opacity");l.useScreenCoordinates=b.getUniformLocation(i,"useScreenCoordinates");l.sizeAttenuation=b.getUniformLocation(i,"sizeAttenuation");l.screenPosition=b.getUniformLocation(i,
 "uv");l.uvOffset=b.getUniformLocation(i,"uvOffset");l.uvScale=b.getUniformLocation(i,"uvScale");l.rotation=b.getUniformLocation(i,"rotation");l.scale=b.getUniformLocation(i,"scale");l.alignment=b.getUniformLocation(i,"alignment");l.color=b.getUniformLocation(i,"color");l.map=b.getUniformLocation(i,"map");l.opacity=b.getUniformLocation(i,"opacity");l.useScreenCoordinates=b.getUniformLocation(i,"useScreenCoordinates");l.sizeAttenuation=b.getUniformLocation(i,"sizeAttenuation");l.screenPosition=b.getUniformLocation(i,
-"screenPosition");l.modelViewMatrix=b.getUniformLocation(i,"modelViewMatrix");l.projectionMatrix=b.getUniformLocation(i,"projectionMatrix");l.fogType=b.getUniformLocation(i,"fogType");l.fogDensity=b.getUniformLocation(i,"fogDensity");l.fogNear=b.getUniformLocation(i,"fogNear");l.fogFar=b.getUniformLocation(i,"fogFar");l.fogColor=b.getUniformLocation(i,"fogColor");l.alphaTest=b.getUniformLocation(i,"alphaTest")};this.render=function(d,e,f,t){var p=d.__webglSprites,r=p.length;if(r){var s=k,u=l,z=t/
-f,f=0.5*f,G=0.5*t;b.useProgram(i);b.enableVertexAttribArray(s.position);b.enableVertexAttribArray(s.uv);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(s.position,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(s.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.uniformMatrix4fv(u.projectionMatrix,!1,e.projectionMatrix.elements);b.activeTexture(b.TEXTURE0);b.uniform1i(u.map,0);var B=s=0,F=d.fog;F?(b.uniform3f(u.fogColor,F.color.r,F.color.g,F.color.b),
-F instanceof THREE.Fog?(b.uniform1f(u.fogNear,F.near),b.uniform1f(u.fogFar,F.far),b.uniform1i(u.fogType,1),B=s=1):F instanceof THREE.FogExp2&&(b.uniform1f(u.fogDensity,F.density),b.uniform1i(u.fogType,2),B=s=2)):(b.uniform1i(u.fogType,0),B=s=0);for(var I,E,A=[],F=0;F<r;F++)I=p[F],E=I.material,I.visible&&0!==E.opacity&&(E.useScreenCoordinates?I.z=-I.position.z:(I._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,I.matrixWorld),I.z=-I._modelViewMatrix.elements[14]));p.sort(a);for(F=0;F<r;F++)I=
-p[F],E=I.material,I.visible&&0!==E.opacity&&(E.map&&E.map.image&&E.map.image.width)&&(b.uniform1f(u.alphaTest,E.alphaTest),!0===E.useScreenCoordinates?(b.uniform1i(u.useScreenCoordinates,1),b.uniform3f(u.screenPosition,(I.position.x*c.devicePixelRatio-f)/f,(G-I.position.y*c.devicePixelRatio)/G,Math.max(0,Math.min(1,I.position.z))),A[0]=c.devicePixelRatio,A[1]=c.devicePixelRatio):(b.uniform1i(u.useScreenCoordinates,0),b.uniform1i(u.sizeAttenuation,E.sizeAttenuation?1:0),b.uniformMatrix4fv(u.modelViewMatrix,
-!1,I._modelViewMatrix.elements),A[0]=1,A[1]=1),e=d.fog&&E.fog?B:0,s!==e&&(b.uniform1i(u.fogType,e),s=e),e=1/(E.scaleByViewport?t:1),A[0]*=e*z*I.scale.x,A[1]*=e*I.scale.y,b.uniform2f(u.uvScale,E.uvScale.x,E.uvScale.y),b.uniform2f(u.uvOffset,E.uvOffset.x,E.uvOffset.y),b.uniform2f(u.alignment,E.alignment.x,E.alignment.y),b.uniform1f(u.opacity,E.opacity),b.uniform3f(u.color,E.color.r,E.color.g,E.color.b),b.uniform1f(u.rotation,I.rotation),b.uniform2fv(u.scale,A),c.setBlending(E.blending,E.blendEquation,
-E.blendSrc,E.blendDst),c.setDepthTest(E.depthTest),c.setDepthWrite(E.depthWrite),c.setTexture(E.map,0),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
-vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(i,k){var l,m,n,q,t,p;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===i.autoUpdate&&i.updateMatrixWorld();k.matrixWorldInverse.getInverse(k.matrixWorld);g.multiplyMatrices(k.projectionMatrix,
-k.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(this.renderTarget);b.clear();p=i.__webglObjects;l=0;for(m=p.length;l<m;l++)if(n=p[l],t=n.object,n.render=!1,t.visible&&(!(t instanceof THREE.Mesh||t instanceof THREE.ParticleSystem)||!t.frustumCulled||h.intersectsObject(t)))t._modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,t.matrixWorld),n.render=!0;var r;l=0;for(m=p.length;l<m;l++)if(n=p[l],n.render&&(t=n.object,n=n.buffer,!(t instanceof THREE.ParticleSystem)||t.customDepthMaterial))(r=
-t.material instanceof THREE.MeshFaceMaterial?t.material.materials[0]:t.material)&&b.setMaterialFaces(t.material),q=0<t.geometry.morphTargets.length&&r.morphTargets,r=t instanceof THREE.SkinnedMesh&&r.skinning,q=t.customDepthMaterial?t.customDepthMaterial:r?q?f:e:q?d:c,n instanceof THREE.BufferGeometry?b.renderBufferDirect(k,i.__lights,null,q,n,t):b.renderBuffer(k,i.__lights,null,q,n,t);p=i.__webglObjectsImmediate;l=0;for(m=p.length;l<m;l++)n=p[l],t=n.object,t.visible&&(t._modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,
-t.matrixWorld),b.renderImmediateObject(k,i.__lights,null,c,t));l=b.getClearColor();m=b.getClearAlpha();a.clearColor(l.r,l.g,l.b,m);a.enable(a.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}",
+"screenPosition");l.modelViewMatrix=b.getUniformLocation(i,"modelViewMatrix");l.projectionMatrix=b.getUniformLocation(i,"projectionMatrix");l.fogType=b.getUniformLocation(i,"fogType");l.fogDensity=b.getUniformLocation(i,"fogDensity");l.fogNear=b.getUniformLocation(i,"fogNear");l.fogFar=b.getUniformLocation(i,"fogFar");l.fogColor=b.getUniformLocation(i,"fogColor");l.alphaTest=b.getUniformLocation(i,"alphaTest")};this.render=function(d,e,f,s){var q=d.__webglSprites,p=q.length;if(p){var r=k,w=l,z=s/
+f,f=0.5*f,C=0.5*s;b.useProgram(i);b.enableVertexAttribArray(r.position);b.enableVertexAttribArray(r.uv);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(r.position,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(r.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.uniformMatrix4fv(w.projectionMatrix,!1,e.projectionMatrix.elements);b.activeTexture(b.TEXTURE0);b.uniform1i(w.map,0);var F=r=0,G=d.fog;G?(b.uniform3f(w.fogColor,G.color.r,G.color.g,G.color.b),
+G instanceof THREE.Fog?(b.uniform1f(w.fogNear,G.near),b.uniform1f(w.fogFar,G.far),b.uniform1i(w.fogType,1),F=r=1):G instanceof THREE.FogExp2&&(b.uniform1f(w.fogDensity,G.density),b.uniform1i(w.fogType,2),F=r=2)):(b.uniform1i(w.fogType,0),F=r=0);for(var E,I,B=[],G=0;G<p;G++)E=q[G],I=E.material,E.visible&&0!==I.opacity&&(I.useScreenCoordinates?E.z=-E.position.z:(E._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,E.matrixWorld),E.z=-E._modelViewMatrix.elements[14]));q.sort(a);for(G=0;G<p;G++)E=
+q[G],I=E.material,E.visible&&0!==I.opacity&&(I.map&&I.map.image&&I.map.image.width)&&(b.uniform1f(w.alphaTest,I.alphaTest),!0===I.useScreenCoordinates?(b.uniform1i(w.useScreenCoordinates,1),b.uniform3f(w.screenPosition,(E.position.x*c.devicePixelRatio-f)/f,(C-E.position.y*c.devicePixelRatio)/C,Math.max(0,Math.min(1,E.position.z))),B[0]=c.devicePixelRatio,B[1]=c.devicePixelRatio):(b.uniform1i(w.useScreenCoordinates,0),b.uniform1i(w.sizeAttenuation,I.sizeAttenuation?1:0),b.uniformMatrix4fv(w.modelViewMatrix,
+!1,E._modelViewMatrix.elements),B[0]=1,B[1]=1),e=d.fog&&I.fog?F:0,r!==e&&(b.uniform1i(w.fogType,e),r=e),e=1/(I.scaleByViewport?s:1),B[0]*=e*z*E.scale.x,B[1]*=e*E.scale.y,b.uniform2f(w.uvScale,I.uvScale.x,I.uvScale.y),b.uniform2f(w.uvOffset,I.uvOffset.x,I.uvOffset.y),b.uniform2f(w.alignment,I.alignment.x,I.alignment.y),b.uniform1f(w.opacity,I.opacity),b.uniform3f(w.color,I.color.r,I.color.g,I.color.b),b.uniform1f(w.rotation,E.rotation),b.uniform2fv(w.scale,B),c.setBlending(I.blending,I.blendEquation,
+I.blendSrc,I.blendDst),c.setDepthTest(I.depthTest),c.setDepthWrite(I.depthWrite),c.setTexture(I.map,0),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(i,k){var l,m,n,t,s,q;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===i.autoUpdate&&i.updateMatrixWorld();k.matrixWorldInverse.getInverse(k.matrixWorld);g.multiplyMatrices(k.projectionMatrix,
+k.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(this.renderTarget);b.clear();q=i.__webglObjects;l=0;for(m=q.length;l<m;l++)if(n=q[l],s=n.object,n.render=!1,s.visible&&(!(s instanceof THREE.Mesh||s instanceof THREE.ParticleSystem)||!s.frustumCulled||h.intersectsObject(s)))s._modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,s.matrixWorld),n.render=!0;var p;l=0;for(m=q.length;l<m;l++)if(n=q[l],n.render&&(s=n.object,n=n.buffer,!(s instanceof THREE.ParticleSystem)||s.customDepthMaterial))(p=
+s.material instanceof THREE.MeshFaceMaterial?s.material.materials[0]:s.material)&&b.setMaterialFaces(s.material),t=0<s.geometry.morphTargets.length&&p.morphTargets,p=s instanceof THREE.SkinnedMesh&&p.skinning,t=s.customDepthMaterial?s.customDepthMaterial:p?t?f:e:t?d:c,n instanceof THREE.BufferGeometry?b.renderBufferDirect(k,i.__lights,null,t,n,s):b.renderBuffer(k,i.__lights,null,t,n,s);q=i.__webglObjectsImmediate;l=0;for(m=q.length;l<m;l++)n=q[l],s=n.object,s.visible&&(s._modelViewMatrix.multiplyMatrices(k.matrixWorldInverse,
+s.matrixWorld),b.renderImmediateObject(k,i.__lights,null,c,s));l=b.getClearColor();m=b.getClearAlpha();a.clearColor(l.r,l.g,l.b,m);a.enable(a.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:"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}"}};THREE.ShaderSprite={sprite:{vertexShader:"uniform int useScreenCoordinates;\nuniform int sizeAttenuation;\nuniform vec3 screenPosition;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 alignment;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position + alignment;\nvec2 rotatedPosition;\nrotatedPosition.x = ( cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y ) * scale.x;\nrotatedPosition.y = ( sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y ) * scale.y;\nvec4 finalPosition;\nif( useScreenCoordinates != 0 ) {\nfinalPosition = vec4( screenPosition.xy + rotatedPosition, screenPosition.z, 1.0 );\n} else {\nfinalPosition = projectionMatrix * modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition * ( sizeAttenuation == 1 ? 1.0 : finalPosition.z );\n}\ngl_Position = finalPosition;\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}"}};THREE.ShaderSprite={sprite:{vertexShader:"uniform int useScreenCoordinates;\nuniform int sizeAttenuation;\nuniform vec3 screenPosition;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 alignment;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position + alignment;\nvec2 rotatedPosition;\nrotatedPosition.x = ( cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y ) * scale.x;\nrotatedPosition.y = ( sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y ) * scale.y;\nvec4 finalPosition;\nif( useScreenCoordinates != 0 ) {\nfinalPosition = vec4( screenPosition.xy + rotatedPosition, screenPosition.z, 1.0 );\n} else {\nfinalPosition = projectionMatrix * modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition * ( sizeAttenuation == 1 ? 1.0 : finalPosition.z );\n}\ngl_Position = finalPosition;\n}",
 fragmentShader:"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}"}};
 fragmentShader:"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}"}};