Explorar o código

Updated builds.

Mr.doob %!s(int64=12) %!d(string=hai) anos
pai
achega
1fc8c1cc3c
Modificáronse 2 ficheiros con 168 adicións e 158 borrados
  1. 78 68
      build/three.js
  2. 90 90
      build/three.min.js

+ 78 - 68
build/three.js

@@ -5053,7 +5053,7 @@ THREE.Ray.prototype = {
 
 		if ( directionDistance < 0 ) {
 
-			return this.origin.clone();
+			return result.copy( this.origin );
 
 		}
 
@@ -5085,7 +5085,7 @@ THREE.Ray.prototype = {
 
 	}(),
 
-	distanceToSegment: function( v0, v1, optionalPointOnRay, optionalPointOnSegment ) {
+	distanceSqToSegment: function( v0, v1, optionalPointOnRay, optionalPointOnSegment ) {
 
 		// from http://www.geometrictools.com/LibMathematics/Distance/Wm5DistRay3Segment3.cpp
 		// It returns the min distance between the ray and the segment
@@ -6914,20 +6914,20 @@ THREE.EventDispatcher.prototype = {
 
 			for ( var i = 0; i < nbVertices - 1; i = i + step ) {
 
-				localRay.distanceToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment );
-				interSegment.applyMatrix4( object.matrixWorld );
-				interRay.applyMatrix4( object.matrixWorld );
+				var distSq = localRay.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment );
 
-				if ( interRay.distanceToSquared( interSegment ) <= precisionSq ) {
+				if ( distSq <= precisionSq ) {
 
-					var distance = raycaster.ray.origin.distanceTo( interRay );
+					var distance = localRay.origin.distanceTo( interRay );
 
 					if ( raycaster.near <= distance && distance <= raycaster.far ) {
 
 						intersects.push( {
 
 							distance: distance,
-							point: interSegment.clone(),
+							// What do we want? intersection point on the ray or on the segment??
+							// point: raycaster.ray.at( distance ),
+							point: interSegment.clone().applyMatrix4( object.matrixWorld ),
 							face: null,
 							faceIndex: null,
 							object: object
@@ -35299,53 +35299,58 @@ THREE.CameraHelper.prototype.update = function () {
  * @author mrdoob / http://mrdoob.com/
  */
 
-THREE.DirectionalLightHelper = function ( light, sphereSize ) {
+THREE.DirectionalLightHelper = function ( light, size ) {
 
 	THREE.Object3D.call( this );
 
-	this.matrixAutoUpdate = false;
-
 	this.light = light;
+	this.light.updateMatrixWorld();
 
-	var geometry = new THREE.SphereGeometry( sphereSize, 4, 2 );
-	var material = new THREE.MeshBasicMaterial( { fog: false, wireframe: true } );
-	material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
+	this.matrixWorld = light.matrixWorld;
+	this.matrixAutoUpdate = false;
 
-	this.lightSphere = new THREE.Mesh( geometry, material );
-	this.lightSphere.matrixWorld = this.light.matrixWorld;
-	this.lightSphere.matrixAutoUpdate = false;
-	this.add( this.lightSphere );
+	var geometry = new THREE.PlaneGeometry( size, size );
+	var material = new THREE.MeshBasicMaterial( { wireframe: true, fog: false } );
+	material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
 
-	/*
-	this.targetSphere = new THREE.Mesh( geometry, material );
-	this.targetSphere.position = this.light.target.position;
-	this.add( this.targetSphere );
-	*/
+	this.lightPlane = new THREE.Mesh( geometry, material );
+	this.add( this.lightPlane );
 
 	geometry = new THREE.Geometry();
-	geometry.vertices.push( this.light.position );
-	geometry.vertices.push( this.light.target.position );
+	geometry.vertices.push( new THREE.Vector3() );
+	geometry.vertices.push( new THREE.Vector3() );
 	geometry.computeLineDistances();
 
-	material = new THREE.LineDashedMaterial( { dashSize: 4, gapSize: 4, opacity: 0.75, transparent: true, fog: false } );
+	material = new THREE.LineBasicMaterial( { fog: false } );
 	material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
 
 	this.targetLine = new THREE.Line( geometry, material );
 	this.add( this.targetLine );
 
-}
+	this.update();
+
+};
 
 THREE.DirectionalLightHelper.prototype = Object.create( THREE.Object3D.prototype );
 
 THREE.DirectionalLightHelper.prototype.update = function () {
 
-	this.lightSphere.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
+	var vector = new THREE.Vector3();
+
+	return function () {
 
-	this.targetLine.geometry.computeLineDistances();
-	this.targetLine.geometry.verticesNeedUpdate = true;
-	this.targetLine.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
+		vector.getPositionFromMatrix( this.light.matrixWorld ).negate();
 
-};
+		this.lightPlane.lookAt( vector );
+		this.lightPlane.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
+
+		this.targetLine.geometry.vertices[ 1 ].copy( vector );
+		this.targetLine.geometry.verticesNeedUpdate = true;
+		this.targetLine.material.color.copy( this.lightPlane.material.color );
+
+	}
+
+}();
 
 
 /**
@@ -35475,39 +35480,48 @@ THREE.HemisphereLightHelper = function ( light, sphereSize, arrowLength, domeSiz
 	THREE.Object3D.call( this );
 
 	this.light = light;
+	this.light.updateMatrixWorld();
+
+	this.matrixWorld = light.matrixWorld;
+	this.matrixAutoUpdate = false;
+
+	this.colors = [ new THREE.Color(), new THREE.Color() ];
 
 	var geometry = new THREE.SphereGeometry( sphereSize, 4, 2 );
 	geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 
 	for ( var i = 0, il = 8; i < il; i ++ ) {
 
-		geometry.faces[ i ].materialIndex = i < 4 ? 0 : 1;
+		geometry.faces[ i ].color = this.colors[ i < 4 ? 0 : 1 ];
 
 	}
 
-	var materialSky = new THREE.MeshBasicMaterial( { fog: false, wireframe: true } );
-	materialSky.color.copy( light.color ).multiplyScalar( light.intensity );
-
-	var materialGround = new THREE.MeshBasicMaterial( { fog: false, wireframe: true } );
-	materialGround.color.copy( light.groundColor ).multiplyScalar( light.intensity );
+	var material = new THREE.MeshBasicMaterial( { vertexColors: THREE.FaceColors, wireframe: true } );
 
-	this.lightSphere = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( [ materialSky, materialGround ] ) );
-	this.lightSphere.position = light.position;
-	this.lightSphere.lookAt( new THREE.Vector3() );
+	this.lightSphere = new THREE.Mesh( geometry, material );
 	this.add( this.lightSphere );
 
+	this.update();
+
 };
 
 THREE.HemisphereLightHelper.prototype = Object.create( THREE.Object3D.prototype );
 
 THREE.HemisphereLightHelper.prototype.update = function () {
 
-	this.lightSphere.lookAt( new THREE.Vector3() );
+	var vector = new THREE.Vector3();
 
-	this.lightSphere.material.materials[ 0 ].color.copy( this.light.color ).multiplyScalar( this.light.intensity );
-	this.lightSphere.material.materials[ 1 ].color.copy( this.light.groundColor ).multiplyScalar( this.light.intensity );
+	return function () {
 
-};
+		this.colors[ 0 ].copy( this.light.color ).multiplyScalar( this.light.intensity );
+		this.colors[ 1 ].copy( this.light.groundColor ).multiplyScalar( this.light.intensity );
+
+		this.lightSphere.lookAt( vector.getPositionFromMatrix( this.light.matrixWorld ).negate() );
+		this.lightSphere.geometry.colorsNeedUpdate = true;
+
+	}
+
+}();
 
 
 /**
@@ -35518,9 +35532,10 @@ THREE.HemisphereLightHelper.prototype.update = function () {
 THREE.PointLightHelper = function ( light, sphereSize ) {
 
 	this.light = light;
+	this.light.updateMatrixWorld();
 
 	var geometry = new THREE.SphereGeometry( sphereSize, 4, 2 );
-	var material = new THREE.MeshBasicMaterial( { fog: false, wireframe: true } );
+	var material = new THREE.MeshBasicMaterial( { wireframe: true, fog: false } );
 	material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
 
 	THREE.Mesh.call( this, geometry, material );
@@ -35584,53 +35599,48 @@ THREE.PointLightHelper.prototype.update = function () {
 
 THREE.SpotLightHelper = function ( light ) {
 
-	// spotlight helper must be a child of the scene
+	THREE.Object3D.call( this );
 
 	this.light = light;
+	this.light.updateMatrixWorld();
+
+	this.matrixWorld = light.matrixWorld;
+	this.matrixAutoUpdate = false;
 
 	var geometry = new THREE.CylinderGeometry( 0, 1, 1, 8, 1, true );
 
 	geometry.applyMatrix( new THREE.Matrix4().makeTranslation( 0, -0.5, 0 ) );
-
 	geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 
-	var material = new THREE.MeshBasicMaterial( { wireframe: true, opacity: 0.3, transparent: true } );
-
-	THREE.Mesh.call( this, geometry, material );
+	var material = new THREE.MeshBasicMaterial( { wireframe: true, fog: false } );
+	
+	this.cone = new THREE.Mesh( geometry, material );
+	this.add( this.cone );
 
 	this.update();
 
 };
 
-THREE.SpotLightHelper.prototype = Object.create( THREE.Mesh.prototype );
+THREE.SpotLightHelper.prototype = Object.create( THREE.Object3D.prototype );
 
-THREE.SpotLightHelper.prototype.update = ( function () {
+THREE.SpotLightHelper.prototype.update = function () {
 
-	var targetPosition = new THREE.Vector3();
+	var vector = new THREE.Vector3();
 
-	return function() {
+	return function () {
 
 		var coneLength = this.light.distance ? this.light.distance : 10000;
-
 		var coneWidth = coneLength * Math.tan( this.light.angle );
 
-		this.scale.set( coneWidth, coneWidth, coneLength );
+		this.cone.scale.set( coneWidth, coneWidth, coneLength );
 
-		this.light.updateMatrixWorld( true );
+		this.cone.lookAt( vector.getPositionFromMatrix( this.light.matrixWorld ).negate() );
 
-		this.position.getPositionFromMatrix( this.light.matrixWorld );
-
-		this.light.target.updateMatrixWorld( true );
-
-		targetPosition.getPositionFromMatrix( this.light.target.matrixWorld );
-
-		this.lookAt( targetPosition );
-
-		this.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
+		this.cone.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity );
 
 	}
 
-}());
+}();
 
 /**
  * @author mrdoob / http://mrdoob.com/

+ 90 - 90
build/three.min.js

@@ -89,15 +89,15 @@ typeof a.order&&console.error("ERROR: Matrix's .makeRotationFromEuler() now expe
 j*c-i,b[8]=f*d,b[1]=f*e,b[5]=f*g,b[9]=-c,b[2]=i*c-j,b[6]=l+a*c,b[10]=f*h):"ZXY"===a.order?(a=h*g,i=h*e,j=d*g,l=d*e,b[0]=a-l*c,b[4]=-f*e,b[8]=j+i*c,b[1]=i+j*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,j=c*g,l=c*e,b[0]=h*g,b[4]=j*d-i,b[8]=a*d+l,b[1]=h*e,b[5]=l*d+a,b[9]=i*d-j,b[2]=-d,b[6]=c*h,b[10]=f*h):"YZX"===a.order?(a=f*h,i=f*d,j=c*h,l=c*d,b[0]=h*g,b[4]=l-a*e,b[8]=j*e+i,b[1]=e,b[5]=f*g,b[9]=-c*g,b[2]=-d*g,b[6]=i*e+j,b[10]=a-l*e):"XZY"===a.order&&(a=f*h,i=f*d,j=
 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-j,b[2]=j*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,j=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]=j-f;b[8]=c+g;b[1]=j+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],j=c[1],l=c[5],m=c[9],n=c[13],p=c[2],t=c[6],q=c[10],r=c[14],s=c[3],u=c[7],
-z=c[11],c=c[15],C=d[0],F=d[4],H=d[8],I=d[12],G=d[1],A=d[5],K=d[9],B=d[13],J=d[2],N=d[6],y=d[10],M=d[14],w=d[3],Z=d[7],L=d[11],d=d[15];e[0]=f*C+h*G+g*J+i*w;e[4]=f*F+h*A+g*N+i*Z;e[8]=f*H+h*K+g*y+i*L;e[12]=f*I+h*B+g*M+i*d;e[1]=j*C+l*G+m*J+n*w;e[5]=j*F+l*A+m*N+n*Z;e[9]=j*H+l*K+m*y+n*L;e[13]=j*I+l*B+m*M+n*d;e[2]=p*C+t*G+q*J+r*w;e[6]=p*F+t*A+q*N+r*Z;e[10]=p*H+t*K+q*y+r*L;e[14]=p*I+t*B+q*M+r*d;e[3]=s*C+u*G+z*J+c*w;e[7]=s*F+u*A+z*N+c*Z;e[11]=s*H+u*K+z*y+c*L;e[15]=s*I+u*B+z*M+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],j=c[1],l=c[5],m=c[9],n=c[13],p=c[2],t=c[6],q=c[10],r=c[14],s=c[3],v=c[7],
+z=c[11],c=c[15],C=d[0],F=d[4],H=d[8],I=d[12],G=d[1],A=d[5],K=d[9],B=d[13],J=d[2],N=d[6],y=d[10],M=d[14],w=d[3],Z=d[7],L=d[11],d=d[15];e[0]=f*C+h*G+g*J+i*w;e[4]=f*F+h*A+g*N+i*Z;e[8]=f*H+h*K+g*y+i*L;e[12]=f*I+h*B+g*M+i*d;e[1]=j*C+l*G+m*J+n*w;e[5]=j*F+l*A+m*N+n*Z;e[9]=j*H+l*K+m*y+n*L;e[13]=j*I+l*B+m*M+n*d;e[2]=p*C+t*G+q*J+r*w;e[6]=p*F+t*A+q*N+r*Z;e[10]=p*H+t*K+q*y+r*L;e[14]=p*I+t*B+q*M+r*d;e[3]=s*C+v*G+z*J+c*w;e[7]=s*F+v*A+z*N+c*Z;e[11]=s*H+v*K+z*y+c*L;e[15]=s*I+v*B+z*M+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.");
 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],j=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*j-e*g*j)+a[11]*(+b*i*l-b*h*n-e*f*l+c*f*n+e*h*j-c*i*j)+a[15]*(-d*h*j-b*g*l+b*h*m+d*f*l-c*f*
 m+c*g*j)},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;
-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],j=d[5],l=d[9],m=d[13],n=d[2],p=d[6],t=d[10],q=d[14],r=d[3],s=d[7],u=d[11],d=d[15];c[0]=l*q*s-m*t*s+m*p*u-j*q*u-l*p*d+j*t*d;c[4]=g*t*s-h*q*s-g*p*u+f*q*u+h*p*d-f*t*d;c[8]=h*m*s-g*l*s+g*j*u-f*m*u-h*j*d+f*l*d;c[12]=g*l*p-h*m*p-g*j*t+f*m*t+h*j*q-f*l*q;c[1]=m*t*r-l*q*r-m*n*u+i*q*u+l*n*d-i*t*d;c[5]=h*q*r-g*t*r+g*n*u-e*q*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*q+e*l*q;c[2]=j*q*r-m*p*r+m*n*s-i*q*s-j*n*d+i*p*d;c[6]=g*p*r-f*q*r-g*n*s+e*q*s+f*n*d-e*p*d;c[10]=f*m*r-g*j*r+g*i*s-e*m*s-f*i*d+e*j*d;c[14]=g*j*n-f*m*n-g*i*p+e*m*p+f*i*q-e*j*q;c[3]=l*p*r-j*t*r-l*n*s+i*t*s+j*n*u-i*p*u;c[7]=f*t*r-h*p*r+h*n*s-e*t*s-f*n*u+e*p*u;c[11]=h*j*r-f*l*r-h*i*s+e*l*s+f*i*u-e*j*u;c[15]=f*l*n-h*j*n+h*i*p-e*l*p-f*i*t+e*j*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],j=d[5],l=d[9],m=d[13],n=d[2],p=d[6],t=d[10],q=d[14],r=d[3],s=d[7],v=d[11],d=d[15];c[0]=l*q*s-m*t*s+m*p*v-j*q*v-l*p*d+j*t*d;c[4]=g*t*s-h*q*s-g*p*v+f*q*v+h*p*d-f*t*d;c[8]=h*m*s-g*l*s+g*j*v-f*m*v-h*j*d+f*l*d;c[12]=g*l*p-h*m*p-g*j*t+f*m*t+h*j*q-f*l*q;c[1]=m*t*r-l*q*r-m*n*v+i*q*v+l*n*d-i*t*d;c[5]=h*q*r-g*t*r+g*n*v-e*q*v-h*n*d+e*t*d;c[9]=g*l*r-h*m*r-g*i*v+e*m*v+h*i*d-
+e*l*d;c[13]=h*m*n-g*l*n+g*i*t-e*m*t-h*i*q+e*l*q;c[2]=j*q*r-m*p*r+m*n*s-i*q*s-j*n*d+i*p*d;c[6]=g*p*r-f*q*r-g*n*s+e*q*s+f*n*d-e*p*d;c[10]=f*m*r-g*j*r+g*i*s-e*m*s-f*i*d+e*j*d;c[14]=g*j*n-f*m*n-g*i*p+e*m*p+f*i*q-e*j*q;c[3]=l*p*r-j*t*r-l*n*s+i*t*s+j*n*v-i*p*v;c[7]=f*t*r-h*p*r+h*n*s-e*t*s-f*n*v+e*p*v;c[11]=h*j*r-f*l*r-h*i*s+e*l*s+f*i*v-e*j*v;c[15]=f*l*n-h*j*n+h*i*p-e*l*p-f*i*t+e*j*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");
 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,
 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,j=e*h;this.set(i*f+c,i*h-d*g,i*g+d*h,0,i*h+d*g,j*h+c,j*g-d*f,0,i*g-d*h,j*g+d*f,e*g*g+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,
@@ -106,8 +106,8 @@ f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=j;b.elements[9]*=j;b.elements
 b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var h=this.elements,g=b-a,i=c-d,j=f-e;h[0]=2/g;h[4]=0;h[8]=0;h[12]=-((b+a)/g);h[1]=0;h[5]=2/i;h[9]=0;h[13]=-((c+d)/i);h[2]=0;h[6]=0;h[10]=-2/j;h[14]=-((f+e)/j);h[3]=0;h[7]=0;h[11]=0;h[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){var a=this.elements;return new THREE.Matrix4(a[0],
 a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3};
 THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);
-var d=c.dot(this.direction);return 0>d?this.origin.clone():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)}}(),distanceToSegment: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),j=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)+j):(m=h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+j):(m=-h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+j):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)+j):m<=n?(g=0,m=Math.min(Math.max(-h,-i),h),a=m*(m+2*i)+j):(g=Math.max(0,-(a*h+b)),m=0<g?h:Math.min(Math.max(-h,
+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),j=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)+j):(m=h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+j):(m=-h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+j):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)+j):m<=n?(g=0,m=Math.min(Math.max(-h,-i),h),a=m*(m+2*i)+j):(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)+j)):(m=0<a?-h:h,g=Math.max(0,-(a*m+b)),a=-g*g+m*(m+2*i)+j);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};
 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)-
@@ -137,13 +137,13 @@ a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.Eve
 THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,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,j,n){if(g instanceof a.Particle){f.getPositionFromMatrix(g.matrixWorld);var p=j.ray.distanceToPoint(f);if(p>g.scale.x)return n;n.push({distance:p,point:g.position,face:null,object:g})}else if(g instanceof
 a.LOD)f.getPositionFromMatrix(g.matrixWorld),p=j.ray.origin.distanceTo(f),i(g.getObjectForDistance(p),j,n);else if(g instanceof a.Mesh){p=g.geometry;f.getPositionFromMatrix(g.matrixWorld);null===p.boundingSphere&&p.computeBoundingSphere();b.set(f,p.boundingSphere.radius*g.matrixWorld.getMaxScaleOnAxis());if(!1===j.ray.isIntersectionSphere(b))return n;var t=p.vertices;if(p instanceof a.BufferGeometry){var q=g.material;if(void 0===q||!1===p.dynamic)return n;var r=g.material instanceof a.MeshFaceMaterial,
-s=!0===r?g.material.materials:null,u=g.material.side,z,C,F=j.precision;h.getInverse(g.matrixWorld);c.copy(j.ray).applyMatrix4(h);var H,t=!1;p.attributes.index&&(t=!0);s=new a.Vector3;H=new a.Vector3;var I=new a.Vector3;new a.Vector3;new a.Vector3;for(var G=0;G<p.offsets.length;++G)for(var A=p.offsets[G].start,K=p.offsets[G].index,r=A,B=A+p.offsets[G].count;r<B;r+=3)if(t?(u=K+p.attributes.index.array[r],z=K+p.attributes.index.array[r+1],C=K+p.attributes.index.array[r+2]):(u=K,z=K+1,C=K+2),s.set(p.attributes.position.array[3*
-u],p.attributes.position.array[3*u+1],p.attributes.position.array[3*u+2]),H.set(p.attributes.position.array[3*z],p.attributes.position.array[3*z+1],p.attributes.position.array[3*z+2]),I.set(p.attributes.position.array[3*C],p.attributes.position.array[3*C+1],p.attributes.position.array[3*C+2]),d.setFromCoplanarPoints(s,H,I),A=c.distanceToPlane(d),!(A<F)&&null!==A){u=q.side;if(u!==a.DoubleSide&&(z=c.direction.dot(d.normal),!(u===a.FrontSide?0>z:0<z)))continue;A<j.near||A>j.far||(e=c.at(A,e),!1!==a.Triangle.containsPoint(e,
-s,H,I)&&n.push({distance:A,point:j.ray.at(A),face:null,faceIndex:null,object:g}))}}else if(p instanceof a.Geometry){r=g.material instanceof a.MeshFaceMaterial;s=!0===r?g.material.materials:null;F=j.precision;h.getInverse(g.matrixWorld);c.copy(j.ray).applyMatrix4(h);I=0;for(H=p.faces.length;I<H;I++)if(G=p.faces[I],q=!0===r?s[G.materialIndex]:g.material,void 0!==q&&(d.setFromNormalAndCoplanarPoint(G.normal,t[G.a]),A=c.distanceToPlane(d),!(A<F)&&null!==A)){u=q.side;if(u!==a.DoubleSide&&(z=c.direction.dot(d.normal),
-!(u===a.FrontSide?0>z:0<z)))continue;if(!(A<j.near||A>j.far)){e=c.at(A,e);if(G instanceof a.Face3){if(u=t[G.a],z=t[G.b],C=t[G.c],!1===a.Triangle.containsPoint(e,u,z,C))continue}else if(G instanceof a.Face4){if(u=t[G.a],z=t[G.b],C=t[G.c],q=t[G.d],!1===a.Triangle.containsPoint(e,u,z,q)&&!1===a.Triangle.containsPoint(e,z,C,q))continue}else throw Error("face type not supported");n.push({distance:A,point:j.ray.at(A),face:G,faceIndex:I,object:g})}}}}else if(g instanceof a.Line){F=j.linePrecision;F*=F;p=
-g.geometry;null===p.boundingSphere&&p.computeBoundingSphere();f.getPositionFromMatrix(g.matrixWorld);b.set(f,p.boundingSphere.radius*g.matrixWorld.getMaxScaleOnAxis());if(!1===j.ray.isIntersectionSphere(b))return n;h.getInverse(g.matrixWorld);c.copy(j.ray).applyMatrix4(h);c.direction.normalize();t=p.vertices;q=t.length;A=new a.Vector3;u=new a.Vector3;z=g.type===a.LineStrip?1:2;for(r=0;r<q-1;r+=z)c.distanceToSegment(t[r],t[r+1],u,A),A.applyMatrix4(g.matrixWorld),u.applyMatrix4(g.matrixWorld),u.distanceToSquared(A)<=
-F&&(p=j.ray.origin.distanceTo(u),j.near<=p&&p<=j.far&&n.push({distance:p,point:A.clone(),face:null,faceIndex:null,object:g}))}},j=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&&j(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&&j(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;
+s=!0===r?g.material.materials:null,v=g.material.side,z,C,F=j.precision;h.getInverse(g.matrixWorld);c.copy(j.ray).applyMatrix4(h);var H,t=!1;p.attributes.index&&(t=!0);s=new a.Vector3;H=new a.Vector3;var I=new a.Vector3;new a.Vector3;new a.Vector3;for(var G=0;G<p.offsets.length;++G)for(var A=p.offsets[G].start,K=p.offsets[G].index,r=A,B=A+p.offsets[G].count;r<B;r+=3)if(t?(v=K+p.attributes.index.array[r],z=K+p.attributes.index.array[r+1],C=K+p.attributes.index.array[r+2]):(v=K,z=K+1,C=K+2),s.set(p.attributes.position.array[3*
+v],p.attributes.position.array[3*v+1],p.attributes.position.array[3*v+2]),H.set(p.attributes.position.array[3*z],p.attributes.position.array[3*z+1],p.attributes.position.array[3*z+2]),I.set(p.attributes.position.array[3*C],p.attributes.position.array[3*C+1],p.attributes.position.array[3*C+2]),d.setFromCoplanarPoints(s,H,I),A=c.distanceToPlane(d),!(A<F)&&null!==A){v=q.side;if(v!==a.DoubleSide&&(z=c.direction.dot(d.normal),!(v===a.FrontSide?0>z:0<z)))continue;A<j.near||A>j.far||(e=c.at(A,e),!1!==a.Triangle.containsPoint(e,
+s,H,I)&&n.push({distance:A,point:j.ray.at(A),face:null,faceIndex:null,object:g}))}}else if(p instanceof a.Geometry){r=g.material instanceof a.MeshFaceMaterial;s=!0===r?g.material.materials:null;F=j.precision;h.getInverse(g.matrixWorld);c.copy(j.ray).applyMatrix4(h);I=0;for(H=p.faces.length;I<H;I++)if(G=p.faces[I],q=!0===r?s[G.materialIndex]:g.material,void 0!==q&&(d.setFromNormalAndCoplanarPoint(G.normal,t[G.a]),A=c.distanceToPlane(d),!(A<F)&&null!==A)){v=q.side;if(v!==a.DoubleSide&&(z=c.direction.dot(d.normal),
+!(v===a.FrontSide?0>z:0<z)))continue;if(!(A<j.near||A>j.far)){e=c.at(A,e);if(G instanceof a.Face3){if(v=t[G.a],z=t[G.b],C=t[G.c],!1===a.Triangle.containsPoint(e,v,z,C))continue}else if(G instanceof a.Face4){if(v=t[G.a],z=t[G.b],C=t[G.c],q=t[G.d],!1===a.Triangle.containsPoint(e,v,z,q)&&!1===a.Triangle.containsPoint(e,z,C,q))continue}else throw Error("face type not supported");n.push({distance:A,point:j.ray.at(A),face:G,faceIndex:I,object:g})}}}}else if(g instanceof a.Line){F=j.linePrecision;F*=F;p=
+g.geometry;null===p.boundingSphere&&p.computeBoundingSphere();f.getPositionFromMatrix(g.matrixWorld);b.set(f,p.boundingSphere.radius*g.matrixWorld.getMaxScaleOnAxis());if(!1===j.ray.isIntersectionSphere(b))return n;h.getInverse(g.matrixWorld);c.copy(j.ray).applyMatrix4(h);c.direction.normalize();t=p.vertices;q=t.length;A=new a.Vector3;v=new a.Vector3;z=g.type===a.LineStrip?1:2;for(r=0;r<q-1;r+=z)c.distanceSqToSegment(t[r],t[r+1],v,A)<=F&&(p=c.origin.distanceTo(v),j.near<=p&&p<=j.far&&n.push({distance:p,
+point:A.clone().applyMatrix4(g.matrixWorld),face:null,faceIndex:null,object:g}))}},j=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&&j(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&&j(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;
 this.visible=this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
 THREE.Object3D.prototype={constructor:THREE.Object3D,addEventListener:THREE.EventDispatcher.prototype.addEventListener,hasEventListener:THREE.EventDispatcher.prototype.hasEventListener,removeEventListener:THREE.EventDispatcher.prototype.removeEventListener,dispatchEvent:THREE.EventDispatcher.prototype.dispatchEvent,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);
@@ -156,7 +156,7 @@ getObjectById:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=th
 a&&(a=[]);Array.prototype.push.apply(a,this.children);for(var b=0,c=this.children.length;b<c;b++)this.children[b].getDescendants(a);return a},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===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());return a}};THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(i===l){var a=new THREE.RenderableVertex;j.push(a);l++;i++;return a}return j[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,j=[],l=0,m,n,p=[],t=0,q,r=[],s=0,u,z,C=[],F=0,H,I,G=[],A=0,K={objects:[],sprites:[],lights:[],elements:[]},B=new THREE.Vector3,J=new THREE.Vector4,N=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),y=new THREE.Box3,M=Array(3),w=Array(4),Z=new THREE.Matrix4,L=new THREE.Matrix4,pa,Pa=new THREE.Matrix4,Ua=new THREE.Matrix3,O=new THREE.Matrix3,ka=new THREE.Vector3,Fa=new THREE.Frustum,wa=new THREE.Vector4,D=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);
+0,g,i,j=[],l=0,m,n,p=[],t=0,q,r=[],s=0,v,z,C=[],F=0,H,I,G=[],A=0,K={objects:[],sprites:[],lights:[],elements:[]},B=new THREE.Vector3,J=new THREE.Vector4,N=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),y=new THREE.Box3,M=Array(3),w=Array(4),Z=new THREE.Matrix4,L=new THREE.Matrix4,pa,Pa=new THREE.Matrix4,Ua=new THREE.Matrix3,O=new THREE.Matrix3,ka=new THREE.Vector3,Fa=new THREE.Frustum,wa=new THREE.Vector4,D=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 V=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:(B.getPositionFromMatrix(a.matrixWorld),B.applyProjection(L),d.z=B.z);return d},ea=function(a){if(!1!==a.visible){a instanceof THREE.Light?K.lights.push(a):a instanceof THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===Fa.intersectsObject(a))&&K.objects.push(V(a)):(a instanceof THREE.Sprite||a instanceof THREE.Particle)&&K.sprites.push(V(a));for(var b=0,c=a.children.length;b<c;b++)ea(a.children[b])}};
 this.projectScene=function(d,f,h,l){var V=!1,B,fa,da,T,aa,na,ha,X,xa,ab,la,ia,ra;I=z=q=n=0;K.elements.length=0;!0===d.autoUpdate&&d.updateMatrixWorld();void 0===f.parent&&f.updateMatrixWorld();Z.copy(f.matrixWorldInverse.getInverse(f.matrixWorld));L.multiplyMatrices(f.projectionMatrix,Z);O.getNormalMatrix(Z);Fa.setFromMatrix(L);e=0;K.objects.length=0;K.sprites.length=0;K.lights.length=0;ea(d);!0===h&&K.objects.sort(b);d=0;for(h=K.objects.length;d<h;d++)if(X=K.objects[d].object,pa=X.matrixWorld,i=
@@ -166,8 +166,8 @@ T.positionScreen.y)*(aa.positionScreen.x-T.positionScreen.x),na===THREE.DoubleSi
 0>(la.positionScreen.x-T.positionScreen.x)*(aa.positionScreen.y-T.positionScreen.y)-(la.positionScreen.y-T.positionScreen.y)*(aa.positionScreen.x-T.positionScreen.x)||0>(aa.positionScreen.x-ha.positionScreen.x)*(la.positionScreen.y-ha.positionScreen.y)-(aa.positionScreen.y-ha.positionScreen.y)*(la.positionScreen.x-ha.positionScreen.x),na===THREE.DoubleSide||V===(na===THREE.FrontSide)){if(q===s){var ua=new THREE.RenderableFace4;r.push(ua);s++;q++;m=ua}else m=r[q++];m.id=X.id;m.v1.copy(T);m.v2.copy(aa);
 m.v3.copy(ha);m.v4.copy(la)}else continue;else continue;m.normalModel.copy(fa.normal);!1===V&&(na===THREE.BackSide||na===THREE.DoubleSide)&&m.normalModel.negate();m.normalModel.applyMatrix3(Ua).normalize();m.normalModelView.copy(m.normalModel).applyMatrix3(O);m.centroidModel.copy(fa.centroid).applyMatrix4(pa);ha=fa.vertexNormals;T=0;for(aa=ha.length;T<aa;T++)la=m.vertexNormalsModel[T],la.copy(ha[T]),!1===V&&(na===THREE.BackSide||na===THREE.DoubleSide)&&la.negate(),la.applyMatrix3(Ua).normalize(),
 m.vertexNormalsModelView[T].copy(la).applyMatrix3(O);m.vertexNormalsLength=ha.length;T=0;for(aa=xa.length;T<aa;T++)if(la=xa[T][da],void 0!==la){na=0;for(ha=la.length;na<ha;na++)m.uvs[T][na]=la[na]}m.color=fa.color;m.material=ja;ka.copy(m.centroidModel).applyProjection(L);m.z=ka.z;K.elements.push(m)}}else if(X instanceof THREE.Line){Pa.multiplyMatrices(L,pa);da=X.geometry.vertices;T=a();T.positionScreen.copy(da[0]).applyMatrix4(Pa);ab=X.type===THREE.LinePieces?2:1;B=1;for(fa=da.length;B<fa;B++)T=a(),
-T.positionScreen.copy(da[B]).applyMatrix4(Pa),0<(B+1)%ab||(aa=j[i-2],wa.copy(T.positionScreen),D.copy(aa.positionScreen),!0===c(wa,D)&&(wa.multiplyScalar(1/wa.w),D.multiplyScalar(1/D.w),z===F?(xa=new THREE.RenderableLine,C.push(xa),F++,z++,u=xa):u=C[z++],u.id=X.id,u.v1.positionScreen.copy(wa),u.v2.positionScreen.copy(D),u.z=Math.max(wa.z,D.z),u.material=X.material,X.material.vertexColors===THREE.VertexColors&&(u.vertexColors[0].copy(X.geometry.colors[B]),u.vertexColors[1].copy(X.geometry.colors[B-
-1])),K.elements.push(u)))}d=0;for(h=K.sprites.length;d<h;d++)X=K.sprites[d].object,pa=X.matrixWorld,X instanceof THREE.Particle&&(J.set(pa.elements[12],pa.elements[13],pa.elements[14],1),J.applyMatrix4(L),ja=1/J.w,J.z*=ja,0<J.z&&1>J.z&&(I===A?(V=new THREE.RenderableParticle,G.push(V),A++,I++,H=V):H=G[I++],H.id=X.id,H.x=J.x*ja,H.y=J.y*ja,H.z=J.z,H.object=X,H.rotation=X.rotation.z,H.scale.x=X.scale.x*Math.abs(H.x-(J.x+f.projectionMatrix.elements[0])/(J.w+f.projectionMatrix.elements[12])),H.scale.y=
+T.positionScreen.copy(da[B]).applyMatrix4(Pa),0<(B+1)%ab||(aa=j[i-2],wa.copy(T.positionScreen),D.copy(aa.positionScreen),!0===c(wa,D)&&(wa.multiplyScalar(1/wa.w),D.multiplyScalar(1/D.w),z===F?(xa=new THREE.RenderableLine,C.push(xa),F++,z++,v=xa):v=C[z++],v.id=X.id,v.v1.positionScreen.copy(wa),v.v2.positionScreen.copy(D),v.z=Math.max(wa.z,D.z),v.material=X.material,X.material.vertexColors===THREE.VertexColors&&(v.vertexColors[0].copy(X.geometry.colors[B]),v.vertexColors[1].copy(X.geometry.colors[B-
+1])),K.elements.push(v)))}d=0;for(h=K.sprites.length;d<h;d++)X=K.sprites[d].object,pa=X.matrixWorld,X instanceof THREE.Particle&&(J.set(pa.elements[12],pa.elements[13],pa.elements[14],1),J.applyMatrix4(L),ja=1/J.w,J.z*=ja,0<J.z&&1>J.z&&(I===A?(V=new THREE.RenderableParticle,G.push(V),A++,I++,H=V):H=G[I++],H.id=X.id,H.x=J.x*ja,H.y=J.y*ja,H.z=J.z,H.object=X,H.rotation=X.rotation.z,H.scale.x=X.scale.x*Math.abs(H.x-(J.x+f.projectionMatrix.elements[0])/(J.w+f.projectionMatrix.elements[12])),H.scale.y=
 X.scale.y*Math.abs(H.y-(J.y+f.projectionMatrix.elements[5])/(J.w+f.projectionMatrix.elements[13])),H.material=X.material,K.elements.push(H)));!0===l&&K.elements.sort(b);return K}};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();
 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};
@@ -184,7 +184,7 @@ this.faces.length;b<c;b++)d=this.faces[b],d instanceof THREE.Face3?(d.vertexNorm
 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,j;c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],i=new THREE.Vector3,j=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(j)}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],j=h.vertexNormals[c],
 i.copy(e.normal),e instanceof THREE.Face3?(j.a.copy(e.vertexNormals[0]),j.b.copy(e.vertexNormals[1]),j.c.copy(e.vertexNormals[2])):(j.a.copy(e.vertexNormals[0]),j.b.copy(e.vertexNormals[1]),j.c.copy(e.vertexNormals[2]),j.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];j=a.vertices[d];l=h[e];m=h[f];n=h[y];p=i.x-
-g.x;t=j.x-g.x;q=i.y-g.y;r=j.y-g.y;s=i.z-g.z;u=j.z-g.z;z=m.x-l.x;C=n.x-l.x;F=m.y-l.y;H=n.y-l.y;I=1/(z*H-C*F);B.set((H*p-F*t)*I,(H*q-F*r)*I,(H*s-F*u)*I);J.set((z*t-C*p)*I,(z*r-C*q)*I,(z*u-C*s)*I);A[b].add(B);A[c].add(B);A[d].add(B);K[b].add(J);K[c].add(J);K[d].add(J)}var b,c,d,e,f,h,g,i,j,l,m,n,p,t,q,r,s,u,z,C,F,H,I,G,A=[],K=[],B=new THREE.Vector3,J=new THREE.Vector3,N=new THREE.Vector3,y=new THREE.Vector3,M=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)A[b]=new THREE.Vector3,K[b]=new THREE.Vector3;
+g.x;t=j.x-g.x;q=i.y-g.y;r=j.y-g.y;s=i.z-g.z;v=j.z-g.z;z=m.x-l.x;C=n.x-l.x;F=m.y-l.y;H=n.y-l.y;I=1/(z*H-C*F);B.set((H*p-F*t)*I,(H*q-F*r)*I,(H*s-F*v)*I);J.set((z*t-C*p)*I,(z*r-C*q)*I,(z*v-C*s)*I);A[b].add(B);A[c].add(B);A[d].add(B);K[b].add(J);K[c].add(J);K[d].add(J)}var b,c,d,e,f,h,g,i,j,l,m,n,p,t,q,r,s,v,z,C,F,H,I,G,A=[],K=[],B=new THREE.Vector3,J=new THREE.Vector3,N=new THREE.Vector3,y=new THREE.Vector3,M=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)A[b]=new THREE.Vector3,K[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++)M.copy(f.vertexNormals[d]),e=f[w[d]],G=A[e],N.copy(G),N.sub(M.multiplyScalar(M.dot(G))).normalize(),y.crossVectors(f.vertexNormals[d],G),e=y.dot(K[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,j;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];
@@ -194,12 +194,12 @@ e[h].y));a.faceVertexUvs[0].push(f)}return a},dispose:function(){this.dispatchEv
 THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addEventListener:THREE.EventDispatcher.prototype.addEventListener,hasEventListener:THREE.EventDispatcher.prototype.hasEventListener,removeEventListener:THREE.EventDispatcher.prototype.removeEventListener,dispatchEvent:THREE.EventDispatcher.prototype.dispatchEvent,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=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,j,l,m,n=new THREE.Vector3,p=new THREE.Vector3,t=new THREE.Vector3,q=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],j=e[3*h],l=e[3*h+1],m=e[3*h+2],n.set(j,l,m),j=e[3*g],l=e[3*g+1],m=e[3*g+2],p.set(j,l,m),j=e[3*i],l=e[3*i+1],m=e[3*i+2],t.set(j,l,m),q.subVectors(t,p),r.subVectors(n,p),q.cross(r),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)j=e[a],l=e[a+1],m=e[a+2],n.set(j,l,m),j=e[a+3],l=e[a+4],
+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,j,l,m,n=new THREE.Vector3,p=new THREE.Vector3,t=new THREE.Vector3,q=new THREE.Vector3,r=new THREE.Vector3;if(this.attributes.index){var s=this.attributes.index.array,v=this.offsets;c=0;for(d=
+v.length;c<d;++c){b=v[c].start;h=v[c].count;var z=v[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],j=e[3*h],l=e[3*h+1],m=e[3*h+2],n.set(j,l,m),j=e[3*g],l=e[3*g+1],m=e[3*g+2],p.set(j,l,m),j=e[3*i],l=e[3*i+1],m=e[3*i+2],t.set(j,l,m),q.subVectors(t,p),r.subVectors(n,p),q.cross(r),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)j=e[a],l=e[a+1],m=e[a+2],n.set(j,l,m),j=e[a+3],l=e[a+4],
 m=e[a+5],p.set(j,l,m),j=e[a+6],l=e[a+7],m=e[a+8],t.set(j,l,m),q.subVectors(t,p),r.subVectors(n,p),q.cross(r),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];Ua.copy(Pa);ka=g[a];L.copy(ka);L.sub(Pa.multiplyScalar(Pa.dot(ka))).normalize();pa.crossVectors(Ua,ka);Fa=pa.dot(i[a]);O=0>Fa?-1:1;h[4*a]=L.x;h[4*a+1]=L.y;h[4*a+2]=L.z;h[4*a+3]=O}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=[],j=0;j<f;j++)g[j]=new THREE.Vector3,i[j]=new THREE.Vector3;var l,m,n,p,t,q,r,s,u,z,C,F,H,I,G,f=new THREE.Vector3,j=new THREE.Vector3,A,K,B,J,N,y,M,w=this.offsets;B=0;for(J=w.length;B<J;++B){K=w[B].start;N=w[B].count;var Z=w[B].index;A=K;for(K+=N;A<K;A+=3)N=Z+b[A],y=Z+b[A+1],M=Z+b[A+
-2],l=c[3*N],m=c[3*N+1],n=c[3*N+2],p=c[3*y],t=c[3*y+1],q=c[3*y+2],r=c[3*M],s=c[3*M+1],u=c[3*M+2],z=e[2*N],C=e[2*N+1],F=e[2*y],H=e[2*y+1],I=e[2*M],G=e[2*M+1],p-=l,l=r-l,t-=m,m=s-m,q-=n,n=u-n,F-=z,z=I-z,H-=C,C=G-C,G=1/(F*C-z*H),f.set((C*p-H*l)*G,(C*t-H*m)*G,(C*q-H*n)*G),j.set((F*l-z*p)*G,(F*m-z*t)*G,(F*n-z*q)*G),g[N].add(f),g[y].add(f),g[M].add(f),i[N].add(j),i[y].add(j),i[M].add(j)}var L=new THREE.Vector3,pa=new THREE.Vector3,Pa=new THREE.Vector3,Ua=new THREE.Vector3,O,ka,Fa;B=0;for(J=w.length;B<J;++B){K=
+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=[],j=0;j<f;j++)g[j]=new THREE.Vector3,i[j]=new THREE.Vector3;var l,m,n,p,t,q,r,s,v,z,C,F,H,I,G,f=new THREE.Vector3,j=new THREE.Vector3,A,K,B,J,N,y,M,w=this.offsets;B=0;for(J=w.length;B<J;++B){K=w[B].start;N=w[B].count;var Z=w[B].index;A=K;for(K+=N;A<K;A+=3)N=Z+b[A],y=Z+b[A+1],M=Z+b[A+
+2],l=c[3*N],m=c[3*N+1],n=c[3*N+2],p=c[3*y],t=c[3*y+1],q=c[3*y+2],r=c[3*M],s=c[3*M+1],v=c[3*M+2],z=e[2*N],C=e[2*N+1],F=e[2*y],H=e[2*y+1],I=e[2*M],G=e[2*M+1],p-=l,l=r-l,t-=m,m=s-m,q-=n,n=v-n,F-=z,z=I-z,H-=C,C=G-C,G=1/(F*C-z*H),f.set((C*p-H*l)*G,(C*t-H*m)*G,(C*q-H*n)*G),j.set((F*l-z*p)*G,(F*m-z*t)*G,(F*n-z*q)*G),g[N].add(f),g[y].add(f),g[M].add(f),i[N].add(j),i[y].add(j),i[M].add(j)}var L=new THREE.Vector3,pa=new THREE.Vector3,Pa=new THREE.Vector3,Ua=new THREE.Vector3,O,ka,Fa;B=0;for(J=w.length;B<J;++B){K=
 w[B].start;N=w[B].count;Z=w[B].index;A=K;for(K+=N;A<K;A+=3)N=Z+b[A],y=Z+b[A+1],M=Z+b[A+2],a(N),a(y),a(M)}this.tangentsNeedUpdate=this.hasTangents=!0}},dispose:function(){this.dispatchEvent({type:"dispose"})}};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.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,
@@ -208,8 +208,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(){}};
 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}function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function e(a,e,f,g,i,j,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]);j&&(f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==
-f[j[0]]&&(a[e].wrapS=f[j[0]]),void 0!==f[j[1]]&&(a[e].wrapT=f[j[1]]));r&&(a[e].anisotropy=r);if(!s){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=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,j,r){var s=/\.dds$/i.test(f),v=b+"/"+f;if(s){var z=THREE.ImageUtils.loadCompressedTexture(v);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]);j&&(f={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==
+f[j[0]]&&(a[e].wrapS=f[j[0]]),void 0!==f[j[1]]&&(a[e].wrapT=f[j[1]]));r&&(a[e].anisotropy=r);if(!s){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=v}}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 j=a.shading.toLowerCase();"phong"===j?g="MeshPhongMaterial":"basic"===j&&(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&&
 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,
@@ -219,8 +219,8 @@ 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.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)};
-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,j,l,m,n,p,t,q,r,s,u,z=a.faces;p=a.vertices;var C=a.normals,F=a.colors,H=0;if(void 0!==a.uvs){for(e=0;e<a.uvs.length;e++)a.uvs[e].length&&H++;for(e=0;e<H;e++)c.faceUvs[e]=[],c.faceVertexUvs[e]=[]}g=0;for(i=p.length;g<i;)j=new THREE.Vector3,j.x=p[g++]*d,j.y=p[g++]*d,j.z=p[g++]*d,c.vertices.push(j);g=0;for(i=z.length;g<i;){p=z[g++];j=p&1;h=p&2;e=p&4;f=p&8;m=p&16;l=p&32;t=p&64;p&=128;j?(q=
-new THREE.Face4,q.a=z[g++],q.b=z[g++],q.c=z[g++],q.d=z[g++],j=4):(q=new THREE.Face3,q.a=z[g++],q.b=z[g++],q.c=z[g++],j=3);h&&(h=z[g++],q.materialIndex=h);h=c.faces.length;if(e)for(e=0;e<H;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<H;e++){r=a.uvs[e];s=[];for(f=0;f<j;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=C[m++],f.y=C[m++],f.z=C[m],q.normal=f);if(l)for(e=0;e<j;e++)m=
+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,j,l,m,n,p,t,q,r,s,v,z=a.faces;p=a.vertices;var C=a.normals,F=a.colors,H=0;if(void 0!==a.uvs){for(e=0;e<a.uvs.length;e++)a.uvs[e].length&&H++;for(e=0;e<H;e++)c.faceUvs[e]=[],c.faceVertexUvs[e]=[]}g=0;for(i=p.length;g<i;)j=new THREE.Vector3,j.x=p[g++]*d,j.y=p[g++]*d,j.z=p[g++]*d,c.vertices.push(j);g=0;for(i=z.length;g<i;){p=z[g++];j=p&1;h=p&2;e=p&4;f=p&8;m=p&16;l=p&32;t=p&64;p&=128;j?(q=
+new THREE.Face4,q.a=z[g++],q.b=z[g++],q.c=z[g++],q.d=z[g++],j=4):(q=new THREE.Face3,q.a=z[g++],q.b=z[g++],q.c=z[g++],j=3);h&&(h=z[g++],q.materialIndex=h);h=c.faces.length;if(e)for(e=0;e<H;e++)r=a.uvs[e],n=z[g++],v=r[2*n],n=r[2*n+1],c.faceUvs[e][h]=new THREE.Vector2(v,n);if(f)for(e=0;e<H;e++){r=a.uvs[e];s=[];for(f=0;f<j;f++)n=z[g++],v=r[2*n],n=r[2*n+1],s[f]=new THREE.Vector2(v,n);c.faceVertexUvs[e][h]=s}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<j;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);t&&(l=z[g++],l=new THREE.Color(F[l]),q.color=l);if(p)for(e=0;e<j;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;H=a.morphTargets[g].vertices;z=0;for(C=H.length;z<C;z+=3)p=new THREE.Vector3,p.x=H[z]*d,p.y=H[z+1]*d,p.z=H[z+2]*d,F.push(p)}}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)H=new THREE.Color(16755200),H.setRGB(F[d],F[d+1],F[d+2]),C.push(H)}}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};
@@ -238,12 +238,12 @@ THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b){va
 B.objects)}function f(a,b){var c,e,h,i,j,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,B.urlBaseType),g(n,a,t,s)):e.load(d(s.url,B.urlBaseType),g(n,
 a,t,s),h)}}else if(void 0!==s.geometry){if(p=A.geometries[s.geometry]){r=!1;t=A.materials[s.material];r=t instanceof THREE.ShaderMaterial;h=s.position;i=s.rotation;j=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&&p.computeTangents();s.skin?r=new THREE.SkinnedMesh(p,t):s.morph?(r=new THREE.MorphAnimMesh(p,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&&p.computeMorphNormals()):r=new THREE.Mesh(p,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(j));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,C=void 0!==s.intensity?s.intensity:1,"DirectionalLight"===s.type?(h=s.direction,u=new THREE.DirectionalLight(z,C),u.position.fromArray(h),s.target&&(K.push({object:u,targetName:s.target}),u.target=null)):"PointLight"===s.type?(h=s.position,e=s.distance,u=new THREE.PointLight(z,
-C,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?q=new THREE.PerspectiveCamera(s.fov,s.aspect,s.near,s.far):"OrthographicCamera"===s.type&&(q=new THREE.OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.far)),q.name=n,q.position.fromArray(h),void 0!==l?q.quaternion.fromArray(l):
+r.scale.fromArray(j));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,C=void 0!==s.intensity?s.intensity:1,"DirectionalLight"===s.type?(h=s.direction,v=new THREE.DirectionalLight(z,C),v.position.fromArray(h),s.target&&(K.push({object:v,targetName:s.target}),v.target=null)):"PointLight"===s.type?(h=s.position,e=s.distance,v=new THREE.PointLight(z,
+C,e),v.position.fromArray(h)):"AmbientLight"===s.type&&(v=new THREE.AmbientLight(z)),a.add(v),v.name=n,A.lights[n]=v,A.objects[n]=v):"PerspectiveCamera"===s.type||"OrthographicCamera"===s.type?(h=s.position,i=s.rotation,l=s.quaternion,"PerspectiveCamera"===s.type?q=new THREE.PerspectiveCamera(s.fov,s.aspect,s.near,s.far):"OrthographicCamera"===s.type&&(q=new THREE.OrthographicCamera(s.left,s.right,s.top,s.bottom,s.near,s.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),A.cameras[n]=q,A.objects[n]=q):(h=s.position,i=s.rotation,j=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(j),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 F in s.userData)r.userData[F]=s.userData[F];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();F-=1;m.onLoadComplete();j()}}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();F-=1;m.onLoadComplete();j()}}function i(a){return function(b,c){b.name=a;A.geometries[a]=b;A.face_materials[a]=c}}function j(){m.callbackProgress({totalModels:I,totalTextures:G,loadedModels:I-F,loadedTextures:G-H},A);m.onLoadProgress();if(0===F&&0===H){for(var a=0;a<K.length;a++){var c=K[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),p,t,q,r,s,u,z,C,F,H,I,G,A,K=[],B=a,J;for(J in this.geometryHandlers)a=this.geometryHandlers[J].loaderClass,this.geometryHandlers[J].loaderObject=new a;for(J in this.hierarchyHandlers)a=this.hierarchyHandlers[J].loaderClass,this.hierarchyHandlers[J].loaderObject=new a;H=F=0;A={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},
+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),p,t,q,r,s,v,z,C,F,H,I,G,A,K=[],B=a,J;for(J in this.geometryHandlers)a=this.geometryHandlers[J].loaderClass,this.geometryHandlers[J].loaderObject=new a;for(J in this.hierarchyHandlers)a=this.hierarchyHandlers[J].loaderClass,this.hierarchyHandlers[J].loaderObject=new a;H=F=0;A={scene:new THREE.Scene,geometries:{},face_materials:{},materials:{},textures:{},
 objects:{},cameras:{},lights:{},fogs:{},empties:{},groups:{}};if(B.transform&&(J=B.transform.position,a=B.transform.rotation,c=B.transform.scale,J&&A.scene.position.fromArray(J),a&&A.scene.rotation.fromArray(a),c&&A.scene.scale.fromArray(c),J||a||c))A.scene.updateMatrix(),A.scene.updateMatrixWorld();J=function(a){return function(){H-=a;j();m.onLoadComplete()}};for(var N in B.fogs)a=B.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 B.geometries)r=B.geometries[y],r.type in this.geometryHandlers&&(F+=1,m.onLoadStart());for(var M in B.objects)l(B.objects[M],function(a){a.type&&a.type in m.hierarchyHandlers&&(F+=1,m.onLoadStart())});I=F;for(y in B.geometries)if(r=B.geometries[y],"cube"===r.type)p=new THREE.CubeGeometry(r.width,r.height,r.depth,r.widthSegments,r.heightSegments,r.depthSegments),p.name=y,A.geometries[y]=p;else if("plane"===r.type)p=new THREE.PlaneGeometry(r.width,
 r.height,r.widthSegments,r.heightSegments),p.name=y,A.geometries[y]=p;else if("sphere"===r.type)p=new THREE.SphereGeometry(r.radius,r.widthSegments,r.heightSegments),p.name=y,A.geometries[y]=p;else if("cylinder"===r.type)p=new THREE.CylinderGeometry(r.topRad,r.botRad,r.height,r.radSegs,r.heightSegs),p.name=y,A.geometries[y]=p;else if("torus"===r.type)p=new THREE.TorusGeometry(r.radius,r.tube,r.segmentsR,r.segmentsT),p.name=y,A.geometries[y]=p;else if("icosahedron"===r.type)p=new THREE.IcosahedronGeometry(r.radius,
@@ -308,7 +308,7 @@ y.fill()}function g(a,b,c,d,e,f,g,k,i,j,m,l,n){if(!(n instanceof THREE.DataTextu
 g=(g+p)*r,k=(1-k+q)*t,c=c-a,d=d-b,e=e-a,f=f-b,i=(i+p)*r-g,j=(1-j+q)*t-k,m=(m+p)*r-g,l=(1-l+q)*t-k,p=i*l-m*j;0===p?(void 0===Ab[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),Ab[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=Ab[n.id],g=4*(Math.floor(g)+Math.floor(k)*n.image.width),ia.setRGB(b[g]/255,b[g+1]/255,b[g+2]/255),h(ia)):(p=1/p,n=(l*c-j*e)*p,j=(l*d-j*f)*p,c=(i*e-m*c)*p,d=(i*f-m*d)*p,a=a-
 n*g-c*k,g=b-j*g-d*k,y.save(),y.transform(n,j,c,d,a,g),y.fill(),y.restore())}}function i(a,b,c,d,e,f,h,g,k,i,j,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;k=k*n-h;i=i*p-g;j=j*n-h;m=m*p-g;p=1/(k*m-j*i);n=(m*c-i*e)*p;i=(m*d-i*f)*p;c=(k*e-j*c)*p;d=(k*f-j*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 j(a,b,c,d){Ka[0]=255*a.r|0;Ka[1]=255*a.g|0;Ka[2]=255*a.b|0;Ka[4]=255*b.r|0;Ka[5]=255*b.g|0;Ka[6]=255*b.b|0;Ka[8]=255*
 c.r|0;Ka[9]=255*c.g|0;Ka[10]=255*c.b|0;Ka[12]=255*d.r|0;Ka[13]=255*d.g|0;Ka[14]=255*d.b|0;Bb.putImageData(Kb,0,0);Lb.drawImage(Gb,0,0);return Sb}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){Z!==a&&(Z=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 p(a){Ua!==a&&(Ua=y.lineWidth=a)}function t(a){O!==a&&(O=y.lineCap=a)}function q(a){ka!==a&&(ka=y.lineJoin=a)}function r(a){pa!==a&&(pa=y.strokeStyle=a)}function s(a){Pa!==a&&(Pa=y.fillStyle=a)}function u(a,b){if(Fa!==a||wa!==b)y.setLineDash([a,b]),Fa=a,wa=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var z=THREE.Math.smoothstep,a=a||{},C=this,F,H,I,G=new THREE.Projector,A=void 0!==a.canvas?a.canvas:document.createElement("canvas"),K,B,J,N,y=A.getContext("2d"),M=new THREE.Color(0),
+"darker"),L=a)}function p(a){Ua!==a&&(Ua=y.lineWidth=a)}function t(a){O!==a&&(O=y.lineCap=a)}function q(a){ka!==a&&(ka=y.lineJoin=a)}function r(a){pa!==a&&(pa=y.strokeStyle=a)}function s(a){Pa!==a&&(Pa=y.fillStyle=a)}function v(a,b){if(Fa!==a||wa!==b)y.setLineDash([a,b]),Fa=a,wa=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var z=THREE.Math.smoothstep,a=a||{},C=this,F,H,I,G=new THREE.Projector,A=void 0!==a.canvas?a.canvas:document.createElement("canvas"),K,B,J,N,y=A.getContext("2d"),M=new THREE.Color(0),
 w=0,Z=1,L=0,pa=null,Pa=null,Ua=null,O=null,ka=null,Fa=null,wa=0,D,V,ea,qa,eb,pb=new THREE.RenderableVertex,ub=new THREE.RenderableVertex,ya,Ha,fa,da,T,aa,na,ha,X,xa,ab,la,ia=new THREE.Color,ra=new THREE.Color,ja=new THREE.Color,ua=new THREE.Color,Ra=new THREE.Color,Qa=new THREE.Color,Xa=new THREE.Color,Xb=new THREE.Color,Jb={},Ab={},Sa,xb,lb,Ga,Ca,yb,Ib,k,Rb,Yb,fb=new THREE.Box2,oa=new THREE.Box2,va=new THREE.Box2,ib=new THREE.Color,Tb=new THREE.Color,Ub=new THREE.Color,Wa=new THREE.Vector3,Gb,Bb,
 Kb,Ka,Sb,Lb,Hb=16;Gb=document.createElement("canvas");Gb.width=Gb.height=2;Bb=Gb.getContext("2d");Bb.fillStyle="rgba(0,0,0,1)";Bb.fillRect(0,0,2,2);Kb=Bb.getImageData(0,0,2,2);Ka=Kb.data;Sb=document.createElement("canvas");Sb.width=Sb.height=Hb;Lb=Sb.getContext("2d");Lb.translate(-Hb/2,-Hb/2);Lb.scale(Hb,Hb);Hb--;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){K=a*this.devicePixelRatio;B=b*this.devicePixelRatio;J=Math.floor(K/2);N=Math.floor(B/2);A.width=K;A.height=B;1!==this.devicePixelRatio&&!1!==c&&(A.style.width=a+"px",A.style.height=b+"px");fb.set(new THREE.Vector2(-J,-N),new THREE.Vector2(J,N));oa.set(new THREE.Vector2(-J,
@@ -319,7 +319,7 @@ N;B=V;m(w.opacity);n(w.blending);var mb=void 0,nb=void 0,vb=void 0,zb=void 0,Zb=
 1,vb=U.scale.x*J,zb=U.scale.y*N,mb=vb*Jc,nb=zb*Kc,va.min.set(B.x-mb,B.y-nb),va.max.set(B.x+mb,B.y+nb),!1===fb.isIntersectionBox(va)?va.makeEmpty():(y.save(),y.translate(B.x,B.y),y.rotate(-U.rotation),y.scale(vb,-zb),y.translate(-Jc,-Kc),y.drawImage(Zb,0,0),y.restore())):w instanceof THREE.ParticleCanvasMaterial&&(mb=U.scale.x*J,nb=U.scale.y*N,va.min.set(B.x-mb,B.y-nb),va.max.set(B.x+mb,B.y+nb),!1===fb.isIntersectionBox(va)?va.makeEmpty():(r(w.color.getStyle()),s(w.color.getStyle()),y.save(),y.translate(B.x,
 B.y),y.rotate(-U.rotation),y.scale(mb,nb),w.program(y),y.restore()))}else if(U instanceof THREE.RenderableLine){if(V=U.v1,ea=U.v2,V.positionScreen.x*=J,V.positionScreen.y*=N,ea.positionScreen.x*=J,ea.positionScreen.y*=N,va.setFromPoints([V.positionScreen,ea.positionScreen]),!0===fb.isIntersectionBox(va))if(B=V,mb=ea,m(w.opacity),n(w.blending),y.beginPath(),y.moveTo(B.positionScreen.x,B.positionScreen.y),y.lineTo(mb.positionScreen.x,mb.positionScreen.y),w instanceof THREE.LineBasicMaterial){p(w.linewidth);
 t(w.linecap);q(w.linejoin);if(w.vertexColors!==THREE.VertexColors)r(w.color.getStyle());else if(nb=U.vertexColors[0].getStyle(),U=U.vertexColors[1].getStyle(),nb===U)r(nb);else{try{var wc=y.createLinearGradient(B.positionScreen.x,B.positionScreen.y,mb.positionScreen.x,mb.positionScreen.y);wc.addColorStop(0,nb);wc.addColorStop(1,U)}catch(fd){wc=nb}r(wc)}y.stroke();va.expandByScalar(2*w.linewidth)}else w instanceof THREE.LineDashedMaterial&&(p(w.linewidth),t(w.linecap),q(w.linejoin),r(w.color.getStyle()),
-u(w.dashSize,w.gapSize),y.stroke(),va.expandByScalar(2*w.linewidth),u(null,null))}else if(U instanceof THREE.RenderableFace3){V=U.v1;ea=U.v2;qa=U.v3;if(-1>V.positionScreen.z||1<V.positionScreen.z)continue;if(-1>ea.positionScreen.z||1<ea.positionScreen.z)continue;if(-1>qa.positionScreen.z||1<qa.positionScreen.z)continue;V.positionScreen.x*=J;V.positionScreen.y*=N;ea.positionScreen.x*=J;ea.positionScreen.y*=N;qa.positionScreen.x*=J;qa.positionScreen.y*=N;0<w.overdraw&&(l(V.positionScreen,ea.positionScreen,
+v(w.dashSize,w.gapSize),y.stroke(),va.expandByScalar(2*w.linewidth),v(null,null))}else if(U instanceof THREE.RenderableFace3){V=U.v1;ea=U.v2;qa=U.v3;if(-1>V.positionScreen.z||1<V.positionScreen.z)continue;if(-1>ea.positionScreen.z||1<ea.positionScreen.z)continue;if(-1>qa.positionScreen.z||1<qa.positionScreen.z)continue;V.positionScreen.x*=J;V.positionScreen.y*=N;ea.positionScreen.x*=J;ea.positionScreen.y*=N;qa.positionScreen.x*=J;qa.positionScreen.y*=N;0<w.overdraw&&(l(V.positionScreen,ea.positionScreen,
 w.overdraw),l(ea.positionScreen,qa.positionScreen,w.overdraw),l(qa.positionScreen,V.positionScreen,w.overdraw));va.setFromPoints([V.positionScreen,ea.positionScreen,qa.positionScreen]);!0===fb.isIntersectionBox(va)&&c(V,ea,qa,0,1,2,U,w)}else if(U instanceof THREE.RenderableFace4){V=U.v1;ea=U.v2;qa=U.v3;eb=U.v4;if(-1>V.positionScreen.z||1<V.positionScreen.z)continue;if(-1>ea.positionScreen.z||1<ea.positionScreen.z)continue;if(-1>qa.positionScreen.z||1<qa.positionScreen.z)continue;if(-1>eb.positionScreen.z||
 1<eb.positionScreen.z)continue;V.positionScreen.x*=J;V.positionScreen.y*=N;ea.positionScreen.x*=J;ea.positionScreen.y*=N;qa.positionScreen.x*=J;qa.positionScreen.y*=N;eb.positionScreen.x*=J;eb.positionScreen.y*=N;pb.positionScreen.copy(ea.positionScreen);ub.positionScreen.copy(eb.positionScreen);0<w.overdraw&&(l(V.positionScreen,ea.positionScreen,w.overdraw),l(ea.positionScreen,eb.positionScreen,w.overdraw),l(eb.positionScreen,V.positionScreen,w.overdraw),l(qa.positionScreen,pb.positionScreen,w.overdraw),
 l(qa.positionScreen,ub.positionScreen,w.overdraw));va.setFromPoints([V.positionScreen,ea.positionScreen,qa.positionScreen,eb.positionScreen]);!0===fb.isIntersectionBox(va)&&(B=V,mb=ea,nb=qa,vb=eb,zb=pb,Zb=ub,C.info.render.vertices+=4,C.info.render.faces++,m(w.opacity),n(w.blending),void 0!==w.map&&null!==w.map||void 0!==w.envMap&&null!==w.envMap?(c(B,mb,vb,0,1,3,U,w),c(zb,nb,Zb,1,2,3,U,w)):(ya=B.positionScreen.x,Ha=B.positionScreen.y,fa=mb.positionScreen.x,da=mb.positionScreen.y,T=nb.positionScreen.x,
@@ -387,19 +387,19 @@ THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function h(a){return a
 c,Xb,Jb),ya=qa=null,pb=ub=T=da=ab=xa=aa=-1,yb=!0}function n(a,b,c,d,e,f,h,g){var k,i,j,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(k=a[l],k.render){i=k.object;j=k.buffer;if(g)k=g;else{k=k[c];if(!k)continue;h&&D.setBlending(k.blending,k.blendEquation,k.blendSrc,k.blendDst);D.setDepthTest(k.depthTest);D.setDepthWrite(k.depthWrite);K(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}D.setMaterialFaces(k);j instanceof THREE.BufferGeometry?D.renderBufferDirect(d,
 e,f,k,j,i):D.renderBuffer(d,e,f,k,j,i)}}function p(a,b,c,d,e,f,h){for(var g,k,i=0,j=a.length;i<j;i++)if(g=a[i],k=g.object,k.visible){if(h)g=h;else{g=g[b];if(!g)continue;f&&D.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);D.setDepthTest(g.depthTest);D.setDepthWrite(g.depthWrite);K(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}D.renderImmediateObject(c,d,e,g,k)}}function t(a,b){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,j;for(i in f.attributes)j="index"===i?k.ELEMENT_ARRAY_BUFFER:k.ARRAY_BUFFER,g=f.attributes[i],void 0===g.numItems&&(g.numItems=g.array.length),g.buffer=k.createBuffer(),k.bindBuffer(j,g.buffer),k.bufferData(j,g.array,k.STATIC_DRAW)}else if(a instanceof THREE.Mesh){h=a.material;
-if(void 0===f.geometryGroups){i=f;var m,l,n,p,r;j={};var s=i.morphTargets.length,t=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===j[n]&&(j[n]={hash:n,counter:0}),r=j[n].hash+"_"+j[n].counter,void 0===i.geometryGroups[r]&&(i.geometryGroups[r]={faces3:[],faces4:[],materialIndex:n,vertices:0,numMorphTargets:s,numMorphNormals:t}),p=l instanceof THREE.Face3?3:4,65535<i.geometryGroups[r].vertices+
+if(void 0===f.geometryGroups){i=f;var m,l,n,p,r;j={};var s=i.morphTargets.length,t=i.morphNormals.length,v=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(m=i.faces.length;h<m;h++)l=i.faces[h],n=v?l.materialIndex:0,void 0===j[n]&&(j[n]={hash:n,counter:0}),r=j[n].hash+"_"+j[n].counter,void 0===i.geometryGroups[r]&&(i.geometryGroups[r]={faces3:[],faces4:[],materialIndex:n,vertices:0,numMorphTargets:s,numMorphNormals:t}),p=l instanceof THREE.Face3?3:4,65535<i.geometryGroups[r].vertices+
 p&&(j[n].counter+=1,r=j[n].hash+"_"+j[n].counter,void 0===i.geometryGroups[r]&&(i.geometryGroups[r]={faces3:[],faces4:[],materialIndex:n,vertices:0,numMorphTargets:s,numMorphNormals:t})),l instanceof THREE.Face3?i.geometryGroups[r].faces3.push(h):i.geometryGroups[r].faces4.push(h),i.geometryGroups[r].vertices+=p;i.geometryGroupsList=[];for(g in i.geometryGroups)i.geometryGroups[g].id=Ha++,i.geometryGroupsList.push(i.geometryGroups[g])}for(e in f.geometryGroups)if(g=f.geometryGroups[e],!g.__webglVertexBuffer){i=
 g;i.__webglVertexBuffer=k.createBuffer();i.__webglNormalBuffer=k.createBuffer();i.__webglTangentBuffer=k.createBuffer();i.__webglColorBuffer=k.createBuffer();i.__webglUVBuffer=k.createBuffer();i.__webglUV2Buffer=k.createBuffer();i.__webglSkinIndicesBuffer=k.createBuffer();i.__webglSkinWeightsBuffer=k.createBuffer();i.__webglFaceBuffer=k.createBuffer();i.__webglLineBuffer=k.createBuffer();s=j=void 0;if(i.numMorphTargets){i.__webglMorphTargetsBuffers=[];j=0;for(s=i.numMorphTargets;j<s;j++)i.__webglMorphTargetsBuffers.push(k.createBuffer())}if(i.numMorphNormals){i.__webglMorphNormalsBuffers=
 [];j=0;for(s=i.numMorphNormals;j<s;j++)i.__webglMorphNormalsBuffers.push(k.createBuffer())}D.info.memory.geometries++;d(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=k.createBuffer(),g.__webglColorBuffer=k.createBuffer(),g.__webglNormalBuffer=k.createBuffer(),D.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,c(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.normalsNeedUpdate=!0):a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=k.createBuffer(),g.__webglColorBuffer=k.createBuffer(),g.__webglLineDistanceBuffer=k.createBuffer(),D.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,c(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.ParticleSystem&&!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=k.createBuffer(),g.__webglColorBuffer=k.createBuffer(),D.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,c(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)q(b.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],q(b.__webglObjects,g,a)}else a instanceof THREE.Ribbon||a instanceof THREE.Line||a instanceof THREE.ParticleSystem?(f=a.geometry,q(b.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?b.__webglObjectsImmediate.push({id:null,object:a,opaque:null,
-transparent:null,z:0}):a instanceof THREE.Sprite?b.__webglSprites.push(a):a instanceof THREE.LensFlare&&b.__webglFlares.push(a);a.__webglActive=!0}}function q(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function r(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function s(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function u(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Ribbon||a instanceof
+transparent:null,z:0}):a instanceof THREE.Sprite?b.__webglSprites.push(a):a instanceof THREE.LensFlare&&b.__webglFlares.push(a);a.__webglActive=!0}}function q(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function r(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function s(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function v(a,b){a instanceof THREE.Mesh||a instanceof THREE.ParticleSystem||a instanceof THREE.Ribbon||a instanceof
 THREE.Line?z(b.__webglObjects,a):a instanceof THREE.Sprite?C(b.__webglSprites,a):a instanceof THREE.LensFlare?C(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&z(b.__webglObjectsImmediate,a);delete a.__webglActive}function z(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function C(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function F(a,b,c,d,e){fa=0;d.needsUpdate&&(d.program&&vc(d),D.initMaterial(d,b,c,e),d.needsUpdate=
 !1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(D.maxMorphTargets));var f=!1,g=d.program,h=g.uniforms,i=d.uniforms;g!==qa&&(k.useProgram(g),qa=g,f=!0);d.id!==pb&&(pb=d.id,f=!0);if(f||a!==ya)k.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),a!==ya&&(ya=a);if(d.skinning)if(Bb&&e.useVertexTexture){if(null!==h.boneTexture){var j=H();k.uniform1i(h.boneTexture,j);D.setTexture(e.boneTexture,j)}}else null!==h.boneGlobalMatrices&&k.uniformMatrix4fv(h.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(yb){for(var m,l=j=0,n=0,p,q,r,s=Ib,t=s.directional.colors,u=s.directional.positions,z=s.point.colors,y=s.point.positions,A=s.point.distances,B=s.spot.colors,F=s.spot.positions,C=s.spot.distances,E=s.spot.directions,J=
+!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(yb){for(var m,l=j=0,n=0,p,q,r,s=Ib,t=s.directional.colors,v=s.directional.positions,z=s.point.colors,y=s.point.positions,A=s.point.distances,B=s.spot.colors,F=s.spot.positions,C=s.spot.distances,E=s.spot.directions,J=
 s.spot.anglesCos,L=s.spot.exponents,V=s.hemi.skyColors,K=s.hemi.groundColors,M=s.hemi.positions,O=0,ea=0,T=0,aa=0,da=0,R=0,S=0,P=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&&(D.gammaInput?(j+=p.r*p.r,l+=p.g*p.g,n+=p.b*p.b):(j+=p.r,l+=p.g,n+=p.b)):m instanceof THREE.DirectionalLight?(da+=1,m.visible&&(Ca.getPositionFromMatrix(m.matrixWorld),Ga.getPositionFromMatrix(m.target.matrixWorld),Ca.sub(Ga),Ca.normalize(),
-0===Ca.x&&0===Ca.y&&0===Ca.z||(m=3*O,u[m]=Ca.x,u[m+1]=Ca.y,u[m+2]=Ca.z,D.gammaInput?I(t,m,p,q*q):G(t,m,p,q),O+=1))):m instanceof THREE.PointLight?(R+=1,m.visible&&(ba=3*ea,D.gammaInput?I(z,ba,p,q*q):G(z,ba,p,q),Ga.getPositionFromMatrix(m.matrixWorld),y[ba]=Ga.x,y[ba+1]=Ga.y,y[ba+2]=Ga.z,A[ea]=r,ea+=1)):m instanceof THREE.SpotLight?(S+=1,m.visible&&(ba=3*T,D.gammaInput?I(B,ba,p,q*q):G(B,ba,p,q),Ga.getPositionFromMatrix(m.matrixWorld),F[ba]=Ga.x,F[ba+1]=Ga.y,F[ba+2]=Ga.z,C[T]=r,Ca.copy(Ga),Ga.getPositionFromMatrix(m.target.matrixWorld),
+0===Ca.x&&0===Ca.y&&0===Ca.z||(m=3*O,v[m]=Ca.x,v[m+1]=Ca.y,v[m+2]=Ca.z,D.gammaInput?I(t,m,p,q*q):G(t,m,p,q),O+=1))):m instanceof THREE.PointLight?(R+=1,m.visible&&(ba=3*ea,D.gammaInput?I(z,ba,p,q*q):G(z,ba,p,q),Ga.getPositionFromMatrix(m.matrixWorld),y[ba]=Ga.x,y[ba+1]=Ga.y,y[ba+2]=Ga.z,A[ea]=r,ea+=1)):m instanceof THREE.SpotLight?(S+=1,m.visible&&(ba=3*T,D.gammaInput?I(B,ba,p,q*q):G(B,ba,p,q),Ga.getPositionFromMatrix(m.matrixWorld),F[ba]=Ga.x,F[ba+1]=Ga.y,F[ba+2]=Ga.z,C[T]=r,Ca.copy(Ga),Ga.getPositionFromMatrix(m.target.matrixWorld),
 Ca.sub(Ga),Ca.normalize(),E[ba]=Ca.x,E[ba+1]=Ca.y,E[ba+2]=Ca.z,J[T]=Math.cos(m.angle),L[T]=m.exponent,T+=1)):m instanceof THREE.HemisphereLight&&(P+=1,m.visible&&(Ca.getPositionFromMatrix(m.matrixWorld),Ca.normalize(),0===Ca.x&&0===Ca.y&&0===Ca.z||(r=3*aa,M[r]=Ca.x,M[r+1]=Ca.y,M[r+2]=Ca.z,p=m.color,m=m.groundColor,D.gammaInput?(q*=q,I(V,r,p,q),I(K,r,m,q)):(G(V,r,p,q),G(K,r,m,q)),aa+=1))));c=3*O;for(f=Math.max(t.length,3*da);c<f;c++)t[c]=0;c=3*ea;for(f=Math.max(z.length,3*R);c<f;c++)z[c]=0;c=3*T;for(f=
 Math.max(B.length,3*S);c<f;c++)B[c]=0;c=3*aa;for(f=Math.max(V.length,3*P);c<f;c++)V[c]=0;c=3*aa;for(f=Math.max(K.length,3*P);c<f;c++)K[c]=0;s.directional.length=O;s.point.length=ea;s.spot.length=T;s.hemi.length=aa;s.ambient[0]=j;s.ambient[1]=l;s.ambient[2]=n;yb=!1}c=Ib;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||
@@ -411,8 +411,8 @@ d.opacity);if(e.receiveShadow&&!d._shadowPass&&i.shadowMatrix){c=X=0;for(f=b.len
 l)k.uniform1i(f,j);else if("f"===l)k.uniform1f(f,j);else if("v2"===l)k.uniform2f(f,j.x,j.y);else if("v3"===l)k.uniform3f(f,j.x,j.y,j.z);else if("v4"===l)k.uniform4f(f,j.x,j.y,j.z,j.w);else if("c"===l)k.uniform3f(f,j.r,j.g,j.b);else if("iv1"===l)k.uniform1iv(f,j);else if("iv"===l)k.uniform3iv(f,j);else if("fv1"===l)k.uniform1fv(f,j);else if("fv"===l)k.uniform3fv(f,j);else if("v2v"===l){void 0===c._array&&(c._array=new Float32Array(2*j.length));l=0;for(n=j.length;l<n;l++)s=2*l,c._array[s]=j[l].x,c._array[s+
 1]=j[l].y;k.uniform2fv(f,c._array)}else if("v3v"===l){void 0===c._array&&(c._array=new Float32Array(3*j.length));l=0;for(n=j.length;l<n;l++)s=3*l,c._array[s]=j[l].x,c._array[s+1]=j[l].y,c._array[s+2]=j[l].z;k.uniform3fv(f,c._array)}else if("v4v"===l){void 0===c._array&&(c._array=new Float32Array(4*j.length));l=0;for(n=j.length;l<n;l++)s=4*l,c._array[s]=j[l].x,c._array[s+1]=j[l].y,c._array[s+2]=j[l].z,c._array[s+3]=j[l].w;k.uniform4fv(f,c._array)}else if("m4"===l)void 0===c._array&&(c._array=new Float32Array(16)),
 j.flattenToArray(c._array),k.uniformMatrix4fv(f,!1,c._array);else if("m4v"===l){void 0===c._array&&(c._array=new Float32Array(16*j.length));l=0;for(n=j.length;l<n;l++)j[l].flattenToArrayOffset(c._array,16*l);k.uniformMatrix4fv(f,!1,c._array)}else if("t"===l){if(s=j,j=H(),k.uniform1i(f,j),s)if(s.image instanceof Array&&6===s.image.length){if(c=s,f=j,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",gc),c.image.__webglTextureCube=k.createTexture(),D.info.memory.textures++);
-k.activeTexture(k.TEXTURE0+f);k.bindTexture(k.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;j=[];for(l=0;6>l;l++)D.autoScaleCubemaps&&!f?(n=j,s=l,t=c.image[l],z=Ub,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):j[l]=c.image[l];
-l=j[0];n=0===(l.width&l.width-1)&&0===(l.height&l.height-1);s=w(c.format);t=w(c.type);N(k.TEXTURE_CUBE_MAP,c,n);for(l=0;6>l;l++)if(f){z=j[l].mipmaps;y=0;for(A=z.length;y<A;y++)u=z[y],k.compressedTexImage2D(k.TEXTURE_CUBE_MAP_POSITIVE_X+l,y,s,u.width,u.height,0,u.data)}else k.texImage2D(k.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,s,s,t,j[l]);c.generateMipmaps&&n&&k.generateMipmap(k.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else k.activeTexture(k.TEXTURE0+f),k.bindTexture(k.TEXTURE_CUBE_MAP,
+k.activeTexture(k.TEXTURE0+f);k.bindTexture(k.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);k.pixelStorei(k.UNPACK_FLIP_Y_WEBGL,c.flipY);f=c instanceof THREE.CompressedTexture;j=[];for(l=0;6>l;l++)D.autoScaleCubemaps&&!f?(n=j,s=l,t=c.image[l],z=Ub,t.width<=z&&t.height<=z||(y=Math.max(t.width,t.height),v=Math.floor(t.width*z/y),z=Math.floor(t.height*z/y),y=document.createElement("canvas"),y.width=v,y.height=z,y.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,v,z),t=y),n[s]=t):j[l]=c.image[l];
+l=j[0];n=0===(l.width&l.width-1)&&0===(l.height&l.height-1);s=w(c.format);t=w(c.type);N(k.TEXTURE_CUBE_MAP,c,n);for(l=0;6>l;l++)if(f){z=j[l].mipmaps;y=0;for(A=z.length;y<A;y++)v=z[y],k.compressedTexImage2D(k.TEXTURE_CUBE_MAP_POSITIVE_X+l,y,s,v.width,v.height,0,v.data)}else k.texImage2D(k.TEXTURE_CUBE_MAP_POSITIVE_X+l,0,s,s,t,j[l]);c.generateMipmaps&&n&&k.generateMipmap(k.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else k.activeTexture(k.TEXTURE0+f),k.bindTexture(k.TEXTURE_CUBE_MAP,
 c.image.__webglTextureCube)}else s instanceof THREE.WebGLRenderTargetCube?(c=s,k.activeTexture(k.TEXTURE0+j),k.bindTexture(k.TEXTURE_CUBE_MAP,c.__webglTexture)):D.setTexture(s,j)}else if("tv"===l){void 0===c._array&&(c._array=[]);l=0;for(n=c.value.length;l<n;l++)c._array[l]=H();k.uniform1iv(f,c._array);l=0;for(n=c.value.length;l<n;l++)s=c.value[l],j=c._array[l],s&&D.setTexture(s,j)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+l);if((d instanceof THREE.ShaderMaterial||d instanceof
 THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition)Ga.getPositionFromMatrix(a.matrixWorld),k.uniform3f(h.cameraPosition,Ga.x,Ga.y,Ga.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==h.viewMatrix&&k.uniformMatrix4fv(h.viewMatrix,!1,a.matrixWorldInverse.elements)}k.uniformMatrix4fv(h.modelViewMatrix,!1,e._modelViewMatrix.elements);h.normalMatrix&&k.uniformMatrix3fv(h.normalMatrix,!1,e._normalMatrix.elements);
 null!==h.modelMatrix&&k.uniformMatrix4fv(h.modelMatrix,!1,e.matrixWorld.elements);return g}function H(){var a=fa;a>=ib&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+ib);fa+=1;return a}function I(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 G(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function A(a){a!==ja&&(k.lineWidth(a),ja=a)}function K(a,b,c){la!==a&&(a?k.enable(k.POLYGON_OFFSET_FILL):k.disable(k.POLYGON_OFFSET_FILL),la=a);
@@ -461,11 +461,11 @@ THREE.ParticleSystem)||!h.frustumCulled||Sa.intersectsObject(h))){var q=h;q._mod
 !0;!0===this.sortObjects&&(null!==h.renderDepth?f.z=h.renderDepth:(Ga.getPositionFromMatrix(h.matrixWorld),Ga.applyProjection(xb),f.z=Ga.z))}this.sortObjects&&g.sort(j);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),K(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),n(a.__webglObjects,!1,"",b,i,l,!0,d),p(a.__webglObjectsImmediate,"",b,i,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),n(a.__webglObjects,!0,"opaque",b,i,l,!1,d),p(a.__webglObjectsImmediate,"opaque",b,i,l,!1,d),n(a.__webglObjects,!1,"transparent",b,i,l,!0,d),p(a.__webglObjectsImmediate,"transparent",b,
 i,l,!0,d));m(this.renderPluginsPost,a,b);c&&(c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter)&&(c instanceof THREE.WebGLRenderTargetCube?(k.bindTexture(k.TEXTURE_CUBE_MAP,c.__webglTexture),k.generateMipmap(k.TEXTURE_CUBE_MAP),k.bindTexture(k.TEXTURE_CUBE_MAP,null)):(k.bindTexture(k.TEXTURE_2D,c.__webglTexture),k.generateMipmap(k.TEXTURE_2D),k.bindTexture(k.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,
-b,c,d,e){var f=F(a,b,c,d,e);ub=-1;D.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,k,Sa):e.render(function(a){D.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;)u(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,c=
-a.__webglObjects.length;b<c;b++){var g=a.__webglObjects[b].object;void 0===g.__webglInit&&(void 0!==g.__webglActive&&u(g,a),t(g,a));var i=g,j=i.geometry,m=void 0,n=void 0,p=void 0;if(j instanceof THREE.BufferGeometry){var q=k.DYNAMIC_DRAW,z=!j.dynamic,w=j.attributes,y=void 0,A=void 0;for(y in w)A=w[y],A.needsUpdate&&("index"===y?(k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,A.buffer),k.bufferData(k.ELEMENT_ARRAY_BUFFER,A.array,q)):(k.bindBuffer(k.ARRAY_BUFFER,A.buffer),k.bufferData(k.ARRAY_BUFFER,A.array,
+b,c,d,e){var f=F(a,b,c,d,e);ub=-1;D.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,k,Sa):e.render(function(a){D.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;)v(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,c=
+a.__webglObjects.length;b<c;b++){var g=a.__webglObjects[b].object;void 0===g.__webglInit&&(void 0!==g.__webglActive&&v(g,a),t(g,a));var i=g,j=i.geometry,m=void 0,n=void 0,p=void 0;if(j instanceof THREE.BufferGeometry){var q=k.DYNAMIC_DRAW,z=!j.dynamic,w=j.attributes,y=void 0,A=void 0;for(y in w)A=w[y],A.needsUpdate&&("index"===y?(k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,A.buffer),k.bufferData(k.ELEMENT_ARRAY_BUFFER,A.array,q)):(k.bindBuffer(k.ARRAY_BUFFER,A.buffer),k.bufferData(k.ARRAY_BUFFER,A.array,
 q)),A.needsUpdate=!1),z&&!A.dynamic&&(A.array=null)}else if(i instanceof THREE.Mesh){for(var B=0,F=j.geometryGroupsList.length;B<F;B++)if(m=j.geometryGroupsList[B],p=e(i,m),j.buffersNeedUpdate&&d(m,i),n=p.attributes&&r(p),j.verticesNeedUpdate||j.morphTargetsNeedUpdate||j.elementsNeedUpdate||j.uvsNeedUpdate||j.normalsNeedUpdate||j.colorsNeedUpdate||j.tangentsNeedUpdate||n){var C=m,G=i,H=k.DYNAMIC_DRAW,I=!j.dynamic,J=p;if(C.__inittedArrays){var V=f(J),K=J.vertexColors?J.vertexColors:!1,L=h(J),M=V===
 THREE.SmoothShading,E=void 0,D=void 0,N=void 0,Q=void 0,O=void 0,ea=void 0,T=void 0,X=void 0,qa=void 0,fa=void 0,aa=void 0,R=void 0,S=void 0,P=void 0,ba=void 0,Z=void 0,da=void 0,ya=void 0,ja=void 0,ha=void 0,Ha=void 0,ia=void 0,eb=void 0,ka=void 0,na=void 0,la=void 0,ua=void 0,oa=void 0,pa=void 0,ra=void 0,Ca=void 0,va=void 0,wa=void 0,xa=void 0,pb=void 0,za=void 0,ub=void 0,Fa=void 0,Pa=void 0,Ra=void 0,bb=void 0,ab=void 0,Za=void 0,$a=void 0,Ua=void 0,Qa=void 0,Ta=0,Ya=0,Wa=0,Xa=0,Ka=0,jb=0,Da=
-0,ob=0,Va=0,Y=0,ga=0,x=0,Aa=void 0,cb=C.__vertexArray,fb=C.__uvArray,ib=C.__uv2Array,Sa=C.__normalArray,La=C.__tangentArray,db=C.__colorArray,Ma=C.__skinIndexArray,Na=C.__skinWeightArray,yb=C.__morphTargetsArrays,Ab=C.__morphNormalsArrays,Bb=C.__webglCustomAttributesList,v=void 0,Mb=C.__faceArray,wb=C.__lineArray,qb=G.geometry,Gb=qb.elementsNeedUpdate,Hb=qb.uvsNeedUpdate,Rb=qb.normalsNeedUpdate,Sb=qb.tangentsNeedUpdate,Xb=qb.colorsNeedUpdate,Yb=qb.morphTargetsNeedUpdate,cc=qb.vertices,sa=C.faces3,
+0,ob=0,Va=0,Y=0,ga=0,x=0,Aa=void 0,cb=C.__vertexArray,fb=C.__uvArray,ib=C.__uv2Array,Sa=C.__normalArray,La=C.__tangentArray,db=C.__colorArray,Ma=C.__skinIndexArray,Na=C.__skinWeightArray,yb=C.__morphTargetsArrays,Ab=C.__morphNormalsArrays,Bb=C.__webglCustomAttributesList,u=void 0,Mb=C.__faceArray,wb=C.__lineArray,qb=G.geometry,Gb=qb.elementsNeedUpdate,Hb=qb.uvsNeedUpdate,Rb=qb.normalsNeedUpdate,Sb=qb.tangentsNeedUpdate,Xb=qb.colorsNeedUpdate,Yb=qb.morphTargetsNeedUpdate,cc=qb.vertices,sa=C.faces3,
 ta=C.faces4,kb=qb.faces,Jb=qb.faceVertexUvs[0],Lb=qb.faceVertexUvs[1],dc=qb.skinIndices,$b=qb.skinWeights,ac=qb.morphTargets,Ib=qb.morphNormals;if(qb.verticesNeedUpdate){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],R=cc[Q.a],S=cc[Q.b],P=cc[Q.c],cb[Ya]=R.x,cb[Ya+1]=R.y,cb[Ya+2]=R.z,cb[Ya+3]=S.x,cb[Ya+4]=S.y,cb[Ya+5]=S.z,cb[Ya+6]=P.x,cb[Ya+7]=P.y,cb[Ya+8]=P.z,Ya+=9;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],R=cc[Q.a],S=cc[Q.b],P=cc[Q.c],ba=cc[Q.d],cb[Ya]=R.x,cb[Ya+1]=R.y,cb[Ya+2]=R.z,cb[Ya+3]=S.x,cb[Ya+4]=
 S.y,cb[Ya+5]=S.z,cb[Ya+6]=P.x,cb[Ya+7]=P.y,cb[Ya+8]=P.z,cb[Ya+9]=ba.x,cb[Ya+10]=ba.y,cb[Ya+11]=ba.z,Ya+=12;k.bindBuffer(k.ARRAY_BUFFER,C.__webglVertexBuffer);k.bufferData(k.ARRAY_BUFFER,cb,H)}if(Yb){bb=0;for(ab=ac.length;bb<ab;bb++){E=ga=0;for(D=sa.length;E<D;E++)Ua=sa[E],Q=kb[Ua],R=ac[bb].vertices[Q.a],S=ac[bb].vertices[Q.b],P=ac[bb].vertices[Q.c],Za=yb[bb],Za[ga]=R.x,Za[ga+1]=R.y,Za[ga+2]=R.z,Za[ga+3]=S.x,Za[ga+4]=S.y,Za[ga+5]=S.z,Za[ga+6]=P.x,Za[ga+7]=P.y,Za[ga+8]=P.z,J.morphNormals&&(M?(Qa=Ib[bb].vertexNormals[Ua],
 ha=Qa.a,Ha=Qa.b,ia=Qa.c):ia=Ha=ha=Ib[bb].faceNormals[Ua],$a=Ab[bb],$a[ga]=ha.x,$a[ga+1]=ha.y,$a[ga+2]=ha.z,$a[ga+3]=Ha.x,$a[ga+4]=Ha.y,$a[ga+5]=Ha.z,$a[ga+6]=ia.x,$a[ga+7]=ia.y,$a[ga+8]=ia.z),ga+=9;E=0;for(D=ta.length;E<D;E++)Ua=ta[E],Q=kb[Ua],R=ac[bb].vertices[Q.a],S=ac[bb].vertices[Q.b],P=ac[bb].vertices[Q.c],ba=ac[bb].vertices[Q.d],Za=yb[bb],Za[ga]=R.x,Za[ga+1]=R.y,Za[ga+2]=R.z,Za[ga+3]=S.x,Za[ga+4]=S.y,Za[ga+5]=S.z,Za[ga+6]=P.x,Za[ga+7]=P.y,Za[ga+8]=P.z,Za[ga+9]=ba.x,Za[ga+10]=ba.y,Za[ga+11]=
@@ -478,18 +478,18 @@ Z.x,La[Da+1]=Z.y,La[Da+2]=Z.z,La[Da+3]=Z.w,La[Da+4]=da.x,La[Da+5]=da.y,La[Da+6]=
 C.__webglTangentBuffer);k.bufferData(k.ARRAY_BUFFER,La,H)}if(Rb&&V){E=0;for(D=sa.length;E<D;E++)if(Q=kb[sa[E]],O=Q.vertexNormals,ea=Q.normal,3===O.length&&M)for(za=0;3>za;za++)Fa=O[za],Sa[jb]=Fa.x,Sa[jb+1]=Fa.y,Sa[jb+2]=Fa.z,jb+=3;else for(za=0;3>za;za++)Sa[jb]=ea.x,Sa[jb+1]=ea.y,Sa[jb+2]=ea.z,jb+=3;E=0;for(D=ta.length;E<D;E++)if(Q=kb[ta[E]],O=Q.vertexNormals,ea=Q.normal,4===O.length&&M)for(za=0;4>za;za++)Fa=O[za],Sa[jb]=Fa.x,Sa[jb+1]=Fa.y,Sa[jb+2]=Fa.z,jb+=3;else for(za=0;4>za;za++)Sa[jb]=ea.x,Sa[jb+
 1]=ea.y,Sa[jb+2]=ea.z,jb+=3;k.bindBuffer(k.ARRAY_BUFFER,C.__webglNormalBuffer);k.bufferData(k.ARRAY_BUFFER,Sa,H)}if(Hb&&Jb&&L){E=0;for(D=sa.length;E<D;E++)if(N=sa[E],fa=Jb[N],void 0!==fa)for(za=0;3>za;za++)Pa=fa[za],fb[Wa]=Pa.x,fb[Wa+1]=Pa.y,Wa+=2;E=0;for(D=ta.length;E<D;E++)if(N=ta[E],fa=Jb[N],void 0!==fa)for(za=0;4>za;za++)Pa=fa[za],fb[Wa]=Pa.x,fb[Wa+1]=Pa.y,Wa+=2;0<Wa&&(k.bindBuffer(k.ARRAY_BUFFER,C.__webglUVBuffer),k.bufferData(k.ARRAY_BUFFER,fb,H))}if(Hb&&Lb&&L){E=0;for(D=sa.length;E<D;E++)if(N=
 sa[E],aa=Lb[N],void 0!==aa)for(za=0;3>za;za++)Ra=aa[za],ib[Xa]=Ra.x,ib[Xa+1]=Ra.y,Xa+=2;E=0;for(D=ta.length;E<D;E++)if(N=ta[E],aa=Lb[N],void 0!==aa)for(za=0;4>za;za++)Ra=aa[za],ib[Xa]=Ra.x,ib[Xa+1]=Ra.y,Xa+=2;0<Xa&&(k.bindBuffer(k.ARRAY_BUFFER,C.__webglUV2Buffer),k.bufferData(k.ARRAY_BUFFER,ib,H))}if(Gb){E=0;for(D=sa.length;E<D;E++)Mb[Ka]=Ta,Mb[Ka+1]=Ta+1,Mb[Ka+2]=Ta+2,Ka+=3,wb[ob]=Ta,wb[ob+1]=Ta+1,wb[ob+2]=Ta,wb[ob+3]=Ta+2,wb[ob+4]=Ta+1,wb[ob+5]=Ta+2,ob+=6,Ta+=3;E=0;for(D=ta.length;E<D;E++)Mb[Ka]=
-Ta,Mb[Ka+1]=Ta+1,Mb[Ka+2]=Ta+3,Mb[Ka+3]=Ta+1,Mb[Ka+4]=Ta+2,Mb[Ka+5]=Ta+3,Ka+=6,wb[ob]=Ta,wb[ob+1]=Ta+1,wb[ob+2]=Ta,wb[ob+3]=Ta+3,wb[ob+4]=Ta+1,wb[ob+5]=Ta+2,wb[ob+6]=Ta+2,wb[ob+7]=Ta+3,ob+=8,Ta+=4;k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,C.__webglFaceBuffer);k.bufferData(k.ELEMENT_ARRAY_BUFFER,Mb,H);k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,C.__webglLineBuffer);k.bufferData(k.ELEMENT_ARRAY_BUFFER,wb,H)}if(Bb){za=0;for(ub=Bb.length;za<ub;za++)if(v=Bb[za],v.__original.needsUpdate){x=0;if(1===v.size)if(void 0===
-v.boundTo||"vertices"===v.boundTo){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],v.array[x]=v.value[Q.a],v.array[x+1]=v.value[Q.b],v.array[x+2]=v.value[Q.c],x+=3;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],v.array[x]=v.value[Q.a],v.array[x+1]=v.value[Q.b],v.array[x+2]=v.value[Q.c],v.array[x+3]=v.value[Q.d],x+=4}else{if("faces"===v.boundTo){E=0;for(D=sa.length;E<D;E++)Aa=v.value[sa[E]],v.array[x]=Aa,v.array[x+1]=Aa,v.array[x+2]=Aa,x+=3;E=0;for(D=ta.length;E<D;E++)Aa=v.value[ta[E]],v.array[x]=Aa,v.array[x+1]=
-Aa,v.array[x+2]=Aa,v.array[x+3]=Aa,x+=4}}else if(2===v.size)if(void 0===v.boundTo||"vertices"===v.boundTo){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],R=v.value[Q.a],S=v.value[Q.b],P=v.value[Q.c],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+2]=S.x,v.array[x+3]=S.y,v.array[x+4]=P.x,v.array[x+5]=P.y,x+=6;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],R=v.value[Q.a],S=v.value[Q.b],P=v.value[Q.c],ba=v.value[Q.d],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+2]=S.x,v.array[x+3]=S.y,v.array[x+4]=P.x,v.array[x+5]=P.y,v.array[x+
-6]=ba.x,v.array[x+7]=ba.y,x+=8}else{if("faces"===v.boundTo){E=0;for(D=sa.length;E<D;E++)P=S=R=Aa=v.value[sa[E]],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+2]=S.x,v.array[x+3]=S.y,v.array[x+4]=P.x,v.array[x+5]=P.y,x+=6;E=0;for(D=ta.length;E<D;E++)ba=P=S=R=Aa=v.value[ta[E]],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+2]=S.x,v.array[x+3]=S.y,v.array[x+4]=P.x,v.array[x+5]=P.y,v.array[x+6]=ba.x,v.array[x+7]=ba.y,x+=8}}else if(3===v.size){var W;W="c"===v.type?["r","g","b"]:["x","y","z"];if(void 0===v.boundTo||
-"vertices"===v.boundTo){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],R=v.value[Q.a],S=v.value[Q.b],P=v.value[Q.c],v.array[x]=R[W[0]],v.array[x+1]=R[W[1]],v.array[x+2]=R[W[2]],v.array[x+3]=S[W[0]],v.array[x+4]=S[W[1]],v.array[x+5]=S[W[2]],v.array[x+6]=P[W[0]],v.array[x+7]=P[W[1]],v.array[x+8]=P[W[2]],x+=9;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],R=v.value[Q.a],S=v.value[Q.b],P=v.value[Q.c],ba=v.value[Q.d],v.array[x]=R[W[0]],v.array[x+1]=R[W[1]],v.array[x+2]=R[W[2]],v.array[x+3]=S[W[0]],v.array[x+4]=S[W[1]],
-v.array[x+5]=S[W[2]],v.array[x+6]=P[W[0]],v.array[x+7]=P[W[1]],v.array[x+8]=P[W[2]],v.array[x+9]=ba[W[0]],v.array[x+10]=ba[W[1]],v.array[x+11]=ba[W[2]],x+=12}else if("faces"===v.boundTo){E=0;for(D=sa.length;E<D;E++)P=S=R=Aa=v.value[sa[E]],v.array[x]=R[W[0]],v.array[x+1]=R[W[1]],v.array[x+2]=R[W[2]],v.array[x+3]=S[W[0]],v.array[x+4]=S[W[1]],v.array[x+5]=S[W[2]],v.array[x+6]=P[W[0]],v.array[x+7]=P[W[1]],v.array[x+8]=P[W[2]],x+=9;E=0;for(D=ta.length;E<D;E++)ba=P=S=R=Aa=v.value[ta[E]],v.array[x]=R[W[0]],
-v.array[x+1]=R[W[1]],v.array[x+2]=R[W[2]],v.array[x+3]=S[W[0]],v.array[x+4]=S[W[1]],v.array[x+5]=S[W[2]],v.array[x+6]=P[W[0]],v.array[x+7]=P[W[1]],v.array[x+8]=P[W[2]],v.array[x+9]=ba[W[0]],v.array[x+10]=ba[W[1]],v.array[x+11]=ba[W[2]],x+=12}else if("faceVertices"===v.boundTo){E=0;for(D=sa.length;E<D;E++)Aa=v.value[sa[E]],R=Aa[0],S=Aa[1],P=Aa[2],v.array[x]=R[W[0]],v.array[x+1]=R[W[1]],v.array[x+2]=R[W[2]],v.array[x+3]=S[W[0]],v.array[x+4]=S[W[1]],v.array[x+5]=S[W[2]],v.array[x+6]=P[W[0]],v.array[x+
-7]=P[W[1]],v.array[x+8]=P[W[2]],x+=9;E=0;for(D=ta.length;E<D;E++)Aa=v.value[ta[E]],R=Aa[0],S=Aa[1],P=Aa[2],ba=Aa[3],v.array[x]=R[W[0]],v.array[x+1]=R[W[1]],v.array[x+2]=R[W[2]],v.array[x+3]=S[W[0]],v.array[x+4]=S[W[1]],v.array[x+5]=S[W[2]],v.array[x+6]=P[W[0]],v.array[x+7]=P[W[1]],v.array[x+8]=P[W[2]],v.array[x+9]=ba[W[0]],v.array[x+10]=ba[W[1]],v.array[x+11]=ba[W[2]],x+=12}}else if(4===v.size)if(void 0===v.boundTo||"vertices"===v.boundTo){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],R=v.value[Q.a],S=
-v.value[Q.b],P=v.value[Q.c],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+2]=R.z,v.array[x+3]=R.w,v.array[x+4]=S.x,v.array[x+5]=S.y,v.array[x+6]=S.z,v.array[x+7]=S.w,v.array[x+8]=P.x,v.array[x+9]=P.y,v.array[x+10]=P.z,v.array[x+11]=P.w,x+=12;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],R=v.value[Q.a],S=v.value[Q.b],P=v.value[Q.c],ba=v.value[Q.d],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+2]=R.z,v.array[x+3]=R.w,v.array[x+4]=S.x,v.array[x+5]=S.y,v.array[x+6]=S.z,v.array[x+7]=S.w,v.array[x+8]=P.x,v.array[x+9]=
-P.y,v.array[x+10]=P.z,v.array[x+11]=P.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){E=0;for(D=sa.length;E<D;E++)P=S=R=Aa=v.value[sa[E]],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+2]=R.z,v.array[x+3]=R.w,v.array[x+4]=S.x,v.array[x+5]=S.y,v.array[x+6]=S.z,v.array[x+7]=S.w,v.array[x+8]=P.x,v.array[x+9]=P.y,v.array[x+10]=P.z,v.array[x+11]=P.w,x+=12;E=0;for(D=ta.length;E<D;E++)ba=P=S=R=Aa=v.value[ta[E]],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+
-2]=R.z,v.array[x+3]=R.w,v.array[x+4]=S.x,v.array[x+5]=S.y,v.array[x+6]=S.z,v.array[x+7]=S.w,v.array[x+8]=P.x,v.array[x+9]=P.y,v.array[x+10]=P.z,v.array[x+11]=P.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){E=0;for(D=sa.length;E<D;E++)Aa=v.value[sa[E]],R=Aa[0],S=Aa[1],P=Aa[2],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+2]=R.z,v.array[x+3]=R.w,v.array[x+4]=S.x,v.array[x+5]=S.y,v.array[x+6]=S.z,v.array[x+7]=S.w,v.array[x+8]=P.x,
-v.array[x+9]=P.y,v.array[x+10]=P.z,v.array[x+11]=P.w,x+=12;E=0;for(D=ta.length;E<D;E++)Aa=v.value[ta[E]],R=Aa[0],S=Aa[1],P=Aa[2],ba=Aa[3],v.array[x]=R.x,v.array[x+1]=R.y,v.array[x+2]=R.z,v.array[x+3]=R.w,v.array[x+4]=S.x,v.array[x+5]=S.y,v.array[x+6]=S.z,v.array[x+7]=S.w,v.array[x+8]=P.x,v.array[x+9]=P.y,v.array[x+10]=P.z,v.array[x+11]=P.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}k.bindBuffer(k.ARRAY_BUFFER,v.buffer);k.bufferData(k.ARRAY_BUFFER,v.array,H)}}I&&
+Ta,Mb[Ka+1]=Ta+1,Mb[Ka+2]=Ta+3,Mb[Ka+3]=Ta+1,Mb[Ka+4]=Ta+2,Mb[Ka+5]=Ta+3,Ka+=6,wb[ob]=Ta,wb[ob+1]=Ta+1,wb[ob+2]=Ta,wb[ob+3]=Ta+3,wb[ob+4]=Ta+1,wb[ob+5]=Ta+2,wb[ob+6]=Ta+2,wb[ob+7]=Ta+3,ob+=8,Ta+=4;k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,C.__webglFaceBuffer);k.bufferData(k.ELEMENT_ARRAY_BUFFER,Mb,H);k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,C.__webglLineBuffer);k.bufferData(k.ELEMENT_ARRAY_BUFFER,wb,H)}if(Bb){za=0;for(ub=Bb.length;za<ub;za++)if(u=Bb[za],u.__original.needsUpdate){x=0;if(1===u.size)if(void 0===
+u.boundTo||"vertices"===u.boundTo){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],u.array[x]=u.value[Q.a],u.array[x+1]=u.value[Q.b],u.array[x+2]=u.value[Q.c],x+=3;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],u.array[x]=u.value[Q.a],u.array[x+1]=u.value[Q.b],u.array[x+2]=u.value[Q.c],u.array[x+3]=u.value[Q.d],x+=4}else{if("faces"===u.boundTo){E=0;for(D=sa.length;E<D;E++)Aa=u.value[sa[E]],u.array[x]=Aa,u.array[x+1]=Aa,u.array[x+2]=Aa,x+=3;E=0;for(D=ta.length;E<D;E++)Aa=u.value[ta[E]],u.array[x]=Aa,u.array[x+1]=
+Aa,u.array[x+2]=Aa,u.array[x+3]=Aa,x+=4}}else if(2===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],R=u.value[Q.a],S=u.value[Q.b],P=u.value[Q.c],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=S.x,u.array[x+3]=S.y,u.array[x+4]=P.x,u.array[x+5]=P.y,x+=6;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],R=u.value[Q.a],S=u.value[Q.b],P=u.value[Q.c],ba=u.value[Q.d],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=S.x,u.array[x+3]=S.y,u.array[x+4]=P.x,u.array[x+5]=P.y,u.array[x+
+6]=ba.x,u.array[x+7]=ba.y,x+=8}else{if("faces"===u.boundTo){E=0;for(D=sa.length;E<D;E++)P=S=R=Aa=u.value[sa[E]],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=S.x,u.array[x+3]=S.y,u.array[x+4]=P.x,u.array[x+5]=P.y,x+=6;E=0;for(D=ta.length;E<D;E++)ba=P=S=R=Aa=u.value[ta[E]],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=S.x,u.array[x+3]=S.y,u.array[x+4]=P.x,u.array[x+5]=P.y,u.array[x+6]=ba.x,u.array[x+7]=ba.y,x+=8}}else if(3===u.size){var W;W="c"===u.type?["r","g","b"]:["x","y","z"];if(void 0===u.boundTo||
+"vertices"===u.boundTo){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],R=u.value[Q.a],S=u.value[Q.b],P=u.value[Q.c],u.array[x]=R[W[0]],u.array[x+1]=R[W[1]],u.array[x+2]=R[W[2]],u.array[x+3]=S[W[0]],u.array[x+4]=S[W[1]],u.array[x+5]=S[W[2]],u.array[x+6]=P[W[0]],u.array[x+7]=P[W[1]],u.array[x+8]=P[W[2]],x+=9;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],R=u.value[Q.a],S=u.value[Q.b],P=u.value[Q.c],ba=u.value[Q.d],u.array[x]=R[W[0]],u.array[x+1]=R[W[1]],u.array[x+2]=R[W[2]],u.array[x+3]=S[W[0]],u.array[x+4]=S[W[1]],
+u.array[x+5]=S[W[2]],u.array[x+6]=P[W[0]],u.array[x+7]=P[W[1]],u.array[x+8]=P[W[2]],u.array[x+9]=ba[W[0]],u.array[x+10]=ba[W[1]],u.array[x+11]=ba[W[2]],x+=12}else if("faces"===u.boundTo){E=0;for(D=sa.length;E<D;E++)P=S=R=Aa=u.value[sa[E]],u.array[x]=R[W[0]],u.array[x+1]=R[W[1]],u.array[x+2]=R[W[2]],u.array[x+3]=S[W[0]],u.array[x+4]=S[W[1]],u.array[x+5]=S[W[2]],u.array[x+6]=P[W[0]],u.array[x+7]=P[W[1]],u.array[x+8]=P[W[2]],x+=9;E=0;for(D=ta.length;E<D;E++)ba=P=S=R=Aa=u.value[ta[E]],u.array[x]=R[W[0]],
+u.array[x+1]=R[W[1]],u.array[x+2]=R[W[2]],u.array[x+3]=S[W[0]],u.array[x+4]=S[W[1]],u.array[x+5]=S[W[2]],u.array[x+6]=P[W[0]],u.array[x+7]=P[W[1]],u.array[x+8]=P[W[2]],u.array[x+9]=ba[W[0]],u.array[x+10]=ba[W[1]],u.array[x+11]=ba[W[2]],x+=12}else if("faceVertices"===u.boundTo){E=0;for(D=sa.length;E<D;E++)Aa=u.value[sa[E]],R=Aa[0],S=Aa[1],P=Aa[2],u.array[x]=R[W[0]],u.array[x+1]=R[W[1]],u.array[x+2]=R[W[2]],u.array[x+3]=S[W[0]],u.array[x+4]=S[W[1]],u.array[x+5]=S[W[2]],u.array[x+6]=P[W[0]],u.array[x+
+7]=P[W[1]],u.array[x+8]=P[W[2]],x+=9;E=0;for(D=ta.length;E<D;E++)Aa=u.value[ta[E]],R=Aa[0],S=Aa[1],P=Aa[2],ba=Aa[3],u.array[x]=R[W[0]],u.array[x+1]=R[W[1]],u.array[x+2]=R[W[2]],u.array[x+3]=S[W[0]],u.array[x+4]=S[W[1]],u.array[x+5]=S[W[2]],u.array[x+6]=P[W[0]],u.array[x+7]=P[W[1]],u.array[x+8]=P[W[2]],u.array[x+9]=ba[W[0]],u.array[x+10]=ba[W[1]],u.array[x+11]=ba[W[2]],x+=12}}else if(4===u.size)if(void 0===u.boundTo||"vertices"===u.boundTo){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],R=u.value[Q.a],S=
+u.value[Q.b],P=u.value[Q.c],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,u.array[x+9]=P.y,u.array[x+10]=P.z,u.array[x+11]=P.w,x+=12;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],R=u.value[Q.a],S=u.value[Q.b],P=u.value[Q.c],ba=u.value[Q.d],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,u.array[x+9]=
+P.y,u.array[x+10]=P.z,u.array[x+11]=P.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){E=0;for(D=sa.length;E<D;E++)P=S=R=Aa=u.value[sa[E]],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,u.array[x+9]=P.y,u.array[x+10]=P.z,u.array[x+11]=P.w,x+=12;E=0;for(D=ta.length;E<D;E++)ba=P=S=R=Aa=u.value[ta[E]],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+
+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,u.array[x+9]=P.y,u.array[x+10]=P.z,u.array[x+11]=P.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){E=0;for(D=sa.length;E<D;E++)Aa=u.value[sa[E]],R=Aa[0],S=Aa[1],P=Aa[2],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,
+u.array[x+9]=P.y,u.array[x+10]=P.z,u.array[x+11]=P.w,x+=12;E=0;for(D=ta.length;E<D;E++)Aa=u.value[ta[E]],R=Aa[0],S=Aa[1],P=Aa[2],ba=Aa[3],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,u.array[x+9]=P.y,u.array[x+10]=P.z,u.array[x+11]=P.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}k.bindBuffer(k.ARRAY_BUFFER,u.buffer);k.bufferData(k.ARRAY_BUFFER,u.array,H)}}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)}}j.verticesNeedUpdate=!1;j.morphTargetsNeedUpdate=!1;j.elementsNeedUpdate=!1;j.uvsNeedUpdate=!1;j.normalsNeedUpdate=!1;j.colorsNeedUpdate=!1;j.tangentsNeedUpdate=!1;j.buffersNeedUpdate=!1;p.attributes&&s(p)}else if(i instanceof THREE.Ribbon){p=e(i,
 j);n=p.attributes&&r(p);if(j.verticesNeedUpdate||j.colorsNeedUpdate||j.normalsNeedUpdate||n){var Cb=j,Kb=k.DYNAMIC_DRAW,nc=void 0,oc=void 0,pc=void 0,Tb=void 0,Ba=void 0,Ub=void 0,xc=void 0,yc=void 0,gc=void 0,gb=void 0,hc=void 0,Ia=void 0,rb=void 0,kc=Cb.vertices,lc=Cb.colors,mc=Cb.normals,uc=kc.length,vc=lc.length,Yc=mc.length,zc=Cb.__vertexArray,Ac=Cb.__colorArray,Bc=Cb.__normalArray,Zc=Cb.colorsNeedUpdate,$c=Cb.normalsNeedUpdate,Lc=Cb.__webglCustomAttributesList;if(Cb.verticesNeedUpdate){for(nc=
 0;nc<uc;nc++)Tb=kc[nc],Ba=3*nc,zc[Ba]=Tb.x,zc[Ba+1]=Tb.y,zc[Ba+2]=Tb.z;k.bindBuffer(k.ARRAY_BUFFER,Cb.__webglVertexBuffer);k.bufferData(k.ARRAY_BUFFER,zc,Kb)}if(Zc){for(oc=0;oc<vc;oc++)Ub=lc[oc],Ba=3*oc,Ac[Ba]=Ub.r,Ac[Ba+1]=Ub.g,Ac[Ba+2]=Ub.b;k.bindBuffer(k.ARRAY_BUFFER,Cb.__webglColorBuffer);k.bufferData(k.ARRAY_BUFFER,Ac,Kb)}if($c){for(pc=0;pc<Yc;pc++)xc=mc[pc],Ba=3*pc,Bc[Ba]=xc.x,Bc[Ba+1]=xc.y,Bc[Ba+2]=xc.z;k.bindBuffer(k.ARRAY_BUFFER,Cb.__webglNormalBuffer);k.bufferData(k.ARRAY_BUFFER,Bc,Kb)}if(Lc){yc=
@@ -508,15 +508,15 @@ uc);var i,j,l,m,n;a instanceof THREE.MeshDepthMaterial?n="depth":a instanceof TH
 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;Bb&&d&&d.useVertexTexture?l=1024:(b=k.getParameter(k.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:Bb&&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,w,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=V.length;t<u;t++)if(d=V[t],d.code===n){d.usedTimes++;j=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(w in s)d=s[w],!1!==d&&(d="#define "+w+" "+d,u.push(d));d=u.join("\n");w=k.createProgram();u=["precision "+L+" float;",d,Gb?"#define VERTEX_TEXTURES":"",D.gammaInput?"#define GAMMA_INPUT":"",D.gammaOutput?"#define GAMMA_OUTPUT":"",D.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,
+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,v,w,d=[];n?d.push(n):(d.push(r),d.push(q));for(v in s)d.push(v),d.push(s[v]);for(t in c)d.push(t),d.push(c[t]);n=d.join();t=0;for(v=V.length;t<v;t++)if(d=V[t],d.code===n){d.usedTimes++;j=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");v=[];for(w in s)d=s[w],!1!==d&&(d="#define "+w+" "+d,v.push(d));d=v.join("\n");w=k.createProgram();v=["precision "+L+" float;",d,Gb?"#define VERTEX_TEXTURES":"",D.gammaInput?"#define GAMMA_INPUT":"",D.gammaOutput?"#define GAMMA_OUTPUT":"",D.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.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?"#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 "+L+" float;",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:"",D.gammaInput?"#define GAMMA_INPUT":"",D.gammaOutput?"#define GAMMA_OUTPUT":"",D.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.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=J("vertex",u+q);t=J("fragment",t+r);k.attachShader(w,u);k.attachShader(w,t);k.linkProgram(w);k.getProgramParameter(w,k.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+k.getProgramParameter(w,k.VALIDATE_STATUS)+", gl error ["+
-k.getError()+"]");k.deleteShader(t);k.deleteShader(u);w.uniforms={};w.attributes={};var z;t="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?t.push("boneTexture"):t.push("boneGlobalMatrices");for(z in p)t.push(z);z=t;t=0;for(u=z.length;t<u;t++)p=z[t],w.uniforms[p]=k.getUniformLocation(w,p);t="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(z=0;z<c.maxMorphTargets;z++)t.push("morphTarget"+
+"",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");v=J("vertex",v+q);t=J("fragment",t+r);k.attachShader(w,v);k.attachShader(w,t);k.linkProgram(w);k.getProgramParameter(w,k.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+k.getProgramParameter(w,k.VALIDATE_STATUS)+", gl error ["+
+k.getError()+"]");k.deleteShader(t);k.deleteShader(v);w.uniforms={};w.attributes={};var z;t="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?t.push("boneTexture"):t.push("boneGlobalMatrices");for(z in p)t.push(z);z=t;t=0;for(v=z.length;t<v;t++)p=z[t],w.uniforms[p]=k.getUniformLocation(w,p);t="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(z=0;z<c.maxMorphTargets;z++)t.push("morphTarget"+
 z);for(z=0;z<c.maxMorphNormals;z++)t.push("morphNormal"+z);for(j in b)t.push(j);j=t;z=0;for(b=j.length;z<b;z++)t=j[z],w.attributes[t]=k.getAttribLocation(w,t);w.id=ea++;V.push({program:w,code:n,usedTimes:1});D.info.memory.programs=V.length;j=w}a.program=j;z=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(j=0;j<this.maxMorphTargets;j++)w=b+j,0<=z[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=0;b="morphNormal";for(j=0;j<this.maxMorphNormals;j++)w=
 b+j,0<=z[w]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?k.disable(k.CULL_FACE):(b===THREE.FrontFaceDirectionCW?k.frontFace(k.CW):k.frontFace(k.CCW),a===THREE.CullFaceBack?k.cullFace(k.BACK):a===THREE.CullFaceFront?k.cullFace(k.FRONT):k.cullFace(k.FRONT_AND_BACK),k.enable(k.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;da!==
 b&&(b?k.disable(k.CULL_FACE):k.enable(k.CULL_FACE),da=b);T!==a&&(a?k.frontFace(k.CW):k.frontFace(k.CCW),T=a)};this.setDepthTest=function(a){xa!==a&&(a?k.enable(k.DEPTH_TEST):k.disable(k.DEPTH_TEST),xa=a)};this.setDepthWrite=function(a){ab!==a&&(k.depthMask(a),ab=a)};this.setBlending=function(a,b,c,d){a!==aa&&(a===THREE.NoBlending?k.disable(k.BLEND):a===THREE.AdditiveBlending?(k.enable(k.BLEND),k.blendEquation(k.FUNC_ADD),k.blendFunc(k.SRC_ALPHA,k.ONE)):a===THREE.SubtractiveBlending?(k.enable(k.BLEND),
@@ -548,14 +548,14 @@ i,!0);j.responseType="arraybuffer";j.send(null)}else j=new XMLHttpRequest,j.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;
 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,j=0;j<i;j++){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),j=i.data,l=0;l<d;l++)for(var m=
-0;m<e;m++){var n=0>m-1?0:m-1,p=m+1>e-1?e-1:m+1,t=0>l-1?0:l-1,q=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+q)]/255*b]);r.push([1,0,g[4*(m*d+q)]/255*b]);r.push([1,1,g[4*(p*d+q)]/255*b]);r.push([0,1,g[4*(p*d+l)]/255*b]);r.push([-1,1,g[4*(p*d+t)]/255*b]);n=[];t=r.length;for(p=0;p<t;p++){var q=r[p],u=r[(p+1)%t],q=[q[0]-s[0],q[1]-s[1],q[2]-s[2]],u=[u[0]-s[0],u[1]-s[1],u[2]-s[2]];
-n.push(c([q[1]*u[2]-q[2]*u[1],q[2]*u[0]-q[0]*u[2],q[0]*u[1]-q[1]*u[0]]))}r=[0,0,0];for(p=0;p<n.length;p++)r[0]+=n[p][0],r[1]+=n[p][1],r[2]+=n[p][2];r[0]/=n.length;r[1]/=n.length;r[2]/=n.length;s=4*(m*d+l);j[s]=255*((r[0]+1)/2)|0;j[s+1]=255*((r[1]+1)/2)|0;j[s+2]=255*r[2]|0;j[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,p=m+1>e-1?e-1:m+1,t=0>l-1?0:l-1,q=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+q)]/255*b]);r.push([1,0,g[4*(m*d+q)]/255*b]);r.push([1,1,g[4*(p*d+q)]/255*b]);r.push([0,1,g[4*(p*d+l)]/255*b]);r.push([-1,1,g[4*(p*d+t)]/255*b]);n=[];t=r.length;for(p=0;p<t;p++){var q=r[p],v=r[(p+1)%t],q=[q[0]-s[0],q[1]-s[1],q[2]-s[2]],v=[v[0]-s[0],v[1]-s[1],v[2]-s[2]];
+n.push(c([q[1]*v[2]-q[2]*v[1],q[2]*v[0]-q[0]*v[2],q[0]*v[1]-q[1]*v[0]]))}r=[0,0,0];for(p=0;p<n.length;p++)r[0]+=n[p][0],r[1]+=n[p][1],r[2]+=n[p][2];r[0]/=n.length;r[1]/=n.length;r[2]/=n.length;s=4*(m*d+l);j[s]=255*((r[0]+1)/2)|0;j[s+1]=255*((r[1]+1)/2)|0;j[s+2]=255*r[2]|0;j[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,
 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,j,l,m,n,p,t,q,r,s=b.glyphs[a]||b.glyphs["?"];if(s){if(s.o){b=s._cachedOutline||(s._cachedOutline=s.o.split(" "));j=b.length;for(a=0;a<j;)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;p=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(p,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,p,i);THREE.Shape.Utils.b2(u,n,t,l)}}break;case "b":if(i=b[a++]*c+d,l=b[a++]*c,p=b[a++]*c+d,t=b[a++]*-c,q=b[a++]*c+d,r=b[a++]*-c,e.bezierCurveTo(i,l,p,t,q,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,p,q,i),THREE.Shape.Utils.b3(u,n,t,r,l)}}}return{offset:s.ha*c,path:e}}}};
+c+d;l=b[a++]*c;p=b[a++]*c+d;t=b[a++]*c;e.quadraticCurveTo(p,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 v=h/g;THREE.Shape.Utils.b2(v,m,p,i);THREE.Shape.Utils.b2(v,n,t,l)}}break;case "b":if(i=b[a++]*c+d,l=b[a++]*c,p=b[a++]*c+d,t=b[a++]*-c,q=b[a++]*c+d,r=b[a++]*-c,e.bezierCurveTo(i,l,p,t,q,r),h=f[f.length-1]){m=h.x;n=h.y;h=1;for(g=this.divisions;h<=g;h++)v=h/g,THREE.Shape.Utils.b3(v,m,p,q,i),THREE.Shape.Utils.b3(v,n,t,r,l)}}}return{offset:s.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};
-(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,j,l;if(0<b(a))for(j=0;j<e;j++)h[j]=j;else for(j=0;j<e;j++)h[j]=e-1-j;var m=2*e;for(j=e-1;2<e;){if(0>=m--){console.log("Warning, unable to triangulate polygon!");break}i=j;e<=i&&(i=0);j=i+1;e<=j&&(j=0);l=j+1;e<=l&&(l=0);var n;a:{var p=n=void 0,t=void 0,q=void 0,r=void 0,s=void 0,u=void 0,z=void 0,C=
-void 0,p=a[h[i]].x,t=a[h[i]].y,q=a[h[j]].x,r=a[h[j]].y,s=a[h[l]].x,u=a[h[l]].y;if(1E-10>(q-p)*(u-t)-(r-t)*(s-p))n=!1;else{var F=void 0,H=void 0,I=void 0,G=void 0,A=void 0,K=void 0,B=void 0,J=void 0,N=void 0,y=void 0,N=J=B=C=z=void 0,F=s-q,H=u-r,I=p-s,G=t-u,A=q-p,K=r-t;for(n=0;n<e;n++)if(!(n===i||n===j||n===l))if(z=a[h[n]].x,C=a[h[n]].y,B=z-p,J=C-t,N=z-q,y=C-r,z-=s,C-=u,N=F*y-H*N,B=A*J-K*B,J=I*C-G*z,0<=N&&0<=J&&0<=B){n=!1;break a}n=!0}}if(n){f.push([a[h[i]],a[h[j]],a[h[l]]]);g.push([h[i],h[j],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,j,l;if(0<b(a))for(j=0;j<e;j++)h[j]=j;else for(j=0;j<e;j++)h[j]=e-1-j;var m=2*e;for(j=e-1;2<e;){if(0>=m--){console.log("Warning, unable to triangulate polygon!");break}i=j;e<=i&&(i=0);j=i+1;e<=j&&(j=0);l=j+1;e<=l&&(l=0);var n;a:{var p=n=void 0,t=void 0,q=void 0,r=void 0,s=void 0,v=void 0,z=void 0,C=
+void 0,p=a[h[i]].x,t=a[h[i]].y,q=a[h[j]].x,r=a[h[j]].y,s=a[h[l]].x,v=a[h[l]].y;if(1E-10>(q-p)*(v-t)-(r-t)*(s-p))n=!1;else{var F=void 0,H=void 0,I=void 0,G=void 0,A=void 0,K=void 0,B=void 0,J=void 0,N=void 0,y=void 0,N=J=B=C=z=void 0,F=s-q,H=v-r,I=p-s,G=t-v,A=q-p,K=r-t;for(n=0;n<e;n++)if(!(n===i||n===j||n===l))if(z=a[h[n]].x,C=a[h[n]].y,B=z-p,J=C-t,N=z-q,y=C-r,z-=s,C-=v,N=F*y-H*N,B=A*J-K*B,J=I*C-G*z,0<=N&&0<=J&&0<=B){n=!1;break a}n=!0}}if(n){f.push([a[h[i]],a[h[j]],a[h[l]]]);g.push([h[i],h[j],h[l]]);
 i=j;for(l=j+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.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()};
@@ -622,16 +622,16 @@ 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.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],
-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 r,s=g.widthSegments,u=g.heightSegments,z=e/2,C=f/2,F=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 H=s+1,I=u+1,G=e/s,A=f/u,K=new THREE.Vector3;K[r]=0<h?1:-1;for(e=0;e<I;e++)for(f=0;f<H;f++){var B=new THREE.Vector3;B[a]=(f*G-z)*c;B[b]=(e*A-C)*d;B[r]=h;g.vertices.push(B)}for(e=
-0;e<u;e++)for(f=0;f<s;f++)a=new THREE.Face4(f+H*e+F,f+H*(e+1)+F,f+1+H*(e+1)+F,f+1+H*e+F),a.normal.copy(K),a.vertexNormals.push(K.clone(),K.clone(),K.clone(),K.clone()),a.materialIndex=q,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[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 r,s=g.widthSegments,v=g.heightSegments,z=e/2,C=f/2,F=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",v=g.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)r="x",s=g.depthSegments;var H=s+1,I=v+1,G=e/s,A=f/v,K=new THREE.Vector3;K[r]=0<h?1:-1;for(e=0;e<I;e++)for(f=0;f<H;f++){var B=new THREE.Vector3;B[a]=(f*G-z)*c;B[b]=(e*A-C)*d;B[r]=h;g.vertices.push(B)}for(e=
+0;e<v;e++)for(f=0;f<s;f++)a=new THREE.Face4(f+H*e+F,f+H*(e+1)+F,f+1+H*(e+1)+F,f+1+H*e+F),a.normal.copy(K),a.vertexNormals.push(K.clone(),K.clone(),K.clone(),K.clone()),a.materialIndex=q,g.faces.push(a),g.faceVertexUvs[0].push([new THREE.Vector2(f/s,1-e/v),new THREE.Vector2(f/s,1-(e+1)/v),new THREE.Vector2((f+1)/s,1-(e+1)/v),new THREE.Vector2((f+1)/s,1-e/v)])}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,j=[],l=[];for(i=0;i<=e;i++){var m=[],n=[],p=i/e,t=p*(b-a)+a;for(g=0;g<=d;g++){var q=g/d,r=new THREE.Vector3;r.x=t*Math.sin(2*q*Math.PI);r.y=-p*c+h;r.z=t*Math.cos(2*q*Math.PI);this.vertices.push(r);m.push(this.vertices.length-1);n.push(new THREE.Vector2(q,
-1-p))}j.push(m);l.push(n)}c=(b-a)/c;for(g=0;g<d;g++){0!==a?(m=this.vertices[j[0][g]].clone(),n=this.vertices[j[0][g+1]].clone()):(m=this.vertices[j[1][g]].clone(),n=this.vertices[j[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 p=j[i][g],t=j[i+1][g],q=j[i+1][g+1],r=j[i][g+1],s=m.clone(),u=m.clone(),z=n.clone(),C=n.clone(),F=l[i][g].clone(),H=l[i+1][g].clone(),I=l[i+1][g+1].clone(),G=l[i][g+1].clone();this.faces.push(new THREE.Face4(p,
-t,q,r,[s,u,z,C]));this.faceVertexUvs[0].push([F,H,I,G])}}if(!1===f&&0<a){this.vertices.push(new THREE.Vector3(0,h,0));for(g=0;g<d;g++)p=j[0][g],t=j[0][g+1],q=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),F=l[0][g].clone(),H=l[0][g+1].clone(),I=new THREE.Vector2(H.u,0),this.faces.push(new THREE.Face3(p,t,q,[s,u,z])),this.faceVertexUvs[0].push([F,H,I])}if(!1===f&&0<b){this.vertices.push(new THREE.Vector3(0,-h,0));for(g=0;g<d;g++)p=j[i][g+1],
-t=j[i][g],q=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),F=l[i][g+1].clone(),H=l[i][g].clone(),I=new THREE.Vector2(H.u,1),this.faces.push(new THREE.Face3(p,t,q,[s,u,z])),this.faceVertexUvs[0].push([F,H,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)};
+1-p))}j.push(m);l.push(n)}c=(b-a)/c;for(g=0;g<d;g++){0!==a?(m=this.vertices[j[0][g]].clone(),n=this.vertices[j[0][g+1]].clone()):(m=this.vertices[j[1][g]].clone(),n=this.vertices[j[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 p=j[i][g],t=j[i+1][g],q=j[i+1][g+1],r=j[i][g+1],s=m.clone(),v=m.clone(),z=n.clone(),C=n.clone(),F=l[i][g].clone(),H=l[i+1][g].clone(),I=l[i+1][g+1].clone(),G=l[i][g+1].clone();this.faces.push(new THREE.Face4(p,
+t,q,r,[s,v,z,C]));this.faceVertexUvs[0].push([F,H,I,G])}}if(!1===f&&0<a){this.vertices.push(new THREE.Vector3(0,h,0));for(g=0;g<d;g++)p=j[0][g],t=j[0][g+1],q=this.vertices.length-1,s=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),F=l[0][g].clone(),H=l[0][g+1].clone(),I=new THREE.Vector2(H.u,0),this.faces.push(new THREE.Face3(p,t,q,[s,v,z])),this.faceVertexUvs[0].push([F,H,I])}if(!1===f&&0<b){this.vertices.push(new THREE.Vector3(0,-h,0));for(g=0;g<d;g++)p=j[i][g+1],
+t=j[i][g],q=this.vertices.length-1,s=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),F=l[i][g+1].clone(),H=l[i][g].clone(),I=new THREE.Vector2(H.u,1),this.faces.push(new THREE.Face3(p,t,q,[s,v,z])),this.faceVertexUvs[0].push([F,H,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)};
 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(O=c.length;0<=--O;){e=O;f=O-1;0>f&&(f=c.length-1);for(var g=0,h=p+2*l,
-g=0;g<h;g++){var i=pa*g,j=pa*(g+1),m=d+e+i,i=d+f+i,n=d+f+j,j=d+e+j,q=c,r=g,s=h,t=e,w=f,m=m+J,i=i+J,n=n+J,j=j+J;B.faces.push(new THREE.Face4(m,i,n,j,null,null,u));m=z.generateSideWallUV(B,a,q,b,m,i,n,j,r,s,t,w);B.faceVertexUvs[0].push(m)}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=J;d+=J;e+=J;B.faces.push(new THREE.Face3(c,d,e,null,null,s));c=f?z.generateBottomUV(B,a,b,c,d,e):z.generateTopUV(B,a,b,c,d,e);B.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:
-100,i=void 0!==b.bevelThickness?b.bevelThickness:6,j=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,p=void 0!==b.steps?b.steps:1,t=b.extrudePath,q,r=!1,s=b.material,u=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,C,F,H,I;t&&(q=t.getSpacedPoints(p),r=!0,m=!1,C=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,p,
+g=0;g<h;g++){var i=pa*g,j=pa*(g+1),m=d+e+i,i=d+f+i,n=d+f+j,j=d+e+j,q=c,r=g,s=h,t=e,w=f,m=m+J,i=i+J,n=n+J,j=j+J;B.faces.push(new THREE.Face4(m,i,n,j,null,null,v));m=z.generateSideWallUV(B,a,q,b,m,i,n,j,r,s,t,w);B.faceVertexUvs[0].push(m)}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=J;d+=J;e+=J;B.faces.push(new THREE.Face3(c,d,e,null,null,s));c=f?z.generateBottomUV(B,a,b,c,d,e):z.generateTopUV(B,a,b,c,d,e);B.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:
+100,i=void 0!==b.bevelThickness?b.bevelThickness:6,j=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,p=void 0!==b.steps?b.steps:1,t=b.extrudePath,q,r=!1,s=b.material,v=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,C,F,H,I;t&&(q=t.getSpacedPoints(p),r=!0,m=!1,C=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,p,
 !1),F=new THREE.Vector3,H=new THREE.Vector3,I=new THREE.Vector3);m||(j=i=l=0);var G,A,K,B=this,J=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(K=n.length;A<K;A++)G=n[A],THREE.Shape.Utils.isClockWise(G)&&(n[A]=G.reverse());t=!1}var y=THREE.Shape.Utils.triangulateShape(N,n),t=N;A=0;for(K=n.length;A<K;A++)G=n[A],N=N.concat(G);var M,w,Z,L,pa=N.length,Pa=y.length,Ua=[],O=0,ka=t.length;M=ka-1;for(w=O+1;O<ka;O++,M++,w++)M===ka&&
 (M=0),w===ka&&(w=0),Ua[O]=d(t[O],t[M],t[w]);var Fa=[],wa,D=Ua.concat();A=0;for(K=n.length;A<K;A++){G=n[A];wa=[];O=0;ka=G.length;M=ka-1;for(w=O+1;O<ka;O++,M++,w++)M===ka&&(M=0),w===ka&&(w=0),wa[O]=d(G[O],G[M],G[w]);Fa.push(wa);D=D.concat(wa)}for(M=0;M<l;M++){G=M/l;Z=i*(1-G);w=j*Math.sin(G*Math.PI/2);O=0;for(ka=t.length;O<ka;O++)L=c(t[O],Ua[O],w),f(L.x,L.y,-Z);A=0;for(K=n.length;A<K;A++){G=n[A];wa=Fa[A];O=0;for(ka=G.length;O<ka;O++)L=c(G[O],wa[O],w),f(L.x,L.y,-Z)}}w=j;for(O=0;O<pa;O++)L=m?c(N[O],D[O],
 w):N[O],r?(H.copy(C.normals[0]).multiplyScalar(L.x),F.copy(C.binormals[0]).multiplyScalar(L.y),I.copy(q[0]).add(H).add(F),f(I.x,I.y,I.z)):f(L.x,L.y,0);for(G=1;G<=p;G++)for(O=0;O<pa;O++)L=m?c(N[O],D[O],w):N[O],r?(H.copy(C.normals[G]).multiplyScalar(L.x),F.copy(C.binormals[G]).multiplyScalar(L.y),I.copy(q[G]).add(H).add(F),f(I.x,I.y,I.z)):f(L.x,L.y,g/p*G);for(M=l-1;0<=M;M--){G=M/l;Z=i*(1-G);w=j*Math.sin(G*Math.PI/2);O=0;for(ka=t.length;O<ka;O++)L=c(t[O],Ua[O],w),f(L.x,L.y,g+Z);A=0;for(K=n.length;A<
@@ -657,7 +657,7 @@ THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THRE
 d).normalize();f[0].crossVectors(e[0],g);h[0].crossVectors(e[0],f[0]);for(j=1;j<b;j++)f[j]=f[j-1].clone(),h[j]=h[j-1].clone(),g.crossVectors(e[j-1],e[j]),1E-4<g.length()&&(g.normalize(),d=Math.acos(THREE.Math.clamp(e[j-1].dot(e[j]),-1,1)),f[j].applyMatrix4(i.makeRotationAxis(g,d))),h[j].crossVectors(e[j],f[j]);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(j=1;j<b;j++)f[j].applyMatrix4(i.makeRotationAxis(e[j],d*j)),h[j].crossVectors(e[j],
 f[j])}};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,j=a.length;i<j;i++)e(new THREE.Vector3(a[i][0],a[i][1],a[i][2]));for(var l=this.vertices,a=[],i=0,j=b.length;i<j;i++){var m=l[b[i][0]],n=l[b[i][1]],p=l[b[i][2]];a[i]=new THREE.Face3(m.index,n.index,p.index,[m.clone(),n.clone(),p.clone()])}i=0;for(j=a.length;i<j;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=[],p=0;p<=b;p++){n[p]=[];for(var q=e(l.clone().lerp(t,p/b)),r=e(m.clone().lerp(t,p/b)),s=b-p,u=0;u<=s;u++)n[p][u]=0==u&&p==b?q:e(q.clone().lerp(r,u/s))}for(p=0;p<b;p++)for(u=0;u<2*(b-p)-1;u++)l=Math.floor(u/2),0==u%2?f(n[p][l+1],n[p+1][l],n[p][l]):f(n[p][l+1],n[p+1][l+1],n[p+1][l])}i=0;for(j=this.faceVertexUvs[0].length;i<j;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)),
+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=[],p=0;p<=b;p++){n[p]=[];for(var q=e(l.clone().lerp(t,p/b)),r=e(m.clone().lerp(t,p/b)),s=b-p,v=0;v<=s;v++)n[p][v]=0==v&&p==b?q:e(q.clone().lerp(r,v/s))}for(p=0;p<b;p++)for(v=0;v<2*(b-p)-1;v++)l=Math.floor(v/2),0==v%2?f(n[p][l+1],n[p+1][l],n[p][l]):f(n[p][l+1],n[p+1][l+1],n[p+1][l])}i=0;for(j=this.faceVertexUvs[0].length;i<j;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(j=this.vertices.length;i<j;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,j,l,m=b+1;for(g=0;g<=c;g++){l=g/c;for(i=0;i<=b;i++)j=i/b,j=a(j,l),e.push(j)}var n,p,t,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,j=(g+1)*m+i+1,n=new THREE.Vector2(i/b,g/c),p=new THREE.Vector2((i+1)/b,g/c),t=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,
 j,l)),h.push([n,p,t]),h.push([p,q,t])):(f.push(new THREE.Face4(a,e,j,l)),h.push([n,p,q,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)};
 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}));
@@ -668,14 +668,14 @@ THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingB
 b("n1","f1",16755200);b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()};
 THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,h,g,i){a.set(h,g,i);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d){h=0;for(g=d.length;h<g;h++)e.geometry.vertices[d[h]].copy(a)}}var e=this;b.projectionMatrix.copy(this.camera.projectionMatrix);d("c",0,0,-1);d("t",0,0,1);d("n1",-1,-1,-1);d("n2",1,-1,-1);d("n3",-1,1,-1);d("n4",1,1,-1);d("f1",-1,-1,1);d("f2",1,-1,1);d("f3",-1,1,1);d("f4",1,1,1);d("u1",
-0.7,1.1,-1);d("u2",-0.7,1.1,-1);d("u3",0,2,-1);d("cf1",-1,0,1);d("cf2",1,0,1);d("cf3",0,-1,1);d("cf4",0,1,1);d("cn1",-1,0,-1);d("cn2",1,0,-1);d("cn3",0,-1,-1);d("cn4",0,1,-1);this.geometry.verticesNeedUpdate=!0}}();THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.light=a;var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightSphere=new THREE.Mesh(c,d);this.lightSphere.matrixWorld=this.light.matrixWorld;this.lightSphere.matrixAutoUpdate=!1;this.add(this.lightSphere);c=new THREE.Geometry;c.vertices.push(this.light.position);c.vertices.push(this.light.target.position);
-c.computeLineDistances();d=new THREE.LineDashedMaterial({dashSize:4,gapSize:4,opacity:0.75,transparent:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine)};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);
-THREE.DirectionalLightHelper.prototype.update=function(){this.lightSphere.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.computeLineDistances();this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var a=c||16776960,d=d||1,b=new THREE.Geometry,c=0,e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3),b.vertices.push(new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
+0.7,1.1,-1);d("u2",-0.7,1.1,-1);d("u3",0,2,-1);d("cf1",-1,0,1);d("cf2",1,0,1);d("cf3",0,-1,1);d("cf4",0,1,1);d("cn1",-1,0,-1);d("cn2",1,0,-1);d("cn3",0,-1,-1);d("cn4",0,1,-1);this.geometry.verticesNeedUpdate=!0}}();THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;var c=new THREE.PlaneGeometry(b,b),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightPlane=new THREE.Mesh(c,d);this.add(this.lightPlane);c=new THREE.Geometry;c.vertices.push(new THREE.Vector3);c.vertices.push(new THREE.Vector3);c.computeLineDistances();
+d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);
+THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){a.getPositionFromMatrix(this.light.matrixWorld).negate();this.lightPlane.lookAt(a);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(a);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var a=c||16776960,d=d||1,b=new THREE.Geometry,c=0,e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3),b.vertices.push(new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
 THREE.FaceNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var b=this.geometry.vertices,c=this.object.geometry.faces,d=this.object.matrixWorld,e=0,f=c.length;e<f;e++){var h=c[e];a.copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);var g=2*e;b[g].copy(h.centroid).applyMatrix4(d);b[g+1].addVectors(b[g],a)}this.geometry.verticesNeedUpdate=
 !0;return this}}();THREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924);this.color2=new THREE.Color(8947848);for(var e=-a;e<=a;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)};THREE.GridHelper.prototype=Object.create(THREE.Line.prototype);
-THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a);this.color2.set(b);this.geometry.colorsNeedUpdate=!0};THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].materialIndex=4>d?0:1;d=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});d.color.copy(a.color).multiplyScalar(a.intensity);var e=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});e.color.copy(a.groundColor).multiplyScalar(a.intensity);this.lightSphere=new THREE.Mesh(c,new THREE.MeshFaceMaterial([d,
-e]));this.lightSphere.position=a.position;this.lightSphere.lookAt(new THREE.Vector3);this.add(this.lightSphere)};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.update=function(){this.lightSphere.lookAt(new THREE.Vector3);this.lightSphere.material.materials[0].color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightSphere.material.materials[1].color.copy(this.light.groundColor).multiplyScalar(this.light.intensity)};THREE.PointLightHelper=function(a,b){this.light=a;var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrixWorld=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};THREE.SpotLightHelper=function(a){this.light=a;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.applyMatrix((new THREE.Matrix4).makeTranslation(0,-0.5,0));a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var b=new THREE.MeshBasicMaterial({wireframe:!0,opacity:0.3,transparent:!0});THREE.Mesh.call(this,a,b);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Mesh.prototype);
-THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=this.light.distance?this.light.distance:1E4,c=b*Math.tan(this.light.angle);this.scale.set(c,c,b);this.light.updateMatrixWorld(!0);this.position.getPositionFromMatrix(this.light.matrixWorld);this.light.target.updateMatrixWorld(!0);a.getPositionFromMatrix(this.light.target.matrixWorld);this.lookAt(a);this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var b=c||16711680,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].vertexNormals.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.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);
+THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a);this.color2.set(b);this.geometry.colorsNeedUpdate=!0};THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(c,d);this.add(this.lightSphere);
+this.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.getPositionFromMatrix(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}();THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrixWorld=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};THREE.SpotLightHelper=function(a){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.applyMatrix((new THREE.Matrix4).makeTranslation(0,-0.5,0));a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype);
+THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=this.light.distance?this.light.distance:1E4,c=b*Math.tan(this.light.angle);this.cone.scale.set(c,c,b);this.cone.lookAt(a.getPositionFromMatrix(this.light.matrixWorld).negate());this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var b=c||16711680,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].vertexNormals.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.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);
 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 j=e[g],l=0,m=j.vertexNormals.length;l<m;l++){var n=j.vertexNormals[l];c[h].copy(d[j[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);
 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 j=e[g],l=0,m=j.vertexTangents.length;l<m;l++){var n=j.vertexTangents[l];c[h].copy(d[j[b[l]]]).applyMatrix4(f);a.copy(n).transformDirection(f).multiplyScalar(this.size);a.add(c[h]);h+=1;c[h].copy(a);
@@ -693,29 +693,29 @@ f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetI
 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();j=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,j);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={};p={};n.vertex=b.getAttribLocation(m,"position");n.uv=b.getAttribLocation(m,"uv");p.renderType=b.getUniformLocation(m,"renderType");p.map=b.getUniformLocation(m,"map");p.occlusionMap=b.getUniformLocation(m,"occlusionMap");p.opacity=
-b.getUniformLocation(m,"opacity");p.color=b.getUniformLocation(m,"color");p.scale=b.getUniformLocation(m,"scale");p.rotation=b.getUniformLocation(m,"rotation");p.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,C=f/e,F=0.5*e,H=0.5*f,I=16/f,G=new THREE.Vector2(I*C,I),A=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1),B=p,I=n;b.useProgram(m);b.enableVertexAttribArray(n.vertex);b.enableVertexAttribArray(n.uv);
-b.uniform1i(B.occlusionMap,0);b.uniform1i(B.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 J,N,y,M,w;for(J=0;J<u;J++)if(I=16/f,G.set(I*C,I),M=a[J],z.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),z.applyMatrix4(d.matrixWorldInverse),z.applyProjection(d.projectionMatrix),A.copy(z),K.x=A.x*F+F,
+b.getUniformLocation(m,"opacity");p.color=b.getUniformLocation(m,"color");p.scale=b.getUniformLocation(m,"scale");p.rotation=b.getUniformLocation(m,"rotation");p.screenPosition=b.getUniformLocation(m,"screenPosition")};this.render=function(a,d,e,f){var a=a.__webglFlares,v=a.length;if(v){var z=new THREE.Vector3,C=f/e,F=0.5*e,H=0.5*f,I=16/f,G=new THREE.Vector2(I*C,I),A=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1),B=p,I=n;b.useProgram(m);b.enableVertexAttribArray(n.vertex);b.enableVertexAttribArray(n.uv);
+b.uniform1i(B.occlusionMap,0);b.uniform1i(B.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 J,N,y,M,w;for(J=0;J<v;J++)if(I=16/f,G.set(I*C,I),M=a[J],z.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),z.applyMatrix4(d.matrixWorldInverse),z.applyProjection(d.projectionMatrix),A.copy(z),K.x=A.x*F+F,
 K.y=A.y*H+H,l||0<K.x&&K.x<e&&0<K.y&&K.y<f){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,K.x-8,K.y-8,16,16,0);b.uniform1i(B.renderType,0);b.uniform2f(B.scale,G.x,G.y);b.uniform3f(B.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,j);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,K.x-8,K.y-8,16,16,0);b.uniform1i(B.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);M.positionScreen.copy(A);M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares();b.uniform1i(B.renderType,2);b.enable(b.BLEND);N=0;for(y=M.lensFlares.length;N<y;N++)w=M.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,G.x=I*C,G.y=I,b.uniform3f(B.screenPosition,A.x,A.y,A.z),b.uniform2f(B.scale,G.x,G.y),b.uniform1f(B.rotation,w.rotation),b.uniform1f(B.opacity,
 w.opacity),b.uniform3f(B.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,j=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 p,t,q,r,s,u,z,C,F,H=[];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?
+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 p,t,q,r,s,v,z,C,F,H=[];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);p=0;for(t=m.__lights.length;p<t;p++)if(q=m.__lights[p],q.castShadow)if(q instanceof THREE.DirectionalLight&&q.shadowCascade)for(s=0;s<q.shadowCascadeCount;s++){var I;if(q.shadowCascadeArray[s])I=q.shadowCascadeArray[s];else{F=q;z=s;I=new THREE.DirectionalLight;I.isVirtual=!0;I.onlyShadow=!0;I.castShadow=!0;I.shadowCameraNear=F.shadowCameraNear;I.shadowCameraFar=F.shadowCameraFar;I.shadowCameraLeft=F.shadowCameraLeft;I.shadowCameraRight=F.shadowCameraRight;
-I.shadowCameraBottom=F.shadowCameraBottom;I.shadowCameraTop=F.shadowCameraTop;I.shadowCameraVisible=F.shadowCameraVisible;I.shadowDarkness=F.shadowDarkness;I.shadowBias=F.shadowCascadeBias[z];I.shadowMapWidth=F.shadowCascadeWidth[z];I.shadowMapHeight=F.shadowCascadeHeight[z];I.pointsWorld=[];I.pointsFrustum=[];C=I.pointsWorld;u=I.pointsFrustum;for(var G=0;8>G;G++)C[G]=new THREE.Vector3,u[G]=new THREE.Vector3;C=F.shadowCascadeNearZ[z];F=F.shadowCascadeFarZ[z];u[0].set(-1,-1,C);u[1].set(1,-1,C);u[2].set(-1,
-1,C);u[3].set(1,1,C);u[4].set(-1,-1,F);u[5].set(1,-1,F);u[6].set(-1,1,F);u[7].set(1,1,F);I.originalCamera=n;u=new THREE.Gyroscope;u.position=q.shadowCascadeOffset;u.add(I);u.add(I.target);n.add(u);q.shadowCascadeArray[s]=I;console.log("Created virtualLight",I)}z=q;C=s;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];u=z.shadowCascadeNearZ[C];
-z=z.shadowCascadeFarZ[C];F=F.pointsFrustum;F[0].z=u;F[1].z=u;F[2].z=u;F[3].z=u;F[4].z=z;F[5].z=z;F[6].z=z;F[7].z=z;H[r]=I;r++}else H[r]=q,r++;p=0;for(t=H.length;p<t;p++){q=H[p];q.shadowMap||(s=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(s=THREE.NearestFilter),q.shadowMap=new THREE.WebGLRenderTarget(q.shadowMapWidth,q.shadowMapHeight,{minFilter:s,magFilter:s,format:THREE.RGBAFormat}),q.shadowMapSize=new THREE.Vector2(q.shadowMapWidth,q.shadowMapHeight),q.shadowMatrix=new THREE.Matrix4);
+I.shadowCameraBottom=F.shadowCameraBottom;I.shadowCameraTop=F.shadowCameraTop;I.shadowCameraVisible=F.shadowCameraVisible;I.shadowDarkness=F.shadowDarkness;I.shadowBias=F.shadowCascadeBias[z];I.shadowMapWidth=F.shadowCascadeWidth[z];I.shadowMapHeight=F.shadowCascadeHeight[z];I.pointsWorld=[];I.pointsFrustum=[];C=I.pointsWorld;v=I.pointsFrustum;for(var G=0;8>G;G++)C[G]=new THREE.Vector3,v[G]=new THREE.Vector3;C=F.shadowCascadeNearZ[z];F=F.shadowCascadeFarZ[z];v[0].set(-1,-1,C);v[1].set(1,-1,C);v[2].set(-1,
+1,C);v[3].set(1,1,C);v[4].set(-1,-1,F);v[5].set(1,-1,F);v[6].set(-1,1,F);v[7].set(1,1,F);I.originalCamera=n;v=new THREE.Gyroscope;v.position=q.shadowCascadeOffset;v.add(I);v.add(I.target);n.add(v);q.shadowCascadeArray[s]=I;console.log("Created virtualLight",I)}z=q;C=s;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];v=z.shadowCascadeNearZ[C];
+z=z.shadowCascadeFarZ[C];F=F.pointsFrustum;F[0].z=v;F[1].z=v;F[2].z=v;F[3].z=v;F[4].z=z;F[5].z=z;F[6].z=z;F[7].z=z;H[r]=I;r++}else H[r]=q,r++;p=0;for(t=H.length;p<t;p++){q=H[p];q.shadowMap||(s=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(s=THREE.NearestFilter),q.shadowMap=new THREE.WebGLRenderTarget(q.shadowMapWidth,q.shadowMapHeight,{minFilter:s,magFilter:s,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&&I.originalCamera==n){s=n;r=q.shadowCamera;u=q.pointsFrustum;F=q.pointsWorld;i.set(Infinity,Infinity,Infinity);j.set(-Infinity,-Infinity,-Infinity);for(z=0;8>z;z++)C=F[z],C.copy(u[z]),THREE.ShadowMapPlugin.__projector.unprojectVector(C,s),C.applyMatrix4(r.matrixWorldInverse),C.x<i.x&&(i.x=C.x),C.x>j.x&&(j.x=C.x),C.y<i.y&&(i.y=C.y),C.y>j.y&&(j.y=C.y),C.z<i.z&&(i.z=C.z),C.z>j.z&&
-(j.z=C.z);r.left=i.x;r.right=j.x;r.top=j.y;r.bottom=i.y;r.updateProjectionMatrix()}r=q.shadowMap;u=q.shadowMatrix;s=q.shadowCamera;s.position.getPositionFromMatrix(q.matrixWorld);l.getPositionFromMatrix(q.target.matrixWorld);s.lookAt(l);s.updateMatrixWorld();s.matrixWorldInverse.getInverse(s.matrixWorld);q.cameraHelper&&(q.cameraHelper.visible=q.shadowCameraVisible);q.shadowCameraVisible&&q.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();F=m.__webglObjects;q=0;for(r=F.length;q<r;q++)if(z=F[q],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;q=0;for(r=F.length;q<r;q++)z=F[q],z.render&&(u=z.object,z=z.buffer,G=u.material instanceof THREE.MeshFaceMaterial?
-u.material.materials[0]:u.material,C=0<u.geometry.morphTargets.length&&G.morphTargets,G=u instanceof THREE.SkinnedMesh&&G.skinning,C=u.customDepthMaterial?u.customDepthMaterial:G?C?f:e:C?d:c,z instanceof THREE.BufferGeometry?b.renderBufferDirect(s,m.__lights,null,C,z,u):b.renderBuffer(s,m.__lights,null,C,z,u));F=m.__webglObjectsImmediate;q=0;for(r=F.length;q<r;q++)z=F[q],u=z.object,u.visible&&u.castShadow&&(u._modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,u.matrixWorld),b.renderImmediateObject(s,
-m.__lights,null,c,u))}p=b.getClearColor();t=b.getClearAlpha();a.clearColor(p.r,p.g,p.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,j,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,
+!q.cameraHelper&&(q.cameraHelper=new THREE.CameraHelper(q.shadowCamera),q.shadowCamera.add(q.cameraHelper));if(q.isVirtual&&I.originalCamera==n){s=n;r=q.shadowCamera;v=q.pointsFrustum;F=q.pointsWorld;i.set(Infinity,Infinity,Infinity);j.set(-Infinity,-Infinity,-Infinity);for(z=0;8>z;z++)C=F[z],C.copy(v[z]),THREE.ShadowMapPlugin.__projector.unprojectVector(C,s),C.applyMatrix4(r.matrixWorldInverse),C.x<i.x&&(i.x=C.x),C.x>j.x&&(j.x=C.x),C.y<i.y&&(i.y=C.y),C.y>j.y&&(j.y=C.y),C.z<i.z&&(i.z=C.z),C.z>j.z&&
+(j.z=C.z);r.left=i.x;r.right=j.x;r.top=j.y;r.bottom=i.y;r.updateProjectionMatrix()}r=q.shadowMap;v=q.shadowMatrix;s=q.shadowCamera;s.position.getPositionFromMatrix(q.matrixWorld);l.getPositionFromMatrix(q.target.matrixWorld);s.lookAt(l);s.updateMatrixWorld();s.matrixWorldInverse.getInverse(s.matrixWorld);q.cameraHelper&&(q.cameraHelper.visible=q.shadowCameraVisible);q.shadowCameraVisible&&q.cameraHelper.update();v.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);v.multiply(s.projectionMatrix);v.multiply(s.matrixWorldInverse);
+g.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse);h.setFromMatrix(g);b.setRenderTarget(r);b.clear();F=m.__webglObjects;q=0;for(r=F.length;q<r;q++)if(z=F[q],v=z.object,z.render=!1,v.visible&&v.castShadow&&(!(v instanceof THREE.Mesh||v instanceof THREE.ParticleSystem)||!v.frustumCulled||h.intersectsObject(v)))v._modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,v.matrixWorld),z.render=!0;q=0;for(r=F.length;q<r;q++)z=F[q],z.render&&(v=z.object,z=z.buffer,G=v.material instanceof THREE.MeshFaceMaterial?
+v.material.materials[0]:v.material,C=0<v.geometry.morphTargets.length&&G.morphTargets,G=v instanceof THREE.SkinnedMesh&&G.skinning,C=v.customDepthMaterial?v.customDepthMaterial:G?C?f:e:C?d:c,z instanceof THREE.BufferGeometry?b.renderBufferDirect(s,m.__lights,null,C,z,v):b.renderBuffer(s,m.__lights,null,C,z,v));F=m.__webglObjectsImmediate;q=0;for(r=F.length;q<r;q++)z=F[q],v=z.object,v.visible&&v.castShadow&&(v._modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,v.matrixWorld),b.renderImmediateObject(s,
+m.__lights,null,c,v))}p=b.getClearColor();t=b.getClearAlpha();a.clearColor(p.r,p.g,p.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,j,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(),p=b.createShader(b.FRAGMENT_SHADER),t=b.createShader(b.VERTEX_SHADER),q="precision "+d+" float;\n";b.shaderSource(p,q+a.fragmentShader);b.shaderSource(t,q+a.vertexShader);b.compileShader(p);b.compileShader(t);b.attachShader(n,p);b.attachShader(n,t);b.linkProgram(n);i=n;j={};l={};j.position=b.getAttribLocation(i,"position");j.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,
-"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 q=d.__webglSprites,r=q.length;if(r){var s=j,u=l,z=t/
-f,f=0.5*f,C=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 F=s=0,H=d.fog;H?(b.uniform3f(u.fogColor,H.color.r,H.color.g,H.color.b),
-H instanceof THREE.Fog?(b.uniform1f(u.fogNear,H.near),b.uniform1f(u.fogFar,H.far),b.uniform1i(u.fogType,1),F=s=1):H instanceof THREE.FogExp2&&(b.uniform1f(u.fogDensity,H.density),b.uniform1i(u.fogType,2),F=s=2)):(b.uniform1i(u.fogType,0),F=s=0);for(var I,G,A=[],H=0;H<r;H++)I=q[H],G=I.material,I.visible&&0!==G.opacity&&(G.useScreenCoordinates?I.z=-I.position.z:(I._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,I.matrixWorld),I.z=-I._modelViewMatrix.elements[14]));q.sort(a);for(H=0;H<r;H++)I=
-q[H],G=I.material,I.visible&&0!==G.opacity&&(G.map&&G.map.image&&G.map.image.width)&&(b.uniform1f(u.alphaTest,G.alphaTest),!0===G.useScreenCoordinates?(b.uniform1i(u.useScreenCoordinates,1),b.uniform3f(u.screenPosition,(I.position.x*c.devicePixelRatio-f)/f,(C-I.position.y*c.devicePixelRatio)/C,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,G.sizeAttenuation?1:0),b.uniformMatrix4fv(u.modelViewMatrix,
-!1,I._modelViewMatrix.elements),A[0]=1,A[1]=1),e=d.fog&&G.fog?F:0,s!==e&&(b.uniform1i(u.fogType,e),s=e),e=1/(G.scaleByViewport?t:1),A[0]*=e*z*I.scale.x,A[1]*=e*I.scale.y,b.uniform2f(u.uvScale,G.uvScale.x,G.uvScale.y),b.uniform2f(u.uvOffset,G.uvOffset.x,G.uvOffset.y),b.uniform2f(u.alignment,G.alignment.x,G.alignment.y),b.uniform1f(u.opacity,G.opacity),b.uniform3f(u.color,G.color.r,G.color.g,G.color.b),b.uniform1f(u.rotation,I.rotation),b.uniform2fv(u.scale,A),c.setBlending(G.blending,G.blendEquation,
+"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 q=d.__webglSprites,r=q.length;if(r){var s=j,v=l,z=t/
+f,f=0.5*f,C=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(v.projectionMatrix,!1,e.projectionMatrix.elements);b.activeTexture(b.TEXTURE0);b.uniform1i(v.map,0);var F=s=0,H=d.fog;H?(b.uniform3f(v.fogColor,H.color.r,H.color.g,H.color.b),
+H instanceof THREE.Fog?(b.uniform1f(v.fogNear,H.near),b.uniform1f(v.fogFar,H.far),b.uniform1i(v.fogType,1),F=s=1):H instanceof THREE.FogExp2&&(b.uniform1f(v.fogDensity,H.density),b.uniform1i(v.fogType,2),F=s=2)):(b.uniform1i(v.fogType,0),F=s=0);for(var I,G,A=[],H=0;H<r;H++)I=q[H],G=I.material,I.visible&&0!==G.opacity&&(G.useScreenCoordinates?I.z=-I.position.z:(I._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,I.matrixWorld),I.z=-I._modelViewMatrix.elements[14]));q.sort(a);for(H=0;H<r;H++)I=
+q[H],G=I.material,I.visible&&0!==G.opacity&&(G.map&&G.map.image&&G.map.image.width)&&(b.uniform1f(v.alphaTest,G.alphaTest),!0===G.useScreenCoordinates?(b.uniform1i(v.useScreenCoordinates,1),b.uniform3f(v.screenPosition,(I.position.x*c.devicePixelRatio-f)/f,(C-I.position.y*c.devicePixelRatio)/C,Math.max(0,Math.min(1,I.position.z))),A[0]=c.devicePixelRatio,A[1]=c.devicePixelRatio):(b.uniform1i(v.useScreenCoordinates,0),b.uniform1i(v.sizeAttenuation,G.sizeAttenuation?1:0),b.uniformMatrix4fv(v.modelViewMatrix,
+!1,I._modelViewMatrix.elements),A[0]=1,A[1]=1),e=d.fog&&G.fog?F:0,s!==e&&(b.uniform1i(v.fogType,e),s=e),e=1/(G.scaleByViewport?t:1),A[0]*=e*z*I.scale.x,A[1]*=e*I.scale.y,b.uniform2f(v.uvScale,G.uvScale.x,G.uvScale.y),b.uniform2f(v.uvOffset,G.uvOffset.x,G.uvOffset.y),b.uniform2f(v.alignment,G.alignment.x,G.alignment.y),b.uniform1f(v.opacity,G.opacity),b.uniform3f(v.color,G.color.r,G.color.g,G.color.b),b.uniform1f(v.rotation,I.rotation),b.uniform2fv(v.scale,A),c.setBlending(G.blending,G.blendEquation,
 G.blendSrc,G.blendDst),c.setDepthTest(G.depthTest),c.setDepthWrite(G.depthWrite),c.setTexture(G.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,j){var l,m,n,p,t,q;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===i.autoUpdate&&i.updateMatrixWorld();j.matrixWorldInverse.getInverse(j.matrixWorld);g.multiplyMatrices(j.projectionMatrix,
 j.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],t=n.object,n.render=!1,t.visible&&(!(t instanceof THREE.Mesh||t instanceof THREE.ParticleSystem)||!t.frustumCulled||h.intersectsObject(t)))t._modelViewMatrix.multiplyMatrices(j.matrixWorldInverse,t.matrixWorld),n.render=!0;var r;l=0;for(m=q.length;l<m;l++)if(n=q[l],n.render&&(t=n.object,n=n.buffer,!(t instanceof THREE.ParticleSystem)||t.customDepthMaterial))(r=