فهرست منبع

Updated builds.

Mr.doob 11 سال پیش
والد
کامیت
80e354b991
2فایلهای تغییر یافته به همراه275 افزوده شده و 157 حذف شده
  1. 222 105
      build/three.js
  2. 53 52
      build/three.min.js

+ 222 - 105
build/three.js

@@ -18751,8 +18751,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	_precision = parameters.precision !== undefined ? parameters.precision : 'highp',
 
-	_buffers = {},
-
 	_alpha = parameters.alpha !== undefined ? parameters.alpha : false,
 	_depth = parameters.depth !== undefined ? parameters.depth : true,
 	_stencil = parameters.stencil !== undefined ? parameters.stencil : true,
@@ -23569,8 +23567,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		for ( var j = 0, jl = uniforms.length; j < jl; j ++ ) {
 
-			var location = uniforms[ j ][ 1 ];
-
 			var uniform = uniforms[ j ][ 0 ];
 
 			// needsUpdate property is not added to all uniforms.
@@ -23578,201 +23574,322 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			var type = uniform.type;
 			var value = uniform.value;
+			var location = uniforms[ j ][ 1 ];
 
-			if ( type === 'i' ) { // single integer
+			switch ( type ) {
 
-				_gl.uniform1i( location, value );
+				case '1i':
+					_gl.uniform1i( location, value );
+					break;
 
-			} else if ( type === 'f' ) { // single float
+				case '1f':
+					_gl.uniform1f( location, value );
+					break;
 
-				_gl.uniform1f( location, value );
+				case '2f':
+					_gl.uniform2f( location, value[ 0 ], value[ 1 ] );
+					break;
 
-			} else if ( type === 'v2' ) { // single THREE.Vector2
+				case '3f':
+					_gl.uniform3f( location, value[ 0 ], value[ 1 ], value[ 2 ] );
+					break;
 
-				_gl.uniform2f( location, value.x, value.y );
+				case '4f':
+					_gl.uniform4f( location, value[ 0 ], value[ 1 ], value[ 2 ], value[ 3 ] );
+					break;
 
-			} else if ( type === 'v3' ) { // single THREE.Vector3
+				case '1iv':
+					_gl.uniform1iv( location, value );
+					break;
 
-				_gl.uniform3f( location, value.x, value.y, value.z );
+				case '3iv':
+					_gl.uniform3iv( location, value );
+					break;
 
-			} else if ( type === 'v4' ) { // single THREE.Vector4
+				case '1fv':
+					_gl.uniform1fv( location, value );
+					break;
 
-				_gl.uniform4f( location, value.x, value.y, value.z, value.w );
+				case '2fv':
+					_gl.uniform2fv( location, value );
+					break;
 
-			} else if ( type === 'c' ) { // single THREE.Color
+				case '3fv':
+					_gl.uniform3fv( location, value );
+					break;
 
-				_gl.uniform3f( location, value.r, value.g, value.b );
+				case '4fv':
+					_gl.uniform4fv( location, value );
+					break;
 
-			} else if ( type === 'iv1' ) { // flat array of integers (JS or typed array)
+				case 'Matrix3fv':
+					_gl.uniformMatrix3fv( location, false, value );
+					break;
 
-				_gl.uniform1iv( location, value );
+				case 'Matrix4fv':
+					_gl.uniformMatrix4fv( location, false, value );
+					break;
 
-			} else if ( type === 'iv' ) { // flat array of integers with 3 x N size (JS or typed array)
+				//
 
-				_gl.uniform3iv( location, value );
+				case 'i': 
 
-			} else if ( type === 'fv1' ) { // flat array of floats (JS or typed array)
+					// single integer
+					_gl.uniform1i( location, value );
 
-				_gl.uniform1fv( location, value );
+					break;
 
-			} else if ( type === 'fv' ) { // flat array of floats with 3 x N size (JS or typed array)
+				case 'f':
 
-				_gl.uniform3fv( location, value );
+					// single float
+					_gl.uniform1f( location, value );
 
-			} else if ( type === 'v2v' ) { // array of THREE.Vector2
+					break;
 
-				if ( uniform._array === undefined ) {
+				case 'v2':
 
-					uniform._array = new Float32Array( 2 * value.length );
+					// single THREE.Vector2
+					_gl.uniform2f( location, value.x, value.y );
 
-				}
+					break;
 
-				for ( var i = 0, il = value.length; i < il; i ++ ) {
+				case 'v3':
 
-					offset = i * 2;
+					// single THREE.Vector3
+					_gl.uniform3f( location, value.x, value.y, value.z );
 
-					uniform._array[ offset ]   = value[ i ].x;
-					uniform._array[ offset + 1 ] = value[ i ].y;
+					break;
 
-				}
+				case 'v4': 
 
-				_gl.uniform2fv( location, uniform._array );
+					// single THREE.Vector4
+					_gl.uniform4f( location, value.x, value.y, value.z, value.w );
 
-			} else if ( type === 'v3v' ) { // array of THREE.Vector3
+					break;
 
-				if ( uniform._array === undefined ) {
+				case 'c':
 
-					uniform._array = new Float32Array( 3 * value.length );
+					// single THREE.Color
+					_gl.uniform3f( location, value.r, value.g, value.b );
 
-				}
+					break;
 
-				for ( var i = 0, il = value.length; i < il; i ++ ) {
+				case 'iv1':
 
-					offset = i * 3;
+					// flat array of integers (JS or typed array)
+					_gl.uniform1iv( location, value );
 
-					uniform._array[ offset ]   = value[ i ].x;
-					uniform._array[ offset + 1 ] = value[ i ].y;
-					uniform._array[ offset + 2 ] = value[ i ].z;
+					break;
 
-				}
+				case 'iv':
 
-				_gl.uniform3fv( location, uniform._array );
+					// flat array of integers with 3 x N size (JS or typed array)
+					_gl.uniform3iv( location, value );
 
-			} else if ( type === 'v4v' ) { // array of THREE.Vector4
+					break;
 
-				if ( uniform._array === undefined ) {
+				case 'fv1':
 
-					uniform._array = new Float32Array( 4 * value.length );
+					// flat array of floats (JS or typed array)
+					_gl.uniform1fv( location, value );
 
-				}
+					break;
 
-				for ( var i = 0, il = value.length; i < il; i ++ ) {
+				case 'fv':
 
-					offset = i * 4;
+					// flat array of floats with 3 x N size (JS or typed array)
+					_gl.uniform3fv( location, value );
 
-					uniform._array[ offset ]   = value[ i ].x;
-					uniform._array[ offset + 1 ] = value[ i ].y;
-					uniform._array[ offset + 2 ] = value[ i ].z;
-					uniform._array[ offset + 3 ] = value[ i ].w;
+					break;
 
-				}
+				case 'v2v':
 
-				_gl.uniform4fv( location, uniform._array );
+					// array of THREE.Vector2
 
-			} else if ( type === 'm3' ) { // single THREE.Matrix3
+					if ( uniform._array === undefined ) {
 
-				_gl.uniformMatrix3fv( location, false, value.elements );
+						uniform._array = new Float32Array( 2 * value.length );
 
-			} else if ( type === 'm3v' ) { // array of THREE.Matrix3
+					}
 
-				if ( uniform._array === undefined ) {
+					for ( var i = 0, il = value.length; i < il; i ++ ) {
 
-					uniform._array = new Float32Array( 9 * value.length );
+						offset = i * 2;
 
-				}
+						uniform._array[ offset ]   = value[ i ].x;
+						uniform._array[ offset + 1 ] = value[ i ].y;
 
-				for ( var i = 0, il = value.length; i < il; i ++ ) {
+					}
 
-					value[ i ].flattenToArrayOffset( uniform._array, i * 9 );
+					_gl.uniform2fv( location, uniform._array );
 
-				}
+					break;
 
-				_gl.uniformMatrix3fv( location, false, uniform._array );
+				case 'v3v':
 
-			} else if ( type === 'm4' ) { // single THREE.Matrix4
+					// array of THREE.Vector3
 
-				_gl.uniformMatrix4fv( location, false, value.elements );
+					if ( uniform._array === undefined ) {
 
-			} else if ( type === 'm4v' ) { // array of THREE.Matrix4
+						uniform._array = new Float32Array( 3 * value.length );
 
-				if ( uniform._array === undefined ) {
+					}
 
-					uniform._array = new Float32Array( 16 * value.length );
+					for ( var i = 0, il = value.length; i < il; i ++ ) {
 
-				}
+						offset = i * 3;
 
-				for ( var i = 0, il = value.length; i < il; i ++ ) {
+						uniform._array[ offset ]   = value[ i ].x;
+						uniform._array[ offset + 1 ] = value[ i ].y;
+						uniform._array[ offset + 2 ] = value[ i ].z;
 
-					value[ i ].flattenToArrayOffset( uniform._array, i * 16 );
+					}
 
-				}
+					_gl.uniform3fv( location, uniform._array );
 
-				_gl.uniformMatrix4fv( location, false, uniform._array );
+					break;
 
-			} else if ( type === 't' ) { // single THREE.Texture (2d or cube)
+				case 'v4v':
 
-				texture = value;
-				textureUnit = getTextureUnit();
+					// array of THREE.Vector4
 
-				_gl.uniform1i( location, textureUnit );
+					if ( uniform._array === undefined ) {
 
-				if ( ! texture ) continue;
+						uniform._array = new Float32Array( 4 * value.length );
 
-				if ( texture instanceof THREE.CubeTexture ||
-				   ( texture.image instanceof Array && texture.image.length === 6 ) ) { // CompressedTexture can have Array in image :/
+					}
 
-					setCubeTexture( texture, textureUnit );
+					for ( var i = 0, il = value.length; i < il; i ++ ) {
 
-				} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
+						offset = i * 4;
 
-					setCubeTextureDynamic( texture, textureUnit );
+						uniform._array[ offset ]   = value[ i ].x;
+						uniform._array[ offset + 1 ] = value[ i ].y;
+						uniform._array[ offset + 2 ] = value[ i ].z;
+						uniform._array[ offset + 3 ] = value[ i ].w;
 
-				} else {
+					}
 
-					_this.setTexture( texture, textureUnit );
+					_gl.uniform4fv( location, uniform._array );
 
-				}
+					break;
 
-			} else if ( type === 'tv' ) { // array of THREE.Texture (2d)
+				case 'm3':
 
-				if ( uniform._array === undefined ) {
+					// single THREE.Matrix3
+					_gl.uniformMatrix3fv( location, false, value.elements );
 
-					uniform._array = [];
+					break;
 
-				}
+				case 'm3v':
 
-				for ( var i = 0, il = uniform.value.length; i < il; i ++ ) {
+					// array of THREE.Matrix3
 
-					uniform._array[ i ] = getTextureUnit();
+					if ( uniform._array === undefined ) {
 
-				}
+						uniform._array = new Float32Array( 9 * value.length );
+
+					}
+
+					for ( var i = 0, il = value.length; i < il; i ++ ) {
 
-				_gl.uniform1iv( location, uniform._array );
+						value[ i ].flattenToArrayOffset( uniform._array, i * 9 );
 
-				for ( var i = 0, il = uniform.value.length; i < il; i ++ ) {
+					}
+
+					_gl.uniformMatrix3fv( location, false, uniform._array );
+
+					break;
+
+				case 'm4':
+
+					// single THREE.Matrix4
+					_gl.uniformMatrix4fv( location, false, value.elements );
+
+					break;
+
+				case 'm4v':
+
+					// array of THREE.Matrix4
+
+					if ( uniform._array === undefined ) {
+
+						uniform._array = new Float32Array( 16 * value.length );
+
+					}
 
-					texture = uniform.value[ i ];
-					textureUnit = uniform._array[ i ];
+					for ( var i = 0, il = value.length; i < il; i ++ ) {
+
+						value[ i ].flattenToArrayOffset( uniform._array, i * 16 );
+
+					}
+
+					_gl.uniformMatrix4fv( location, false, uniform._array );
+
+					break;
+
+				case 't':
+
+					// single THREE.Texture (2d or cube)
+
+					texture = value;
+					textureUnit = getTextureUnit();
+
+					_gl.uniform1i( location, textureUnit );
 
 					if ( ! texture ) continue;
 
-					_this.setTexture( texture, textureUnit );
+					if ( texture instanceof THREE.CubeTexture ||
+					   ( texture.image instanceof Array && texture.image.length === 6 ) ) { // CompressedTexture can have Array in image :/
 
-				}
+						setCubeTexture( texture, textureUnit );
 
-			} else {
+					} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
+
+						setCubeTextureDynamic( texture, textureUnit );
+
+					} else {
+
+						_this.setTexture( texture, textureUnit );
+
+					}
+
+					break;
+
+				case 'tv':
+
+					// array of THREE.Texture (2d)
+
+					if ( uniform._array === undefined ) {
+
+						uniform._array = [];
+
+					}
+
+					for ( var i = 0, il = uniform.value.length; i < il; i ++ ) {
+
+						uniform._array[ i ] = getTextureUnit();
+
+					}
+
+					_gl.uniform1iv( location, uniform._array );
+
+					for ( var i = 0, il = uniform.value.length; i < il; i ++ ) {
+
+						texture = uniform.value[ i ];
+						textureUnit = uniform._array[ i ];
+
+						if ( ! texture ) continue;
+
+						_this.setTexture( texture, textureUnit );
+
+					}
+
+					break;
+
+				default:
 
-				console.warn( 'THREE.WebGLRenderer: Unknown uniform type: ' + type );
+					console.warn( 'THREE.WebGLRenderer: Unknown uniform type: ' + type );
 
 			}
 

+ 53 - 52
build/three.min.js

@@ -1,4 +1,4 @@
-// three.js / threejs.org/license
+// threejs.org/license
 'use strict';var THREE={REVISION:"68dev"};"object"===typeof module&&(module.exports=THREE);THREE.CullFaceNone=0;THREE.CullFaceBack=1;THREE.CullFaceFront=2;THREE.CullFaceFrontBack=3;THREE.FrontFaceDirectionCW=0;THREE.FrontFaceDirectionCCW=1;THREE.BasicShadowMap=0;THREE.PCFShadowMap=1;THREE.PCFSoftShadowMap=2;THREE.FrontSide=0;THREE.BackSide=1;THREE.DoubleSide=2;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NoBlending=0;
 THREE.NormalBlending=1;THREE.AdditiveBlending=2;THREE.SubtractiveBlending=3;THREE.MultiplyBlending=4;THREE.CustomBlending=5;THREE.AddEquation=100;THREE.SubtractEquation=101;THREE.ReverseSubtractEquation=102;THREE.ZeroFactor=200;THREE.OneFactor=201;THREE.SrcColorFactor=202;THREE.OneMinusSrcColorFactor=203;THREE.SrcAlphaFactor=204;THREE.OneMinusSrcAlphaFactor=205;THREE.DstAlphaFactor=206;THREE.OneMinusDstAlphaFactor=207;THREE.DstColorFactor=208;THREE.OneMinusDstColorFactor=209;
 THREE.SrcAlphaSaturateFactor=210;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.AddOperation=2;THREE.UVMapping=function(){};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.RepeatWrapping=1E3;THREE.ClampToEdgeWrapping=1001;THREE.MirroredRepeatWrapping=1002;THREE.NearestFilter=1003;THREE.NearestMipMapNearestFilter=1004;THREE.NearestMipMapLinearFilter=1005;
@@ -165,20 +165,20 @@ this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matri
 THREE.Object3DIdCount=0;
 THREE.Projector=function(){function a(){if(q===t){var a=new THREE.RenderableVertex;r.push(a);t++;q++;return a}return r[q++]}function b(){if(p===w){var a=new THREE.RenderableFace;v.push(a);w++;p++;return a}return v[p++]}function c(){if(D===x){var a=new THREE.RenderableLine;B.push(a);x++;D++;return a}return B[D++]}function d(){if(O===y){var a=new THREE.RenderableSprite;A.push(a);y++;O++;return a}return A[O++]}function e(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function f(a,b){var c=0,d=
 1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var g,h,k=[],l=0,n,q,r=[],t=0,s,p,v=[],w=0,u,D,B=[],x=0,C,O,A=[],y=0,M={objects:[],lights:[],elements:[]},Q=new THREE.Vector3,aa=new THREE.Vector3,H=new THREE.Vector3,z=new THREE.Vector3,K=new THREE.Vector4,E=new THREE.Box3(new THREE.Vector3(-1,
--1,-1),new THREE.Vector3(1,1,1)),P=new THREE.Box3,L=Array(3),R=new THREE.Matrix4,I=new THREE.Matrix4,T,Z=new THREE.Matrix4,X=new THREE.Matrix3,J=new THREE.Frustum,oa=new THREE.Vector4,V=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);I.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(I)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);I.multiplyMatrices(c.matrixWorld,
-a);return b.applyProjection(I)}}();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 U=new function(){var d=[],e=[],f=null,g=null,h=new THREE.Matrix3,k=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(T);c.copy(b).applyMatrix4(I);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},l=function(a,
+-1,-1),new THREE.Vector3(1,1,1)),P=new THREE.Box3,L=Array(3),R=new THREE.Matrix4,I=new THREE.Matrix4,S,Z=new THREE.Matrix4,X=new THREE.Matrix3,J=new THREE.Frustum,oa=new THREE.Vector4,V=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);I.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(I)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);I.multiplyMatrices(c.matrixWorld,
+a);return b.applyProjection(I)}}();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 T=new function(){var d=[],e=[],f=null,g=null,h=new THREE.Matrix3,k=function(a){var b=a.positionWorld,c=a.positionScreen;b.copy(a.position).applyMatrix4(S);c.copy(b).applyMatrix4(I);b=1/c.w;c.x*=b;c.y*=b;c.z*=b;a.visible=-1<=c.x&&1>=c.x&&-1<=c.y&&1>=c.y&&-1<=c.z&&1>=c.z},l=function(a,
 b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;L[0]=a.positionScreen;L[1]=b.positionScreen;L[2]=c.positionScreen;return E.isIntersectionBox(P.setFromPoints(L))},q=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:l,
 checkBackfaceCulling:q,pushVertex:function(b,c,d){n=a();n.position.set(b,c,d);k(n)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=r[a],e=r[b];u=c();u.id=f.id;u.v1.copy(d);u.v2.copy(e);u.z=(d.positionScreen.z+e.positionScreen.z)/2;u.material=f.material;M.elements.push(u)},pushTriangle:function(a,c,k){var n=r[a],p=r[c],t=r[k];if(!1!==l(n,p,t)&&(g.side===THREE.DoubleSide||!0===q(n,p,t))){s=b();s.id=f.id;s.v1.copy(n);s.v2.copy(p);s.v3.copy(t);
 s.z=(n.positionScreen.z+p.positionScreen.z+t.positionScreen.z)/3;for(n=0;3>n;n++)p=3*arguments[n],t=s.vertexNormalsModel[n],t.set(d[p],d[p+1],d[p+2]),t.applyMatrix3(h).normalize(),p=2*arguments[n],s.uvs[n].set(e[p],e[p+1]);s.vertexNormalsLength=3;s.material=f.material;M.elements.push(s)}}}};this.projectScene=function(n,t,w,v){O=D=p=0;M.elements.length=0;!0===n.autoUpdate&&n.updateMatrixWorld();void 0===t.parent&&t.updateMatrixWorld();R.copy(t.matrixWorldInverse.getInverse(t.matrixWorld));I.multiplyMatrices(t.projectionMatrix,
 R);J.setFromMatrix(I);h=0;M.objects.length=0;M.lights.length=0;n.traverseVisible(function(a){if(a instanceof THREE.Light)M.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===J.intersectsObject(a)){if(h===l){var b=new THREE.RenderableObject;k.push(b);l++;h++;g=b}else g=k[h++];g.id=a.id;g.object=a;null!==a.renderDepth?g.z=a.renderDepth:(z.setFromMatrixPosition(a.matrixWorld),z.applyProjection(I),g.z=z.z);M.objects.push(g)}});
-!0===w&&M.objects.sort(e);n=0;for(w=M.objects.length;n<w;n++){var B=M.objects[n].object,x=B.geometry;U.setObject(B);T=B.matrixWorld;q=0;if(B instanceof THREE.Mesh)if(x instanceof THREE.BufferGeometry){var A=x.attributes,B=x.offsets;if(void 0!==A.position){for(var y=A.position.array,x=0,F=y.length;x<F;x+=3)U.pushVertex(y[x],y[x+1],y[x+2]);if(void 0!==A.normal)for(var L=A.normal.array,x=0,F=L.length;x<F;x+=3)U.pushNormal(L[x],L[x+1],L[x+2]);if(void 0!==A.uv)for(L=A.uv.array,x=0,F=L.length;x<F;x+=2)U.pushUv(L[x],
-L[x+1]);if(void 0!==A.index)if(A=A.index.array,0<B.length)for(n=0;n<B.length;n++)for(F=B[n],y=F.index,x=F.start,F=F.start+F.count;x<F;x+=3)U.pushTriangle(A[x]+y,A[x+1]+y,A[x+2]+y);else for(x=0,F=A.length;x<F;x+=3)U.pushTriangle(A[x],A[x+1],A[x+2]);else for(x=0,F=y.length/3;x<F;x+=3)U.pushTriangle(x,x+1,x+2)}}else{if(x instanceof THREE.Geometry){var P=x.vertices,F=x.faces,A=x.faceVertexUvs[0];X.getNormalMatrix(T);for(var y=B.material instanceof THREE.MeshFaceMaterial,L=!0===y?B.material:null,E=0,da=
-P.length;E<da;E++){var ka=P[E];U.pushVertex(ka.x,ka.y,ka.z)}P=0;for(E=F.length;P<E;P++){var da=F[P],Fa=!0===y?L.materials[da.materialIndex]:B.material;if(void 0!==Fa){var ia=Fa.side,ka=r[da.a],Ca=r[da.b],Da=r[da.c];if(!0===Fa.morphTargets){var ta=x.morphTargets,Ka=B.morphTargetInfluences,$=ka.position,wa=Ca.position,Ga=Da.position;Q.set(0,0,0);aa.set(0,0,0);H.set(0,0,0);for(var La=0,Va=ta.length;La<Va;La++){var ma=Ka[La];if(0!==ma){var ya=ta[La].vertices;Q.x+=(ya[da.a].x-$.x)*ma;Q.y+=(ya[da.a].y-
-$.y)*ma;Q.z+=(ya[da.a].z-$.z)*ma;aa.x+=(ya[da.b].x-wa.x)*ma;aa.y+=(ya[da.b].y-wa.y)*ma;aa.z+=(ya[da.b].z-wa.z)*ma;H.x+=(ya[da.c].x-Ga.x)*ma;H.y+=(ya[da.c].y-Ga.y)*ma;H.z+=(ya[da.c].z-Ga.z)*ma}}ka.position.add(Q);Ca.position.add(aa);Da.position.add(H);U.projectVertex(ka);U.projectVertex(Ca);U.projectVertex(Da)}if(!1!==U.checkTriangleVisibility(ka,Ca,Da)){ta=U.checkBackfaceCulling(ka,Ca,Da);if(ia!==THREE.DoubleSide){if(ia===THREE.FrontSide&&!1===ta)continue;if(ia===THREE.BackSide&&!0===ta)continue}s=
+!0===w&&M.objects.sort(e);n=0;for(w=M.objects.length;n<w;n++){var B=M.objects[n].object,x=B.geometry;T.setObject(B);S=B.matrixWorld;q=0;if(B instanceof THREE.Mesh)if(x instanceof THREE.BufferGeometry){var A=x.attributes,B=x.offsets;if(void 0!==A.position){for(var y=A.position.array,x=0,F=y.length;x<F;x+=3)T.pushVertex(y[x],y[x+1],y[x+2]);if(void 0!==A.normal)for(var L=A.normal.array,x=0,F=L.length;x<F;x+=3)T.pushNormal(L[x],L[x+1],L[x+2]);if(void 0!==A.uv)for(L=A.uv.array,x=0,F=L.length;x<F;x+=2)T.pushUv(L[x],
+L[x+1]);if(void 0!==A.index)if(A=A.index.array,0<B.length)for(n=0;n<B.length;n++)for(F=B[n],y=F.index,x=F.start,F=F.start+F.count;x<F;x+=3)T.pushTriangle(A[x]+y,A[x+1]+y,A[x+2]+y);else for(x=0,F=A.length;x<F;x+=3)T.pushTriangle(A[x],A[x+1],A[x+2]);else for(x=0,F=y.length/3;x<F;x+=3)T.pushTriangle(x,x+1,x+2)}}else{if(x instanceof THREE.Geometry){var P=x.vertices,F=x.faces,A=x.faceVertexUvs[0];X.getNormalMatrix(S);for(var y=B.material instanceof THREE.MeshFaceMaterial,L=!0===y?B.material:null,E=0,da=
+P.length;E<da;E++){var ka=P[E];T.pushVertex(ka.x,ka.y,ka.z)}P=0;for(E=F.length;P<E;P++){var da=F[P],Fa=!0===y?L.materials[da.materialIndex]:B.material;if(void 0!==Fa){var ia=Fa.side,ka=r[da.a],Ca=r[da.b],Da=r[da.c];if(!0===Fa.morphTargets){var ta=x.morphTargets,Ka=B.morphTargetInfluences,$=ka.position,wa=Ca.position,Ga=Da.position;Q.set(0,0,0);aa.set(0,0,0);H.set(0,0,0);for(var La=0,Va=ta.length;La<Va;La++){var ma=Ka[La];if(0!==ma){var ya=ta[La].vertices;Q.x+=(ya[da.a].x-$.x)*ma;Q.y+=(ya[da.a].y-
+$.y)*ma;Q.z+=(ya[da.a].z-$.z)*ma;aa.x+=(ya[da.b].x-wa.x)*ma;aa.y+=(ya[da.b].y-wa.y)*ma;aa.z+=(ya[da.b].z-wa.z)*ma;H.x+=(ya[da.c].x-Ga.x)*ma;H.y+=(ya[da.c].y-Ga.y)*ma;H.z+=(ya[da.c].z-Ga.z)*ma}}ka.position.add(Q);Ca.position.add(aa);Da.position.add(H);T.projectVertex(ka);T.projectVertex(Ca);T.projectVertex(Da)}if(!1!==T.checkTriangleVisibility(ka,Ca,Da)){ta=T.checkBackfaceCulling(ka,Ca,Da);if(ia!==THREE.DoubleSide){if(ia===THREE.FrontSide&&!1===ta)continue;if(ia===THREE.BackSide&&!0===ta)continue}s=
 b();s.id=B.id;s.v1.copy(ka);s.v2.copy(Ca);s.v3.copy(Da);s.normalModel.copy(da.normal);!1!==ta||ia!==THREE.BackSide&&ia!==THREE.DoubleSide||s.normalModel.negate();s.normalModel.applyMatrix3(X).normalize();Ka=da.vertexNormals;$=0;for(wa=Math.min(Ka.length,3);$<wa;$++)Ga=s.vertexNormalsModel[$],Ga.copy(Ka[$]),!1!==ta||ia!==THREE.BackSide&&ia!==THREE.DoubleSide||Ga.negate(),Ga.applyMatrix3(X).normalize();s.vertexNormalsLength=Ka.length;ia=A[P];if(void 0!==ia)for(ta=0;3>ta;ta++)s.uvs[ta].copy(ia[ta]);
-s.color=da.color;s.material=Fa;s.z=(ka.positionScreen.z+Ca.positionScreen.z+Da.positionScreen.z)/3;M.elements.push(s)}}}}}else if(B instanceof THREE.Line)if(x instanceof THREE.BufferGeometry){if(A=x.attributes,void 0!==A.position){y=A.position.array;x=0;for(F=y.length;x<F;x+=3)U.pushVertex(y[x],y[x+1],y[x+2]);if(void 0!==A.index)for(A=A.index.array,x=0,F=A.length;x<F;x+=2)U.pushLine(A[x],A[x+1]);else for(A=B.type===THREE.LinePieces?2:1,x=0,F=y.length/3-1;x<F;x+=A)U.pushLine(x,x+1)}}else{if(x instanceof
-THREE.Geometry&&(Z.multiplyMatrices(I,T),P=B.geometry.vertices,0!==P.length))for(ka=a(),ka.positionScreen.copy(P[0]).applyMatrix4(Z),A=B.type===THREE.LinePieces?2:1,E=1,da=P.length;E<da;E++)ka=a(),ka.positionScreen.copy(P[E]).applyMatrix4(Z),0<(E+1)%A||(Ca=r[q-2],oa.copy(ka.positionScreen),V.copy(Ca.positionScreen),!0===f(oa,V)&&(oa.multiplyScalar(1/oa.w),V.multiplyScalar(1/V.w),u=c(),u.id=B.id,u.v1.positionScreen.copy(oa),u.v2.positionScreen.copy(V),u.z=Math.max(oa.z,V.z),u.material=B.material,B.material.vertexColors===
-THREE.VertexColors&&(u.vertexColors[0].copy(B.geometry.colors[E]),u.vertexColors[1].copy(B.geometry.colors[E-1])),M.elements.push(u)))}else B instanceof THREE.Sprite&&(K.set(T.elements[12],T.elements[13],T.elements[14],1),K.applyMatrix4(I),x=1/K.w,K.z*=x,-1<=K.z&&1>=K.z&&(C=d(),C.id=B.id,C.x=K.x*x,C.y=K.y*x,C.z=K.z,C.object=B,C.rotation=B.rotation,C.scale.x=B.scale.x*Math.abs(C.x-(K.x+t.projectionMatrix.elements[0])/(K.w+t.projectionMatrix.elements[12])),C.scale.y=B.scale.y*Math.abs(C.y-(K.y+t.projectionMatrix.elements[5])/
+s.color=da.color;s.material=Fa;s.z=(ka.positionScreen.z+Ca.positionScreen.z+Da.positionScreen.z)/3;M.elements.push(s)}}}}}else if(B instanceof THREE.Line)if(x instanceof THREE.BufferGeometry){if(A=x.attributes,void 0!==A.position){y=A.position.array;x=0;for(F=y.length;x<F;x+=3)T.pushVertex(y[x],y[x+1],y[x+2]);if(void 0!==A.index)for(A=A.index.array,x=0,F=A.length;x<F;x+=2)T.pushLine(A[x],A[x+1]);else for(A=B.type===THREE.LinePieces?2:1,x=0,F=y.length/3-1;x<F;x+=A)T.pushLine(x,x+1)}}else{if(x instanceof
+THREE.Geometry&&(Z.multiplyMatrices(I,S),P=B.geometry.vertices,0!==P.length))for(ka=a(),ka.positionScreen.copy(P[0]).applyMatrix4(Z),A=B.type===THREE.LinePieces?2:1,E=1,da=P.length;E<da;E++)ka=a(),ka.positionScreen.copy(P[E]).applyMatrix4(Z),0<(E+1)%A||(Ca=r[q-2],oa.copy(ka.positionScreen),V.copy(Ca.positionScreen),!0===f(oa,V)&&(oa.multiplyScalar(1/oa.w),V.multiplyScalar(1/V.w),u=c(),u.id=B.id,u.v1.positionScreen.copy(oa),u.v2.positionScreen.copy(V),u.z=Math.max(oa.z,V.z),u.material=B.material,B.material.vertexColors===
+THREE.VertexColors&&(u.vertexColors[0].copy(B.geometry.colors[E]),u.vertexColors[1].copy(B.geometry.colors[E-1])),M.elements.push(u)))}else B instanceof THREE.Sprite&&(K.set(S.elements[12],S.elements[13],S.elements[14],1),K.applyMatrix4(I),x=1/K.w,K.z*=x,-1<=K.z&&1>=K.z&&(C=d(),C.id=B.id,C.x=K.x*x,C.y=K.y*x,C.z=K.z,C.object=B,C.rotation=B.rotation,C.scale.x=B.scale.x*Math.abs(C.x-(K.x+t.projectionMatrix.elements[0])/(K.w+t.projectionMatrix.elements[12])),C.scale.y=B.scale.y*Math.abs(C.y-(K.y+t.projectionMatrix.elements[5])/
 (K.w+t.projectionMatrix.elements[13])),C.material=B.material,M.elements.push(C)))}!0===v&&M.elements.sort(e);return M}};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};
 THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.materialIndex=this.materialIndex;for(var b=0,c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}};
 THREE.Face4=function(a,b,c,d,e,f,g){console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead.");return new THREE.Face3(a,b,c,e,f,g)};THREE.BufferAttribute=function(a,b){this.array=a;this.itemSize=b};
@@ -199,10 +199,10 @@ v=e[0][r][1],w=e[0][r][2],q[t]=p.x,q[t+1]=p.y,q[t+2]=v.x,q[t+3]=v.y,q[t+4]=w.x,q
 computeFaceNormals:function(){},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 for(a=0,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,g,h,k,l,n,q,r=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,p=new THREE.Vector3,v=new THREE.Vector3;
 if(this.attributes.index){var w=this.attributes.index.array,u=0<this.offsets.length?this.offsets:[{start:0,count:w.length,index:0}];c=0;for(d=u.length;c<d;++c){b=u[c].start;g=u[c].count;var D=u[c].index;a=b;for(b+=g;a<b;a+=3)g=D+w[a],h=D+w[a+1],k=D+w[a+2],l=e[3*g],n=e[3*g+1],q=e[3*g+2],r.set(l,n,q),l=e[3*h],n=e[3*h+1],q=e[3*h+2],t.set(l,n,q),l=e[3*k],n=e[3*k+1],q=e[3*k+2],s.set(l,n,q),p.subVectors(s,t),v.subVectors(r,t),p.cross(v),f[3*g]+=p.x,f[3*g+1]+=p.y,f[3*g+2]+=p.z,f[3*h]+=p.x,f[3*h+1]+=p.y,
 f[3*h+2]+=p.z,f[3*k]+=p.x,f[3*k+1]+=p.y,f[3*k+2]+=p.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],n=e[a+1],q=e[a+2],r.set(l,n,q),l=e[a+3],n=e[a+4],q=e[a+5],t.set(l,n,q),l=e[a+6],n=e[a+7],q=e[a+8],s.set(l,n,q),p.subVectors(s,t),v.subVectors(r,t),p.cross(v),f[a]=p.x,f[a+1]=p.y,f[a+2]=p.z,f[a+3]=p.x,f[a+4]=p.y,f[a+5]=p.z,f[a+6]=p.x,f[a+7]=p.y,f[a+8]=p.z;this.normalizeNormals();this.normalsNeedUpdate=!0}},computeTangents:function(){function a(a,b,c){q=d[3*a];r=d[3*a+1];t=d[3*a+2];s=d[3*b];p=d[3*b+1];v=d[3*
-b+2];w=d[3*c];u=d[3*c+1];D=d[3*c+2];B=f[2*a];x=f[2*a+1];C=f[2*b];O=f[2*b+1];A=f[2*c];y=f[2*c+1];M=s-q;Q=w-q;aa=p-r;H=u-r;z=v-t;K=D-t;E=C-B;P=A-B;L=O-x;R=y-x;I=1/(E*R-P*L);T.set((R*M-L*Q)*I,(R*aa-L*H)*I,(R*z-L*K)*I);Z.set((E*Q-P*M)*I,(E*H-P*aa)*I,(E*K-P*z)*I);k[a].add(T);k[b].add(T);k[c].add(T);l[a].add(Z);l[b].add(Z);l[c].add(Z)}function b(a){qa.x=e[3*a];qa.y=e[3*a+1];qa.z=e[3*a+2];Pa.copy(qa);sa=k[a];Ea.copy(sa);Ea.sub(qa.multiplyScalar(qa.dot(sa))).normalize();Ba.crossVectors(Pa,sa);F=Ba.dot(l[a]);
+b+2];w=d[3*c];u=d[3*c+1];D=d[3*c+2];B=f[2*a];x=f[2*a+1];C=f[2*b];O=f[2*b+1];A=f[2*c];y=f[2*c+1];M=s-q;Q=w-q;aa=p-r;H=u-r;z=v-t;K=D-t;E=C-B;P=A-B;L=O-x;R=y-x;I=1/(E*R-P*L);S.set((R*M-L*Q)*I,(R*aa-L*H)*I,(R*z-L*K)*I);Z.set((E*Q-P*M)*I,(E*H-P*aa)*I,(E*K-P*z)*I);k[a].add(S);k[b].add(S);k[c].add(S);l[a].add(Z);l[b].add(Z);l[c].add(Z)}function b(a){qa.x=e[3*a];qa.y=e[3*a+1];qa.z=e[3*a+2];Pa.copy(qa);sa=k[a];Ea.copy(sa);Ea.sub(qa.multiplyScalar(qa.dot(sa))).normalize();Ba.crossVectors(Pa,sa);F=Ba.dot(l[a]);
 Qa=0>F?-1:1;h[4*a]=Ea.x;h[4*a+1]=Ea.y;h[4*a+2]=Ea.z;h[4*a+3]=Qa}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&(this.attributes.tangent=
-{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var q,r,t,s,p,v,w,u,D,B,x,C,O,A,y,M,Q,aa,H,z,K,E,P,L,R,I,T=new THREE.Vector3,Z=new THREE.Vector3,X,J,oa,V,U,la=this.offsets,n=0;for(J=la.length;n<J;++n){X=la[n].start;oa=la[n].count;var za=la[n].index,g=X;for(X+=oa;g<X;g+=3)oa=za+c[g],V=za+c[g+1],U=za+c[g+2],a(oa,V,U)}var Ea=new THREE.Vector3,Ba=new THREE.Vector3,qa=new THREE.Vector3,Pa=new THREE.Vector3,
-Qa,sa,F,n=0;for(J=la.length;n<J;++n)for(X=la[n].start,oa=la[n].count,za=la[n].index,g=X,X+=oa;g<X;g+=3)oa=za+c[g],V=za+c[g+1],U=za+c[g+2],b(oa),b(V),b(U)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,q=new Int32Array(6),r=new Int32Array(c.length),t=new Int32Array(c.length),s=0;s<c.length;s++)r[s]=-1,t[s]=-1;for(c=
+{itemSize:4,array:new Float32Array(4*g)});for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<g;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var q,r,t,s,p,v,w,u,D,B,x,C,O,A,y,M,Q,aa,H,z,K,E,P,L,R,I,S=new THREE.Vector3,Z=new THREE.Vector3,X,J,oa,V,T,la=this.offsets,n=0;for(J=la.length;n<J;++n){X=la[n].start;oa=la[n].count;var za=la[n].index,g=X;for(X+=oa;g<X;g+=3)oa=za+c[g],V=za+c[g+1],T=za+c[g+2],a(oa,V,T)}var Ea=new THREE.Vector3,Ba=new THREE.Vector3,qa=new THREE.Vector3,Pa=new THREE.Vector3,
+Qa,sa,F,n=0;for(J=la.length;n<J;++n)for(X=la[n].start,oa=la[n].count,za=la[n].index,g=X,X+=oa;g<X;g+=3)oa=za+c[g],V=za+c[g+1],T=za+c[g+2],b(oa),b(V),b(T)}},computeOffsets:function(a){var b=a;void 0===a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),f=0,g=0,h=[{start:0,count:0,index:0}],k=h[0],l=0,n=0,q=new Int32Array(6),r=new Int32Array(c.length),t=new Int32Array(c.length),s=0;s<c.length;s++)r[s]=-1,t[s]=-1;for(c=
 0;c<d;c++){for(var p=n=0;3>p;p++)s=a[3*c+p],-1==r[s]?(q[2*p]=s,q[2*p+1]=-1,n++):r[s]<k.index?(q[2*p]=s,q[2*p+1]=-1,l++):(q[2*p]=s,q[2*p+1]=r[s]);if(g+n>k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)p=q[n+1],-1<p&&p<k.index&&(q[n+1]=-1);for(n=0;6>n;n+=2)s=q[n],p=q[n+1],-1===p&&(p=g++),r[s]=p,t[p]=s,e[f++]=p-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array,
 b,c,d,e=0,f=a.length;e<f;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],f;for(f in this.attributes)if("index"!=f)for(var g=this.attributes[f].array,h=0,k=e.length;h<k;h++){var l=e[h];if(g instanceof l){d[f]=new l(this.attributes[f].itemSize*c);break}}for(e=0;e<c;e++)for(f in g=b[e],this.attributes)if("index"!=
 f)for(var h=this.attributes[f].array,k=this.attributes[f].itemSize,l=d[f],n=0;n<k;n++)l[e*k+n]=h[g*k+n];this.attributes.index.array=a;for(f in this.attributes)"index"!=f&&(this.attributes[f].array=d[f],this.attributes[f].numItems=this.attributes[f].itemSize*c)},clone:function(){var a=new THREE.BufferGeometry,b=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],c;for(c in this.attributes){for(var d=this.attributes[c],e=d.array,f={itemSize:d.itemSize,
@@ -366,21 +366,21 @@ THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),th
 THREE.CanvasRenderer=function(a){function b(a,b,c,d){l(b);n(c);q(d);r(a.getStyle());z.stroke();wa.expandByScalar(2*b)}function c(a){t(a.getStyle());z.fill()}function d(a){e(a.target)}function e(a){if(!(a instanceof THREE.CompressedTexture)){var b=a.wrapS===THREE.RepeatWrapping,c=a.wrapT===THREE.RepeatWrapping,d=a.image,e=document.createElement("canvas");e.width=d.width;e.height=d.height;var f=e.getContext("2d");f.setTransform(1,0,0,-1,0,d.height);f.drawImage(d,0,0);Za[a.id]=z.createPattern(e,!0===
 b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":!1===b&&!0===c?"repeat-y":"no-repeat")}}function f(a,b,c,f,g,h,k,l,n,r,q,s,p){if(!(p instanceof THREE.DataTexture)){!1===p.hasEventListener("update",d)&&(void 0!==p.image&&0<p.image.width&&e(p),p.addEventListener("update",d));var w=Za[p.id];if(void 0!==w){t(w);var w=p.offset.x/p.repeat.x,m=p.offset.y/p.repeat.y,u=p.image.width*p.repeat.x;p=p.image.height*p.repeat.y;k=(k+w)*u;l=(l+m)*p;c-=a;f-=b;g-=a;h-=b;n=(n+w)*u-k;r=(r+m)*p-l;q=(q+w)*u-k;s=(s+m)*p-l;
 p=n*s-q*r;0!==p&&(w=1/p,p=(s*c-r*g)*w,r=(s*f-r*h)*w,c=(n*g-q*c)*w,f=(n*h-q*f)*w,a=a-p*k-c*l,b=b-r*k-f*l,z.save(),z.transform(p,r,c,f,a,b),z.fill(),z.restore())}else t("rgba(0,0,0,1)"),z.fill()}}function g(a,b,c){var d=b.x-a.x,e=b.y-a.y,f=d*d+e*e;0!==f&&(c/=Math.sqrt(f),d*=c,e*=c,b.x+=d,b.y+=e,a.x-=d,a.y-=e)}function h(a){P!==a&&(P=z.globalAlpha=a)}function k(a){L!==a&&(a===THREE.NormalBlending?z.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?z.globalCompositeOperation="lighter":
-a===THREE.SubtractiveBlending&&(z.globalCompositeOperation="darker"),L=a)}function l(a){T!==a&&(T=z.lineWidth=a)}function n(a){Z!==a&&(Z=z.lineCap=a)}function q(a){X!==a&&(X=z.lineJoin=a)}function r(a){R!==a&&(R=z.strokeStyle=a)}function t(a){I!==a&&(I=z.fillStyle=a)}function s(a){J.length!==a.length&&(z.setLineDash(a),J=a)}console.log("THREE.CanvasRenderer",THREE.REVISION);var p=THREE.Math.smoothstep;a=a||{};var v=this,w,u,D,B=new THREE.Projector,x=void 0!==a.canvas?a.canvas:document.createElement("canvas"),
-C=x.width,O=x.height,A=Math.floor(C/2),y=Math.floor(O/2),M=0,Q=0,aa=C,H=O,z=x.getContext("2d",{alpha:!0===a.alpha}),K=new THREE.Color(0),E=0,P=1,L=0,R=null,I=null,T=null,Z=null,X=null,J=[],oa,V,U,la;new THREE.RenderableVertex;new THREE.RenderableVertex;var za,Ea,Ba,qa,Pa,Qa,sa=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var F=new THREE.Color,Ja=new THREE.Color,Ta=new THREE.Color,Za={},da,ka,Fa,ia,Ca,Da,ta,Ka=new THREE.Box2,$=new THREE.Box2,wa=new THREE.Box2,Ga=
+a===THREE.SubtractiveBlending&&(z.globalCompositeOperation="darker"),L=a)}function l(a){S!==a&&(S=z.lineWidth=a)}function n(a){Z!==a&&(Z=z.lineCap=a)}function q(a){X!==a&&(X=z.lineJoin=a)}function r(a){R!==a&&(R=z.strokeStyle=a)}function t(a){I!==a&&(I=z.fillStyle=a)}function s(a){J.length!==a.length&&(z.setLineDash(a),J=a)}console.log("THREE.CanvasRenderer",THREE.REVISION);var p=THREE.Math.smoothstep;a=a||{};var v=this,w,u,D,B=new THREE.Projector,x=void 0!==a.canvas?a.canvas:document.createElement("canvas"),
+C=x.width,O=x.height,A=Math.floor(C/2),y=Math.floor(O/2),M=0,Q=0,aa=C,H=O,z=x.getContext("2d",{alpha:!0===a.alpha}),K=new THREE.Color(0),E=0,P=1,L=0,R=null,I=null,S=null,Z=null,X=null,J=[],oa,V,T,la;new THREE.RenderableVertex;new THREE.RenderableVertex;var za,Ea,Ba,qa,Pa,Qa,sa=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var F=new THREE.Color,Ja=new THREE.Color,Ta=new THREE.Color,Za={},da,ka,Fa,ia,Ca,Da,ta,Ka=new THREE.Box2,$=new THREE.Box2,wa=new THREE.Box2,Ga=
 new THREE.Color,La=new THREE.Color,Va=new THREE.Color,ma=new THREE.Vector3,ya=new THREE.Vector3,pa=new THREE.Vector3,Aa=new THREE.Matrix3;void 0===z.setLineDash&&(z.setLineDash=function(){});this.domElement=x;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=
-function(a,b,c){C=a*this.devicePixelRatio;O=b*this.devicePixelRatio;x.width=C;x.height=O;A=Math.floor(C/2);y=Math.floor(O/2);!1!==c&&(x.style.width=a+"px",x.style.height=b+"px");Ka.min.set(-A,-y);Ka.max.set(A,y);$.min.set(-A,-y);$.max.set(A,y);P=1;L=0;X=Z=T=I=R=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){M=a*this.devicePixelRatio;Q=b*this.devicePixelRatio;aa=c*this.devicePixelRatio;H=d*this.devicePixelRatio};this.setScissor=function(){};this.enableScissorTest=function(){};this.setClearColor=
+function(a,b,c){C=a*this.devicePixelRatio;O=b*this.devicePixelRatio;x.width=C;x.height=O;A=Math.floor(C/2);y=Math.floor(O/2);!1!==c&&(x.style.width=a+"px",x.style.height=b+"px");Ka.min.set(-A,-y);Ka.max.set(A,y);$.min.set(-A,-y);$.max.set(A,y);P=1;L=0;X=Z=S=I=R=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){M=a*this.devicePixelRatio;Q=b*this.devicePixelRatio;aa=c*this.devicePixelRatio;H=d*this.devicePixelRatio};this.setScissor=function(){};this.enableScissorTest=function(){};this.setClearColor=
 function(a,b){K.set(a);E=void 0!==b?b:1;$.min.set(-A,-y);$.max.set(A,y)};this.setClearColorHex=function(a,b){console.warn("THREE.CanvasRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){!1===$.empty()&&($.intersect(Ka),$.expandByScalar(2),$.min.x+=A,$.min.y=-$.min.y+y,$.max.x+=A,$.max.y=-$.max.y+y,1>E&&z.clearRect($.min.x|0,$.min.y|0,$.max.x-$.min.x|0,$.max.y-$.min.y|0),0<E&&(k(THREE.NormalBlending),
 h(1),t("rgba("+Math.floor(255*K.r)+","+Math.floor(255*K.g)+","+Math.floor(255*K.b)+","+E+")"),z.fillRect($.min.x|0,$.min.y|0,$.max.x-$.min.x|0,$.max.y-$.min.y|0)),$.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,x){if(!1===x instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");else{!0===this.autoClear&&this.clear();v.info.render.vertices=0;v.info.render.faces=
 0;z.setTransform(aa/C,0,0,-H/O,M,O-Q);z.translate(A,y);w=B.projectScene(a,x,this.sortObjects,this.sortElements);u=w.elements;D=w.lights;oa=x;Aa.getNormalMatrix(x.matrixWorldInverse);Ga.setRGB(0,0,0);La.setRGB(0,0,0);Va.setRGB(0,0,0);for(var L=0,P=D.length;L<P;L++){var E=D[L],J=E.color;E instanceof THREE.AmbientLight?Ga.add(J):E instanceof THREE.DirectionalLight?La.add(J):E instanceof THREE.PointLight&&Va.add(J)}L=0;for(P=u.length;L<P;L++){var K=u[L],I=K.material;if(void 0!==I&&0!==I.opacity){wa.makeEmpty();
-if(K instanceof THREE.RenderableSprite){V=K;V.x*=A;V.y*=y;var E=V,R=K,J=I;h(J.opacity);k(J.blending);var T=R.scale.x*A,R=R.scale.y*y,K=0.5*Math.sqrt(T*T+R*R);wa.min.set(E.x-K,E.y-K);wa.max.set(E.x+K,E.y+K);if(J instanceof THREE.SpriteMaterial){var ba=J.map;if(null!==ba&&void 0!==ba.image){!1===ba.hasEventListener("update",d)&&(0<ba.image.width&&e(ba),ba.addEventListener("update",d));K=Za[ba.id];void 0!==K?t(K):t("rgba( 0, 0, 0, 1 )");var ca=ba.image,K=ca.width*ba.offset.x,I=ca.height*ba.offset.y,
-Z=ca.width*ba.repeat.x,ba=ca.height*ba.repeat.y,ca=T/Z,X=R/ba;z.save();z.translate(E.x,E.y);0!==J.rotation&&z.rotate(J.rotation);z.translate(-T/2,-R/2);z.scale(ca,X);z.translate(-K,-I);z.fillRect(K,I,Z,ba)}else t(J.color.getStyle()),z.save(),z.translate(E.x,E.y),0!==J.rotation&&z.rotate(J.rotation),z.scale(T,-R),z.fillRect(-0.5,-0.5,1,1);z.restore()}else J instanceof THREE.SpriteCanvasMaterial&&(r(J.color.getStyle()),t(J.color.getStyle()),z.save(),z.translate(E.x,E.y),0!==J.rotation&&z.rotate(J.rotation),
-z.scale(T,R),J.program(z),z.restore())}else if(K instanceof THREE.RenderableLine){if(V=K.v1,U=K.v2,V.positionScreen.x*=A,V.positionScreen.y*=y,U.positionScreen.x*=A,U.positionScreen.y*=y,wa.setFromPoints([V.positionScreen,U.positionScreen]),!0===Ka.isIntersectionBox(wa))if(E=V,J=U,T=K,R=I,h(R.opacity),k(R.blending),z.beginPath(),z.moveTo(E.positionScreen.x,E.positionScreen.y),z.lineTo(J.positionScreen.x,J.positionScreen.y),R instanceof THREE.LineBasicMaterial){l(R.linewidth);n(R.linecap);q(R.linejoin);
-if(R.vertexColors!==THREE.VertexColors)r(R.color.getStyle());else if(K=T.vertexColors[0].getStyle(),T=T.vertexColors[1].getStyle(),K===T)r(K);else{try{var m=z.createLinearGradient(E.positionScreen.x,E.positionScreen.y,J.positionScreen.x,J.positionScreen.y);m.addColorStop(0,K);m.addColorStop(1,T)}catch(ub){m=K}r(m)}z.stroke();wa.expandByScalar(2*R.linewidth)}else R instanceof THREE.LineDashedMaterial&&(l(R.linewidth),n(R.linecap),q(R.linejoin),r(R.color.getStyle()),s([R.dashSize,R.gapSize]),z.stroke(),
-wa.expandByScalar(2*R.linewidth),s([]))}else if(K instanceof THREE.RenderableFace){V=K.v1;U=K.v2;la=K.v3;if(-1>V.positionScreen.z||1<V.positionScreen.z)continue;if(-1>U.positionScreen.z||1<U.positionScreen.z)continue;if(-1>la.positionScreen.z||1<la.positionScreen.z)continue;V.positionScreen.x*=A;V.positionScreen.y*=y;U.positionScreen.x*=A;U.positionScreen.y*=y;la.positionScreen.x*=A;la.positionScreen.y*=y;0<I.overdraw&&(g(V.positionScreen,U.positionScreen,I.overdraw),g(U.positionScreen,la.positionScreen,
-I.overdraw),g(la.positionScreen,V.positionScreen,I.overdraw));wa.setFromPoints([V.positionScreen,U.positionScreen,la.positionScreen]);if(!0===Ka.isIntersectionBox(wa)){J=V;T=U;R=la;E=I;v.info.render.vertices+=3;v.info.render.faces++;h(E.opacity);k(E.blending);za=J.positionScreen.x;Ea=J.positionScreen.y;Ba=T.positionScreen.x;qa=T.positionScreen.y;Pa=R.positionScreen.x;Qa=R.positionScreen.y;var I=za,Z=Ea,ba=Ba,ca=qa,X=Pa,qb=Qa;z.beginPath();z.moveTo(I,Z);z.lineTo(ba,ca);z.lineTo(X,qb);z.closePath();
-if((E instanceof THREE.MeshLambertMaterial||E instanceof THREE.MeshPhongMaterial)&&null===E.map){F.copy(E.color);Ja.copy(E.emissive);E.vertexColors===THREE.FaceColors&&F.multiply(K.color);sa.copy(Ga);ya.copy(J.positionWorld).add(T.positionWorld).add(R.positionWorld).divideScalar(3);J=ya;T=K.normalModel;R=sa;K=0;for(I=D.length;K<I;K++)Z=D[K],Ta.copy(Z.color),Z instanceof THREE.DirectionalLight?(ba=ma.setFromMatrixPosition(Z.matrixWorld).normalize(),ca=T.dot(ba),0>=ca||(ca*=Z.intensity,R.add(Ta.multiplyScalar(ca)))):
-Z instanceof THREE.PointLight&&(ba=ma.setFromMatrixPosition(Z.matrixWorld),ca=T.dot(ma.subVectors(ba,J).normalize()),0>=ca||(ca*=0==Z.distance?1:1-Math.min(J.distanceTo(ba)/Z.distance,1),0!=ca&&(ca*=Z.intensity,R.add(Ta.multiplyScalar(ca)))));sa.multiply(F).add(Ja);!0===E.wireframe?b(sa,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(sa)}else E instanceof THREE.MeshBasicMaterial||E instanceof THREE.MeshLambertMaterial||E instanceof THREE.MeshPhongMaterial?null!==E.map?E.map.mapping instanceof
+if(K instanceof THREE.RenderableSprite){V=K;V.x*=A;V.y*=y;var E=V,R=K,J=I;h(J.opacity);k(J.blending);var S=R.scale.x*A,R=R.scale.y*y,K=0.5*Math.sqrt(S*S+R*R);wa.min.set(E.x-K,E.y-K);wa.max.set(E.x+K,E.y+K);if(J instanceof THREE.SpriteMaterial){var ba=J.map;if(null!==ba&&void 0!==ba.image){!1===ba.hasEventListener("update",d)&&(0<ba.image.width&&e(ba),ba.addEventListener("update",d));K=Za[ba.id];void 0!==K?t(K):t("rgba( 0, 0, 0, 1 )");var ca=ba.image,K=ca.width*ba.offset.x,I=ca.height*ba.offset.y,
+Z=ca.width*ba.repeat.x,ba=ca.height*ba.repeat.y,ca=S/Z,X=R/ba;z.save();z.translate(E.x,E.y);0!==J.rotation&&z.rotate(J.rotation);z.translate(-S/2,-R/2);z.scale(ca,X);z.translate(-K,-I);z.fillRect(K,I,Z,ba)}else t(J.color.getStyle()),z.save(),z.translate(E.x,E.y),0!==J.rotation&&z.rotate(J.rotation),z.scale(S,-R),z.fillRect(-0.5,-0.5,1,1);z.restore()}else J instanceof THREE.SpriteCanvasMaterial&&(r(J.color.getStyle()),t(J.color.getStyle()),z.save(),z.translate(E.x,E.y),0!==J.rotation&&z.rotate(J.rotation),
+z.scale(S,R),J.program(z),z.restore())}else if(K instanceof THREE.RenderableLine){if(V=K.v1,T=K.v2,V.positionScreen.x*=A,V.positionScreen.y*=y,T.positionScreen.x*=A,T.positionScreen.y*=y,wa.setFromPoints([V.positionScreen,T.positionScreen]),!0===Ka.isIntersectionBox(wa))if(E=V,J=T,S=K,R=I,h(R.opacity),k(R.blending),z.beginPath(),z.moveTo(E.positionScreen.x,E.positionScreen.y),z.lineTo(J.positionScreen.x,J.positionScreen.y),R instanceof THREE.LineBasicMaterial){l(R.linewidth);n(R.linecap);q(R.linejoin);
+if(R.vertexColors!==THREE.VertexColors)r(R.color.getStyle());else if(K=S.vertexColors[0].getStyle(),S=S.vertexColors[1].getStyle(),K===S)r(K);else{try{var m=z.createLinearGradient(E.positionScreen.x,E.positionScreen.y,J.positionScreen.x,J.positionScreen.y);m.addColorStop(0,K);m.addColorStop(1,S)}catch(ub){m=K}r(m)}z.stroke();wa.expandByScalar(2*R.linewidth)}else R instanceof THREE.LineDashedMaterial&&(l(R.linewidth),n(R.linecap),q(R.linejoin),r(R.color.getStyle()),s([R.dashSize,R.gapSize]),z.stroke(),
+wa.expandByScalar(2*R.linewidth),s([]))}else if(K instanceof THREE.RenderableFace){V=K.v1;T=K.v2;la=K.v3;if(-1>V.positionScreen.z||1<V.positionScreen.z)continue;if(-1>T.positionScreen.z||1<T.positionScreen.z)continue;if(-1>la.positionScreen.z||1<la.positionScreen.z)continue;V.positionScreen.x*=A;V.positionScreen.y*=y;T.positionScreen.x*=A;T.positionScreen.y*=y;la.positionScreen.x*=A;la.positionScreen.y*=y;0<I.overdraw&&(g(V.positionScreen,T.positionScreen,I.overdraw),g(T.positionScreen,la.positionScreen,
+I.overdraw),g(la.positionScreen,V.positionScreen,I.overdraw));wa.setFromPoints([V.positionScreen,T.positionScreen,la.positionScreen]);if(!0===Ka.isIntersectionBox(wa)){J=V;S=T;R=la;E=I;v.info.render.vertices+=3;v.info.render.faces++;h(E.opacity);k(E.blending);za=J.positionScreen.x;Ea=J.positionScreen.y;Ba=S.positionScreen.x;qa=S.positionScreen.y;Pa=R.positionScreen.x;Qa=R.positionScreen.y;var I=za,Z=Ea,ba=Ba,ca=qa,X=Pa,qb=Qa;z.beginPath();z.moveTo(I,Z);z.lineTo(ba,ca);z.lineTo(X,qb);z.closePath();
+if((E instanceof THREE.MeshLambertMaterial||E instanceof THREE.MeshPhongMaterial)&&null===E.map){F.copy(E.color);Ja.copy(E.emissive);E.vertexColors===THREE.FaceColors&&F.multiply(K.color);sa.copy(Ga);ya.copy(J.positionWorld).add(S.positionWorld).add(R.positionWorld).divideScalar(3);J=ya;S=K.normalModel;R=sa;K=0;for(I=D.length;K<I;K++)Z=D[K],Ta.copy(Z.color),Z instanceof THREE.DirectionalLight?(ba=ma.setFromMatrixPosition(Z.matrixWorld).normalize(),ca=S.dot(ba),0>=ca||(ca*=Z.intensity,R.add(Ta.multiplyScalar(ca)))):
+Z instanceof THREE.PointLight&&(ba=ma.setFromMatrixPosition(Z.matrixWorld),ca=S.dot(ma.subVectors(ba,J).normalize()),0>=ca||(ca*=0==Z.distance?1:1-Math.min(J.distanceTo(ba)/Z.distance,1),0!=ca&&(ca*=Z.intensity,R.add(Ta.multiplyScalar(ca)))));sa.multiply(F).add(Ja);!0===E.wireframe?b(sa,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(sa)}else E instanceof THREE.MeshBasicMaterial||E instanceof THREE.MeshLambertMaterial||E instanceof THREE.MeshPhongMaterial?null!==E.map?E.map.mapping instanceof
 THREE.UVMapping&&(da=K.uvs,f(za,Ea,Ba,qa,Pa,Qa,da[0].x,da[0].y,da[1].x,da[1].y,da[2].x,da[2].y,E.map)):null!==E.envMap?E.envMap.mapping instanceof THREE.SphericalReflectionMapping?(pa.copy(K.vertexNormalsModel[0]).applyMatrix3(Aa),ka=0.5*pa.x+0.5,Fa=0.5*pa.y+0.5,pa.copy(K.vertexNormalsModel[1]).applyMatrix3(Aa),ia=0.5*pa.x+0.5,Ca=0.5*pa.y+0.5,pa.copy(K.vertexNormalsModel[2]).applyMatrix3(Aa),Da=0.5*pa.x+0.5,ta=0.5*pa.y+0.5,f(za,Ea,Ba,qa,Pa,Qa,ka,Fa,ia,Ca,Da,ta,E.envMap)):E.envMap.mapping instanceof
 THREE.SphericalRefractionMapping&&(pa.copy(K.vertexNormalsModel[0]).applyMatrix3(Aa),ka=-0.5*pa.x+0.5,Fa=-0.5*pa.y+0.5,pa.copy(K.vertexNormalsModel[1]).applyMatrix3(Aa),ia=-0.5*pa.x+0.5,Ca=-0.5*pa.y+0.5,pa.copy(K.vertexNormalsModel[2]).applyMatrix3(Aa),Da=-0.5*pa.x+0.5,ta=-0.5*pa.y+0.5,f(za,Ea,Ba,qa,Pa,Qa,ka,Fa,ia,Ca,Da,ta,E.envMap)):(sa.copy(E.color),E.vertexColors===THREE.FaceColors&&sa.multiply(K.color),!0===E.wireframe?b(sa,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(sa)):(E instanceof
 THREE.MeshDepthMaterial?sa.r=sa.g=sa.b=1-p(J.positionScreen.z*J.positionScreen.w,oa.near,oa.far):E instanceof THREE.MeshNormalMaterial?(pa.copy(K.normalModel).applyMatrix3(Aa),sa.setRGB(pa.x,pa.y,pa.z).multiplyScalar(0.5).addScalar(0.5)):sa.setRGB(1,1,1),!0===E.wireframe?b(sa,E.wireframeLinewidth,E.wireframeLinecap,E.wireframeLinejoin):c(sa))}}$.union(wa)}}z.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={};THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( gl_FragColor.a < ALPHATEST ) discard;\n\n#endif\n";
@@ -453,15 +453,15 @@ function c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.leng
 "index"===b?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER,d=a.attributes[b];d.buffer=m.createBuffer();m.bindBuffer(c,d.buffer);m.bufferData(c,d.array,m.STATIC_DRAW)}}function h(a,b,c,d){for(var e in b){var f=b[e],g=c[e];if(0<=f)if(g){var h=g.itemSize;m.bindBuffer(m.ARRAY_BUFFER,g.buffer);l(f);m.vertexAttribPointer(f,h,m.FLOAT,!1,0,d*h*4)}else a.defaultAttributeValues&&(2===a.defaultAttributeValues[e].length?m.vertexAttrib2fv(f,a.defaultAttributeValues[e]):3===a.defaultAttributeValues[e].length&&m.vertexAttrib3fv(f,
 a.defaultAttributeValues[e]))}n()}function k(){for(var a=0,b=Fb.length;a<b;a++)Fb[a]=0}function l(a){Fb[a]=1;0===tb[a]&&(m.enableVertexAttribArray(a),tb[a]=1)}function n(){for(var a=0,b=tb.length;a<b;a++)tb[a]!==Fb[a]&&(m.disableVertexAttribArray(a),tb[a]=0)}function q(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function r(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function t(a,b){return b[0]-a[0]}function s(a,b,h){if(!1!==b.visible){var k=a.__webglObjects[b.id];if(k&&(!1===b.frustumCulled||!0===kc.intersectsObject(b))){var l=
 b.geometry,n,r,p;if(l instanceof THREE.BufferGeometry){var q=m.DYNAMIC_DRAW,w=l.attributes,u,v;for(u in w)v=w[u],v.needsUpdate&&("index"===u?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,v.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,v.array,q)):(m.bindBuffer(m.ARRAY_BUFFER,v.buffer),m.bufferData(m.ARRAY_BUFFER,v.array,q)),v.needsUpdate=!1)}else if(b instanceof THREE.Mesh){if(l.buffersNeedUpdate||l.groupsNeedUpdate)l instanceof THREE.BufferGeometry?g(l):b instanceof THREE.Mesh&&D(a,b,l);for(var B=0,A=l.geometryGroupsList.length;B<
-A;B++)if(n=l.geometryGroupsList[B],p=d(b,n),(l.buffersNeedUpdate||l.groupsNeedUpdate)&&c(n,b),r=p.attributes&&x(p),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||r){var y=n,E=b,F=m.DYNAMIC_DRAW,O=!l.dynamic,L=p;if(y.__inittedArrays){var K=e(L),M=L.vertexColors?L.vertexColors:!1,J=f(L),P=K===THREE.SmoothShading,z=void 0,I=void 0,Q=void 0,H=void 0,la=void 0,R=void 0,aa=void 0,T=void 0,V=void 0,U=void 0,
-Z=void 0,fa=void 0,ga=void 0,ha=void 0,qa=void 0,Ea=void 0,$=void 0,za=void 0,S=void 0,ca=void 0,da=void 0,X=void 0,Ba=void 0,ka=void 0,oa=void 0,pa=void 0,ta=void 0,wa=void 0,Ja=void 0,ia=void 0,Ca=void 0,Fa=void 0,Da=void 0,Ga=void 0,ma=void 0,Ka=void 0,ya=void 0,Aa=void 0,La=void 0,Ta=void 0,cb=0,db=0,Sa=0,Za=0,Va=0,fb=0,Ua=0,vb=0,$a=0,xa=0,Ha=0,N=0,Ra=void 0,gb=y.__vertexArray,eb=y.__uvArray,ob=y.__uv2Array,yb=y.__normalArray,Wa=y.__tangentArray,hb=y.__colorArray,Xa=y.__skinIndexArray,Ya=y.__skinWeightArray,
+A;B++)if(n=l.geometryGroupsList[B],p=d(b,n),(l.buffersNeedUpdate||l.groupsNeedUpdate)&&c(n,b),r=p.attributes&&x(p),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||r){var y=n,E=b,F=m.DYNAMIC_DRAW,O=!l.dynamic,L=p;if(y.__inittedArrays){var K=e(L),M=L.vertexColors?L.vertexColors:!1,J=f(L),P=K===THREE.SmoothShading,z=void 0,I=void 0,Q=void 0,H=void 0,la=void 0,R=void 0,aa=void 0,S=void 0,V=void 0,T=void 0,
+Z=void 0,fa=void 0,ga=void 0,ha=void 0,qa=void 0,Ea=void 0,$=void 0,za=void 0,U=void 0,ca=void 0,da=void 0,X=void 0,Ba=void 0,ka=void 0,oa=void 0,pa=void 0,ta=void 0,wa=void 0,Ja=void 0,ia=void 0,Ca=void 0,Fa=void 0,Da=void 0,Ga=void 0,ma=void 0,Ka=void 0,ya=void 0,Aa=void 0,La=void 0,Ta=void 0,cb=0,db=0,Sa=0,Za=0,Va=0,fb=0,Ua=0,vb=0,$a=0,xa=0,Ha=0,N=0,Ra=void 0,gb=y.__vertexArray,eb=y.__uvArray,ob=y.__uv2Array,yb=y.__normalArray,Wa=y.__tangentArray,hb=y.__colorArray,Xa=y.__skinIndexArray,Ya=y.__skinWeightArray,
 tb=y.__morphTargetsArrays,ub=y.__morphNormalsArrays,qb=y.__webglCustomAttributesList,G=void 0,pb=y.__faceArray,zb=y.__lineArray,Ma=E.geometry,Eb=Ma.elementsNeedUpdate,xb=Ma.uvsNeedUpdate,Fb=Ma.normalsNeedUpdate,Gb=Ma.tangentsNeedUpdate,Qb=Ma.colorsNeedUpdate,Rb=Ma.morphTargetsNeedUpdate,Db=Ma.vertices,ja=y.faces3,ib=Ma.faces,Jb=Ma.faceVertexUvs[0],Kb=Ma.faceVertexUvs[1],mc=Ma.skinIndices,Wb=Ma.skinWeights,Xb=Ma.morphTargets,Lb=Ma.morphNormals;if(Ma.verticesNeedUpdate){z=0;for(I=ja.length;z<I;z++)H=
 ib[ja[z]],fa=Db[H.a],ga=Db[H.b],ha=Db[H.c],gb[db]=fa.x,gb[db+1]=fa.y,gb[db+2]=fa.z,gb[db+3]=ga.x,gb[db+4]=ga.y,gb[db+5]=ga.z,gb[db+6]=ha.x,gb[db+7]=ha.y,gb[db+8]=ha.z,db+=9;m.bindBuffer(m.ARRAY_BUFFER,y.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,gb,F)}if(Rb)for(ma=0,Ka=Xb.length;ma<Ka;ma++){z=Ha=0;for(I=ja.length;z<I;z++)La=ja[z],H=ib[La],fa=Xb[ma].vertices[H.a],ga=Xb[ma].vertices[H.b],ha=Xb[ma].vertices[H.c],ya=tb[ma],ya[Ha]=fa.x,ya[Ha+1]=fa.y,ya[Ha+2]=fa.z,ya[Ha+3]=ga.x,ya[Ha+4]=ga.y,ya[Ha+
-5]=ga.z,ya[Ha+6]=ha.x,ya[Ha+7]=ha.y,ya[Ha+8]=ha.z,L.morphNormals&&(P?(Ta=Lb[ma].vertexNormals[La],za=Ta.a,S=Ta.b,ca=Ta.c):ca=S=za=Lb[ma].faceNormals[La],Aa=ub[ma],Aa[Ha]=za.x,Aa[Ha+1]=za.y,Aa[Ha+2]=za.z,Aa[Ha+3]=S.x,Aa[Ha+4]=S.y,Aa[Ha+5]=S.z,Aa[Ha+6]=ca.x,Aa[Ha+7]=ca.y,Aa[Ha+8]=ca.z),Ha+=9;m.bindBuffer(m.ARRAY_BUFFER,y.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,tb[ma],F);L.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,ub[ma],
+5]=ga.z,ya[Ha+6]=ha.x,ya[Ha+7]=ha.y,ya[Ha+8]=ha.z,L.morphNormals&&(P?(Ta=Lb[ma].vertexNormals[La],za=Ta.a,U=Ta.b,ca=Ta.c):ca=U=za=Lb[ma].faceNormals[La],Aa=ub[ma],Aa[Ha]=za.x,Aa[Ha+1]=za.y,Aa[Ha+2]=za.z,Aa[Ha+3]=U.x,Aa[Ha+4]=U.y,Aa[Ha+5]=U.z,Aa[Ha+6]=ca.x,Aa[Ha+7]=ca.y,Aa[Ha+8]=ca.z),Ha+=9;m.bindBuffer(m.ARRAY_BUFFER,y.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,tb[ma],F);L.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,ub[ma],
 F))}if(Wb.length){z=0;for(I=ja.length;z<I;z++)H=ib[ja[z]],ka=Wb[H.a],oa=Wb[H.b],pa=Wb[H.c],Ya[xa]=ka.x,Ya[xa+1]=ka.y,Ya[xa+2]=ka.z,Ya[xa+3]=ka.w,Ya[xa+4]=oa.x,Ya[xa+5]=oa.y,Ya[xa+6]=oa.z,Ya[xa+7]=oa.w,Ya[xa+8]=pa.x,Ya[xa+9]=pa.y,Ya[xa+10]=pa.z,Ya[xa+11]=pa.w,ta=mc[H.a],wa=mc[H.b],Ja=mc[H.c],Xa[xa]=ta.x,Xa[xa+1]=ta.y,Xa[xa+2]=ta.z,Xa[xa+3]=ta.w,Xa[xa+4]=wa.x,Xa[xa+5]=wa.y,Xa[xa+6]=wa.z,Xa[xa+7]=wa.w,Xa[xa+8]=Ja.x,Xa[xa+9]=Ja.y,Xa[xa+10]=Ja.z,Xa[xa+11]=Ja.w,xa+=12;0<xa&&(m.bindBuffer(m.ARRAY_BUFFER,
-y.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Xa,F),m.bindBuffer(m.ARRAY_BUFFER,y.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Ya,F))}if(Qb&&M){z=0;for(I=ja.length;z<I;z++)H=ib[ja[z]],aa=H.vertexColors,T=H.color,3===aa.length&&M===THREE.VertexColors?(da=aa[0],X=aa[1],Ba=aa[2]):Ba=X=da=T,hb[$a]=da.r,hb[$a+1]=da.g,hb[$a+2]=da.b,hb[$a+3]=X.r,hb[$a+4]=X.g,hb[$a+5]=X.b,hb[$a+6]=Ba.r,hb[$a+7]=Ba.g,hb[$a+8]=Ba.b,$a+=9;0<$a&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,
+y.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Xa,F),m.bindBuffer(m.ARRAY_BUFFER,y.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Ya,F))}if(Qb&&M){z=0;for(I=ja.length;z<I;z++)H=ib[ja[z]],aa=H.vertexColors,S=H.color,3===aa.length&&M===THREE.VertexColors?(da=aa[0],X=aa[1],Ba=aa[2]):Ba=X=da=S,hb[$a]=da.r,hb[$a+1]=da.g,hb[$a+2]=da.b,hb[$a+3]=X.r,hb[$a+4]=X.g,hb[$a+5]=X.b,hb[$a+6]=Ba.r,hb[$a+7]=Ba.g,hb[$a+8]=Ba.b,$a+=9;0<$a&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,
 hb,F))}if(Gb&&Ma.hasTangents){z=0;for(I=ja.length;z<I;z++)H=ib[ja[z]],V=H.vertexTangents,qa=V[0],Ea=V[1],$=V[2],Wa[Ua]=qa.x,Wa[Ua+1]=qa.y,Wa[Ua+2]=qa.z,Wa[Ua+3]=qa.w,Wa[Ua+4]=Ea.x,Wa[Ua+5]=Ea.y,Wa[Ua+6]=Ea.z,Wa[Ua+7]=Ea.w,Wa[Ua+8]=$.x,Wa[Ua+9]=$.y,Wa[Ua+10]=$.z,Wa[Ua+11]=$.w,Ua+=12;m.bindBuffer(m.ARRAY_BUFFER,y.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,Wa,F)}if(Fb&&K){z=0;for(I=ja.length;z<I;z++)if(H=ib[ja[z]],la=H.vertexNormals,R=H.normal,3===la.length&&P)for(ia=0;3>ia;ia++)Fa=la[ia],yb[fb]=
-Fa.x,yb[fb+1]=Fa.y,yb[fb+2]=Fa.z,fb+=3;else for(ia=0;3>ia;ia++)yb[fb]=R.x,yb[fb+1]=R.y,yb[fb+2]=R.z,fb+=3;m.bindBuffer(m.ARRAY_BUFFER,y.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,yb,F)}if(xb&&Jb&&J){z=0;for(I=ja.length;z<I;z++)if(Q=ja[z],U=Jb[Q],void 0!==U)for(ia=0;3>ia;ia++)Da=U[ia],eb[Sa]=Da.x,eb[Sa+1]=Da.y,Sa+=2;0<Sa&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,eb,F))}if(xb&&Kb&&J){z=0;for(I=ja.length;z<I;z++)if(Q=ja[z],Z=Kb[Q],void 0!==Z)for(ia=0;3>ia;ia++)Ga=
+Fa.x,yb[fb+1]=Fa.y,yb[fb+2]=Fa.z,fb+=3;else for(ia=0;3>ia;ia++)yb[fb]=R.x,yb[fb+1]=R.y,yb[fb+2]=R.z,fb+=3;m.bindBuffer(m.ARRAY_BUFFER,y.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,yb,F)}if(xb&&Jb&&J){z=0;for(I=ja.length;z<I;z++)if(Q=ja[z],T=Jb[Q],void 0!==T)for(ia=0;3>ia;ia++)Da=T[ia],eb[Sa]=Da.x,eb[Sa+1]=Da.y,Sa+=2;0<Sa&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,eb,F))}if(xb&&Kb&&J){z=0;for(I=ja.length;z<I;z++)if(Q=ja[z],Z=Kb[Q],void 0!==Z)for(ia=0;3>ia;ia++)Ga=
 Z[ia],ob[Za]=Ga.x,ob[Za+1]=Ga.y,Za+=2;0<Za&&(m.bindBuffer(m.ARRAY_BUFFER,y.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,ob,F))}if(Eb){z=0;for(I=ja.length;z<I;z++)pb[Va]=cb,pb[Va+1]=cb+1,pb[Va+2]=cb+2,Va+=3,zb[vb]=cb,zb[vb+1]=cb+1,zb[vb+2]=cb,zb[vb+3]=cb+2,zb[vb+4]=cb+1,zb[vb+5]=cb+2,vb+=6,cb+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,pb,F);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,y.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,zb,F)}if(qb)for(ia=
 0,Ca=qb.length;ia<Ca;ia++)if(G=qb[ia],G.__original.needsUpdate){N=0;if(1===G.size)if(void 0===G.boundTo||"vertices"===G.boundTo)for(z=0,I=ja.length;z<I;z++)H=ib[ja[z]],G.array[N]=G.value[H.a],G.array[N+1]=G.value[H.b],G.array[N+2]=G.value[H.c],N+=3;else{if("faces"===G.boundTo)for(z=0,I=ja.length;z<I;z++)Ra=G.value[ja[z]],G.array[N]=Ra,G.array[N+1]=Ra,G.array[N+2]=Ra,N+=3}else if(2===G.size)if(void 0===G.boundTo||"vertices"===G.boundTo)for(z=0,I=ja.length;z<I;z++)H=ib[ja[z]],fa=G.value[H.a],ga=G.value[H.b],
 ha=G.value[H.c],G.array[N]=fa.x,G.array[N+1]=fa.y,G.array[N+2]=ga.x,G.array[N+3]=ga.y,G.array[N+4]=ha.x,G.array[N+5]=ha.y,N+=6;else{if("faces"===G.boundTo)for(z=0,I=ja.length;z<I;z++)ha=ga=fa=Ra=G.value[ja[z]],G.array[N]=fa.x,G.array[N+1]=fa.y,G.array[N+2]=ga.x,G.array[N+3]=ga.y,G.array[N+4]=ha.x,G.array[N+5]=ha.y,N+=6}else if(3===G.size){var va;va="c"===G.type?["r","g","b"]:["x","y","z"];if(void 0===G.boundTo||"vertices"===G.boundTo)for(z=0,I=ja.length;z<I;z++)H=ib[ja[z]],fa=G.value[H.a],ga=G.value[H.b],
@@ -489,23 +489,24 @@ THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var c=b.__webglObject
 h=g=f=!0);d.id!==da&&(-1===da&&(h=!0),da=d.id,g=!0);if(f||a!==Fa)m.uniformMatrix4fv(l.projectionMatrix,!1,a.projectionMatrix.elements),Ea&&m.uniform1f(l.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Fa&&(Fa=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==l.cameraPosition&&(ba.setFromMatrixPosition(a.matrixWorld),m.uniform3f(l.cameraPosition,ba.x,ba.y,ba.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof
 THREE.ShaderMaterial||d.skinning)&&null!==l.viewMatrix&&m.uniformMatrix4fv(l.viewMatrix,!1,a.matrixWorldInverse.elements);d.skinning&&(e.bindMatrix&&null!==l.bindMatrix&&m.uniformMatrix4fv(l.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==l.bindMatrixInverse&&m.uniformMatrix4fv(l.bindMatrixInverse,!1,e.bindMatrixInverse.elements),Qb&&e.skeleton&&e.skeleton.useVertexTexture?(null!==l.boneTexture&&(f=M(),m.uniform1i(l.boneTexture,f),F.setTexture(e.skeleton.boneTexture,f)),null!==l.boneTextureWidth&&
 m.uniform1i(l.boneTextureWidth,e.skeleton.boneTextureWidth),null!==l.boneTextureHeight&&m.uniform1i(l.boneTextureHeight,e.skeleton.boneTextureHeight)):e.skeleton&&e.skeleton.boneMatrices&&null!==l.boneGlobalMatrices&&m.uniformMatrix4fv(l.boneGlobalMatrices,!1,e.skeleton.boneMatrices));if(g){c&&d.fog&&(n.fogColor.value=c.color,c instanceof THREE.Fog?(n.fogNear.value=c.near,n.fogFar.value=c.far):c instanceof THREE.FogExp2&&(n.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof
-THREE.MeshLambertMaterial||d.lights){if(eb){var h=!0,p,r=f=0,q=0,s,t,w,u=Lb,v=u.directional.colors,x=u.directional.positions,D=u.point.colors,B=u.point.positions,A=u.point.distances,z=u.spot.colors,C=u.spot.positions,O=u.spot.distances,L=u.spot.directions,K=u.spot.anglesCos,J=u.spot.exponents,P=u.hemi.skyColors,Q=u.hemi.groundColors,R=u.hemi.positions,la=0,V=0,U=0,qa=0,Z=0,$=0,za=0,sa=0,X=p=0;c=w=X=0;for(g=b.length;c<g;c++)p=b[c],p.onlyShadow||(s=p.color,t=p.intensity,w=p.distance,p instanceof THREE.AmbientLight?
+THREE.MeshLambertMaterial||d.lights){if(eb){var h=!0,p,r=f=0,q=0,s,t,w,u=Lb,v=u.directional.colors,x=u.directional.positions,D=u.point.colors,B=u.point.positions,A=u.point.distances,z=u.spot.colors,C=u.spot.positions,O=u.spot.distances,L=u.spot.directions,K=u.spot.anglesCos,J=u.spot.exponents,P=u.hemi.skyColors,Q=u.hemi.groundColors,R=u.hemi.positions,la=0,V=0,T=0,qa=0,Z=0,$=0,za=0,sa=0,X=p=0;c=w=X=0;for(g=b.length;c<g;c++)p=b[c],p.onlyShadow||(s=p.color,t=p.intensity,w=p.distance,p instanceof THREE.AmbientLight?
 p.visible&&(F.gammaInput?(f+=s.r*s.r,r+=s.g*s.g,q+=s.b*s.b):(f+=s.r,r+=s.g,q+=s.b)):p instanceof THREE.DirectionalLight?(Z+=1,p.visible&&(ca.setFromMatrixPosition(p.matrixWorld),ba.setFromMatrixPosition(p.target.matrixWorld),ca.sub(ba),ca.normalize(),p=3*la,x[p]=ca.x,x[p+1]=ca.y,x[p+2]=ca.z,F.gammaInput?aa(v,p,s,t*t):H(v,p,s,t),la+=1)):p instanceof THREE.PointLight?($+=1,p.visible&&(X=3*V,F.gammaInput?aa(D,X,s,t*t):H(D,X,s,t),ba.setFromMatrixPosition(p.matrixWorld),B[X]=ba.x,B[X+1]=ba.y,B[X+2]=ba.z,
-A[V]=w,V+=1)):p instanceof THREE.SpotLight?(za+=1,p.visible&&(X=3*U,F.gammaInput?aa(z,X,s,t*t):H(z,X,s,t),ba.setFromMatrixPosition(p.matrixWorld),C[X]=ba.x,C[X+1]=ba.y,C[X+2]=ba.z,O[U]=w,ca.copy(ba),ba.setFromMatrixPosition(p.target.matrixWorld),ca.sub(ba),ca.normalize(),L[X]=ca.x,L[X+1]=ca.y,L[X+2]=ca.z,K[U]=Math.cos(p.angle),J[U]=p.exponent,U+=1)):p instanceof THREE.HemisphereLight&&(sa+=1,p.visible&&(ca.setFromMatrixPosition(p.matrixWorld),ca.normalize(),w=3*qa,R[w]=ca.x,R[w+1]=ca.y,R[w+2]=ca.z,
-s=p.color,p=p.groundColor,F.gammaInput?(t*=t,aa(P,w,s,t),aa(Q,w,p,t)):(H(P,w,s,t),H(Q,w,p,t)),qa+=1)));c=3*la;for(g=Math.max(v.length,3*Z);c<g;c++)v[c]=0;c=3*V;for(g=Math.max(D.length,3*$);c<g;c++)D[c]=0;c=3*U;for(g=Math.max(z.length,3*za);c<g;c++)z[c]=0;c=3*qa;for(g=Math.max(P.length,3*sa);c<g;c++)P[c]=0;c=3*qa;for(g=Math.max(Q.length,3*sa);c<g;c++)Q[c]=0;u.directional.length=la;u.point.length=V;u.spot.length=U;u.hemi.length=qa;u.ambient[0]=f;u.ambient[1]=r;u.ambient[2]=q;eb=!1}h?(h=Lb,n.ambientLightColor.value=
+A[V]=w,V+=1)):p instanceof THREE.SpotLight?(za+=1,p.visible&&(X=3*T,F.gammaInput?aa(z,X,s,t*t):H(z,X,s,t),ba.setFromMatrixPosition(p.matrixWorld),C[X]=ba.x,C[X+1]=ba.y,C[X+2]=ba.z,O[T]=w,ca.copy(ba),ba.setFromMatrixPosition(p.target.matrixWorld),ca.sub(ba),ca.normalize(),L[X]=ca.x,L[X+1]=ca.y,L[X+2]=ca.z,K[T]=Math.cos(p.angle),J[T]=p.exponent,T+=1)):p instanceof THREE.HemisphereLight&&(sa+=1,p.visible&&(ca.setFromMatrixPosition(p.matrixWorld),ca.normalize(),w=3*qa,R[w]=ca.x,R[w+1]=ca.y,R[w+2]=ca.z,
+s=p.color,p=p.groundColor,F.gammaInput?(t*=t,aa(P,w,s,t),aa(Q,w,p,t)):(H(P,w,s,t),H(Q,w,p,t)),qa+=1)));c=3*la;for(g=Math.max(v.length,3*Z);c<g;c++)v[c]=0;c=3*V;for(g=Math.max(D.length,3*$);c<g;c++)D[c]=0;c=3*T;for(g=Math.max(z.length,3*za);c<g;c++)z[c]=0;c=3*qa;for(g=Math.max(P.length,3*sa);c<g;c++)P[c]=0;c=3*qa;for(g=Math.max(Q.length,3*sa);c<g;c++)Q[c]=0;u.directional.length=la;u.point.length=V;u.spot.length=T;u.hemi.length=qa;u.ambient[0]=f;u.ambient[1]=r;u.ambient[2]=q;eb=!1}h?(h=Lb,n.ambientLightColor.value=
 h.ambient,n.directionalLightColor.value=h.directional.colors,n.directionalLightDirection.value=h.directional.positions,n.pointLightColor.value=h.point.colors,n.pointLightPosition.value=h.point.positions,n.pointLightDistance.value=h.point.distances,n.spotLightColor.value=h.spot.colors,n.spotLightPosition.value=h.spot.positions,n.spotLightDistance.value=h.spot.distances,n.spotLightDirection.value=h.spot.directions,n.spotLightAngleCos.value=h.spot.anglesCos,n.spotLightExponent.value=h.spot.exponents,
 n.hemisphereLightSkyColor.value=h.hemi.skyColors,n.hemisphereLightGroundColor.value=h.hemi.groundColors,n.hemisphereLightDirection.value=h.hemi.positions,y(n,!0)):y(n,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){n.opacity.value=d.opacity;F.gammaInput?n.diffuse.value.copyGammaToLinear(d.color):n.diffuse.value=d.color;n.map.value=d.map;n.lightMap.value=d.lightMap;n.specularMap.value=d.specularMap;n.alphaMap.value=d.alphaMap;
-d.bumpMap&&(n.bumpMap.value=d.bumpMap,n.bumpScale.value=d.bumpScale);d.normalMap&&(n.normalMap.value=d.normalMap,n.normalScale.value.copy(d.normalScale));var S;d.map?S=d.map:d.specularMap?S=d.specularMap:d.normalMap?S=d.normalMap:d.bumpMap?S=d.bumpMap:d.alphaMap&&(S=d.alphaMap);void 0!==S&&(h=S.offset,S=S.repeat,n.offsetRepeat.value.set(h.x,h.y,S.x,S.y));n.envMap.value=d.envMap;n.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;n.reflectivity.value=d.reflectivity;n.refractionRatio.value=
+d.bumpMap&&(n.bumpMap.value=d.bumpMap,n.bumpScale.value=d.bumpScale);d.normalMap&&(n.normalMap.value=d.normalMap,n.normalScale.value.copy(d.normalScale));var U;d.map?U=d.map:d.specularMap?U=d.specularMap:d.normalMap?U=d.normalMap:d.bumpMap?U=d.bumpMap:d.alphaMap&&(U=d.alphaMap);void 0!==U&&(h=U.offset,U=U.repeat,n.offsetRepeat.value.set(h.x,h.y,U.x,U.y));n.envMap.value=d.envMap;n.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;n.reflectivity.value=d.reflectivity;n.refractionRatio.value=
 d.refractionRatio;n.combine.value=d.combine;n.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(n.diffuse.value=d.color,n.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(n.diffuse.value=d.color,n.opacity.value=d.opacity,n.dashSize.value=d.dashSize,n.totalSize.value=d.dashSize+d.gapSize,n.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(n.psColor.value=d.color,n.opacity.value=d.opacity,n.size.value=d.size,
-n.scale.value=T.height/2,n.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(n.shininess.value=d.shininess,F.gammaInput?(n.ambient.value.copyGammaToLinear(d.ambient),n.emissive.value.copyGammaToLinear(d.emissive),n.specular.value.copyGammaToLinear(d.specular)):(n.ambient.value=d.ambient,n.emissive.value=d.emissive,n.specular.value=d.specular),d.wrapAround&&n.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(F.gammaInput?(n.ambient.value.copyGammaToLinear(d.ambient),n.emissive.value.copyGammaToLinear(d.emissive)):
-(n.ambient.value=d.ambient,n.emissive.value=d.emissive),d.wrapAround&&n.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(n.mNear.value=a.near,n.mFar.value=a.far,n.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(n.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&n.shadowMatrix)for(S=a=0,h=b.length;S<h;S++)c=b[S],c.castShadow&&(c instanceof THREE.SpotLight||c instanceof THREE.DirectionalLight&&!c.shadowCascade)&&(n.shadowMap.value[a]=c.shadowMap,n.shadowMapSize.value[a]=
-c.shadowMapSize,n.shadowMatrix.value[a]=c.shadowMatrix,n.shadowDarkness.value[a]=c.shadowDarkness,n.shadowBias.value[a]=c.shadowBias,a++);b=d.uniformsList;d=0;for(n=b.length;d<n;d++)if(a=b[d][1],S=b[d][0],!1!==S.needsUpdate)if(c=S.type,h=S.value,"i"===c)m.uniform1i(a,h);else if("f"===c)m.uniform1f(a,h);else if("v2"===c)m.uniform2f(a,h.x,h.y);else if("v3"===c)m.uniform3f(a,h.x,h.y,h.z);else if("v4"===c)m.uniform4f(a,h.x,h.y,h.z,h.w);else if("c"===c)m.uniform3f(a,h.r,h.g,h.b);else if("iv1"===c)m.uniform1iv(a,
-h);else if("iv"===c)m.uniform3iv(a,h);else if("fv1"===c)m.uniform1fv(a,h);else if("fv"===c)m.uniform3fv(a,h);else if("v2v"===c){void 0===S._array&&(S._array=new Float32Array(2*h.length));c=0;for(g=h.length;c<g;c++)f=2*c,S._array[f]=h[c].x,S._array[f+1]=h[c].y;m.uniform2fv(a,S._array)}else if("v3v"===c){void 0===S._array&&(S._array=new Float32Array(3*h.length));c=0;for(g=h.length;c<g;c++)f=3*c,S._array[f]=h[c].x,S._array[f+1]=h[c].y,S._array[f+2]=h[c].z;m.uniform3fv(a,S._array)}else if("v4v"===c){void 0===
-S._array&&(S._array=new Float32Array(4*h.length));c=0;for(g=h.length;c<g;c++)f=4*c,S._array[f]=h[c].x,S._array[f+1]=h[c].y,S._array[f+2]=h[c].z,S._array[f+3]=h[c].w;m.uniform4fv(a,S._array)}else if("m3"===c)m.uniformMatrix3fv(a,!1,h.elements);else if("m3v"===c){void 0===S._array&&(S._array=new Float32Array(9*h.length));c=0;for(g=h.length;c<g;c++)h[c].flattenToArrayOffset(S._array,9*c);m.uniformMatrix3fv(a,!1,S._array)}else if("m4"===c)m.uniformMatrix4fv(a,!1,h.elements);else if("m4v"===c){void 0===
-S._array&&(S._array=new Float32Array(16*h.length));c=0;for(g=h.length;c<g;c++)h[c].flattenToArrayOffset(S._array,16*c);m.uniformMatrix4fv(a,!1,S._array)}else if("t"===c){if(f=h,h=M(),m.uniform1i(a,h),f)if(f instanceof THREE.CubeTexture||f.image instanceof Array&&6===f.image.length){if(a=f,S=h,6===a.image.length)if(a.needsUpdate){a.image.__webglTextureCube||(a.addEventListener("dispose",Rb),a.image.__webglTextureCube=m.createTexture(),F.info.memory.textures++);m.activeTexture(m.TEXTURE0+S);m.bindTexture(m.TEXTURE_CUBE_MAP,
-a.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);S=a instanceof THREE.CompressedTexture;h=[];for(c=0;6>c;c++)F.autoScaleCubemaps&&!S?(g=h,f=c,r=a.image[c],u=sc,r.width<=u&&r.height<=u||(v=Math.max(r.width,r.height),q=Math.floor(r.width*u/v),u=Math.floor(r.height*u/v),v=document.createElement("canvas"),v.width=q,v.height=u,v.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,q,u),r=v),g[f]=r):h[c]=a.image[c];c=h[0];g=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height);
-f=I(a.format);r=I(a.type);E(m.TEXTURE_CUBE_MAP,a,g);for(c=0;6>c;c++)if(S)for(u=h[c].mipmaps,v=0,x=u.length;v<x;v++)q=u[v],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,v,f,q.width,q.height,0,q.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,v,f,q.width,q.height,0,f,r,q.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,f,f,r,h[c]);a.generateMipmaps&&g&&m.generateMipmap(m.TEXTURE_CUBE_MAP);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+
-S),m.bindTexture(m.TEXTURE_CUBE_MAP,a.image.__webglTextureCube)}else f instanceof THREE.WebGLRenderTargetCube?(a=f,m.activeTexture(m.TEXTURE0+h),m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture)):F.setTexture(f,h)}else if("tv"===c){void 0===S._array&&(S._array=[]);c=0;for(g=S.value.length;c<g;c++)S._array[c]=M();m.uniform1iv(a,S._array);c=0;for(g=S.value.length;c<g;c++)f=S.value[c],h=S._array[c],f&&F.setTexture(f,h)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+c)}m.uniformMatrix4fv(l.modelViewMatrix,
+n.scale.value=S.height/2,n.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(n.shininess.value=d.shininess,F.gammaInput?(n.ambient.value.copyGammaToLinear(d.ambient),n.emissive.value.copyGammaToLinear(d.emissive),n.specular.value.copyGammaToLinear(d.specular)):(n.ambient.value=d.ambient,n.emissive.value=d.emissive,n.specular.value=d.specular),d.wrapAround&&n.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(F.gammaInput?(n.ambient.value.copyGammaToLinear(d.ambient),n.emissive.value.copyGammaToLinear(d.emissive)):
+(n.ambient.value=d.ambient,n.emissive.value=d.emissive),d.wrapAround&&n.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(n.mNear.value=a.near,n.mFar.value=a.far,n.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(n.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&n.shadowMatrix)for(U=a=0,h=b.length;U<h;U++)c=b[U],c.castShadow&&(c instanceof THREE.SpotLight||c instanceof THREE.DirectionalLight&&!c.shadowCascade)&&(n.shadowMap.value[a]=c.shadowMap,n.shadowMapSize.value[a]=
+c.shadowMapSize,n.shadowMatrix.value[a]=c.shadowMatrix,n.shadowDarkness.value[a]=c.shadowDarkness,n.shadowBias.value[a]=c.shadowBias,a++);b=d.uniformsList;d=0;for(n=b.length;d<n;d++)if(a=b[d][0],!1!==a.needsUpdate)switch(c=a.type,h=a.value,U=b[d][1],c){case "1i":m.uniform1i(U,h);break;case "1f":m.uniform1f(U,h);break;case "2f":m.uniform2f(U,h[0],h[1]);break;case "3f":m.uniform3f(U,h[0],h[1],h[2]);break;case "4f":m.uniform4f(U,h[0],h[1],h[2],h[3]);break;case "1iv":m.uniform1iv(U,h);break;case "3iv":m.uniform3iv(U,
+h);break;case "1fv":m.uniform1fv(U,h);break;case "2fv":m.uniform2fv(U,h);break;case "3fv":m.uniform3fv(U,h);break;case "4fv":m.uniform4fv(U,h);break;case "Matrix3fv":m.uniformMatrix3fv(U,!1,h);break;case "Matrix4fv":m.uniformMatrix4fv(U,!1,h);break;case "i":m.uniform1i(U,h);break;case "f":m.uniform1f(U,h);break;case "v2":m.uniform2f(U,h.x,h.y);break;case "v3":m.uniform3f(U,h.x,h.y,h.z);break;case "v4":m.uniform4f(U,h.x,h.y,h.z,h.w);break;case "c":m.uniform3f(U,h.r,h.g,h.b);break;case "iv1":m.uniform1iv(U,
+h);break;case "iv":m.uniform3iv(U,h);break;case "fv1":m.uniform1fv(U,h);break;case "fv":m.uniform3fv(U,h);break;case "v2v":void 0===a._array&&(a._array=new Float32Array(2*h.length));c=0;for(g=h.length;c<g;c++)f=2*c,a._array[f]=h[c].x,a._array[f+1]=h[c].y;m.uniform2fv(U,a._array);break;case "v3v":void 0===a._array&&(a._array=new Float32Array(3*h.length));c=0;for(g=h.length;c<g;c++)f=3*c,a._array[f]=h[c].x,a._array[f+1]=h[c].y,a._array[f+2]=h[c].z;m.uniform3fv(U,a._array);break;case "v4v":void 0===
+a._array&&(a._array=new Float32Array(4*h.length));c=0;for(g=h.length;c<g;c++)f=4*c,a._array[f]=h[c].x,a._array[f+1]=h[c].y,a._array[f+2]=h[c].z,a._array[f+3]=h[c].w;m.uniform4fv(U,a._array);break;case "m3":m.uniformMatrix3fv(U,!1,h.elements);break;case "m3v":void 0===a._array&&(a._array=new Float32Array(9*h.length));c=0;for(g=h.length;c<g;c++)h[c].flattenToArrayOffset(a._array,9*c);m.uniformMatrix3fv(U,!1,a._array);break;case "m4":m.uniformMatrix4fv(U,!1,h.elements);break;case "m4v":void 0===a._array&&
+(a._array=new Float32Array(16*h.length));c=0;for(g=h.length;c<g;c++)h[c].flattenToArrayOffset(a._array,16*c);m.uniformMatrix4fv(U,!1,a._array);break;case "t":f=h;h=M();m.uniform1i(U,h);if(!f)continue;if(f instanceof THREE.CubeTexture||f.image instanceof Array&&6===f.image.length){if(a=f,U=h,6===a.image.length)if(a.needsUpdate){a.image.__webglTextureCube||(a.addEventListener("dispose",Rb),a.image.__webglTextureCube=m.createTexture(),F.info.memory.textures++);m.activeTexture(m.TEXTURE0+U);m.bindTexture(m.TEXTURE_CUBE_MAP,
+a.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);U=a instanceof THREE.CompressedTexture;h=[];for(c=0;6>c;c++)F.autoScaleCubemaps&&!U?(g=h,f=c,r=a.image[c],u=sc,r.width<=u&&r.height<=u||(v=Math.max(r.width,r.height),q=Math.floor(r.width*u/v),u=Math.floor(r.height*u/v),v=document.createElement("canvas"),v.width=q,v.height=u,v.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,q,u),r=v),g[f]=r):h[c]=a.image[c];c=h[0];g=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height);
+f=I(a.format);r=I(a.type);E(m.TEXTURE_CUBE_MAP,a,g);for(c=0;6>c;c++)if(U)for(u=h[c].mipmaps,v=0,x=u.length;v<x;v++)q=u[v],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,v,f,q.width,q.height,0,q.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,v,f,q.width,q.height,0,f,r,q.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,f,f,r,h[c]);a.generateMipmaps&&g&&m.generateMipmap(m.TEXTURE_CUBE_MAP);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+
+U),m.bindTexture(m.TEXTURE_CUBE_MAP,a.image.__webglTextureCube)}else f instanceof THREE.WebGLRenderTargetCube?(a=f,m.activeTexture(m.TEXTURE0+h),m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture)):F.setTexture(f,h);break;case "tv":void 0===a._array&&(a._array=[]);c=0;for(g=a.value.length;c<g;c++)a._array[c]=M();m.uniform1iv(U,a._array);c=0;for(g=a.value.length;c<g;c++)f=a.value[c],h=a._array[c],f&&F.setTexture(f,h);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+c)}}m.uniformMatrix4fv(l.modelViewMatrix,
 !1,e._modelViewMatrix.elements);l.normalMatrix&&m.uniformMatrix3fv(l.normalMatrix,!1,e._normalMatrix.elements);null!==l.modelMatrix&&m.uniformMatrix4fv(l.modelMatrix,!1,e.matrixWorld.elements);return k}function y(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=
 b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function M(){var a=ia;a>=Sb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Sb);ia+=1;return a}function Q(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}
 function aa(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 H(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function z(a){a!==pa&&(m.lineWidth(a),pa=a)}function K(a,b,c){Va!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),Va=a);!a||ma===b&&ya===c||(m.polygonOffset(b,c),ma=b,ya=c)}function E(a,b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,I(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,I(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,I(b.magFilter)),m.texParameteri(a,
@@ -516,16 +517,16 @@ if(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFil
 if(a===THREE.UnsignedShort565Type)return m.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return m.BYTE;if(a===THREE.ShortType)return m.SHORT;if(a===THREE.UnsignedShortType)return m.UNSIGNED_SHORT;if(a===THREE.IntType)return m.INT;if(a===THREE.UnsignedIntType)return m.UNSIGNED_INT;if(a===THREE.FloatType)return m.FLOAT;if(a===THREE.AlphaFormat)return m.ALPHA;if(a===THREE.RGBFormat)return m.RGB;if(a===THREE.RGBAFormat)return m.RGBA;if(a===THREE.LuminanceFormat)return m.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return m.LUMINANCE_ALPHA;
 if(a===THREE.AddEquation)return m.FUNC_ADD;if(a===THREE.SubtractEquation)return m.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return m.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return m.ZERO;if(a===THREE.OneFactor)return m.ONE;if(a===THREE.SrcColorFactor)return m.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return m.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return m.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return m.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return m.DST_ALPHA;
 if(a===THREE.OneMinusDstAlphaFactor)return m.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return m.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return m.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return m.SRC_ALPHA_SATURATE;if(void 0!==Sa){if(a===THREE.RGB_S3TC_DXT1_Format)return Sa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Sa.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Sa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Sa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}
-console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var T=void 0!==a.canvas?a.canvas:document.createElement("canvas"),Z=void 0!==a.context?a.context:null,X=void 0!==a.precision?a.precision:"highp",J=void 0!==a.alpha?a.alpha:!1,oa=void 0!==a.depth?a.depth:!0,V=void 0!==a.stencil?a.stencil:!0,U=void 0!==a.antialias?a.antialias:!1,la=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,za=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Ea=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:
-!1,Ba=new THREE.Color(0),qa=0,Pa=[],Qa=[],sa=!0;this.domElement=T;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=
-!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var F=this,Ja=[],Ta=null,Za=null,da=-1,ka=null,Fa=null,ia=0,Ca=-1,Da=-1,ta=-1,Ka=-1,$=-1,wa=-1,Ga=-1,La=-1,Va=null,ma=null,ya=null,pa=null,Aa=0,pb=0,Eb=T.width,xb=T.height,Jb=0,Kb=0,Fb=new Uint8Array(16),tb=new Uint8Array(16),kc=new THREE.Frustum,Vb=new THREE.Matrix4,lc=new THREE.Matrix4,
-ba=new THREE.Vector3,ca=new THREE.Vector3,eb=!0,Lb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,ub,qb,ob,Sa,Gb;(function(){try{var a={alpha:J,depth:oa,stencil:V,antialias:U,premultipliedAlpha:la,preserveDrawingBuffer:za};m=Z||T.getContext("webgl",a)||T.getContext("experimental-webgl",
+console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var S=void 0!==a.canvas?a.canvas:document.createElement("canvas"),Z=void 0!==a.context?a.context:null,X=void 0!==a.precision?a.precision:"highp",J=void 0!==a.alpha?a.alpha:!1,oa=void 0!==a.depth?a.depth:!0,V=void 0!==a.stencil?a.stencil:!0,T=void 0!==a.antialias?a.antialias:!1,la=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,za=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Ea=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:
+!1,Ba=new THREE.Color(0),qa=0,Pa=[],Qa=[],sa=!0;this.domElement=S;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=
+!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var F=this,Ja=[],Ta=null,Za=null,da=-1,ka=null,Fa=null,ia=0,Ca=-1,Da=-1,ta=-1,Ka=-1,$=-1,wa=-1,Ga=-1,La=-1,Va=null,ma=null,ya=null,pa=null,Aa=0,pb=0,Eb=S.width,xb=S.height,Jb=0,Kb=0,Fb=new Uint8Array(16),tb=new Uint8Array(16),kc=new THREE.Frustum,Vb=new THREE.Matrix4,lc=new THREE.Matrix4,
+ba=new THREE.Vector3,ca=new THREE.Vector3,eb=!0,Lb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},m,ub,qb,ob,Sa,Gb;(function(){try{var a={alpha:J,depth:oa,stencil:V,antialias:T,premultipliedAlpha:la,preserveDrawingBuffer:za};m=Z||S.getContext("webgl",a)||S.getContext("experimental-webgl",
 a);if(null===m)throw"Error creating WebGL context.";}catch(b){console.error(b)}ub=m.getExtension("OES_texture_float");m.getExtension("OES_texture_float_linear");qb=m.getExtension("OES_standard_derivatives");ob=m.getExtension("EXT_texture_filter_anisotropic")||m.getExtension("MOZ_EXT_texture_filter_anisotropic")||m.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Sa=m.getExtension("WEBGL_compressed_texture_s3tc")||m.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||m.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
 Gb=m.getExtension("OES_element_index_uint");null===ub&&console.log("THREE.WebGLRenderer: Float textures not supported.");null===qb&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===ob&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===Sa&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===Gb&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");void 0===m.getShaderPrecisionFormat&&
 (m.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});Ea&&m.getExtension("EXT_frag_depth")})();m.clearColor(0,0,0,1);m.clearDepth(1);m.clearStencil(0);m.enable(m.DEPTH_TEST);m.depthFunc(m.LEQUAL);m.frontFace(m.CCW);m.cullFace(m.BACK);m.enable(m.CULL_FACE);m.enable(m.BLEND);m.blendEquation(m.FUNC_ADD);m.blendFunc(m.SRC_ALPHA,m.ONE_MINUS_SRC_ALPHA);m.viewport(Aa,pb,Eb,xb);m.clearColor(Ba.r,Ba.g,Ba.b,qa);this.context=m;var Sb=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),tc=
 m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS);m.getParameter(m.MAX_TEXTURE_SIZE);var sc=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),Tb=ob?m.getParameter(ob.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Db=0<tc,Qb=Db&&ub;Sa&&m.getParameter(m.COMPRESSED_TEXTURE_FORMATS);var zc=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.HIGH_FLOAT),Ac=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_FLOAT);var Bc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT),
 Cc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.LOW_FLOAT);var Dc=0<zc.precision&&0<Bc.precision,fc=0<Ac.precision&&0<Cc.precision;"highp"!==X||Dc||(fc?(X="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(X="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==X||fc||(X="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));this.getContext=
-function(){return m};this.supportsVertexTextures=function(){return Db};this.supportsFloatTextures=function(){return ub};this.supportsStandardDerivatives=function(){return qb};this.supportsCompressedTextureS3TC=function(){return Sa};this.getMaxAnisotropy=function(){return Tb};this.getPrecision=function(){return X};this.setSize=function(a,b,c){T.width=a*this.devicePixelRatio;T.height=b*this.devicePixelRatio;!1!==c&&(T.style.width=a+"px",T.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=
+function(){return m};this.supportsVertexTextures=function(){return Db};this.supportsFloatTextures=function(){return ub};this.supportsStandardDerivatives=function(){return qb};this.supportsCompressedTextureS3TC=function(){return Sa};this.getMaxAnisotropy=function(){return Tb};this.getPrecision=function(){return X};this.setSize=function(a,b,c){S.width=a*this.devicePixelRatio;S.height=b*this.devicePixelRatio;!1!==c&&(S.style.width=a+"px",S.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=
 function(a,b,c,d){Aa=a*this.devicePixelRatio;pb=b*this.devicePixelRatio;Eb=c*this.devicePixelRatio;xb=d*this.devicePixelRatio;m.viewport(Aa,pb,Eb,xb)};this.setScissor=function(a,b,c,d){m.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?m.enable(m.SCISSOR_TEST):m.disable(m.SCISSOR_TEST)};this.setClearColor=function(a,b){Ba.set(a);qa=void 0!==b?b:1;m.clearColor(Ba.r,Ba.g,Ba.b,qa)};this.setClearColorHex=function(a,
 b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return Ba};this.getClearAlpha=function(){return qa};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=m.COLOR_BUFFER_BIT;if(void 0===b||b)d|=m.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=m.STENCIL_BUFFER_BIT;m.clear(d)};this.clearColor=function(){m.clear(m.COLOR_BUFFER_BIT)};this.clearDepth=function(){m.clear(m.DEPTH_BUFFER_BIT)};this.clearStencil=
 function(){m.clear(m.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){Ta=null;da=ka=La=Ga=ta=-1;eb=!0;Da=Ca=-1;gc(a);this.shadowMapPlugin.update(a,b)};var hc=function(a){a=a.target;a.removeEventListener("dispose",hc);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){a=
@@ -692,13 +693,13 @@ s,v,[w,u,B]));this.faceVertexUvs[0].push([x,C,A]);this.faces.push(new THREE.Face
 C,O]);if(!1===f&&0<b)for(this.vertices.push(new THREE.Vector3(0,-g,0)),h=0;h<d;h++)t=l[k][h+1],s=l[k][h],p=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),D=new THREE.Vector3(0,-1,0),x=n[k][h+1].clone(),C=n[k][h].clone(),O=new THREE.Vector2(C.x,1),this.faces.push(new THREE.Face3(t,s,p,[w,u,D])),this.faceVertexUvs[0].push([x,C,O]);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.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
 THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.Math.sign,e=1,e=a.x-b.x,f=a.y-b.y,g=c.x-a.x,h=c.y-a.y,k=e*e+f*f;if(1E-10<Math.abs(e*h-f*g)){var l=Math.sqrt(k),d=Math.sqrt(g*g+h*h),k=b.x-f/l;b=b.y+e/l;g=((c.x-h/d-k)*h-(c.y+g/d-b)*g)/(e*h-f*g);c=k+e*g-a.x;a=b+f*g-a.y;e=c*c+a*a;if(2>=e)return new THREE.Vector2(c,a);e=Math.sqrt(e/2)}else a=!1,1E-10<e?1E-10<g&&(a=!0):-1E-10>e?-1E-10>g&&
-(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(J=c.length;0<=--J;){e=J;f=J-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;g<h;g++){var k=T*g,l=T*(g+1),p=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,r=c,s=g,v=h,w=e,x=f,p=p+aa,k=k+aa,q=q+aa,l=l+aa;Q.faces.push(new THREE.Face3(p,k,l,null,null,u));Q.faces.push(new THREE.Face3(k,q,l,null,null,u));p=D.generateSideWallUV(Q,a,r,b,p,k,q,l,s,v,w,x);Q.faceVertexUvs[0].push([p[0],
+(a=!0):d(f)==d(h)&&(a=!0),a?(c=-f,a=e,e=Math.sqrt(k)):(c=e,a=f,e=Math.sqrt(k/2));return new THREE.Vector2(c/e,a/e)}function e(c,d){var e,f;for(J=c.length;0<=--J;){e=J;f=J-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;g<h;g++){var k=S*g,l=S*(g+1),p=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,r=c,s=g,v=h,w=e,x=f,p=p+aa,k=k+aa,q=q+aa,l=l+aa;Q.faces.push(new THREE.Face3(p,k,l,null,null,u));Q.faces.push(new THREE.Face3(k,q,l,null,null,u));p=D.generateSideWallUV(Q,a,r,b,p,k,q,l,s,v,w,x);Q.faceVertexUvs[0].push([p[0],
 p[1],p[3]]);Q.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function f(a,b,c){Q.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=aa;d+=aa;e+=aa;Q.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?D.generateBottomUV(Q,a,b,c,d,e):D.generateTopUV(Q,a,b,c,d,e);Q.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:
 !0,r=void 0!==b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,p,v=!1,w=b.material,u=b.extrudeMaterial,D=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,B,x,C,O;s&&(p=s.getSpacedPoints(t),v=!0,q=!1,B=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),x=new THREE.Vector3,C=new THREE.Vector3,O=new THREE.Vector3);q||(l=k=n=0);var A,y,M,Q=this,aa=this.vertices.length,s=a.extractPoints(r),r=s.shape,H=s.holes;if(s=!THREE.Shape.Utils.isClockWise(r)){r=
-r.reverse();y=0;for(M=H.length;y<M;y++)A=H[y],THREE.Shape.Utils.isClockWise(A)&&(H[y]=A.reverse());s=!1}var z=THREE.Shape.Utils.triangulateShape(r,H),K=r;y=0;for(M=H.length;y<M;y++)A=H[y],r=r.concat(A);var E,P,L,R,I,T=r.length,Z,X=z.length,s=[],J=0;L=K.length;E=L-1;for(P=J+1;J<L;J++,E++,P++)E===L&&(E=0),P===L&&(P=0),s[J]=d(K[J],K[E],K[P]);var oa=[],V,U=s.concat();y=0;for(M=H.length;y<M;y++){A=H[y];V=[];J=0;L=A.length;E=L-1;for(P=J+1;J<L;J++,E++,P++)E===L&&(E=0),P===L&&(P=0),V[J]=d(A[J],A[E],A[P]);
-oa.push(V);U=U.concat(V)}for(E=0;E<n;E++){L=E/n;R=k*(1-L);P=l*Math.sin(L*Math.PI/2);J=0;for(L=K.length;J<L;J++)I=c(K[J],s[J],P),f(I.x,I.y,-R);y=0;for(M=H.length;y<M;y++)for(A=H[y],V=oa[y],J=0,L=A.length;J<L;J++)I=c(A[J],V[J],P),f(I.x,I.y,-R)}P=l;for(J=0;J<T;J++)I=q?c(r[J],U[J],P):r[J],v?(C.copy(B.normals[0]).multiplyScalar(I.x),x.copy(B.binormals[0]).multiplyScalar(I.y),O.copy(p[0]).add(C).add(x),f(O.x,O.y,O.z)):f(I.x,I.y,0);for(L=1;L<=t;L++)for(J=0;J<T;J++)I=q?c(r[J],U[J],P):r[J],v?(C.copy(B.normals[L]).multiplyScalar(I.x),
-x.copy(B.binormals[L]).multiplyScalar(I.y),O.copy(p[L]).add(C).add(x),f(O.x,O.y,O.z)):f(I.x,I.y,h/t*L);for(E=n-1;0<=E;E--){L=E/n;R=k*(1-L);P=l*Math.sin(L*Math.PI/2);J=0;for(L=K.length;J<L;J++)I=c(K[J],s[J],P),f(I.x,I.y,h+R);y=0;for(M=H.length;y<M;y++)for(A=H[y],V=oa[y],J=0,L=A.length;J<L;J++)I=c(A[J],V[J],P),v?f(I.x,I.y+p[t-1].y,p[t-1].x+R):f(I.x,I.y,h+R)}(function(){if(q){var a;a=0*T;for(J=0;J<X;J++)Z=z[J],g(Z[2]+a,Z[1]+a,Z[0]+a,!0);a=t+2*n;a*=T;for(J=0;J<X;J++)Z=z[J],g(Z[0]+a,Z[1]+a,Z[2]+a,!1)}else{for(J=
-0;J<X;J++)Z=z[J],g(Z[2],Z[1],Z[0],!0);for(J=0;J<X;J++)Z=z[J],g(Z[0]+T*t,Z[1]+T*t,Z[2]+T*t,!1)}})();(function(){var a=0;e(K,a);a+=K.length;y=0;for(M=H.length;y<M;y++)A=H[y],e(A,a),a+=A.length})()};
+r.reverse();y=0;for(M=H.length;y<M;y++)A=H[y],THREE.Shape.Utils.isClockWise(A)&&(H[y]=A.reverse());s=!1}var z=THREE.Shape.Utils.triangulateShape(r,H),K=r;y=0;for(M=H.length;y<M;y++)A=H[y],r=r.concat(A);var E,P,L,R,I,S=r.length,Z,X=z.length,s=[],J=0;L=K.length;E=L-1;for(P=J+1;J<L;J++,E++,P++)E===L&&(E=0),P===L&&(P=0),s[J]=d(K[J],K[E],K[P]);var oa=[],V,T=s.concat();y=0;for(M=H.length;y<M;y++){A=H[y];V=[];J=0;L=A.length;E=L-1;for(P=J+1;J<L;J++,E++,P++)E===L&&(E=0),P===L&&(P=0),V[J]=d(A[J],A[E],A[P]);
+oa.push(V);T=T.concat(V)}for(E=0;E<n;E++){L=E/n;R=k*(1-L);P=l*Math.sin(L*Math.PI/2);J=0;for(L=K.length;J<L;J++)I=c(K[J],s[J],P),f(I.x,I.y,-R);y=0;for(M=H.length;y<M;y++)for(A=H[y],V=oa[y],J=0,L=A.length;J<L;J++)I=c(A[J],V[J],P),f(I.x,I.y,-R)}P=l;for(J=0;J<S;J++)I=q?c(r[J],T[J],P):r[J],v?(C.copy(B.normals[0]).multiplyScalar(I.x),x.copy(B.binormals[0]).multiplyScalar(I.y),O.copy(p[0]).add(C).add(x),f(O.x,O.y,O.z)):f(I.x,I.y,0);for(L=1;L<=t;L++)for(J=0;J<S;J++)I=q?c(r[J],T[J],P):r[J],v?(C.copy(B.normals[L]).multiplyScalar(I.x),
+x.copy(B.binormals[L]).multiplyScalar(I.y),O.copy(p[L]).add(C).add(x),f(O.x,O.y,O.z)):f(I.x,I.y,h/t*L);for(E=n-1;0<=E;E--){L=E/n;R=k*(1-L);P=l*Math.sin(L*Math.PI/2);J=0;for(L=K.length;J<L;J++)I=c(K[J],s[J],P),f(I.x,I.y,h+R);y=0;for(M=H.length;y<M;y++)for(A=H[y],V=oa[y],J=0,L=A.length;J<L;J++)I=c(A[J],V[J],P),v?f(I.x,I.y+p[t-1].y,p[t-1].x+R):f(I.x,I.y,h+R)}(function(){if(q){var a;a=0*S;for(J=0;J<X;J++)Z=z[J],g(Z[2]+a,Z[1]+a,Z[0]+a,!0);a=t+2*n;a*=S;for(J=0;J<X;J++)Z=z[J],g(Z[0]+a,Z[1]+a,Z[2]+a,!1)}else{for(J=
+0;J<X;J++)Z=z[J],g(Z[2],Z[1],Z[0],!0);for(J=0;J<X;J++)Z=z[J],g(Z[0]+S*t,Z[1]+S*t,Z[2]+S*t,!1)}})();(function(){var a=0;e(K,a);a+=K.length;y=0;for(M=H.length;y<M;y++)A=H[y],e(A,a),a+=A.length})()};
 THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,f){b=a.vertices[e].x;e=a.vertices[e].y;c=a.vertices[f].x;f=a.vertices[f].y;return[new THREE.Vector2(a.vertices[d].x,a.vertices[d].y),new THREE.Vector2(b,e),new THREE.Vector2(c,f)]},generateBottomUV:function(a,b,c,d,e,f){return this.generateTopUV(a,b,c,d,e,f)},generateSideWallUV:function(a,b,c,d,e,f,g,h,k,l,n,q){b=a.vertices[e].x;c=a.vertices[e].y;e=a.vertices[e].z;d=a.vertices[f].x;k=a.vertices[f].y;f=a.vertices[f].z;l=a.vertices[g].x;
 n=a.vertices[g].y;g=a.vertices[g].z;q=a.vertices[h].x;var r=a.vertices[h].y;a=a.vertices[h].z;return 0.01>Math.abs(c-k)?[new THREE.Vector2(b,1-e),new THREE.Vector2(d,1-f),new THREE.Vector2(l,1-g),new THREE.Vector2(q,1-a)]:[new THREE.Vector2(c,1-e),new THREE.Vector2(k,1-f),new THREE.Vector2(n,1-g),new THREE.Vector2(r,1-a)]}};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;
 THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};