浏览代码

Updated builds.

Mr.doob 11 年之前
父节点
当前提交
addf447adc
共有 2 个文件被更改,包括 741 次插入727 次删除
  1. 551 540
      build/three.js
  2. 190 187
      build/three.min.js

文件差异内容过多而无法显示
+ 551 - 540
build/three.js


+ 190 - 187
build/three.min.js

@@ -93,8 +93,8 @@ console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotati
 b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,l=d*h,p=d*e,b[0]=a-p*c,b[4]=-f*e,b[8]=l+k*c,b[1]=k+l*c,b[5]=f*h,b[9]=p-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,l=c*h,p=c*e,b[0]=g*h,b[4]=l*d-k,b[8]=a*d+p,b[1]=g*e,b[5]=p*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,l=c*g,p=c*d,b[0]=g*h,b[4]=p-a*e,b[8]=l*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-p*e):"XZY"===a.order&&(a=f*g,k=f*d,l=c*g,p=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+p,b[5]=f*h,b[9]=k*
 e-l,b[2]=l*e-k,b[6]=c*h,b[10]=p*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,k=e+e;a=c*g;var l=c*h,c=c*k,p=d*h,d=d*k,e=e*k,g=f*g,h=f*h,f=f*k;b[0]=1-(p+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-
 (a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+p);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f){var g=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(f,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(f,c).normalize());b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),
-multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],p=c[5],q=c[9],r=c[13],t=c[2],s=c[6],n=c[10],v=c[14],w=c[3],u=c[7],y=c[11],c=c[15],L=d[0],A=d[4],K=d[8],B=d[12],E=d[1],G=d[5],C=d[9],D=d[13],M=d[2],N=d[6],I=d[10],z=d[14],x=d[3],
-H=d[7],Q=d[11],d=d[15];e[0]=f*L+g*E+h*M+k*x;e[4]=f*A+g*G+h*N+k*H;e[8]=f*K+g*C+h*I+k*Q;e[12]=f*B+g*D+h*z+k*d;e[1]=l*L+p*E+q*M+r*x;e[5]=l*A+p*G+q*N+r*H;e[9]=l*K+p*C+q*I+r*Q;e[13]=l*B+p*D+q*z+r*d;e[2]=t*L+s*E+n*M+v*x;e[6]=t*A+s*G+n*N+v*H;e[10]=t*K+s*C+n*I+v*Q;e[14]=t*B+s*D+n*z+v*d;e[3]=w*L+u*E+y*M+c*x;e[7]=w*A+u*G+y*N+c*H;e[11]=w*K+u*C+y*I+c*Q;e[15]=w*B+u*D+y*z+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=
+multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],k=c[12],l=c[1],p=c[5],q=c[9],r=c[13],t=c[2],s=c[6],n=c[10],v=c[14],w=c[3],u=c[7],x=c[11],c=c[15],K=d[0],z=d[4],B=d[8],A=d[12],E=d[1],F=d[5],H=d[9],C=d[13],Q=d[2],D=d[6],R=d[10],L=d[14],J=d[3],
+G=d[7],P=d[11],d=d[15];e[0]=f*K+g*E+h*Q+k*J;e[4]=f*z+g*F+h*D+k*G;e[8]=f*B+g*H+h*R+k*P;e[12]=f*A+g*C+h*L+k*d;e[1]=l*K+p*E+q*Q+r*J;e[5]=l*z+p*F+q*D+r*G;e[9]=l*B+p*H+q*R+r*P;e[13]=l*A+p*C+q*L+r*d;e[2]=t*K+s*E+n*Q+v*J;e[6]=t*z+s*F+n*D+v*G;e[10]=t*B+s*H+n*R+v*P;e[14]=t*A+s*C+n*L+v*d;e[3]=w*K+u*E+x*Q+c*J;e[7]=w*z+u*F+x*D+c*G;e[11]=w*B+u*H+x*R+c*P;e[15]=w*A+u*C+x*L+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=
 d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
 return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=
 b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=
@@ -142,17 +142,8 @@ clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a)
 THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),
 a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){};
 THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&
-c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;e<d;e++)c[e]=b[e];for(e=0;e<d;e++)c[e].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);this.near=d||0;this.far=e||Infinity;this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var b=new a.Sphere,c=new a.Ray;new a.Plane;new a.Vector3;var d=new a.Vector3,e=new a.Matrix4,f=function(a,b){return a.distance-b.distance},g=new a.Vector3,h=new a.Vector3,k=new a.Vector3,l=function(f,p,t){if(f instanceof a.Sprite)f.raycast(p,t);else if(f instanceof a.PointCloud){var s=f.geometry,n=p.params.PointCloud.threshold;
-e.getInverse(f.matrixWorld);c.copy(p.ray).applyMatrix4(e);if(null!==s.boundingBox&&!1===c.isIntersectionBox(s.boundingBox))return t;var v=n/((f.scale.x+f.scale.y+f.scale.z)/3),w=new a.Vector3;if(s instanceof a.BufferGeometry){var n=s.attributes,u=n.position.array;if(void 0!==n.index){var y=n.index.array,L=s.offsets;0===L.length&&(L=[{start:0,count:y.length,index:0}]);for(var A=0,K=L.length;A<K;++A)for(var n=L[A].start,B=L[A].count,E=L[A].index,s=n,G=n+B;s<G;s++){n=E+y[s];w.set(u[3*n],u[3*n+1],u[3*
-n+2]);var C=c.distanceToPoint(w);if(C<v){var D=c.closestPointToPoint(w);D.applyMatrix4(f.matrixWorld);B=p.ray.origin.distanceTo(D);t.push({distance:B,distanceToRay:C,point:D.clone(),index:n,face:null,object:f})}}}else for(n=u.length/3,s=0;s<n;s++)w.set(u[3*s],u[3*s+1],u[3*s+2]),C=c.distanceToPoint(w),C<v&&(D=c.closestPointToPoint(w),D.applyMatrix4(f.matrixWorld),B=p.ray.origin.distanceTo(D),t.push({distance:B,distanceToRay:C,point:D,index:s,face:null,object:f}))}else for(u=f.geometry.vertices,s=0;s<
-u.length;s++)w=u[s],C=c.distanceToPoint(w),C<v&&(D=c.closestPointToPoint(w),D.applyMatrix4(f.matrixWorld),B=p.ray.origin.distanceTo(D),t.push({distance:B,distanceToRay:C,point:D.clone(),index:s,face:null,object:f}))}else if(f instanceof a.LOD)d.setFromMatrixPosition(f.matrixWorld),B=p.ray.origin.distanceTo(d),l(f.getObjectForDistance(B),p,t);else if(f instanceof a.Mesh){s=f.geometry;null===s.boundingSphere&&s.computeBoundingSphere();b.copy(s.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===p.ray.isIntersectionSphere(b))return t;
-e.getInverse(f.matrixWorld);c.copy(p.ray).applyMatrix4(e);if(null!==s.boundingBox&&!1===c.isIntersectionBox(s.boundingBox))return t;if(s instanceof a.BufferGeometry){v=f.material;if(void 0===v)return t;n=s.attributes;w=p.precision;if(void 0!==n.index)for(y=n.index.array,u=n.position.array,L=s.offsets,0===L.length&&(L=[{start:0,count:y.length,index:0}]),A=0,K=L.length;A<K;++A)for(n=L[A].start,B=L[A].count,E=L[A].index,s=n,G=n+B;s<G;s+=3){n=E+y[s];C=E+y[s+1];D=E+y[s+2];g.set(u[3*n],u[3*n+1],u[3*n+2]);
-h.set(u[3*C],u[3*C+1],u[3*C+2]);k.set(u[3*D],u[3*D+1],u[3*D+2]);var M=v.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,v.side!==a.DoubleSide);null!==M&&(M.applyMatrix4(f.matrixWorld),B=p.ray.origin.distanceTo(M),B<w||B<p.near||B>p.far||t.push({distance:B,point:M,indices:[n,C,D],face:null,faceIndex:null,object:f}))}else for(u=n.position.array,y=s=0,G=u.length;s<G;s+=3,y+=9)n=s,C=s+1,D=s+2,g.set(u[y],u[y+1],u[y+2]),h.set(u[y+3],u[y+4],u[y+5]),k.set(u[y+6],u[y+7],u[y+8]),M=
-v.side===a.BackSide?c.intersectTriangle(k,h,g,!0):c.intersectTriangle(g,h,k,v.side!==a.DoubleSide),null!==M&&(M.applyMatrix4(f.matrixWorld),B=p.ray.origin.distanceTo(M),B<w||B<p.near||B>p.far||t.push({distance:B,point:M,indices:[n,C,D],face:null,faceIndex:null,object:f}))}else if(s instanceof a.Geometry)for(y=f.material instanceof a.MeshFaceMaterial,L=!0===y?f.material.materials:null,w=p.precision,u=s.vertices,A=0,K=s.faces.length;A<K;A++)if(E=s.faces[A],v=!0===y?L[E.materialIndex]:f.material,void 0!==
-v){n=u[E.a];C=u[E.b];D=u[E.c];if(!0===v.morphTargets){B=s.morphTargets;M=f.morphTargetInfluences;g.set(0,0,0);h.set(0,0,0);k.set(0,0,0);for(var G=0,N=B.length;G<N;G++){var I=M[G];if(0!==I){var z=B[G].vertices;g.x+=(z[E.a].x-n.x)*I;g.y+=(z[E.a].y-n.y)*I;g.z+=(z[E.a].z-n.z)*I;h.x+=(z[E.b].x-C.x)*I;h.y+=(z[E.b].y-C.y)*I;h.z+=(z[E.b].z-C.z)*I;k.x+=(z[E.c].x-D.x)*I;k.y+=(z[E.c].y-D.y)*I;k.z+=(z[E.c].z-D.z)*I}}g.add(n);h.add(C);k.add(D);n=g;C=h;D=k}M=v.side===a.BackSide?c.intersectTriangle(D,C,n,!0):c.intersectTriangle(n,
-C,D,v.side!==a.DoubleSide);null!==M&&(M.applyMatrix4(f.matrixWorld),B=p.ray.origin.distanceTo(M),B<w||B<p.near||B>p.far||t.push({distance:B,point:M,face:E,faceIndex:A,object:f}))}}else if(f instanceof a.Line){w=p.linePrecision;n=w*w;s=f.geometry;null===s.boundingSphere&&s.computeBoundingSphere();b.copy(s.boundingSphere);b.applyMatrix4(f.matrixWorld);if(!1===p.ray.isIntersectionSphere(b))return t;e.getInverse(f.matrixWorld);c.copy(p.ray).applyMatrix4(e);if(s instanceof a.Geometry)for(u=s.vertices,
-v=u.length,w=new a.Vector3,C=new a.Vector3,D=f.type===a.LineStrip?1:2,s=0;s<v-1;s+=D)c.distanceSqToSegment(u[s],u[s+1],C,w)>n||(B=c.origin.distanceTo(C),B<p.near||B>p.far||t.push({distance:B,point:w.clone().applyMatrix4(f.matrixWorld),face:null,faceIndex:null,object:f}))}},p=function(a,b,c){a=a.getDescendants();for(var d=0,e=a.length;d<e;d++)l(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=
-function(a,b){var c=[];!0===b&&p(a,this,c);l(a,this,c);c.sort(f);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)l(a[d],this,c),!0===b&&p(a[d],this,c);c.sort(f);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,{position:{enumerable:!0,get:function(){return a},set:function(b){console.error("THREE.Object3D: .position = new THREE.Vector3() pattern no longer works. Use .position.copy() instead.");
+c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;e<d;e++)c[e]=b[e];for(e=0;e<d;e++)c[e].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,f,g){this.ray=new a.Ray(b,c);this.near=f||0;this.far=g||Infinity;this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var b=function(a,b){return a.distance-b.distance},c=function(a,b,c){a=a.getDescendants();for(var g=0,h=a.length;g<h;g++)a[g].raycast(b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.linePrecision=1;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b)};a.Raycaster.prototype.intersectObject=function(a,e){var f=
+[];a.raycast(this,f);!0===e&&c(a,this,f);f.sort(b);return f};a.Raycaster.prototype.intersectObjects=function(a,e){for(var f=[],g=0,h=a.length;g<h;g++){var k=a[g];k.raycast(this,f);!0===e&&c(k,this,f)}f.sort(b);return f}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)});c.onChange(function(){b.setFromQuaternion(c,void 0,!1)});Object.defineProperties(this,{position:{enumerable:!0,get:function(){return a},set:function(b){console.error("THREE.Object3D: .position = new THREE.Vector3() pattern no longer works. Use .position.copy() instead.");
 a.copy(b)}},rotation:{enumerable:!0,get:function(){return b},set:function(a){console.error("THREE.Object3D: .rotation = new THREE.Euler() pattern no longer works. Use .rotation.copy() instead.");b.copy(a)}},quaternion:{enumerable:!0,get:function(){return c},set:function(a){console.error("THREE.Object3D: .quaternion = new THREE.Quaternion() pattern no longer works. Use .quaternion.copy() instead.");c.copy(a)}},scale:{enumerable:!0,get:function(){return d},set:function(a){console.error("THREE.Object3D: .scale = new THREE.Vector3() pattern no longer works. Use .scale.copy() instead.");
 d.copy(a)}}});this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0);
 THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){console.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order.");return this.rotation.order},set eulerOrder(a){console.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order.");this.rotation.order=a},get useQuaternion(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},
@@ -164,23 +155,23 @@ a.parent.remove(a);a.parent=this;a.dispatchEvent({type:"added"});this.children.p
 this.children.length;b<c;b++)this.children[b].traverse(a)},getObjectById:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.id===a||!0===b&&(e=e.getObjectById(a,b),void 0!==e))return e}},getObjectByName:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.name===a||!0===b&&(e=e.getObjectByName(a,b),void 0!==e))return e}},getChildByName:function(a,b){console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");
 return this.getObjectByName(a,b)},getDescendants:function(a){void 0===a&&(a=[]);Array.prototype.push.apply(a,this.children);for(var b=0,c=this.children.length;b<c;b++)this.children[b].getDescendants(a);return a},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):
 this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);
-a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(p===r){var a=new THREE.RenderableVertex;q.push(a);r++;p++;return a}return q[p++]}function b(){if(s===v){var a=new THREE.RenderableFace;n.push(a);v++;s++;return a}return n[s++]}function c(){if(u===L){var a=new THREE.RenderableLine;y.push(a);L++;u++;return a}return y[u++]}function d(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function e(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 f,g,h=[],k=0,l,p,q=[],r=0,t,s,n=[],v=0,w,u,y=[],L=0,A,K,B=[],E=0,G={objects:[],lights:[],elements:[]},C=new THREE.Vector3,D=new THREE.Vector3,M=new THREE.Vector3,N=new THREE.Vector3,I=new THREE.Vector4,z=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),x=new THREE.Box3,H=Array(3),Q=new THREE.Matrix4,Y=
-new THREE.Matrix4,U,la=new THREE.Matrix4,W=new THREE.Matrix3,R=new THREE.Frustum,F=new THREE.Vector4,da=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);Y.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(Y)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);Y.multiplyMatrices(c.matrixWorld,a);return b.applyProjection(Y)}}();this.pickingRay=function(a,b){a.z=
--1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var V=function(a){if(!1!==a.visible){if(a instanceof THREE.Light)G.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===R.intersectsObject(a)){if(g===k){var b=new THREE.RenderableObject;h.push(b);k++;g++;f=b}else f=h[g++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:
-(N.setFromMatrixPosition(a.matrixWorld),N.applyProjection(Y),f.z=N.z);G.objects.push(f)}for(var b=0,c=a.children.length;b<c;b++)V(a.children[b])}},X=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(U);c.copy(b).applyMatrix4(Y);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},p=function(a,b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;H[0]=a.positionScreen;
-H[1]=b.positionScreen;H[2]=c.positionScreen;return z.isIntersectionBox(x.setFromPoints(H))},n=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:p,checkBackfaceCulling:n,pushVertex:function(b,c,d){l=a();l.position.set(b,c,d);
-k(l)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=q[a],e=q[b];w=c();w.id=f.id;w.v1.copy(d);w.v2.copy(e);w.z=(d.positionScreen.z+e.positionScreen.z)/2;w.material=f.material;G.elements.push(w)},pushTriangle:function(a,c,k){var l=q[a],r=q[c],s=q[k];if(!1!==p(l,r,s)&&(g.side===THREE.DoubleSide||!0===n(l,r,s))){t=b();t.id=f.id;t.v1.copy(l);t.v2.copy(r);t.v3.copy(s);t.z=(l.positionScreen.z+r.positionScreen.z+s.positionScreen.z)/3;for(l=0;3>l;l++)r=
-3*arguments[l],s=t.vertexNormalsModel[l],s.set(d[r],d[r+1],d[r+2]),s.applyMatrix3(h).normalize(),r=2*arguments[l],t.uvs[l].set(e[r],e[r+1]);t.vertexNormalsLength=3;t.material=f.material;G.elements.push(t)}}}};this.projectScene=function(f,h,k,l){var r,n,v,y,L,x,H,z;K=u=s=0;G.elements.length=0;!0===f.autoUpdate&&f.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();Q.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));Y.multiplyMatrices(h.projectionMatrix,Q);R.setFromMatrix(Y);g=0;G.objects.length=
-0;G.lights.length=0;V(f);!0===k&&G.objects.sort(d);f=0;for(k=G.objects.length;f<k;f++)if(r=G.objects[f].object,n=r.geometry,X.setObject(r),U=r.matrixWorld,p=0,r instanceof THREE.Mesh)if(n instanceof THREE.BufferGeometry){if(x=n.attributes,r=n.offsets,void 0!==x.position){H=x.position.array;n=0;for(y=H.length;n<y;n+=3)X.pushVertex(H[n],H[n+1],H[n+2]);if(void 0!==x.normal)for(z=x.normal.array,n=0,y=z.length;n<y;n+=3)X.pushNormal(z[n],z[n+1],z[n+2]);if(void 0!==x.uv)for(z=x.uv.array,n=0,y=z.length;n<
-y;n+=2)X.pushUv(z[n],z[n+1]);if(void 0!==x.index)if(x=x.index.array,0<r.length)for(f=0;f<r.length;f++)for(y=r[f],H=y.index,n=y.start,y=y.start+y.count;n<y;n+=3)X.pushTriangle(x[n]+H,x[n+1]+H,x[n+2]+H);else for(n=0,y=x.length;n<y;n+=3)X.pushTriangle(x[n],x[n+1],x[n+2]);else for(n=0,y=H.length/3;n<y;n+=3)X.pushTriangle(n,n+1,n+2)}}else{if(n instanceof THREE.Geometry){v=n.vertices;y=n.faces;x=n.faceVertexUvs[0];W.getNormalMatrix(U);H=r.material instanceof THREE.MeshFaceMaterial;z=!0===H?r.material:null;
-for(var N=0,Fa=v.length;N<Fa;N++){var ia=v[N];X.pushVertex(ia.x,ia.y,ia.z)}N=0;for(Fa=y.length;N<Fa;N++){v=y[N];var ma=!0===H?z.materials[v.materialIndex]:r.material;if(void 0!==ma){var ya=ma.side,ia=q[v.a],Z=q[v.b],qa=q[v.c];if(!0===ma.morphTargets){L=n.morphTargets;var ua=r.morphTargetInfluences,Ca=ia.position,va=Z.position,Da=qa.position;C.set(0,0,0);D.set(0,0,0);M.set(0,0,0);for(var Ja=0,ja=L.length;Ja<ja;Ja++){var ra=ua[Ja];if(0!==ra){var Ka=L[Ja].vertices;C.x+=(Ka[v.a].x-Ca.x)*ra;C.y+=(Ka[v.a].y-
-Ca.y)*ra;C.z+=(Ka[v.a].z-Ca.z)*ra;D.x+=(Ka[v.b].x-va.x)*ra;D.y+=(Ka[v.b].y-va.y)*ra;D.z+=(Ka[v.b].z-va.z)*ra;M.x+=(Ka[v.c].x-Da.x)*ra;M.y+=(Ka[v.c].y-Da.y)*ra;M.z+=(Ka[v.c].z-Da.z)*ra}}ia.position.add(C);Z.position.add(D);qa.position.add(M);X.projectVertex(ia);X.projectVertex(Z);X.projectVertex(qa)}if(!1!==X.checkTriangleVisibility(ia,Z,qa)){ua=X.checkBackfaceCulling(ia,Z,qa);if(ya!==THREE.DoubleSide){if(ya===THREE.FrontSide&&!1===ua)continue;if(ya===THREE.BackSide&&!0===ua)continue}t=b();t.id=r.id;
-t.v1.copy(ia);t.v2.copy(Z);t.v3.copy(qa);t.normalModel.copy(v.normal);!1!==ua||ya!==THREE.BackSide&&ya!==THREE.DoubleSide||t.normalModel.negate();t.normalModel.applyMatrix3(W).normalize();L=v.vertexNormals;Ca=0;for(va=Math.min(L.length,3);Ca<va;Ca++)Da=t.vertexNormalsModel[Ca],Da.copy(L[Ca]),!1!==ua||ya!==THREE.BackSide&&ya!==THREE.DoubleSide||Da.negate(),Da.applyMatrix3(W).normalize();t.vertexNormalsLength=L.length;ya=x[N];if(void 0!==ya)for(L=0;3>L;L++)t.uvs[L].copy(ya[L]);t.color=v.color;t.material=
-ma;t.z=(ia.positionScreen.z+Z.positionScreen.z+qa.positionScreen.z)/3;G.elements.push(t)}}}}}else if(r instanceof THREE.Line)if(n instanceof THREE.BufferGeometry){if(x=n.attributes,void 0!==x.position){H=x.position.array;n=0;for(y=H.length;n<y;n+=3)X.pushVertex(H[n],H[n+1],H[n+2]);if(void 0!==x.index)for(x=x.index.array,n=0,y=x.length;n<y;n+=2)X.pushLine(x[n],x[n+1]);else for(n=0,y=H.length/3-1;n<y;n++)X.pushLine(n,n+1)}}else{if(n instanceof THREE.Geometry&&(la.multiplyMatrices(Y,U),v=r.geometry.vertices,
-0!==v.length))for(ia=a(),ia.positionScreen.copy(v[0]).applyMatrix4(la),n=r.type===THREE.LinePieces?2:1,N=1,Fa=v.length;N<Fa;N++)ia=a(),ia.positionScreen.copy(v[N]).applyMatrix4(la),0<(N+1)%n||(Z=q[p-2],F.copy(ia.positionScreen),da.copy(Z.positionScreen),!0===e(F,da)&&(F.multiplyScalar(1/F.w),da.multiplyScalar(1/da.w),w=c(),w.id=r.id,w.v1.positionScreen.copy(F),w.v2.positionScreen.copy(da),w.z=Math.max(F.z,da.z),w.material=r.material,r.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(r.geometry.colors[N]),
-w.vertexColors[1].copy(r.geometry.colors[N-1])),G.elements.push(w)))}else r instanceof THREE.Sprite&&(I.set(U.elements[12],U.elements[13],U.elements[14],1),I.applyMatrix4(Y),n=1/I.w,I.z*=n,-1<=I.z&&1>=I.z&&(K===E?(y=new THREE.RenderableSprite,B.push(y),E++,K++,A=y):A=B[K++],A.id=r.id,A.x=I.x*n,A.y=I.y*n,A.z=I.z,A.object=r,A.rotation=r.rotation,A.scale.x=r.scale.x*Math.abs(A.x-(I.x+h.projectionMatrix.elements[0])/(I.w+h.projectionMatrix.elements[12])),A.scale.y=r.scale.y*Math.abs(A.y-(I.y+h.projectionMatrix.elements[5])/
-(I.w+h.projectionMatrix.elements[13])),A.material=r.material,G.elements.push(A)));!0===l&&G.elements.sort(d);return G}};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};
+a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(p===r){var a=new THREE.RenderableVertex;q.push(a);r++;p++;return a}return q[p++]}function b(){if(s===v){var a=new THREE.RenderableFace;n.push(a);v++;s++;return a}return n[s++]}function c(){if(u===K){var a=new THREE.RenderableLine;x.push(a);K++;u++;return a}return x[u++]}function d(a,b){return a.z!==b.z?b.z-a.z:a.id!==b.id?a.id-b.id:0}function e(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 f,g,h=[],k=0,l,p,q=[],r=0,t,s,n=[],v=0,w,u,x=[],K=0,z,B,A=[],E=0,F={objects:[],lights:[],elements:[]},H=new THREE.Vector3,C=new THREE.Vector3,Q=new THREE.Vector3,D=new THREE.Vector3,R=new THREE.Vector4,L=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),J=new THREE.Box3,G=Array(3),P=new THREE.Matrix4,Y=
+new THREE.Matrix4,M,la=new THREE.Matrix4,W=new THREE.Matrix3,S=new THREE.Frustum,y=new THREE.Vector4,da=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);Y.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection(Y)};this.unprojectVector=function(){var a=new THREE.Matrix4;return function(b,c){a.getInverse(c.projectionMatrix);Y.multiplyMatrices(c.matrixWorld,a);return b.applyProjection(Y)}}();this.pickingRay=function(a,b){a.z=
+-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,c)};var V=function(a){if(!1!==a.visible){if(a instanceof THREE.Light)F.lights.push(a);else if(a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.Sprite)if(!1===a.frustumCulled||!0===S.intersectsObject(a)){if(g===k){var b=new THREE.RenderableObject;h.push(b);k++;g++;f=b}else f=h[g++];f.id=a.id;f.object=a;null!==a.renderDepth?f.z=a.renderDepth:
+(D.setFromMatrixPosition(a.matrixWorld),D.applyProjection(Y),f.z=D.z);F.objects.push(f)}for(var b=0,c=a.children.length;b<c;b++)V(a.children[b])}},X=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(M);c.copy(b).applyMatrix4(Y);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},p=function(a,b,c){if(!0===a.visible||!0===b.visible||!0===c.visible)return!0;G[0]=a.positionScreen;
+G[1]=b.positionScreen;G[2]=c.positionScreen;return L.isIntersectionBox(J.setFromPoints(G))},r=function(a,b,c){return 0>(c.positionScreen.x-a.positionScreen.x)*(b.positionScreen.y-a.positionScreen.y)-(c.positionScreen.y-a.positionScreen.y)*(b.positionScreen.x-a.positionScreen.x)};return{setObject:function(a){f=a;g=f.material;h.getNormalMatrix(f.matrixWorld);d.length=0;e.length=0},projectVertex:k,checkTriangleVisibility:p,checkBackfaceCulling:r,pushVertex:function(b,c,d){l=a();l.position.set(b,c,d);
+k(l)},pushNormal:function(a,b,c){d.push(a,b,c)},pushUv:function(a,b){e.push(a,b)},pushLine:function(a,b){var d=q[a],e=q[b];w=c();w.id=f.id;w.v1.copy(d);w.v2.copy(e);w.z=(d.positionScreen.z+e.positionScreen.z)/2;w.material=f.material;F.elements.push(w)},pushTriangle:function(a,c,k){var l=q[a],n=q[c],s=q[k];if(!1!==p(l,n,s)&&(g.side===THREE.DoubleSide||!0===r(l,n,s))){t=b();t.id=f.id;t.v1.copy(l);t.v2.copy(n);t.v3.copy(s);t.z=(l.positionScreen.z+n.positionScreen.z+s.positionScreen.z)/3;for(l=0;3>l;l++)n=
+3*arguments[l],s=t.vertexNormalsModel[l],s.set(d[n],d[n+1],d[n+2]),s.applyMatrix3(h).normalize(),n=2*arguments[l],t.uvs[l].set(e[n],e[n+1]);t.vertexNormalsLength=3;t.material=f.material;F.elements.push(t)}}}};this.projectScene=function(f,h,k,l){var r,n,v,x,K,J,G,L;B=u=s=0;F.elements.length=0;!0===f.autoUpdate&&f.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();P.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));Y.multiplyMatrices(h.projectionMatrix,P);S.setFromMatrix(Y);g=0;F.objects.length=
+0;F.lights.length=0;V(f);!0===k&&F.objects.sort(d);f=0;for(k=F.objects.length;f<k;f++)if(r=F.objects[f].object,n=r.geometry,X.setObject(r),M=r.matrixWorld,p=0,r instanceof THREE.Mesh)if(n instanceof THREE.BufferGeometry){if(J=n.attributes,r=n.offsets,void 0!==J.position){G=J.position.array;n=0;for(x=G.length;n<x;n+=3)X.pushVertex(G[n],G[n+1],G[n+2]);if(void 0!==J.normal)for(L=J.normal.array,n=0,x=L.length;n<x;n+=3)X.pushNormal(L[n],L[n+1],L[n+2]);if(void 0!==J.uv)for(L=J.uv.array,n=0,x=L.length;n<
+x;n+=2)X.pushUv(L[n],L[n+1]);if(void 0!==J.index)if(J=J.index.array,0<r.length)for(f=0;f<r.length;f++)for(x=r[f],G=x.index,n=x.start,x=x.start+x.count;n<x;n+=3)X.pushTriangle(J[n]+G,J[n+1]+G,J[n+2]+G);else for(n=0,x=J.length;n<x;n+=3)X.pushTriangle(J[n],J[n+1],J[n+2]);else for(n=0,x=G.length/3;n<x;n+=3)X.pushTriangle(n,n+1,n+2)}}else{if(n instanceof THREE.Geometry){v=n.vertices;x=n.faces;J=n.faceVertexUvs[0];W.getNormalMatrix(M);G=r.material instanceof THREE.MeshFaceMaterial;L=!0===G?r.material:null;
+for(var D=0,Fa=v.length;D<Fa;D++){var ia=v[D];X.pushVertex(ia.x,ia.y,ia.z)}D=0;for(Fa=x.length;D<Fa;D++){v=x[D];var ma=!0===G?L.materials[v.materialIndex]:r.material;if(void 0!==ma){var ya=ma.side,ia=q[v.a],Z=q[v.b],qa=q[v.c];if(!0===ma.morphTargets){K=n.morphTargets;var ua=r.morphTargetInfluences,Ca=ia.position,va=Z.position,Da=qa.position;H.set(0,0,0);C.set(0,0,0);Q.set(0,0,0);for(var Ja=0,ja=K.length;Ja<ja;Ja++){var ra=ua[Ja];if(0!==ra){var Ka=K[Ja].vertices;H.x+=(Ka[v.a].x-Ca.x)*ra;H.y+=(Ka[v.a].y-
+Ca.y)*ra;H.z+=(Ka[v.a].z-Ca.z)*ra;C.x+=(Ka[v.b].x-va.x)*ra;C.y+=(Ka[v.b].y-va.y)*ra;C.z+=(Ka[v.b].z-va.z)*ra;Q.x+=(Ka[v.c].x-Da.x)*ra;Q.y+=(Ka[v.c].y-Da.y)*ra;Q.z+=(Ka[v.c].z-Da.z)*ra}}ia.position.add(H);Z.position.add(C);qa.position.add(Q);X.projectVertex(ia);X.projectVertex(Z);X.projectVertex(qa)}if(!1!==X.checkTriangleVisibility(ia,Z,qa)){ua=X.checkBackfaceCulling(ia,Z,qa);if(ya!==THREE.DoubleSide){if(ya===THREE.FrontSide&&!1===ua)continue;if(ya===THREE.BackSide&&!0===ua)continue}t=b();t.id=r.id;
+t.v1.copy(ia);t.v2.copy(Z);t.v3.copy(qa);t.normalModel.copy(v.normal);!1!==ua||ya!==THREE.BackSide&&ya!==THREE.DoubleSide||t.normalModel.negate();t.normalModel.applyMatrix3(W).normalize();K=v.vertexNormals;Ca=0;for(va=Math.min(K.length,3);Ca<va;Ca++)Da=t.vertexNormalsModel[Ca],Da.copy(K[Ca]),!1!==ua||ya!==THREE.BackSide&&ya!==THREE.DoubleSide||Da.negate(),Da.applyMatrix3(W).normalize();t.vertexNormalsLength=K.length;ya=J[D];if(void 0!==ya)for(K=0;3>K;K++)t.uvs[K].copy(ya[K]);t.color=v.color;t.material=
+ma;t.z=(ia.positionScreen.z+Z.positionScreen.z+qa.positionScreen.z)/3;F.elements.push(t)}}}}}else if(r instanceof THREE.Line)if(n instanceof THREE.BufferGeometry){if(J=n.attributes,void 0!==J.position){G=J.position.array;n=0;for(x=G.length;n<x;n+=3)X.pushVertex(G[n],G[n+1],G[n+2]);if(void 0!==J.index)for(J=J.index.array,n=0,x=J.length;n<x;n+=2)X.pushLine(J[n],J[n+1]);else for(n=0,x=G.length/3-1;n<x;n++)X.pushLine(n,n+1)}}else{if(n instanceof THREE.Geometry&&(la.multiplyMatrices(Y,M),v=r.geometry.vertices,
+0!==v.length))for(ia=a(),ia.positionScreen.copy(v[0]).applyMatrix4(la),n=r.type===THREE.LinePieces?2:1,D=1,Fa=v.length;D<Fa;D++)ia=a(),ia.positionScreen.copy(v[D]).applyMatrix4(la),0<(D+1)%n||(Z=q[p-2],y.copy(ia.positionScreen),da.copy(Z.positionScreen),!0===e(y,da)&&(y.multiplyScalar(1/y.w),da.multiplyScalar(1/da.w),w=c(),w.id=r.id,w.v1.positionScreen.copy(y),w.v2.positionScreen.copy(da),w.z=Math.max(y.z,da.z),w.material=r.material,r.material.vertexColors===THREE.VertexColors&&(w.vertexColors[0].copy(r.geometry.colors[D]),
+w.vertexColors[1].copy(r.geometry.colors[D-1])),F.elements.push(w)))}else r instanceof THREE.Sprite&&(R.set(M.elements[12],M.elements[13],M.elements[14],1),R.applyMatrix4(Y),n=1/R.w,R.z*=n,-1<=R.z&&1>=R.z&&(B===E?(x=new THREE.RenderableSprite,A.push(x),E++,B++,z=x):z=A[B++],z.id=r.id,z.x=R.x*n,z.y=R.y*n,z.z=R.z,z.object=r,z.rotation=r.rotation,z.scale.x=r.scale.x*Math.abs(z.x-(R.x+h.projectionMatrix.elements[0])/(R.w+h.projectionMatrix.elements[12])),z.scale.y=r.scale.y*Math.abs(z.y-(R.y+h.projectionMatrix.elements[5])/
+(R.w+h.projectionMatrix.elements[13])),z.material=r.material,F.elements.push(z)));!0===l&&F.elements.sort(d);return F}};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};
 THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},set:function(a){this.array.set(a);return this},setX:function(a,b){this.array[a*this.itemSize]=b;return this},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a]=b;this.array[a+1]=
 c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this}};THREE.Int8Attribute=function(a,b){console.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
@@ -193,12 +184,12 @@ b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getN
 f>b.max.y&&(b.max.y=f);g<b.min.z?b.min.z=g:g>b.max.z&&(b.max.z=g)}}if(void 0===a||0===a.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error("THREE.BufferGeometry.computeBoundingBox()",'Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')},computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===
 this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),a.addPoint(b);a.center(d);for(var g=0,e=0,f=c.length;e<f;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g);isNaN(this.boundingSphere.radius)&&console.error("THREE.BufferGeometry.computeBoundingSphere()",'Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),
 computeFaceNormals:function(){},computeVertexNormals:function(){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,p,q,r=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,n=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 y=u[c].index;a=b;for(b+=g;a<b;a+=3)g=y+w[a],h=y+w[a+1],k=y+w[a+2],l=e[3*g],p=e[3*g+1],q=e[3*g+2],r.set(l,p,q),l=e[3*h],p=e[3*h+1],q=e[3*h+2],t.set(l,p,q),l=e[3*k],p=e[3*k+1],q=e[3*k+2],s.set(l,p,q),n.subVectors(s,t),v.subVectors(r,t),n.cross(v),f[3*g]+=n.x,f[3*g+1]+=n.y,f[3*g+2]+=n.z,f[3*h]+=n.x,f[3*h+1]+=n.y,
+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 x=u[c].index;a=b;for(b+=g;a<b;a+=3)g=x+w[a],h=x+w[a+1],k=x+w[a+2],l=e[3*g],p=e[3*g+1],q=e[3*g+2],r.set(l,p,q),l=e[3*h],p=e[3*h+1],q=e[3*h+2],t.set(l,p,q),l=e[3*k],p=e[3*k+1],q=e[3*k+2],s.set(l,p,q),n.subVectors(s,t),v.subVectors(r,t),n.cross(v),f[3*g]+=n.x,f[3*g+1]+=n.y,f[3*g+2]+=n.z,f[3*h]+=n.x,f[3*h+1]+=n.y,
 f[3*h+2]+=n.z,f[3*k]+=n.x,f[3*k+1]+=n.y,f[3*k+2]+=n.z}}else for(a=0,b=e.length;a<b;a+=9)l=e[a],p=e[a+1],q=e[a+2],r.set(l,p,q),l=e[a+3],p=e[a+4],q=e[a+5],t.set(l,p,q),l=e[a+6],p=e[a+7],q=e[a+8],s.set(l,p,q),n.subVectors(s,t),v.subVectors(r,t),n.cross(v),f[a]=n.x,f[a+1]=n.y,f[a+2]=n.z,f[a+3]=n.x,f[a+4]=n.y,f[a+5]=n.z,f[a+6]=n.x,f[a+7]=n.y,f[a+8]=n.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];n=d[3*b+1];v=d[3*
-b+2];w=d[3*c];u=d[3*c+1];y=d[3*c+2];L=f[2*a];A=f[2*a+1];K=f[2*b];B=f[2*b+1];E=f[2*c];G=f[2*c+1];C=s-q;D=w-q;M=n-r;N=u-r;I=v-t;z=y-t;x=K-L;H=E-L;Q=B-A;Y=G-A;U=1/(x*Y-H*Q);la.set((Y*C-Q*D)*U,(Y*M-Q*N)*U,(Y*I-Q*z)*U);W.set((x*D-H*C)*U,(x*N-H*M)*U,(x*z-H*I)*U);k[a].add(la);k[b].add(la);k[c].add(la);l[a].add(W);l[b].add(W);l[c].add(W)}function b(a){fa.x=e[3*a];fa.y=e[3*a+1];fa.z=e[3*a+2];za.copy(fa);Ea=k[a];wa.copy(Ea);wa.sub(fa.multiplyScalar(fa.dot(Ea))).normalize();Ha.crossVectors(za,Ea);Ga=Ha.dot(l[a]);
+b+2];w=d[3*c];u=d[3*c+1];x=d[3*c+2];K=f[2*a];z=f[2*a+1];B=f[2*b];A=f[2*b+1];E=f[2*c];F=f[2*c+1];H=s-q;C=w-q;Q=n-r;D=u-r;R=v-t;L=x-t;J=B-K;G=E-K;P=A-z;Y=F-z;M=1/(J*Y-G*P);la.set((Y*H-P*C)*M,(Y*Q-P*D)*M,(Y*R-P*L)*M);W.set((J*C-G*H)*M,(J*D-G*Q)*M,(J*L-G*R)*M);k[a].add(la);k[b].add(la);k[c].add(la);l[a].add(W);l[b].add(W);l[c].add(W)}function b(a){fa.x=e[3*a];fa.y=e[3*a+1];fa.z=e[3*a+2];za.copy(fa);Ea=k[a];wa.copy(Ea);wa.sub(fa.multiplyScalar(fa.dot(Ea))).normalize();Ha.crossVectors(za,Ea);Ga=Ha.dot(l[a]);
 Ia=0>Ga?-1:1;h[4*a]=wa.x;h[4*a+1]=wa.y;h[4*a+2]=wa.z;h[4*a+3]=Ia}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=[],p=0;p<g;p++)k[p]=new THREE.Vector3,l[p]=new THREE.Vector3;var q,r,t,s,n,v,w,u,y,L,A,K,B,E,G,C,D,M,N,I,z,x,H,Q,Y,U,la=new THREE.Vector3,W=new THREE.Vector3,R,F,da,V,X,P=this.offsets,p=0;for(F=P.length;p<F;++p){R=P[p].start;da=P[p].count;var ga=P[p].index,g=R;for(R+=da;g<R;g+=3)da=ga+c[g],V=ga+c[g+1],X=ga+c[g+2],a(da,V,X)}var wa=new THREE.Vector3,Ha=new THREE.Vector3,fa=new THREE.Vector3,za=new THREE.Vector3,
-Ia,Ea,Ga,p=0;for(F=P.length;p<F;++p)for(R=P[p].start,da=P[p].count,ga=P[p].index,g=R,R+=da;g<R;g+=3)da=ga+c[g],V=ga+c[g+1],X=ga+c[g+2],b(da),b(V),b(X)}},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,p=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=[],p=0;p<g;p++)k[p]=new THREE.Vector3,l[p]=new THREE.Vector3;var q,r,t,s,n,v,w,u,x,K,z,B,A,E,F,H,C,Q,D,R,L,J,G,P,Y,M,la=new THREE.Vector3,W=new THREE.Vector3,S,y,da,V,X,O=this.offsets,p=0;for(y=O.length;p<y;++p){S=O[p].start;da=O[p].count;var ga=O[p].index,g=S;for(S+=da;g<S;g+=3)da=ga+c[g],V=ga+c[g+1],X=ga+c[g+2],a(da,V,X)}var wa=new THREE.Vector3,Ha=new THREE.Vector3,fa=new THREE.Vector3,za=new THREE.Vector3,
+Ia,Ea,Ga,p=0;for(y=O.length;p<y;++p)for(S=O[p].start,da=O[p].count,ga=O[p].index,g=S,S+=da;g<S;g+=3)da=ga+c[g],V=ga+c[g+1],X=ga+c[g+2],b(da),b(V),b(X)}},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,p=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 n=p=0;3>n;n++)s=a[3*c+n],-1==r[s]?(q[2*n]=s,q[2*n+1]=-1,p++):r[s]<k.index?(q[2*n]=s,q[2*n+1]=-1,l++):(q[2*n]=s,q[2*n+1]=r[s]);if(g+p>k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)n=q[p+1],-1<n&&n<k.index&&(q[p+1]=-1);for(p=0;6>p;p+=2)s=q[p],n=q[p+1],-1===n&&(n=g++),r[s]=n,t[n]=s,e[f++]=n-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],p=0;p<k;p++)l[e*k+p]=h[g*k+p];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,
@@ -209,9 +200,9 @@ computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=
 a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),k.subVectors(e,f),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=
 d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;f.faces=this.faces;a=0;for(b=
 this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var g=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),g.push(k)}g=this.morphNormals[a];f.vertices=this.morphTargets[a].vertices;f.computeFaceNormals();f.computeVertexNormals();c=0;for(d=this.faces.length;c<
-d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,p,q,r,t,s,n,v,w=[],u=[];c=new THREE.Vector3;var y=new THREE.Vector3,L=new THREE.Vector3,A=new THREE.Vector3,K=new THREE.Vector3;a=0;for(b=this.vertices.length;a<
-b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,g=this.vertices[d],h=this.vertices[v],k=this.vertices[e],l=f[0],p=f[1],q=f[2],f=h.x-g.x,r=k.x-g.x,t=h.y-g.y,s=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=p.x-l.x,n=q.x-l.x,p=p.y-l.y,l=q.y-l.y,q=1/(k*l-n*p),c.set((l*f-p*r)*q,(l*t-p*s)*q,(l*h-p*g)*q),y.set((k*r-n*f)*q,(k*s-n*t)*q,(k*g-n*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(y),u[v].add(y),u[e].add(y);y=
-["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)K.copy(e.vertexNormals[c]),d=e[y[c]],v=w[d],L.copy(v),L.sub(K.multiplyScalar(K.dot(v))).normalize(),A.crossVectors(e.vertexNormals[c],v),d=A.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(L.x,L.y,L.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===
+d;c++)e=this.faces[c],h=g.faceNormals[c],k=g.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,k,l,p,q,r,t,s,n,v,w=[],u=[];c=new THREE.Vector3;var x=new THREE.Vector3,K=new THREE.Vector3,z=new THREE.Vector3,B=new THREE.Vector3;a=0;for(b=this.vertices.length;a<
+b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,g=this.vertices[d],h=this.vertices[v],k=this.vertices[e],l=f[0],p=f[1],q=f[2],f=h.x-g.x,r=k.x-g.x,t=h.y-g.y,s=k.y-g.y,h=h.z-g.z,g=k.z-g.z,k=p.x-l.x,n=q.x-l.x,p=p.y-l.y,l=q.y-l.y,q=1/(k*l-n*p),c.set((l*f-p*r)*q,(l*t-p*s)*q,(l*h-p*g)*q),x.set((k*r-n*f)*q,(k*s-n*t)*q,(k*g-n*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(x),u[v].add(x),u[e].add(x);x=
+["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)B.copy(e.vertexNormals[c]),d=e[x[c]],v=w[d],K.copy(v),K.sub(B.multiplyScalar(B.dot(v))).normalize(),z.crossVectors(e.vertexNormals[c],v),d=z.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(K.x,K.y,K.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===
 this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,k=a.faces,l=this.faceVertexUvs[0];
 a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var p=0,q=g.length;p<q;p++){var r=g[p].clone();void 0!==b&&r.applyMatrix4(b);f.push(r)}p=0;for(q=k.length;p<q;p++){var g=k[p],t,s=g.vertexNormals,n=g.vertexColors,r=new THREE.Face3(g.a+e,g.b+e,g.c+e);r.normal.copy(g.normal);void 0!==d&&r.normal.applyMatrix3(d).normalize();b=0;for(f=s.length;b<f;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),r.vertexNormals.push(t);r.color.copy(g.color);
 b=0;for(f=n.length;b<f;b++)t=n[b],r.vertexColors.push(t.clone());r.materialIndex=g.materialIndex+c;h.push(r)}p=0;for(q=a.length;p<q;p++)if(c=a[p],d=[],void 0!==c){b=0;for(f=c.length;b<f;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));l.push(d)}}},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g;f=0;for(g=this.vertices.length;f<g;f++)d=this.vertices[f],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=
@@ -246,10 +237,10 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
 a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
 THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText);if(void 0!==h.metadata&&"scene"===h.metadata.type){console.error('THREE.JSONLoader: "'+b+'" seems to be a Scene. Use THREE.SceneLoader instead.');return}h=a.parse(h,d);c(h.geometry,h.materials)}else console.error('THREE.JSONLoader: "'+b+'" seems to be unreachable or the file is empty.');
 a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load \""+b+'" ('+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))};f.open("GET",b,!0);f.withCredentials=this.withCredentials;f.send(null)};
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,p,q,r,t,s,n,v,w,u=a.faces;p=a.vertices;var y=a.normals,L=a.colors,A=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&A++;for(d=0;d<A;d++)c.faceVertexUvs[d]=[]}k=0;for(l=p.length;k<l;)d=new THREE.Vector3,d.x=p[k++]*b,d.y=p[k++]*b,d.z=p[k++]*b,c.vertices.push(d);k=0;for(l=u.length;k<l;)if(b=u[k++],t=b&1,h=b&2,d=b&8,q=b&16,s=b&32,p=b&64,b&=128,t){t=new THREE.Face3;
-t.a=u[k];t.b=u[k+1];t.c=u[k+3];n=new THREE.Face3;n.a=u[k+1];n.b=u[k+2];n.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,n.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<A;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(y[q++],y[q++],y[q]),n.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(y[q++],
-y[q++],y[q]),2!==d&&t.vertexNormals.push(s),0!==d&&n.vertexNormals.push(s);p&&(p=u[k++],p=L[p],t.color.setHex(p),n.color.setHex(p));if(b)for(d=0;4>d;d++)p=u[k++],p=L[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&n.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(n)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<A;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],
-w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(y[q++],y[q++],y[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(y[q++],y[q++],y[q]),t.vertexNormals.push(s);p&&(p=u[k++],t.color.setHex(L[p]));if(b)for(d=0;3>d;d++)p=u[k++],t.vertexColors.push(new THREE.Color(L[p]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,g,h,k,l,p,q,r,t,s,n,v,w,u=a.faces;p=a.vertices;var x=a.normals,K=a.colors,z=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&z++;for(d=0;d<z;d++)c.faceVertexUvs[d]=[]}k=0;for(l=p.length;k<l;)d=new THREE.Vector3,d.x=p[k++]*b,d.y=p[k++]*b,d.z=p[k++]*b,c.vertices.push(d);k=0;for(l=u.length;k<l;)if(b=u[k++],t=b&1,h=b&2,d=b&8,q=b&16,s=b&32,p=b&64,b&=128,t){t=new THREE.Face3;
+t.a=u[k];t.b=u[k+1];t.c=u[k+3];n=new THREE.Face3;n.a=u[k+1];n.b=u[k+2];n.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,n.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],g=0;4>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==g&&c.faceVertexUvs[d][h].push(w),0!==g&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(x[q++],x[q++],x[q]),n.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*u[k++],s=new THREE.Vector3(x[q++],
+x[q++],x[q]),2!==d&&t.vertexNormals.push(s),0!==d&&n.vertexNormals.push(s);p&&(p=u[k++],p=K[p],t.color.setHex(p),n.color.setHex(p));if(b)for(d=0;4>d;d++)p=u[k++],p=K[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&n.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(n)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<z;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],g=0;3>g;g++)r=u[k++],w=v[2*r],r=v[2*r+1],
+w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(x[q++],x[q++],x[q]));if(s)for(d=0;3>d;d++)q=3*u[k++],s=new THREE.Vector3(x[q++],x[q++],x[q]),t.vertexNormals.push(s);p&&(p=u[k++],t.color.setHex(K[p]));if(b)for(d=0;3>d;d++)p=u[k++],t.vertexColors.push(new THREE.Color(K[p]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;d<g;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
 1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,g=a.skinIndices.length;d<g;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+
 "), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,g,h,k,l,p;d=0;for(g=a.morphTargets.length;d<g;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],l=c.morphTargets[d].vertices,p=a.morphTargets[d].vertices,h=0,k=p.length;h<k;h+=3){var q=new THREE.Vector3;q.x=p[h]*b;q.y=p[h+1]*b;q.z=p[h+2]*b;l.push(q)}}if(void 0!==a.morphColors)for(d=
 0,g=a.morphColors.length;d<g;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,l=a.morphColors[d].colors,b=0,h=l.length;b<h;b+=3)p=new THREE.Color(16755200),p.setRGB(l[b],l[b+1],l[b+2]),k.push(p)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){f++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,f);if(e===f&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
@@ -284,10 +275,21 @@ THREE.ShaderMaterial.prototype.clone=function(){var a=new THREE.ShaderMaterial;T
 this.morphTargets;a.morphNormals=this.morphNormals;return a};THREE.RawShaderMaterial=function(a){THREE.ShaderMaterial.call(this,a)};THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype);THREE.RawShaderMaterial.prototype.clone=function(){var a=new THREE.RawShaderMaterial;THREE.ShaderMaterial.prototype.clone.call(this,a);return a};THREE.SpriteMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.rotation=0;this.fog=!1;this.setValues(a)};THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype);THREE.SpriteMaterial.prototype.clone=function(){var a=new THREE.SpriteMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.rotation=this.rotation;a.fog=this.fog;return a};THREE.SpriteCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(a,c){};this.setValues(a)};THREE.SpriteCanvasMaterial.prototype=Object.create(THREE.Material.prototype);THREE.SpriteCanvasMaterial.prototype.clone=function(){var a=new THREE.SpriteCanvasMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.program=this.program;return a};THREE.ParticleCanvasMaterial=THREE.SpriteCanvasMaterial;THREE.Texture=function(a,b,c,d,e,f,g,h,k){this.id=THREE.TextureIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.image=a;this.mipmaps=[];this.mapping=void 0!==b?b:new THREE.UVMapping;this.wrapS=void 0!==c?c:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==d?d:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==e?e:THREE.LinearFilter;this.minFilter=void 0!==f?f:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==k?k:1;this.format=void 0!==g?g:THREE.RGBAFormat;this.type=void 0!==h?h:THREE.UnsignedByteType;
 this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this._needsUpdate=!1;this.onUpdate=null};
 THREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(a){!0===a&&this.update();this._needsUpdate=a},clone:function(a){void 0===a&&(a=new THREE.Texture);a.image=this.image;a.mipmaps=this.mipmaps.slice(0);a.mapping=this.mapping;a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.format=this.format;a.type=this.type;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.generateMipmaps=
-this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;a.unpackAlignment=this.unpackAlignment;return a},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,p){THREE.Texture.call(this,null,f,g,h,k,l,d,e,p);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,f,g,h,k,l,p){THREE.Texture.call(this,null,f,g,h,k,l,d,e,p);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()});this.sortParticles=!1};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));a.sortParticles=this.sortParticles;THREE.Object3D.prototype.clone.call(this,a);return a};
-THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()});this.type=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);
+this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;a.unpackAlignment=this.unpackAlignment;return a},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CompressedTexture=function(a,b,c,d,e,f,g,h,k,l,p){THREE.Texture.call(this,null,f,g,h,k,l,d,e,p);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,f,g,h,k,l,p){THREE.Texture.call(this,null,f,g,h,k,l,d,e,p);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()});this.sortParticles=!1};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);
+THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this.geometry,f=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===e.boundingBox||!1!==b.isIntersectionBox(e.boundingBox)){var f=f/((this.scale.x+this.scale.y+this.scale.z)/3),g=new THREE.Vector3;if(e instanceof THREE.BufferGeometry){var h=e.attributes,k=h.position.array;if(void 0!==h.index){var h=h.index.array,l=e.offsets;0===l.length&&
+(l=[{start:0,count:h.length,index:0}]);for(var p=0,q=l.length;p<q;++p)for(var r=l[p].start,t=l[p].index,e=r,s=r+l[p].count;e<s;e++){var n=t+h[e];g.set(k[3*n],k[3*n+1],k[3*n+2]);r=b.distanceToPoint(g);if(r<f){var v=b.closestPointToPoint(g);v.applyMatrix4(this.matrixWorld);var w=c.ray.origin.distanceTo(v);d.push({distance:w,distanceToRay:r,point:v.clone(),index:n,face:null,object:this})}}}else for(h=k.length/3,e=0;e<h;e++)g.set(k[3*e],k[3*e+1],k[3*e+2]),r=b.distanceToPoint(g),r<f&&(v=b.closestPointToPoint(g),
+v.applyMatrix4(this.matrixWorld),w=c.ray.origin.distanceTo(v),d.push({distance:w,distanceToRay:r,point:v.clone(),index:e,face:null,object:this}))}else for(k=this.geometry.vertices,e=0;e<k.length;e++)g=k[e],r=b.distanceToPoint(g),r<f&&(v=b.closestPointToPoint(g),v.applyMatrix4(this.matrixWorld),w=c.ray.origin.distanceTo(v),d.push({distance:w,distanceToRay:r,point:v.clone(),index:e,face:null,object:this}))}}}();
+THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));a.sortParticles=this.sortParticles;THREE.Object3D.prototype.clone.call(this,a);return a};THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()});this.type=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);
+THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var f=d.linePrecision,f=f*f,g=this.geometry;null===g.boundingSphere&&g.computeBoundingSphere();c.copy(g.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(d.ray).applyMatrix4(a),g instanceof THREE.Geometry))for(var g=g.vertices,h=g.length,k=new THREE.Vector3,l=new THREE.Vector3,p=this.type===THREE.LineStrip?
+1:2,q=0;q<h-1;q+=p)if(!(b.distanceSqToSegment(g[q],g[q+1],l,k)>f)){var r=b.origin.distanceTo(l);r<d.near||r>d.far||e.push({distance:r,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
-THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
+THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
+THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var l=
+this.material;if(void 0!==l){var p=k.attributes,q,r,t=g.precision;if(void 0!==p.index){var s=p.index.array,n=p.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:s.length,index:0}]);for(var w=0,u=v.length;w<u;++w)for(var p=v[w].start,x=v[w].index,k=p,K=p+v[w].count;k<K;k+=3){p=x+s[k];q=x+s[k+1];r=x+s[k+2];d.set(n[3*p],n[3*p+1],n[3*p+2]);e.set(n[3*q],n[3*q+1],n[3*q+2]);f.set(n[3*r],n[3*r+1],n[3*r+2]);var z=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==
+THREE.DoubleSide);if(null!==z){z.applyMatrix4(this.matrixWorld);var B=g.ray.origin.distanceTo(z);B<t||B<g.near||B>g.far||h.push({distance:B,point:z,indices:[p,q,r],face:null,faceIndex:null,object:this})}}}else for(n=p.position.array,s=k=0,K=n.length;k<K;k+=3,s+=9)p=k,q=k+1,r=k+2,d.set(n[s],n[s+1],n[s+2]),e.set(n[s+3],n[s+4],n[s+5]),f.set(n[s+6],n[s+7],n[s+8]),z=l.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,l.side!==THREE.DoubleSide),null!==z&&(z.applyMatrix4(this.matrixWorld),
+B=g.ray.origin.distanceTo(z),B<t||B<g.near||B>g.far||h.push({distance:B,point:z,indices:[p,q,r],face:null,faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,n=!0===s?this.material.materials:null,t=g.precision,v=k.vertices,w=0,u=k.faces.length;w<u;w++)if(x=k.faces[w],l=!0===s?n[x.materialIndex]:this.material,void 0!==l){p=v[x.a];q=v[x.b];r=v[x.c];if(!0===l.morphTargets){z=k.morphTargets;B=this.morphTargetInfluences;d.set(0,0,0);
+e.set(0,0,0);f.set(0,0,0);for(var K=0,A=z.length;K<A;K++){var E=B[K];if(0!==E){var F=z[K].vertices;d.x+=(F[x.a].x-p.x)*E;d.y+=(F[x.a].y-p.y)*E;d.z+=(F[x.a].z-p.z)*E;e.x+=(F[x.b].x-q.x)*E;e.y+=(F[x.b].y-q.y)*E;e.z+=(F[x.b].z-q.z)*E;f.x+=(F[x.c].x-r.x)*E;f.y+=(F[x.c].y-r.y)*E;f.z+=(F[x.c].z-r.z)*E}}d.add(p);e.add(q);f.add(r);p=d;q=e;r=f}z=l.side===THREE.BackSide?b.intersectTriangle(r,q,p,!0):b.intersectTriangle(p,q,r,l.side!==THREE.DoubleSide);null!==z&&(z.applyMatrix4(this.matrixWorld),B=g.ray.origin.distanceTo(z),
+B<t||B<g.near||B>g.far||h.push({distance:B,point:z,face:x,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Bone.prototype.update=function(a,b){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.skinMatrix.multiplyMatrices(a,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0,this.accumulatedSclWeight=this.accumulatedPosWeight=this.accumulatedRotWeight=0;for(var c=0,d=this.children.length;c<d;c++)this.children[c].update(this.skinMatrix,b)};THREE.Skeleton=function(a,b){this.useVertexTexture=void 0!==b?b:!0;this.bones=[];this.boneMatrices=[];var c,d,e,f,g;if(void 0!==a){for(var h=0;h<a.length;++h)d=a[h],e=d.pos,f=d.rotq,g=d.scl,c=this.addBone(),c.name=d.name,c.position.set(e[0],e[1],e[2]),c.quaternion.set(f[0],f[1],f[2],f[3]),void 0!==g?c.scale.set(g[0],g[1],g[2]):c.scale.set(1,1,1);for(h=0;h<a.length;++h)d=a[h],-1!==d.parent&&this.bones[d.parent].add(this.bones[h]);c=this.bones.length;this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=
 c=256<c?64:64<c?32:16<c?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*c)}};THREE.Skeleton.prototype=Object.create(THREE.Mesh.prototype);
 THREE.Skeleton.prototype.addBone=function(a){void 0===a&&(a=new THREE.Bone(this));this.bones.push(a);return a};THREE.Skeleton.prototype.calculateInverses=function(a){this.boneInverses=[];a=0;for(var b=this.bones.length;a<b;++a){var c=new THREE.Matrix4;c.getInverse(this.bones[a].skinMatrix);this.boneInverses.push(c)}};THREE.SkinnedMesh=function(a,b,c){THREE.Mesh.call(this,a,b);this.skeleton=new THREE.Skeleton(this.geometry&&this.geometry.bones,c);for(a=0;a<this.skeleton.bones.length;++a)b=this.skeleton.bones[a],void 0===b.parent&&this.add(b);this.identityMatrix=new THREE.Matrix4;this.pose()};THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype);
@@ -300,33 +302,34 @@ THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.an
 THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||0>this.time)this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)}else this.time%=this.duration,0>this.time&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);a!==this.currentKeyframe&&
 (this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a);b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b};
 THREE.MorphAnimMesh.prototype.clone=function(a){void 0===a&&(a=new THREE.MorphAnimMesh(this.geometry,this.material));a.duration=this.duration;a.mirroredLoop=this.mirroredLoop;a.time=this.time;a.lastKeyframe=this.lastKeyframe;a.currentKeyframe=this.currentKeyframe;a.direction=this.direction;a.directionBackwards=this.directionBackwards;THREE.Mesh.prototype.clone.call(this,a);return a};THREE.LOD=function(){THREE.Object3D.call(this);this.objects=[]};THREE.LOD.prototype=Object.create(THREE.Object3D.prototype);THREE.LOD.prototype.addLevel=function(a,b){void 0===b&&(b=0);b=Math.abs(b);for(var c=0;c<this.objects.length&&!(b<this.objects[c].distance);c++);this.objects.splice(c,0,{distance:b,object:a});this.add(a)};THREE.LOD.prototype.getObjectForDistance=function(a){for(var b=1,c=this.objects.length;b<c&&!(a<this.objects[b].distance);b++);return this.objects[b-1].object};
+THREE.LOD.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}();
 THREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){if(1<this.objects.length){a.setFromMatrixPosition(c.matrixWorld);b.setFromMatrixPosition(this.matrixWorld);c=a.distanceTo(b);this.objects[0].object.visible=!0;for(var d=1,e=this.objects.length;d<e;d++)if(c>=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;d<e;d++)this.objects[d].object.visible=!1}}}();
 THREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD);THREE.Object3D.prototype.clone.call(this,a);for(var b=0,c=this.objects.length;b<c;b++){var d=this.objects[b].object.clone();d.visible=0===b;a.addLevel(d,this.objects[b].distance)}return a};THREE.Sprite=function(){var a=new Float32Array([-0.5,-0.5,0,0.5,-0.5,0,0.5,0.5,0]),b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(a,3));return function(a){THREE.Object3D.call(this);this.geometry=b;this.material=void 0!==a?a:new THREE.SpriteMaterial}}();THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);
-THREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceToPoint(a);if(d>this.scale.x)return c;c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.updateMatrix=function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0};
+THREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceToPoint(a);d>this.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.updateMatrix=function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0};
 THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Particle=THREE.Sprite;THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.autoUpdate=!0;this.matrixAutoUpdate=!1;this.__lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=Object.create(THREE.Object3D.prototype);
 THREE.Scene.prototype.__addObject=function(a){if(a instanceof THREE.Light)-1===this.__lights.indexOf(a)&&this.__lights.push(a),a.target&&void 0===a.target.parent&&this.add(a.target);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)){this.__objectsAdded.push(a);var b=this.__objectsRemoved.indexOf(a);-1!==b&&this.__objectsRemoved.splice(b,1)}this.dispatchEvent({type:"objectAdded",object:a});a.dispatchEvent({type:"addedToScene",scene:this});for(b=0;b<a.children.length;b++)this.__addObject(a.children[b])};
 THREE.Scene.prototype.__removeObject=function(a){if(a instanceof THREE.Light){var b=this.__lights.indexOf(a);-1!==b&&this.__lights.splice(b,1);if(a.shadowCascadeArray)for(b=0;b<a.shadowCascadeArray.length;b++)this.__removeObject(a.shadowCascadeArray[b])}else a instanceof THREE.Camera||(this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),-1!==b&&this.__objectsAdded.splice(b,1));this.dispatchEvent({type:"objectRemoved",object:a});a.dispatchEvent({type:"removedFromScene",scene:this});for(b=
-0;b<a.children.length;b++)this.__removeObject(a.children[b])};THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.CanvasRenderer=function(a){function b(a,b,c,d){l(b);p(c);q(d);r(a.getStyle());C.stroke();qa.expandByScalar(2*b)}function c(a){t(a.getStyle());C.fill()}function d(a){e(a.target)}function e(a){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);Ga[a.id]=C.createPattern(e,!0===b&&!0===c?"repeat":!0===b&&!1===c?"repeat-x":
+0;b<a.children.length;b++)this.__removeObject(a.children[b])};THREE.Scene.prototype.clone=function(a){void 0===a&&(a=new THREE.Scene);THREE.Object3D.prototype.clone.call(this,a);null!==this.fog&&(a.fog=this.fog.clone());null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone());a.autoUpdate=this.autoUpdate;a.matrixAutoUpdate=this.matrixAutoUpdate;return a};THREE.Fog=function(a,b,c){this.name="";this.color=new THREE.Color(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3};THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)};THREE.FogExp2=function(a,b){this.name="";this.color=new THREE.Color(a);this.density=void 0!==b?b:2.5E-4};THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)};THREE.CanvasRenderer=function(a){function b(a,b,c,d){l(b);p(c);q(d);r(a.getStyle());H.stroke();qa.expandByScalar(2*b)}function c(a){t(a.getStyle());H.fill()}function d(a){e(a.target)}function e(a){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);Ga[a.id]=H.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,p,m,n,r,q){if(!(q instanceof THREE.DataTexture)){!1===q.hasEventListener("update",d)&&(void 0!==q.image&&0<q.image.width&&e(q),q.addEventListener("update",d));var s=Ga[q.id];if(void 0!==s){t(s);var s=q.offset.x/q.repeat.x,u=q.offset.y/q.repeat.y,v=q.image.width*q.repeat.x;q=q.image.height*q.repeat.y;k=(k+s)*v;l=(l+u)*q;c-=a;f-=b;g-=a;h-=b;p=(p+s)*v-k;m=(m+u)*q-l;n=(n+s)*v-k;r=(r+u)*q-l;q=p*r-n*m;0!==q&&(s=1/q,q=(r*c-m*g)*s,m=(r*f-m*
-h)*s,c=(p*g-n*c)*s,f=(p*h-n*f)*s,a=a-q*k-c*l,b=b-m*k-f*l,C.save(),C.transform(q,m,c,f,a,b),C.fill(),C.restore())}else t("rgba(0,0,0,1)"),C.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){N!==a&&(N=C.globalAlpha=a)}function k(a){I!==a&&(a===THREE.NormalBlending?C.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?C.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(C.globalCompositeOperation=
-"darker"),I=a)}function l(a){H!==a&&(H=C.lineWidth=a)}function p(a){Q!==a&&(Q=C.lineCap=a)}function q(a){Y!==a&&(Y=C.lineJoin=a)}function r(a){z!==a&&(z=C.strokeStyle=a)}function t(a){x!==a&&(x=C.fillStyle=a)}function s(a,b){if(U!==a||la!==b)C.setLineDash([a,b]),U=a,la=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var n=THREE.Math.smoothstep;a=a||{};var v=this,w,u,y,L=new THREE.Projector,A=void 0!==a.canvas?a.canvas:document.createElement("canvas"),K=A.width,B=A.height,E=Math.floor(K/2),G=
-Math.floor(B/2),C=A.getContext("2d",{alpha:!0===a.alpha}),D=new THREE.Color(0),M=0,N=1,I=0,z=null,x=null,H=null,Q=null,Y=null,U=null,la=0,W,R,F,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var V,X,P,ga,wa,Ha,fa=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var za=new THREE.Color,Ia=new THREE.Color,Ea=new THREE.Color,Ga={},ha,Oa,Ra,Sa,Fa,ia,ma,ya=new THREE.Box2,Z=new THREE.Box2,qa=new THREE.Box2,ua=new THREE.Color,Ca=new THREE.Color,va=new THREE.Color,
-Da=new THREE.Vector3,Ja=new THREE.Vector3,ja=new THREE.Vector3,ra=new THREE.Matrix3;void 0===C.setLineDash&&(C.setLineDash=function(){});this.domElement=A;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){K=a*this.devicePixelRatio;
-B=b*this.devicePixelRatio;A.width=K;A.height=B;E=Math.floor(K/2);G=Math.floor(B/2);!1!==c&&(A.style.width=a+"px",A.style.height=b+"px");ya.min.set(-E,-G);ya.max.set(E,G);Z.min.set(-E,-G);Z.max.set(E,G);N=1;I=0;Y=Q=H=x=z=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){C.setTransform(c*this.devicePixelRatio/K,0,0,-(d*this.devicePixelRatio)/B,a*this.devicePixelRatio,B-b*this.devicePixelRatio);C.translate(E,G)};this.setScissor=function(){};this.enableScissorTest=function(){};this.setClearColor=
-function(a,b){D.set(a);M=void 0!==b?b:1;Z.min.set(-E,-G);Z.max.set(E,G)};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===Z.empty()&&(Z.intersect(ya),Z.expandByScalar(2),1>M&&C.clearRect(Z.min.x|0,Z.min.y|0,Z.max.x-Z.min.x|0,Z.max.y-Z.min.y|0),0<M&&(k(THREE.NormalBlending),h(1),t("rgba("+Math.floor(255*D.r)+","+
-Math.floor(255*D.g)+","+Math.floor(255*D.b)+","+M+")"),C.fillRect(Z.min.x|0,Z.min.y|0,Z.max.x-Z.min.x|0,Z.max.y-Z.min.y|0)),Z.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,B){if(!1===B 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;w=L.projectScene(a,B,this.sortObjects,
-this.sortElements);u=w.elements;y=w.lights;W=B;ra.getNormalMatrix(B.matrixWorldInverse);ua.setRGB(0,0,0);Ca.setRGB(0,0,0);va.setRGB(0,0,0);for(var A=0,D=y.length;A<D;A++){var x=y[A],K=x.color;x instanceof THREE.AmbientLight?ua.add(K):x instanceof THREE.DirectionalLight?Ca.add(K):x instanceof THREE.PointLight&&va.add(K)}A=0;for(D=u.length;A<D;A++){var H=u[A],z=H.material;if(void 0!==z&&0!==z.opacity){qa.makeEmpty();if(H instanceof THREE.RenderableSprite){R=H;R.x*=E;R.y*=G;var x=R,M=H,K=z;h(K.opacity);
-k(K.blending);var m=M.scale.x*E,M=M.scale.y*G,H=0.5*Math.sqrt(m*m+M*M);qa.min.set(x.x-H,x.y-H);qa.max.set(x.x+H,x.y+H);if(K instanceof THREE.SpriteMaterial){var Q=K.map;if(null!==Q){!1===Q.hasEventListener("update",d)&&(void 0!==Q.image&&0<Q.image.width&&e(Q),Q.addEventListener("update",d));H=Ga[Q.id];void 0!==H?t(H):t("rgba( 0, 0, 0, 1 )");var N=Q.image,H=N.width*Q.offset.x,z=N.height*Q.offset.y,I=N.width*Q.repeat.x,Q=N.height*Q.repeat.y,N=m/I,U=M/Q;C.save();C.translate(x.x,x.y);0!==K.rotation&&
-C.rotate(K.rotation);C.translate(-m/2,-M/2);C.scale(N,U);C.translate(-H,-z);C.fillRect(H,z,I,Q)}else t(K.color.getStyle()),C.save(),C.translate(x.x,x.y),0!==K.rotation&&C.rotate(K.rotation),C.scale(m,-M),C.fillRect(-0.5,-0.5,1,1);C.restore()}else K instanceof THREE.SpriteCanvasMaterial&&(r(K.color.getStyle()),t(K.color.getStyle()),C.save(),C.translate(x.x,x.y),0!==K.rotation&&C.rotate(K.rotation),C.scale(m,M),K.program(C),C.restore())}else if(H instanceof THREE.RenderableLine){if(R=H.v1,F=H.v2,R.positionScreen.x*=
-E,R.positionScreen.y*=G,F.positionScreen.x*=E,F.positionScreen.y*=G,qa.setFromPoints([R.positionScreen,F.positionScreen]),!0===ya.isIntersectionBox(qa))if(x=R,K=F,m=H,M=z,h(M.opacity),k(M.blending),C.beginPath(),C.moveTo(x.positionScreen.x,x.positionScreen.y),C.lineTo(K.positionScreen.x,K.positionScreen.y),M instanceof THREE.LineBasicMaterial){l(M.linewidth);p(M.linecap);q(M.linejoin);if(M.vertexColors!==THREE.VertexColors)r(M.color.getStyle());else if(H=m.vertexColors[0].getStyle(),m=m.vertexColors[1].getStyle(),
-H===m)r(H);else{try{var Y=C.createLinearGradient(x.positionScreen.x,x.positionScreen.y,K.positionScreen.x,K.positionScreen.y);Y.addColorStop(0,H);Y.addColorStop(1,m)}catch(la){Y=H}r(Y)}C.stroke();qa.expandByScalar(2*M.linewidth)}else M instanceof THREE.LineDashedMaterial&&(l(M.linewidth),p(M.linecap),q(M.linejoin),r(M.color.getStyle()),s(M.dashSize,M.gapSize),C.stroke(),qa.expandByScalar(2*M.linewidth),s(null,null))}else if(H instanceof THREE.RenderableFace){R=H.v1;F=H.v2;da=H.v3;if(-1>R.positionScreen.z||
-1<R.positionScreen.z)continue;if(-1>F.positionScreen.z||1<F.positionScreen.z)continue;if(-1>da.positionScreen.z||1<da.positionScreen.z)continue;R.positionScreen.x*=E;R.positionScreen.y*=G;F.positionScreen.x*=E;F.positionScreen.y*=G;da.positionScreen.x*=E;da.positionScreen.y*=G;0<z.overdraw&&(g(R.positionScreen,F.positionScreen,z.overdraw),g(F.positionScreen,da.positionScreen,z.overdraw),g(da.positionScreen,R.positionScreen,z.overdraw));qa.setFromPoints([R.positionScreen,F.positionScreen,da.positionScreen]);
-if(!0===ya.isIntersectionBox(qa)){K=R;m=F;M=da;x=z;v.info.render.vertices+=3;v.info.render.faces++;h(x.opacity);k(x.blending);V=K.positionScreen.x;X=K.positionScreen.y;P=m.positionScreen.x;ga=m.positionScreen.y;wa=M.positionScreen.x;Ha=M.positionScreen.y;var z=V,I=X,Q=P,N=ga,U=wa,Db=Ha;C.beginPath();C.moveTo(z,I);C.lineTo(Q,N);C.lineTo(U,Db);C.closePath();if((x instanceof THREE.MeshLambertMaterial||x instanceof THREE.MeshPhongMaterial)&&null===x.map){za.copy(x.color);Ia.copy(x.emissive);x.vertexColors===
-THREE.FaceColors&&za.multiply(H.color);fa.copy(ua);Ja.copy(K.positionWorld).add(m.positionWorld).add(M.positionWorld).divideScalar(3);K=Ja;m=H.normalModel;M=fa;H=0;for(z=y.length;H<z;H++)I=y[H],Ea.copy(I.color),I instanceof THREE.DirectionalLight?(Q=Da.setFromMatrixPosition(I.matrixWorld).normalize(),N=m.dot(Q),0>=N||(N*=I.intensity,M.add(Ea.multiplyScalar(N)))):I instanceof THREE.PointLight&&(Q=Da.setFromMatrixPosition(I.matrixWorld),N=m.dot(Da.subVectors(Q,K).normalize()),0>=N||(N*=0==I.distance?
-1:1-Math.min(K.distanceTo(Q)/I.distance,1),0!=N&&(N*=I.intensity,M.add(Ea.multiplyScalar(N)))));fa.multiply(za).add(Ia);!0===x.wireframe?b(fa,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):c(fa)}else x instanceof THREE.MeshBasicMaterial||x instanceof THREE.MeshLambertMaterial||x instanceof THREE.MeshPhongMaterial?null!==x.map?x.map.mapping instanceof THREE.UVMapping&&(ha=H.uvs,f(V,X,P,ga,wa,Ha,ha[0].x,ha[0].y,ha[1].x,ha[1].y,ha[2].x,ha[2].y,x.map)):null!==x.envMap?x.envMap.mapping instanceof
-THREE.SphericalReflectionMapping?(ja.copy(H.vertexNormalsModel[0]).applyMatrix3(ra),Oa=0.5*ja.x+0.5,Ra=0.5*ja.y+0.5,ja.copy(H.vertexNormalsModel[1]).applyMatrix3(ra),Sa=0.5*ja.x+0.5,Fa=0.5*ja.y+0.5,ja.copy(H.vertexNormalsModel[2]).applyMatrix3(ra),ia=0.5*ja.x+0.5,ma=0.5*ja.y+0.5,f(V,X,P,ga,wa,Ha,Oa,Ra,Sa,Fa,ia,ma,x.envMap)):x.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ja.copy(H.vertexNormalsModel[0]).applyMatrix3(ra),Oa=-0.5*ja.x+0.5,Ra=-0.5*ja.y+0.5,ja.copy(H.vertexNormalsModel[1]).applyMatrix3(ra),
-Sa=-0.5*ja.x+0.5,Fa=-0.5*ja.y+0.5,ja.copy(H.vertexNormalsModel[2]).applyMatrix3(ra),ia=-0.5*ja.x+0.5,ma=-0.5*ja.y+0.5,f(V,X,P,ga,wa,Ha,Oa,Ra,Sa,Fa,ia,ma,x.envMap)):(fa.copy(x.color),x.vertexColors===THREE.FaceColors&&fa.multiply(H.color),!0===x.wireframe?b(fa,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):c(fa)):(x instanceof THREE.MeshDepthMaterial?fa.r=fa.g=fa.b=1-n(K.positionScreen.z*K.positionScreen.w,W.near,W.far):x instanceof THREE.MeshNormalMaterial?(ja.copy(H.normalModel).applyMatrix3(ra),
-fa.setRGB(ja.x,ja.y,ja.z).multiplyScalar(0.5).addScalar(0.5)):fa.setRGB(1,1,1),!0===x.wireframe?b(fa,x.wireframeLinewidth,x.wireframeLinecap,x.wireframeLinejoin):c(fa))}}Z.union(qa)}}}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tconst float LOG2 = 1.442695;\n\t\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
+h)*s,c=(p*g-n*c)*s,f=(p*h-n*f)*s,a=a-q*k-c*l,b=b-m*k-f*l,H.save(),H.transform(q,m,c,f,a,b),H.fill(),H.restore())}else t("rgba(0,0,0,1)"),H.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){D!==a&&(D=H.globalAlpha=a)}function k(a){R!==a&&(a===THREE.NormalBlending?H.globalCompositeOperation="source-over":a===THREE.AdditiveBlending?H.globalCompositeOperation="lighter":a===THREE.SubtractiveBlending&&(H.globalCompositeOperation=
+"darker"),R=a)}function l(a){G!==a&&(G=H.lineWidth=a)}function p(a){P!==a&&(P=H.lineCap=a)}function q(a){Y!==a&&(Y=H.lineJoin=a)}function r(a){L!==a&&(L=H.strokeStyle=a)}function t(a){J!==a&&(J=H.fillStyle=a)}function s(a,b){if(M!==a||la!==b)H.setLineDash([a,b]),M=a,la=b}console.log("THREE.CanvasRenderer",THREE.REVISION);var n=THREE.Math.smoothstep;a=a||{};var v=this,w,u,x,K=new THREE.Projector,z=void 0!==a.canvas?a.canvas:document.createElement("canvas"),B=z.width,A=z.height,E=Math.floor(B/2),F=
+Math.floor(A/2),H=z.getContext("2d",{alpha:!0===a.alpha}),C=new THREE.Color(0),Q=0,D=1,R=0,L=null,J=null,G=null,P=null,Y=null,M=null,la=0,W,S,y,da;new THREE.RenderableVertex;new THREE.RenderableVertex;var V,X,O,ga,wa,Ha,fa=new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;new THREE.Color;var za=new THREE.Color,Ia=new THREE.Color,Ea=new THREE.Color,Ga={},ha,Oa,Ra,Sa,Fa,ia,ma,ya=new THREE.Box2,Z=new THREE.Box2,qa=new THREE.Box2,ua=new THREE.Color,Ca=new THREE.Color,va=new THREE.Color,
+Da=new THREE.Vector3,Ja=new THREE.Vector3,ja=new THREE.Vector3,ra=new THREE.Matrix3;void 0===H.setLineDash&&(H.setLineDash=function(){});this.domElement=z;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.supportsVertexTextures=function(){};this.setFaceCulling=function(){};this.setSize=function(a,b,c){B=a*this.devicePixelRatio;
+A=b*this.devicePixelRatio;z.width=B;z.height=A;E=Math.floor(B/2);F=Math.floor(A/2);!1!==c&&(z.style.width=a+"px",z.style.height=b+"px");ya.min.set(-E,-F);ya.max.set(E,F);Z.min.set(-E,-F);Z.max.set(E,F);D=1;R=0;Y=P=G=J=L=null;this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){H.setTransform(c*this.devicePixelRatio/B,0,0,-(d*this.devicePixelRatio)/A,a*this.devicePixelRatio,A-b*this.devicePixelRatio);H.translate(E,F)};this.setScissor=function(){};this.enableScissorTest=function(){};this.setClearColor=
+function(a,b){C.set(a);Q=void 0!==b?b:1;Z.min.set(-E,-F);Z.max.set(E,F)};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===Z.empty()&&(Z.intersect(ya),Z.expandByScalar(2),1>Q&&H.clearRect(Z.min.x|0,Z.min.y|0,Z.max.x-Z.min.x|0,Z.max.y-Z.min.y|0),0<Q&&(k(THREE.NormalBlending),h(1),t("rgba("+Math.floor(255*C.r)+","+
+Math.floor(255*C.g)+","+Math.floor(255*C.b)+","+Q+")"),H.fillRect(Z.min.x|0,Z.min.y|0,Z.max.x-Z.min.x|0,Z.max.y-Z.min.y|0)),Z.makeEmpty())};this.clearColor=function(){};this.clearDepth=function(){};this.clearStencil=function(){};this.render=function(a,z){if(!1===z 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;w=K.projectScene(a,z,this.sortObjects,
+this.sortElements);u=w.elements;x=w.lights;W=z;ra.getNormalMatrix(z.matrixWorldInverse);ua.setRGB(0,0,0);Ca.setRGB(0,0,0);va.setRGB(0,0,0);for(var A=0,J=x.length;A<J;A++){var B=x[A],C=B.color;B instanceof THREE.AmbientLight?ua.add(C):B instanceof THREE.DirectionalLight?Ca.add(C):B instanceof THREE.PointLight&&va.add(C)}A=0;for(J=u.length;A<J;A++){var G=u[A],P=G.material;if(void 0!==P&&0!==P.opacity){qa.makeEmpty();if(G instanceof THREE.RenderableSprite){S=G;S.x*=E;S.y*=F;var B=S,L=G,C=P;h(C.opacity);
+k(C.blending);var m=L.scale.x*E,L=L.scale.y*F,G=0.5*Math.sqrt(m*m+L*L);qa.min.set(B.x-G,B.y-G);qa.max.set(B.x+G,B.y+G);if(C instanceof THREE.SpriteMaterial){var D=C.map;if(null!==D){!1===D.hasEventListener("update",d)&&(void 0!==D.image&&0<D.image.width&&e(D),D.addEventListener("update",d));G=Ga[D.id];void 0!==G?t(G):t("rgba( 0, 0, 0, 1 )");var Q=D.image,G=Q.width*D.offset.x,P=Q.height*D.offset.y,M=Q.width*D.repeat.x,D=Q.height*D.repeat.y,Q=m/M,R=L/D;H.save();H.translate(B.x,B.y);0!==C.rotation&&
+H.rotate(C.rotation);H.translate(-m/2,-L/2);H.scale(Q,R);H.translate(-G,-P);H.fillRect(G,P,M,D)}else t(C.color.getStyle()),H.save(),H.translate(B.x,B.y),0!==C.rotation&&H.rotate(C.rotation),H.scale(m,-L),H.fillRect(-0.5,-0.5,1,1);H.restore()}else C instanceof THREE.SpriteCanvasMaterial&&(r(C.color.getStyle()),t(C.color.getStyle()),H.save(),H.translate(B.x,B.y),0!==C.rotation&&H.rotate(C.rotation),H.scale(m,L),C.program(H),H.restore())}else if(G instanceof THREE.RenderableLine){if(S=G.v1,y=G.v2,S.positionScreen.x*=
+E,S.positionScreen.y*=F,y.positionScreen.x*=E,y.positionScreen.y*=F,qa.setFromPoints([S.positionScreen,y.positionScreen]),!0===ya.isIntersectionBox(qa))if(B=S,C=y,m=G,L=P,h(L.opacity),k(L.blending),H.beginPath(),H.moveTo(B.positionScreen.x,B.positionScreen.y),H.lineTo(C.positionScreen.x,C.positionScreen.y),L instanceof THREE.LineBasicMaterial){l(L.linewidth);p(L.linecap);q(L.linejoin);if(L.vertexColors!==THREE.VertexColors)r(L.color.getStyle());else if(G=m.vertexColors[0].getStyle(),m=m.vertexColors[1].getStyle(),
+G===m)r(G);else{try{var Y=H.createLinearGradient(B.positionScreen.x,B.positionScreen.y,C.positionScreen.x,C.positionScreen.y);Y.addColorStop(0,G);Y.addColorStop(1,m)}catch(la){Y=G}r(Y)}H.stroke();qa.expandByScalar(2*L.linewidth)}else L instanceof THREE.LineDashedMaterial&&(l(L.linewidth),p(L.linecap),q(L.linejoin),r(L.color.getStyle()),s(L.dashSize,L.gapSize),H.stroke(),qa.expandByScalar(2*L.linewidth),s(null,null))}else if(G instanceof THREE.RenderableFace){S=G.v1;y=G.v2;da=G.v3;if(-1>S.positionScreen.z||
+1<S.positionScreen.z)continue;if(-1>y.positionScreen.z||1<y.positionScreen.z)continue;if(-1>da.positionScreen.z||1<da.positionScreen.z)continue;S.positionScreen.x*=E;S.positionScreen.y*=F;y.positionScreen.x*=E;y.positionScreen.y*=F;da.positionScreen.x*=E;da.positionScreen.y*=F;0<P.overdraw&&(g(S.positionScreen,y.positionScreen,P.overdraw),g(y.positionScreen,da.positionScreen,P.overdraw),g(da.positionScreen,S.positionScreen,P.overdraw));qa.setFromPoints([S.positionScreen,y.positionScreen,da.positionScreen]);
+if(!0===ya.isIntersectionBox(qa)){C=S;m=y;L=da;B=P;v.info.render.vertices+=3;v.info.render.faces++;h(B.opacity);k(B.blending);V=C.positionScreen.x;X=C.positionScreen.y;O=m.positionScreen.x;ga=m.positionScreen.y;wa=L.positionScreen.x;Ha=L.positionScreen.y;var P=V,M=X,D=O,Q=ga,R=wa,Db=Ha;H.beginPath();H.moveTo(P,M);H.lineTo(D,Q);H.lineTo(R,Db);H.closePath();if((B instanceof THREE.MeshLambertMaterial||B instanceof THREE.MeshPhongMaterial)&&null===B.map){za.copy(B.color);Ia.copy(B.emissive);B.vertexColors===
+THREE.FaceColors&&za.multiply(G.color);fa.copy(ua);Ja.copy(C.positionWorld).add(m.positionWorld).add(L.positionWorld).divideScalar(3);C=Ja;m=G.normalModel;L=fa;G=0;for(P=x.length;G<P;G++)M=x[G],Ea.copy(M.color),M instanceof THREE.DirectionalLight?(D=Da.setFromMatrixPosition(M.matrixWorld).normalize(),Q=m.dot(D),0>=Q||(Q*=M.intensity,L.add(Ea.multiplyScalar(Q)))):M instanceof THREE.PointLight&&(D=Da.setFromMatrixPosition(M.matrixWorld),Q=m.dot(Da.subVectors(D,C).normalize()),0>=Q||(Q*=0==M.distance?
+1:1-Math.min(C.distanceTo(D)/M.distance,1),0!=Q&&(Q*=M.intensity,L.add(Ea.multiplyScalar(Q)))));fa.multiply(za).add(Ia);!0===B.wireframe?b(fa,B.wireframeLinewidth,B.wireframeLinecap,B.wireframeLinejoin):c(fa)}else B instanceof THREE.MeshBasicMaterial||B instanceof THREE.MeshLambertMaterial||B instanceof THREE.MeshPhongMaterial?null!==B.map?B.map.mapping instanceof THREE.UVMapping&&(ha=G.uvs,f(V,X,O,ga,wa,Ha,ha[0].x,ha[0].y,ha[1].x,ha[1].y,ha[2].x,ha[2].y,B.map)):null!==B.envMap?B.envMap.mapping instanceof
+THREE.SphericalReflectionMapping?(ja.copy(G.vertexNormalsModel[0]).applyMatrix3(ra),Oa=0.5*ja.x+0.5,Ra=0.5*ja.y+0.5,ja.copy(G.vertexNormalsModel[1]).applyMatrix3(ra),Sa=0.5*ja.x+0.5,Fa=0.5*ja.y+0.5,ja.copy(G.vertexNormalsModel[2]).applyMatrix3(ra),ia=0.5*ja.x+0.5,ma=0.5*ja.y+0.5,f(V,X,O,ga,wa,Ha,Oa,Ra,Sa,Fa,ia,ma,B.envMap)):B.envMap.mapping instanceof THREE.SphericalRefractionMapping&&(ja.copy(G.vertexNormalsModel[0]).applyMatrix3(ra),Oa=-0.5*ja.x+0.5,Ra=-0.5*ja.y+0.5,ja.copy(G.vertexNormalsModel[1]).applyMatrix3(ra),
+Sa=-0.5*ja.x+0.5,Fa=-0.5*ja.y+0.5,ja.copy(G.vertexNormalsModel[2]).applyMatrix3(ra),ia=-0.5*ja.x+0.5,ma=-0.5*ja.y+0.5,f(V,X,O,ga,wa,Ha,Oa,Ra,Sa,Fa,ia,ma,B.envMap)):(fa.copy(B.color),B.vertexColors===THREE.FaceColors&&fa.multiply(G.color),!0===B.wireframe?b(fa,B.wireframeLinewidth,B.wireframeLinecap,B.wireframeLinejoin):c(fa)):(B instanceof THREE.MeshDepthMaterial?fa.r=fa.g=fa.b=1-n(C.positionScreen.z*C.positionScreen.w,W.near,W.far):B instanceof THREE.MeshNormalMaterial?(ja.copy(G.normalModel).applyMatrix3(ra),
+fa.setRGB(ja.x,ja.y,ja.z).multiplyScalar(0.5).addScalar(0.5)):fa.setRGB(1,1,1),!0===B.wireframe?b(fa,B.wireframeLinewidth,B.wireframeLinecap,B.wireframeLinejoin):c(fa))}}Z.union(qa)}}}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tconst float LOG2 = 1.442695;\n\t\tfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
 envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\tuniform samplerCube envMap;\n\tuniform float flipEnvMap;\n\tuniform int combine;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\t\tuniform bool useRefract;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\n\tvec3 reflectVec;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\n\t\tif ( useRefract ) {\n\t\t\treflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t} else { \n\t\t\treflectVec = reflect( cameraToVertex, worldNormal );\n\t\t}\n\t#else\n\t\treflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t\tvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#endif\n\t#ifdef GAMMA_INPUT\n\t\tcubeColor.xyz *= cubeColor.xyz;\n\t#endif\n\tif ( combine == 1 ) {\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n\t} else if ( combine == 2 ) {\n\t\tgl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n\t} else {\n\t\tgl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n\t}\n#endif",
 envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n\tuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#endif\n\t#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\t#endif\n\t#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t#endif\n#endif",
 envmap_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\n\tvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n\tworldNormal = normalize( worldNormal );\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tif ( useRefract ) {\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t} else {\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t}\n#endif",
@@ -381,72 +384,72 @@ THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sa
 THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var e in d.attributes){var f=d.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var g=1;"v2"===f.type?g=2:"v3"===f.type?g=3:"v4"===f.type?g=4:"c"===f.type&&(g=3);f.size=g;f.array=new Float32Array(c*g);f.buffer=m.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}}
 function c(a,b){var c=b.geometry,g=a.faces3,h=3*g.length,k=1*g.length,l=3*g.length,g=d(b,a),p=f(g),n=e(g),r=g.vertexColors?g.vertexColors:!1;a.__vertexArray=new Float32Array(3*h);n&&(a.__normalArray=new Float32Array(3*h));c.hasTangents&&(a.__tangentArray=new Float32Array(4*h));r&&(a.__colorArray=new Float32Array(3*h));p&&(0<c.faceVertexUvs.length&&(a.__uvArray=new Float32Array(2*h)),1<c.faceVertexUvs.length&&(a.__uv2Array=new Float32Array(2*h)));b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&
 (a.__skinIndexArray=new Float32Array(4*h),a.__skinWeightArray=new Float32Array(4*h));c=null!==pb&&21845<k?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*k);a.__lineArray=new c(2*l);if(a.numMorphTargets)for(a.__morphTargetsArrays=[],c=0,p=a.numMorphTargets;c<p;c++)a.__morphTargetsArrays.push(new Float32Array(3*h));if(a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0,p=a.numMorphNormals;c<p;c++)a.__morphNormalsArrays.push(new Float32Array(3*h));a.__webglFaceCount=3*k;a.__webglLineCount=
-2*l;if(g.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var q in g.attributes){var k=g.attributes[q],l={},s;for(s in k)l[s]=k[s];if(!l.__webglInitialized||l.createUniqueBuffers)l.__webglInitialized=!0,c=1,"v2"===l.type?c=2:"v3"===l.type?c=3:"v4"===l.type?c=4:"c"===l.type&&(c=3),l.size=c,l.array=new Float32Array(h*c),l.buffer=m.createBuffer(),l.buffer.belongsToAttribute=q,k.needsUpdate=!0,l.__original=k;a.__webglCustomAttributesList.push(l)}}a.__inittedArrays=
+2*l;if(g.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var q in g.attributes){var k=g.attributes[q],l={},t;for(t in k)l[t]=k[t];if(!l.__webglInitialized||l.createUniqueBuffers)l.__webglInitialized=!0,c=1,"v2"===l.type?c=2:"v3"===l.type?c=3:"v4"===l.type?c=4:"c"===l.type&&(c=3),l.size=c,l.array=new Float32Array(h*c),l.buffer=m.createBuffer(),l.buffer.belongsToAttribute=q,k.needsUpdate=!0,l.__original=k;a.__webglCustomAttributesList.push(l)}}a.__inittedArrays=
 !0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(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);k(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]))}l()}function h(){for(var a=0,b=Ka.length;a<b;a++)Ka[a]=0}function k(a){Ka[a]=1;0===ob[a]&&(m.enableVertexAttribArray(a),ob[a]=1)}function l(){for(var a=0,b=ob.length;a<b;a++)ob[a]!==
-Ka[a]&&(m.disableVertexAttribArray(a),ob[a]=0)}function p(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function q(a,b){return b[0]-a[0]}function r(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)Ia=wa=null,fa=za=ha=Ga=ma=ia=Oa=-1,cb=!0,a[d].render(b,c,ja,ra),Ia=wa=null,fa=za=ha=Ga=ma=ia=Oa=-1,cb=!0}function t(a,b,c,d,e,f,g,h){var k,m,l,p;b?(m=a.length-1,p=b=-1):(m=0,b=a.length,p=1);for(var n=m;n!==b;n+=p)if(k=a[n],k.render){m=k.object;l=k.buffer;if(h)k=h;else{k=k[c];if(!k)continue;g&&P.setBlending(k.blending,
-k.blendEquation,k.blendSrc,k.blendDst);P.setDepthTest(k.depthTest);P.setDepthWrite(k.depthWrite);D(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}P.setMaterialFaces(k);l instanceof THREE.BufferGeometry?P.renderBufferDirect(d,e,f,k,l,m):P.renderBuffer(d,e,f,k,l,m)}}function s(a,b,c,d,e,f,g){for(var h,k,m=0,l=a.length;m<l;m++)if(h=a[m],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&P.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);P.setDepthTest(h.depthTest);
-P.setDepthWrite(h.depthWrite);D(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}P.renderImmediateObject(c,d,e,h,k)}}function n(a,d){var e,f,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,f=a.geometry,void 0!==f&&void 0===f.__webglInit))if(f.__webglInit=!0,f.addEventListener("dispose",Eb),f instanceof THREE.BufferGeometry)for(g in f.attributes){var h="index"===g?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER,k=f.attributes[g];
+Ka[a]&&(m.disableVertexAttribArray(a),ob[a]=0)}function p(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function q(a,b){return b[0]-a[0]}function r(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)Ia=wa=null,fa=za=ha=Ga=ma=ia=Oa=-1,cb=!0,a[d].render(b,c,ja,ra),Ia=wa=null,fa=za=ha=Ga=ma=ia=Oa=-1,cb=!0}function t(a,b,c,d,e,f,g,h){var k,m,l,p;b?(m=a.length-1,p=b=-1):(m=0,b=a.length,p=1);for(var n=m;n!==b;n+=p)if(k=a[n],k.render){m=k.object;l=k.buffer;if(h)k=h;else{k=k[c];if(!k)continue;g&&O.setBlending(k.blending,
+k.blendEquation,k.blendSrc,k.blendDst);O.setDepthTest(k.depthTest);O.setDepthWrite(k.depthWrite);C(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}O.setMaterialFaces(k);l instanceof THREE.BufferGeometry?O.renderBufferDirect(d,e,f,k,l,m):O.renderBuffer(d,e,f,k,l,m)}}function s(a,b,c,d,e,f,g){for(var h,k,m=0,l=a.length;m<l;m++)if(h=a[m],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&O.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);O.setDepthTest(h.depthTest);
+O.setDepthWrite(h.depthWrite);C(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}O.renderImmediateObject(c,d,e,h,k)}}function n(a,d){var e,f,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,f=a.geometry,void 0!==f&&void 0===f.__webglInit))if(f.__webglInit=!0,f.addEventListener("dispose",Eb),f instanceof THREE.BufferGeometry)for(g in f.attributes){var h="index"===g?m.ELEMENT_ARRAY_BUFFER:m.ARRAY_BUFFER,k=f.attributes[g];
 k.buffer=m.createBuffer();m.bindBuffer(h,k.buffer);m.bufferData(h,k.array,m.STATIC_DRAW)}else if(a instanceof THREE.Mesh)for(e in g=a.material,void 0===f.geometryGroups&&f.makeGroups(g instanceof THREE.MeshFaceMaterial,pb?4294967296:65535),f.geometryGroups){if(g=f.geometryGroups[e],!g.__webglVertexBuffer){h=g;h.__webglVertexBuffer=m.createBuffer();h.__webglNormalBuffer=m.createBuffer();h.__webglTangentBuffer=m.createBuffer();h.__webglColorBuffer=m.createBuffer();h.__webglUVBuffer=m.createBuffer();
-h.__webglUV2Buffer=m.createBuffer();h.__webglSkinIndicesBuffer=m.createBuffer();h.__webglSkinWeightsBuffer=m.createBuffer();h.__webglFaceBuffer=m.createBuffer();h.__webglLineBuffer=m.createBuffer();var l=k=void 0;if(h.numMorphTargets)for(h.__webglMorphTargetsBuffers=[],k=0,l=h.numMorphTargets;k<l;k++)h.__webglMorphTargetsBuffers.push(m.createBuffer());if(h.numMorphNormals)for(h.__webglMorphNormalsBuffers=[],k=0,l=h.numMorphNormals;k<l;k++)h.__webglMorphNormalsBuffers.push(m.createBuffer());P.info.memory.geometries++;
-c(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=!0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),g.__webglLineDistanceBuffer=m.createBuffer(),P.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__lineDistanceArray=new Float32Array(1*
-h),g.__webglLineCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.PointCloud&&!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),P.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__sortArray=[],g.__webglParticleCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof
+h.__webglUV2Buffer=m.createBuffer();h.__webglSkinIndicesBuffer=m.createBuffer();h.__webglSkinWeightsBuffer=m.createBuffer();h.__webglFaceBuffer=m.createBuffer();h.__webglLineBuffer=m.createBuffer();var l=k=void 0;if(h.numMorphTargets)for(h.__webglMorphTargetsBuffers=[],k=0,l=h.numMorphTargets;k<l;k++)h.__webglMorphTargetsBuffers.push(m.createBuffer());if(h.numMorphNormals)for(h.__webglMorphNormalsBuffers=[],k=0,l=h.numMorphNormals;k<l;k++)h.__webglMorphNormalsBuffers.push(m.createBuffer());O.info.memory.geometries++;
+c(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=!0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),g.__webglLineDistanceBuffer=m.createBuffer(),O.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__lineDistanceArray=new Float32Array(1*
+h),g.__webglLineCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.lineDistancesNeedUpdate=!0):a instanceof THREE.PointCloud&&!f.__webglVertexBuffer&&(g=f,g.__webglVertexBuffer=m.createBuffer(),g.__webglColorBuffer=m.createBuffer(),O.info.memory.geometries++,g=f,h=g.vertices.length,g.__vertexArray=new Float32Array(3*h),g.__colorArray=new Float32Array(3*h),g.__sortArray=[],g.__webglParticleCount=h,b(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0);if(void 0===a.__webglActive){if(a instanceof
 THREE.Mesh)if(f=a.geometry,f instanceof THREE.BufferGeometry)v(d.__webglObjects,f,a);else{if(f instanceof THREE.Geometry)for(e in f.geometryGroups)g=f.geometryGroups[e],v(d.__webglObjects,g,a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?(f=a.geometry,v(d.__webglObjects,f,a)):a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback?d.__webglObjectsImmediate.push({id:null,object:a,opaque:null,transparent:null,z:0}):a instanceof THREE.Sprite?d.__webglSprites.push(a):a instanceof
-THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function v(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function w(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function u(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function y(a,b){a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line?L(b.__webglObjects,a):a instanceof THREE.Sprite?A(b.__webglSprites,a):a instanceof THREE.LensFlare?
-A(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&L(b.__webglObjectsImmediate,a);delete a.__webglActive}function L(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function A(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function K(a,b,c,d,e){Ea=0;d.needsUpdate&&(d.program&&Fb(d),P.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(P.maxMorphTargets));
-var f=!1,g=d.program,h=g.uniforms,k=d.uniforms;g.id!==wa&&(m.useProgram(g.program),wa=g.id,f=!0);d.id!==fa&&(fa=d.id,f=!0);if(f||a!==Ia)m.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),da&&m.uniform1f(h.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Ia&&(Ia=a);if(d.skinning)if(Gb&&e.skeleton.useVertexTexture){if(null!==h.boneTexture){var l=B();m.uniform1i(h.boneTexture,l);P.setTexture(e.skeleton.boneTexture,l)}null!==h.boneTextureWidth&&m.uniform1i(h.boneTextureWidth,e.skeleton.boneTextureWidth);
-null!==h.boneTextureHeight&&m.uniform1i(h.boneTextureHeight,e.skeleton.boneTextureHeight)}else null!==h.boneGlobalMatrices&&m.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(f){c&&d.fog&&(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(cb){var p,n=l=0,r=0,q,s,t,u=Bb,v=u.directional.colors,
-w=u.directional.positions,y=u.point.colors,A=u.point.positions,C=u.point.distances,L=u.spot.colors,D=u.spot.positions,H=u.spot.distances,K=u.spot.directions,Q=u.spot.anglesCos,N=u.spot.exponents,F=u.hemi.skyColors,I=u.hemi.groundColors,U=u.hemi.positions,Y=0,ga=0,R=0,X=0,$=0,aa=0,ba=0,Z=0,W=p=0;c=t=W=0;for(f=b.length;c<f;c++)if(p=b[c],!p.onlyShadow)if(q=p.color,s=p.intensity,t=p.distance,p instanceof THREE.AmbientLight)p.visible&&(P.gammaInput?(l+=q.r*q.r,n+=q.g*q.g,r+=q.b*q.b):(l+=q.r,n+=q.g,r+=
-q.b));else if(p instanceof THREE.DirectionalLight){if($+=1,p.visible&&(oa.setFromMatrixPosition(p.matrixWorld),xa.setFromMatrixPosition(p.target.matrixWorld),oa.sub(xa),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))p=3*Y,w[p]=oa.x,w[p+1]=oa.y,w[p+2]=oa.z,P.gammaInput?E(v,p,q,s*s):G(v,p,q,s),Y+=1}else p instanceof THREE.PointLight?(aa+=1,p.visible&&(W=3*ga,P.gammaInput?E(y,W,q,s*s):G(y,W,q,s),xa.setFromMatrixPosition(p.matrixWorld),A[W]=xa.x,A[W+1]=xa.y,A[W+2]=xa.z,C[ga]=t,ga+=1)):p instanceof THREE.SpotLight?
-(ba+=1,p.visible&&(W=3*R,P.gammaInput?E(L,W,q,s*s):G(L,W,q,s),xa.setFromMatrixPosition(p.matrixWorld),D[W]=xa.x,D[W+1]=xa.y,D[W+2]=xa.z,H[R]=t,oa.copy(xa),xa.setFromMatrixPosition(p.target.matrixWorld),oa.sub(xa),oa.normalize(),K[W]=oa.x,K[W+1]=oa.y,K[W+2]=oa.z,Q[R]=Math.cos(p.angle),N[R]=p.exponent,R+=1)):p instanceof THREE.HemisphereLight&&(Z+=1,p.visible&&(oa.setFromMatrixPosition(p.matrixWorld),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))&&(t=3*X,U[t]=oa.x,U[t+1]=oa.y,U[t+2]=oa.z,q=p.color,p=
-p.groundColor,P.gammaInput?(s*=s,E(F,t,q,s),E(I,t,p,s)):(G(F,t,q,s),G(I,t,p,s)),X+=1);c=3*Y;for(f=Math.max(v.length,3*$);c<f;c++)v[c]=0;c=3*ga;for(f=Math.max(y.length,3*aa);c<f;c++)y[c]=0;c=3*R;for(f=Math.max(L.length,3*ba);c<f;c++)L[c]=0;c=3*X;for(f=Math.max(F.length,3*Z);c<f;c++)F[c]=0;c=3*X;for(f=Math.max(I.length,3*Z);c<f;c++)I[c]=0;u.directional.length=Y;u.point.length=ga;u.spot.length=R;u.hemi.length=X;u.ambient[0]=l;u.ambient[1]=n;u.ambient[2]=r;cb=!1}c=Bb;k.ambientLightColor.value=c.ambient;
+THREE.LensFlare&&d.__webglFlares.push(a);a.__webglActive=!0}}function v(a,b,c){a.push({id:null,buffer:b,object:c,opaque:null,transparent:null,z:0})}function w(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function u(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,b){a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line?K(b.__webglObjects,a):a instanceof THREE.Sprite?z(b.__webglSprites,a):a instanceof THREE.LensFlare?
+z(b.__webglFlares,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&K(b.__webglObjectsImmediate,a);delete a.__webglActive}function K(a,b){for(var c=a.length-1;0<=c;c--)a[c].object===b&&a.splice(c,1)}function z(a,b){for(var c=a.length-1;0<=c;c--)a[c]===b&&a.splice(c,1)}function B(a,b,c,d,e){Ea=0;d.needsUpdate&&(d.program&&Fb(d),O.initMaterial(d,b,c,e),d.needsUpdate=!1);d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(O.maxMorphTargets));
+var f=!1,g=d.program,h=g.uniforms,k=d.uniforms;g.id!==wa&&(m.useProgram(g.program),wa=g.id,f=!0);d.id!==fa&&(fa=d.id,f=!0);if(f||a!==Ia)m.uniformMatrix4fv(h.projectionMatrix,!1,a.projectionMatrix.elements),da&&m.uniform1f(h.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Ia&&(Ia=a);if(d.skinning)if(Gb&&e.skeleton.useVertexTexture){if(null!==h.boneTexture){var l=A();m.uniform1i(h.boneTexture,l);O.setTexture(e.skeleton.boneTexture,l)}null!==h.boneTextureWidth&&m.uniform1i(h.boneTextureWidth,e.skeleton.boneTextureWidth);
+null!==h.boneTextureHeight&&m.uniform1i(h.boneTextureHeight,e.skeleton.boneTextureHeight)}else null!==h.boneGlobalMatrices&&m.uniformMatrix4fv(h.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(f){c&&d.fog&&(k.fogColor.value=c.color,c instanceof THREE.Fog?(k.fogNear.value=c.near,k.fogFar.value=c.far):c instanceof THREE.FogExp2&&(k.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(cb){var p,n=l=0,r=0,q,t,s,u=Bb,v=u.directional.colors,
+w=u.directional.positions,x=u.point.colors,z=u.point.positions,K=u.point.distances,B=u.spot.colors,H=u.spot.positions,C=u.spot.distances,G=u.spot.directions,P=u.spot.anglesCos,D=u.spot.exponents,y=u.hemi.skyColors,M=u.hemi.groundColors,R=u.hemi.positions,Y=0,ga=0,S=0,X=0,$=0,aa=0,ba=0,Z=0,W=p=0;c=s=W=0;for(f=b.length;c<f;c++)if(p=b[c],!p.onlyShadow)if(q=p.color,t=p.intensity,s=p.distance,p instanceof THREE.AmbientLight)p.visible&&(O.gammaInput?(l+=q.r*q.r,n+=q.g*q.g,r+=q.b*q.b):(l+=q.r,n+=q.g,r+=
+q.b));else if(p instanceof THREE.DirectionalLight){if($+=1,p.visible&&(oa.setFromMatrixPosition(p.matrixWorld),xa.setFromMatrixPosition(p.target.matrixWorld),oa.sub(xa),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))p=3*Y,w[p]=oa.x,w[p+1]=oa.y,w[p+2]=oa.z,O.gammaInput?E(v,p,q,t*t):F(v,p,q,t),Y+=1}else p instanceof THREE.PointLight?(aa+=1,p.visible&&(W=3*ga,O.gammaInput?E(x,W,q,t*t):F(x,W,q,t),xa.setFromMatrixPosition(p.matrixWorld),z[W]=xa.x,z[W+1]=xa.y,z[W+2]=xa.z,K[ga]=s,ga+=1)):p instanceof THREE.SpotLight?
+(ba+=1,p.visible&&(W=3*S,O.gammaInput?E(B,W,q,t*t):F(B,W,q,t),xa.setFromMatrixPosition(p.matrixWorld),H[W]=xa.x,H[W+1]=xa.y,H[W+2]=xa.z,C[S]=s,oa.copy(xa),xa.setFromMatrixPosition(p.target.matrixWorld),oa.sub(xa),oa.normalize(),G[W]=oa.x,G[W+1]=oa.y,G[W+2]=oa.z,P[S]=Math.cos(p.angle),D[S]=p.exponent,S+=1)):p instanceof THREE.HemisphereLight&&(Z+=1,p.visible&&(oa.setFromMatrixPosition(p.matrixWorld),oa.normalize(),0!==oa.x||0!==oa.y||0!==oa.z))&&(s=3*X,R[s]=oa.x,R[s+1]=oa.y,R[s+2]=oa.z,q=p.color,p=
+p.groundColor,O.gammaInput?(t*=t,E(y,s,q,t),E(M,s,p,t)):(F(y,s,q,t),F(M,s,p,t)),X+=1);c=3*Y;for(f=Math.max(v.length,3*$);c<f;c++)v[c]=0;c=3*ga;for(f=Math.max(x.length,3*aa);c<f;c++)x[c]=0;c=3*S;for(f=Math.max(B.length,3*ba);c<f;c++)B[c]=0;c=3*X;for(f=Math.max(y.length,3*Z);c<f;c++)y[c]=0;c=3*X;for(f=Math.max(M.length,3*Z);c<f;c++)M[c]=0;u.directional.length=Y;u.point.length=ga;u.spot.length=S;u.hemi.length=X;u.ambient[0]=l;u.ambient[1]=n;u.ambient[2]=r;cb=!1}c=Bb;k.ambientLightColor.value=c.ambient;
 k.directionalLightColor.value=c.directional.colors;k.directionalLightDirection.value=c.directional.positions;k.pointLightColor.value=c.point.colors;k.pointLightPosition.value=c.point.positions;k.pointLightDistance.value=c.point.distances;k.spotLightColor.value=c.spot.colors;k.spotLightPosition.value=c.spot.positions;k.spotLightDistance.value=c.spot.distances;k.spotLightDirection.value=c.spot.directions;k.spotLightAngleCos.value=c.spot.anglesCos;k.spotLightExponent.value=c.spot.exponents;k.hemisphereLightSkyColor.value=
-c.hemi.skyColors;k.hemisphereLightGroundColor.value=c.hemi.groundColors;k.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;P.gammaInput?k.diffuse.value.copyGammaToLinear(d.color):k.diffuse.value=d.color;k.map.value=d.map;k.lightMap.value=d.lightMap;k.specularMap.value=d.specularMap;d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale);d.normalMap&&
+c.hemi.skyColors;k.hemisphereLightGroundColor.value=c.hemi.groundColors;k.hemisphereLightDirection.value=c.hemi.positions}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){k.opacity.value=d.opacity;O.gammaInput?k.diffuse.value.copyGammaToLinear(d.color):k.diffuse.value=d.color;k.map.value=d.map;k.lightMap.value=d.lightMap;k.specularMap.value=d.specularMap;d.bumpMap&&(k.bumpMap.value=d.bumpMap,k.bumpScale.value=d.bumpScale);d.normalMap&&
 (k.normalMap.value=d.normalMap,k.normalScale.value.copy(d.normalScale));var V;d.map?V=d.map:d.specularMap?V=d.specularMap:d.normalMap?V=d.normalMap:d.bumpMap&&(V=d.bumpMap);void 0!==V&&(c=V.offset,V=V.repeat,k.offsetRepeat.value.set(c.x,c.y,V.x,V.y));k.envMap.value=d.envMap;k.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;k.reflectivity.value=d.reflectivity;k.refractionRatio.value=d.refractionRatio;k.combine.value=d.combine;k.useRefract.value=d.envMap&&d.envMap.mapping instanceof
-THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=x.height/2,k.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(k.shininess.value=
-d.shininess,P.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive),k.specular.value.copyGammaToLinear(d.specular)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive,k.specular.value=d.specular),d.wrapAround&&k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(P.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive),d.wrapAround&&
+THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(k.diffuse.value=d.color,k.opacity.value=d.opacity,k.dashSize.value=d.dashSize,k.totalSize.value=d.dashSize+d.gapSize,k.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(k.psColor.value=d.color,k.opacity.value=d.opacity,k.size.value=d.size,k.scale.value=J.height/2,k.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(k.shininess.value=
+d.shininess,O.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive),k.specular.value.copyGammaToLinear(d.specular)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive,k.specular.value=d.specular),d.wrapAround&&k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(O.gammaInput?(k.ambient.value.copyGammaToLinear(d.ambient),k.emissive.value.copyGammaToLinear(d.emissive)):(k.ambient.value=d.ambient,k.emissive.value=d.emissive),d.wrapAround&&
 k.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(k.mNear.value=a.near,k.mFar.value=a.far,k.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(k.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&k.shadowMatrix)for(c=V=0,f=b.length;c<f;c++)l=b[c],l.castShadow&&(l instanceof THREE.SpotLight||l instanceof THREE.DirectionalLight&&!l.shadowCascade)&&(k.shadowMap.value[V]=l.shadowMap,k.shadowMapSize.value[V]=l.shadowMapSize,k.shadowMatrix.value[V]=l.shadowMatrix,
 k.shadowDarkness.value[V]=l.shadowDarkness,k.shadowBias.value[V]=l.shadowBias,V++);b=d.uniformsList;k=0;for(V=b.length;k<V;k++)if(f=g.uniforms[b[k][1]])if(c=b[k][0],n=c.type,l=c.value,"i"===n)m.uniform1i(f,l);else if("f"===n)m.uniform1f(f,l);else if("v2"===n)m.uniform2f(f,l.x,l.y);else if("v3"===n)m.uniform3f(f,l.x,l.y,l.z);else if("v4"===n)m.uniform4f(f,l.x,l.y,l.z,l.w);else if("c"===n)m.uniform3f(f,l.r,l.g,l.b);else if("iv1"===n)m.uniform1iv(f,l);else if("iv"===n)m.uniform3iv(f,l);else if("fv1"===
 n)m.uniform1fv(f,l);else if("fv"===n)m.uniform3fv(f,l);else if("v2v"===n){void 0===c._array&&(c._array=new Float32Array(2*l.length));n=0;for(r=l.length;n<r;n++)u=2*n,c._array[u]=l[n].x,c._array[u+1]=l[n].y;m.uniform2fv(f,c._array)}else if("v3v"===n){void 0===c._array&&(c._array=new Float32Array(3*l.length));n=0;for(r=l.length;n<r;n++)u=3*n,c._array[u]=l[n].x,c._array[u+1]=l[n].y,c._array[u+2]=l[n].z;m.uniform3fv(f,c._array)}else if("v4v"===n){void 0===c._array&&(c._array=new Float32Array(4*l.length));
 n=0;for(r=l.length;n<r;n++)u=4*n,c._array[u]=l[n].x,c._array[u+1]=l[n].y,c._array[u+2]=l[n].z,c._array[u+3]=l[n].w;m.uniform4fv(f,c._array)}else if("m3"===n)m.uniformMatrix3fv(f,!1,l.elements);else if("m3v"===n){void 0===c._array&&(c._array=new Float32Array(9*l.length));n=0;for(r=l.length;n<r;n++)l[n].flattenToArrayOffset(c._array,9*n);m.uniformMatrix3fv(f,!1,c._array)}else if("m4"===n)m.uniformMatrix4fv(f,!1,l.elements);else if("m4v"===n){void 0===c._array&&(c._array=new Float32Array(16*l.length));
-n=0;for(r=l.length;n<r;n++)l[n].flattenToArrayOffset(c._array,16*n);m.uniformMatrix4fv(f,!1,c._array)}else if("t"===n){if(u=l,l=B(),m.uniform1i(f,l),u)if(u.image instanceof Array&&6===u.image.length){if(c=u,f=l,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",Hb),c.image.__webglTextureCube=m.createTexture(),P.info.memory.textures++);m.activeTexture(m.TEXTURE0+f);m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,
-c.flipY);f=c instanceof THREE.CompressedTexture;l=[];for(n=0;6>n;n++)P.autoScaleCubemaps&&!f?(r=l,u=n,v=c.image[n],y=dc,v.width<=y&&v.height<=y||(A=Math.max(v.width,v.height),w=Math.floor(v.width*y/A),y=Math.floor(v.height*y/A),A=document.createElement("canvas"),A.width=w,A.height=y,A.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,y),v=A),r[u]=v):l[n]=c.image[n];n=l[0];r=THREE.Math.isPowerOfTwo(n.width)&&THREE.Math.isPowerOfTwo(n.height);u=z(c.format);v=z(c.type);M(m.TEXTURE_CUBE_MAP,c,r);
-for(n=0;6>n;n++)if(f)for(y=l[n].mipmaps,A=0,C=y.length;A<C;A++)w=y[A],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,A,u,w.width,w.height,0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,A,u,w.width,w.height,0,u,v,w.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,u,u,v,l[n]);c.generateMipmaps&&r&&m.generateMipmap(m.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else m.activeTexture(m.TEXTURE0+f),m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else u instanceof
-THREE.WebGLRenderTargetCube?(c=u,m.activeTexture(m.TEXTURE0+l),m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture)):P.setTexture(u,l)}else if("tv"===n){void 0===c._array&&(c._array=[]);n=0;for(r=c.value.length;n<r;n++)c._array[n]=B();m.uniform1iv(f,c._array);n=0;for(r=c.value.length;n<r;n++)u=c.value[n],l=c._array[n],u&&P.setTexture(u,l)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+n);(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition&&
+n=0;for(r=l.length;n<r;n++)l[n].flattenToArrayOffset(c._array,16*n);m.uniformMatrix4fv(f,!1,c._array)}else if("t"===n){if(u=l,l=A(),m.uniform1i(f,l),u)if(u.image instanceof Array&&6===u.image.length){if(c=u,f=l,6===c.image.length)if(c.needsUpdate){c.image.__webglTextureCube||(c.addEventListener("dispose",Hb),c.image.__webglTextureCube=m.createTexture(),O.info.memory.textures++);m.activeTexture(m.TEXTURE0+f);m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,
+c.flipY);f=c instanceof THREE.CompressedTexture;l=[];for(n=0;6>n;n++)O.autoScaleCubemaps&&!f?(r=l,u=n,v=c.image[n],x=dc,v.width<=x&&v.height<=x||(z=Math.max(v.width,v.height),w=Math.floor(v.width*x/z),x=Math.floor(v.height*x/z),z=document.createElement("canvas"),z.width=w,z.height=x,z.getContext("2d").drawImage(v,0,0,v.width,v.height,0,0,w,x),v=z),r[u]=v):l[n]=c.image[n];n=l[0];r=THREE.Math.isPowerOfTwo(n.width)&&THREE.Math.isPowerOfTwo(n.height);u=L(c.format);v=L(c.type);Q(m.TEXTURE_CUBE_MAP,c,r);
+for(n=0;6>n;n++)if(f)for(x=l[n].mipmaps,z=0,K=x.length;z<K;z++)w=x[z],c.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,z,u,w.width,w.height,0,w.data):m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,z,u,w.width,w.height,0,u,v,w.data);else m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,u,u,v,l[n]);c.generateMipmaps&&r&&m.generateMipmap(m.TEXTURE_CUBE_MAP);c.needsUpdate=!1;if(c.onUpdate)c.onUpdate()}else m.activeTexture(m.TEXTURE0+f),m.bindTexture(m.TEXTURE_CUBE_MAP,c.image.__webglTextureCube)}else u instanceof
+THREE.WebGLRenderTargetCube?(c=u,m.activeTexture(m.TEXTURE0+l),m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture)):O.setTexture(u,l)}else if("tv"===n){void 0===c._array&&(c._array=[]);n=0;for(r=c.value.length;n<r;n++)c._array[n]=A();m.uniform1iv(f,c._array);n=0;for(r=c.value.length;n<r;n++)u=c.value[n],l=c._array[n],u&&O.setTexture(u,l)}else console.warn("THREE.WebGLRenderer: Unknown uniform type: "+n);(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==h.cameraPosition&&
 (xa.setFromMatrixPosition(a.matrixWorld),m.uniform3f(h.cameraPosition,xa.x,xa.y,xa.z));(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==h.viewMatrix&&m.uniformMatrix4fv(h.viewMatrix,!1,a.matrixWorldInverse.elements)}m.uniformMatrix4fv(h.modelViewMatrix,!1,e._modelViewMatrix.elements);h.normalMatrix&&m.uniformMatrix3fv(h.normalMatrix,!1,e._normalMatrix.elements);null!==h.modelMatrix&&m.uniformMatrix4fv(h.modelMatrix,
-!1,e.matrixWorld.elements);return g}function B(){var a=Ea;a>=Cb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Cb);Ea+=1;return a}function E(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function G(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function C(a){a!==ua&&(m.lineWidth(a),ua=a)}function D(a,b,c){ya!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),ya=a);!a||Z===b&&qa===c||(m.polygonOffset(b,c),Z=b,qa=c)}function M(a,
-b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,z(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,z(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,z(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,z(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,I(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,I(b.minFilter)));db&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,
-db.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Ib)),b.__oldAnisotropy=b.anisotropy)}function N(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,
-a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function I(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function z(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===
+!1,e.matrixWorld.elements);return g}function A(){var a=Ea;a>=Cb&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Cb);Ea+=1;return a}function E(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 F(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function H(a){a!==ua&&(m.lineWidth(a),ua=a)}function C(a,b,c){ya!==a&&(a?m.enable(m.POLYGON_OFFSET_FILL):m.disable(m.POLYGON_OFFSET_FILL),ya=a);!a||Z===b&&qa===c||(m.polygonOffset(b,c),Z=b,qa=c)}function Q(a,
+b,c){c?(m.texParameteri(a,m.TEXTURE_WRAP_S,L(b.wrapS)),m.texParameteri(a,m.TEXTURE_WRAP_T,L(b.wrapT)),m.texParameteri(a,m.TEXTURE_MAG_FILTER,L(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,L(b.minFilter))):(m.texParameteri(a,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(a,m.TEXTURE_MAG_FILTER,R(b.magFilter)),m.texParameteri(a,m.TEXTURE_MIN_FILTER,R(b.minFilter)));db&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(m.texParameterf(a,
+db.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Ib)),b.__oldAnisotropy=b.anisotropy)}function D(a,b){m.bindRenderbuffer(m.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_STENCIL,b.width,b.height),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,
+a)):m.renderbufferStorage(m.RENDERBUFFER,m.RGBA4,b.width,b.height)}function R(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?m.NEAREST:m.LINEAR}function L(a){if(a===THREE.RepeatWrapping)return m.REPEAT;if(a===THREE.ClampToEdgeWrapping)return m.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return m.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return m.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return m.NEAREST_MIPMAP_NEAREST;if(a===
 THREE.NearestMipMapLinearFilter)return m.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return m.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return m.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return m.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return m.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return m.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return m.UNSIGNED_SHORT_5_5_5_1;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!==Pa){if(a===THREE.RGB_S3TC_DXT1_Format)return Pa.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Pa.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Pa.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Pa.COMPRESSED_RGBA_S3TC_DXT5_EXT}return 0}console.log("THREE.WebGLRenderer",
-THREE.REVISION);a=a||{};var x=void 0!==a.canvas?a.canvas:document.createElement("canvas"),H=void 0!==a.context?a.context:null,Q=void 0!==a.precision?a.precision:"highp",Y=void 0!==a.alpha?a.alpha:!1,U=void 0!==a.depth?a.depth:!0,la=void 0!==a.stencil?a.stencil:!0,W=void 0!==a.antialias?a.antialias:!1,R=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,da=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,V=new THREE.Color(0),
-X=0;this.domElement=x;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=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 P=this,ga=[],wa=null,Ha=null,fa=-1,za=null,Ia=null,Ea=0,Ga=-1,ha=-1,Oa=-1,Ra=-1,Sa=-1,Fa=-1,ia=-1,ma=-1,ya=null,Z=null,qa=null,ua=null,Ca=0,va=0,Da=x.width,Ja=x.height,ja=0,ra=0,Ka=new Uint8Array(16),ob=new Uint8Array(16),Ab=new THREE.Frustum,Pb=new THREE.Matrix4,cc=new THREE.Matrix4,xa=new THREE.Vector3,
-oa=new THREE.Vector3,cb=!0,Bb={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,sb,xb,db,Pa,pb;(function(){try{var a={alpha:Y,depth:U,stencil:la,antialias:W,premultipliedAlpha:R,preserveDrawingBuffer:F};m=H||x.getContext("webgl",a)||x.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";
+THREE.REVISION);a=a||{};var J=void 0!==a.canvas?a.canvas:document.createElement("canvas"),G=void 0!==a.context?a.context:null,P=void 0!==a.precision?a.precision:"highp",Y=void 0!==a.alpha?a.alpha:!1,M=void 0!==a.depth?a.depth:!0,la=void 0!==a.stencil?a.stencil:!0,W=void 0!==a.antialias?a.antialias:!1,S=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,y=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,da=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,V=new THREE.Color(0),
+X=0;this.domElement=J;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.autoUpdateObjects=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 O=this,ga=[],wa=null,Ha=null,fa=-1,za=null,Ia=null,Ea=0,Ga=-1,ha=-1,Oa=-1,Ra=-1,Sa=-1,Fa=-1,ia=-1,ma=-1,ya=null,Z=null,qa=null,ua=null,Ca=0,va=0,Da=J.width,Ja=J.height,ja=0,ra=0,Ka=new Uint8Array(16),ob=new Uint8Array(16),Ab=new THREE.Frustum,Pb=new THREE.Matrix4,cc=new THREE.Matrix4,xa=new THREE.Vector3,
+oa=new THREE.Vector3,cb=!0,Bb={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,sb,xb,db,Pa,pb;(function(){try{var a={alpha:Y,depth:M,stencil:la,antialias:W,premultipliedAlpha:S,preserveDrawingBuffer:y};m=G||J.getContext("webgl",a)||J.getContext("experimental-webgl",a);if(null===m)throw"Error creating WebGL context.";
 }catch(b){console.error(b)}sb=m.getExtension("OES_texture_float");m.getExtension("OES_texture_float_linear");xb=m.getExtension("OES_standard_derivatives");db=m.getExtension("EXT_texture_filter_anisotropic")||m.getExtension("MOZ_EXT_texture_filter_anisotropic")||m.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Pa=m.getExtension("WEBGL_compressed_texture_s3tc")||m.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||m.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");pb=m.getExtension("OES_element_index_uint");
 null===sb&&console.log("THREE.WebGLRenderer: Float textures not supported.");null===xb&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===db&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===Pa&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===pb&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");void 0===m.getShaderPrecisionFormat&&(m.getShaderPrecisionFormat=function(){return{rangeMin:1,
 rangeMax:1,precision:1}});da&&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(Ca,va,Da,Ja);m.clearColor(V.r,V.g,V.b,X);this.context=m;var Cb=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),Db=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS);m.getParameter(m.MAX_TEXTURE_SIZE);
 var dc=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),Ib=db?m.getParameter(db.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,Jb=0<Db,Gb=Jb&&sb;Pa&&m.getParameter(m.COMPRESSED_TEXTURE_FORMATS);var ec=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.HIGH_FLOAT),qc=m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.VERTEX_SHADER,m.LOW_FLOAT);var rc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT),sc=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.MEDIUM_FLOAT);m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,
-m.LOW_FLOAT);var tc=0<ec.precision&&0<rc.precision,Kb=0<qc.precision&&0<sc.precision;"highp"!==Q||tc||(Kb?(Q="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(Q="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==Q||Kb||(Q="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));this.getContext=function(){return m};this.supportsVertexTextures=function(){return Jb};this.supportsFloatTextures=
-function(){return sb};this.supportsStandardDerivatives=function(){return xb};this.supportsCompressedTextureS3TC=function(){return Pa};this.getMaxAnisotropy=function(){return Ib};this.getPrecision=function(){return Q};this.setSize=function(a,b,c){x.width=a*this.devicePixelRatio;x.height=b*this.devicePixelRatio;!1!==c&&(x.style.width=a+"px",x.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ca=a*this.devicePixelRatio;va=b*this.devicePixelRatio;Da=c*this.devicePixelRatio;
+m.LOW_FLOAT);var tc=0<ec.precision&&0<rc.precision,Kb=0<qc.precision&&0<sc.precision;"highp"!==P||tc||(Kb?(P="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(P="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==P||Kb||(P="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));this.getContext=function(){return m};this.supportsVertexTextures=function(){return Jb};this.supportsFloatTextures=
+function(){return sb};this.supportsStandardDerivatives=function(){return xb};this.supportsCompressedTextureS3TC=function(){return Pa};this.getMaxAnisotropy=function(){return Ib};this.getPrecision=function(){return P};this.setSize=function(a,b,c){J.width=a*this.devicePixelRatio;J.height=b*this.devicePixelRatio;!1!==c&&(J.style.width=a+"px",J.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Ca=a*this.devicePixelRatio;va=b*this.devicePixelRatio;Da=c*this.devicePixelRatio;
 Ja=d*this.devicePixelRatio;m.viewport(Ca,va,Da,Ja)};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){V.set(a);X=void 0!==b?b:1;m.clearColor(V.r,V.g,V.b,X)};this.setClearColorHex=function(a,b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");
 this.setClearColor(a,b)};this.getClearColor=function(){return V};this.getClearAlpha=function(){return X};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){wa=null;fa=za=ma=ia=Oa=-1;cb=!0;ha=Ga=-1;this.shadowMapPlugin.update(a,b)};var Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&m.deleteBuffer(b[c].buffer);P.info.memory.geometries--}else if(void 0!==
+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){wa=null;fa=za=ma=ia=Oa=-1;cb=!0;ha=Ga=-1;this.shadowMapPlugin.update(a,b)};var Eb=function(a){a=a.target;a.removeEventListener("dispose",Eb);a.__webglInit=void 0;if(a instanceof THREE.BufferGeometry){var b=a.attributes,c;for(c in b)void 0!==b[c].buffer&&m.deleteBuffer(b[c].buffer);O.info.memory.geometries--}else if(void 0!==
 a.geometryGroups)for(b in a.geometryGroups){c=a.geometryGroups[b];if(void 0!==c.numMorphTargets)for(var d=0,e=c.numMorphTargets;d<e;d++)m.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(void 0!==c.numMorphNormals)for(d=0,e=c.numMorphNormals;d<e;d++)m.deleteBuffer(c.__webglMorphNormalsBuffers[d]);Qb(c)}else Qb(a)},Hb=function(a){a=a.target;a.removeEventListener("dispose",Hb);a.image&&a.image.__webglTextureCube?m.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,m.deleteTexture(a.__webglTexture));
-P.info.memory.textures--},Rb=function(a){a=a.target;a.removeEventListener("dispose",Rb);if(a&&a.__webglTexture)if(m.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer);P.info.memory.textures--},Sb=function(a){a=a.target;a.removeEventListener("dispose",Sb);Fb(a)},Qb=function(a){void 0!==
+O.info.memory.textures--},Rb=function(a){a=a.target;a.removeEventListener("dispose",Rb);if(a&&a.__webglTexture)if(m.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)m.deleteFramebuffer(a.__webglFramebuffer[b]),m.deleteRenderbuffer(a.__webglRenderbuffer[b]);else m.deleteFramebuffer(a.__webglFramebuffer),m.deleteRenderbuffer(a.__webglRenderbuffer);O.info.memory.textures--},Sb=function(a){a=a.target;a.removeEventListener("dispose",Sb);Fb(a)},Qb=function(a){void 0!==
 a.__webglVertexBuffer&&m.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&m.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&m.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&m.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&m.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&m.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&m.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&
-m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer);P.info.memory.geometries--},Fb=function(a){var b=a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;
-a=0;for(c=ga.length;a<c;a++)if(d=ga[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=ga.length;a<c;a++)d=ga[a],d.program!==b&&e.push(d);ga=e;m.deleteProgram(b);P.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){h();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=m.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=m.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=m.createBuffer());
-a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),k(b.attributes.position),m.vertexAttribPointer(b.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormals){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,g,n,p,r,q,s,t,u,v=3*a.count;for(u=0;u<v;u+=9)t=a.normalArray,d=t[u],e=t[u+1],f=t[u+2],g=t[u+3],p=
-t[u+4],q=t[u+5],n=t[u+6],r=t[u+7],s=t[u+8],d=(d+g+n)/3,e=(e+p+r)/3,f=(f+q+s)/3,t[u]=d,t[u+1]=e,t[u+2]=f,t[u+3]=d,t[u+4]=e,t[u+5]=f,t[u+6]=d,t[u+7]=e,t[u+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);k(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,a.uvArray,m.DYNAMIC_DRAW),k(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&
-c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),k(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));l();m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var k=K(a,b,c,d,f);a=k.attributes;b=e.attributes;c=!1;k=16777215*e.id+2*k.id+(d.wireframe?1:0);k!==za&&(za=k,c=!0);c&&h();if(f instanceof THREE.Mesh)if(f=b.index){var l;
-f.array instanceof Uint32Array?(k=m.UNSIGNED_INT,l=4):(k=m.UNSIGNED_SHORT,l=2);e=e.offsets;if(0===e.length)c&&(g(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.TRIANGLES,f.array.length,k,0),P.info.render.calls++,P.info.render.vertices+=f.array.length,P.info.render.faces+=f.array.length/3;else{c=!0;for(var n=0,p=e.length;n<p;n++){var r=e[n].index;c&&(g(d,a,b,r),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer));m.drawElements(m.TRIANGLES,e[n].count,k,e[n].start*l);P.info.render.calls++;
-P.info.render.vertices+=e[n].count;P.info.render.faces+=e[n].count/3}}}else c&&g(d,a,b,0),d=e.attributes.position,m.drawArrays(m.TRIANGLES,0,d.array.length/3),P.info.render.calls++,P.info.render.vertices+=d.array.length/3,P.info.render.faces+=d.array.length/9;else if(f instanceof THREE.PointCloud)c&&g(d,a,b,0),d=b.position,m.drawArrays(m.POINTS,0,d.array.length/3),P.info.render.calls++,P.info.render.points+=d.array.length/3;else if(f instanceof THREE.Line)if(k=f.type===THREE.LineStrip?m.LINE_STRIP:
-m.LINES,C(d.linewidth),f=b.index)if(f.array instanceof Uint32Array?(k=m.UNSIGNED_INT,l=4):(k=m.UNSIGNED_SHORT,l=2),e=e.offsets,0===e.length)c&&(g(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,f.array.length,k,0),P.info.render.calls++,P.info.render.vertices+=f.array.length;else for(1<e.length&&(c=!0),n=0,p=e.length;n<p;n++)r=e[n].index,c&&(g(d,a,b,r),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,e[n].count,k,e[n].start*l),P.info.render.calls++,
-P.info.render.vertices+=e[n].count;else c&&g(d,a,b,0),d=b.position,m.drawArrays(k,0,d.array.length/3),P.info.render.calls++,P.info.render.points+=d.array.length/3}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,n;c=K(a,b,c,d,f);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==za&&(za=c,a=!0);a&&h();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),k(b.position),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=
+m.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&m.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&m.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&m.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)m.deleteBuffer(a.__webglCustomAttributesList[b].buffer);O.info.memory.geometries--},Fb=function(a){var b=a.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;
+a=0;for(c=ga.length;a<c;a++)if(d=ga[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=ga.length;a<c;a++)d=ga[a],d.program!==b&&e.push(d);ga=e;m.deleteProgram(b);O.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){h();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=m.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=m.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=m.createBuffer());
+a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=m.createBuffer());a.hasPositions&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,a.positionArray,m.DYNAMIC_DRAW),k(b.attributes.position),m.vertexAttribPointer(b.attributes.position,3,m.FLOAT,!1,0,0));if(a.hasNormals){m.bindBuffer(m.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,g,n,p,r,q,t,s,u,v=3*a.count;for(u=0;u<v;u+=9)s=a.normalArray,d=s[u],e=s[u+1],f=s[u+2],g=s[u+3],p=
+s[u+4],q=s[u+5],n=s[u+6],r=s[u+7],t=s[u+8],d=(d+g+n)/3,e=(e+p+r)/3,f=(f+q+t)/3,s[u]=d,s[u+1]=e,s[u+2]=f,s[u+3]=d,s[u+4]=e,s[u+5]=f,s[u+6]=d,s[u+7]=e,s[u+8]=f}m.bufferData(m.ARRAY_BUFFER,a.normalArray,m.DYNAMIC_DRAW);k(b.attributes.normal);m.vertexAttribPointer(b.attributes.normal,3,m.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglUvBuffer),m.bufferData(m.ARRAY_BUFFER,a.uvArray,m.DYNAMIC_DRAW),k(b.attributes.uv),m.vertexAttribPointer(b.attributes.uv,2,m.FLOAT,!1,0,0));a.hasColors&&
+c.vertexColors!==THREE.NoColors&&(m.bindBuffer(m.ARRAY_BUFFER,a.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,a.colorArray,m.DYNAMIC_DRAW),k(b.attributes.color),m.vertexAttribPointer(b.attributes.color,3,m.FLOAT,!1,0,0));l();m.drawArrays(m.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var k=B(a,b,c,d,f);a=k.attributes;b=e.attributes;c=!1;k=16777215*e.id+2*k.id+(d.wireframe?1:0);k!==za&&(za=k,c=!0);c&&h();if(f instanceof THREE.Mesh)if(f=b.index){var l;
+f.array instanceof Uint32Array?(k=m.UNSIGNED_INT,l=4):(k=m.UNSIGNED_SHORT,l=2);e=e.offsets;if(0===e.length)c&&(g(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.TRIANGLES,f.array.length,k,0),O.info.render.calls++,O.info.render.vertices+=f.array.length,O.info.render.faces+=f.array.length/3;else{c=!0;for(var n=0,p=e.length;n<p;n++){var r=e[n].index;c&&(g(d,a,b,r),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer));m.drawElements(m.TRIANGLES,e[n].count,k,e[n].start*l);O.info.render.calls++;
+O.info.render.vertices+=e[n].count;O.info.render.faces+=e[n].count/3}}}else c&&g(d,a,b,0),d=e.attributes.position,m.drawArrays(m.TRIANGLES,0,d.array.length/3),O.info.render.calls++,O.info.render.vertices+=d.array.length/3,O.info.render.faces+=d.array.length/9;else if(f instanceof THREE.PointCloud)c&&g(d,a,b,0),d=b.position,m.drawArrays(m.POINTS,0,d.array.length/3),O.info.render.calls++,O.info.render.points+=d.array.length/3;else if(f instanceof THREE.Line)if(k=f.type===THREE.LineStrip?m.LINE_STRIP:
+m.LINES,H(d.linewidth),f=b.index)if(f.array instanceof Uint32Array?(k=m.UNSIGNED_INT,l=4):(k=m.UNSIGNED_SHORT,l=2),e=e.offsets,0===e.length)c&&(g(d,a,b,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,f.array.length,k,0),O.info.render.calls++,O.info.render.vertices+=f.array.length;else for(1<e.length&&(c=!0),n=0,p=e.length;n<p;n++)r=e[n].index,c&&(g(d,a,b,r),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,f.buffer)),m.drawElements(m.LINES,e[n].count,k,e[n].start*l),O.info.render.calls++,
+O.info.render.vertices+=e[n].count;else c&&g(d,a,b,0),d=b.position,m.drawArrays(k,0,d.array.length/3),O.info.render.calls++,O.info.render.points+=d.array.length/3}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var g,n;c=B(a,b,c,d,f);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==za&&(za=c,a=!0);a&&h();if(!d.morphTargets&&0<=b.position)a&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),k(b.position),m.vertexAttribPointer(b.position,3,m.FLOAT,!1,0,0));else if(f.morphTargetBase){c=
 d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),k(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0)):0<=c.position&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglVertexBuffer),k(c.position),m.vertexAttribPointer(c.position,3,m.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var p=0;n=f.morphTargetForcedOrder;for(g=f.morphTargetInfluences;p<d.numSupportedMorphTargets&&p<n.length;)0<=c["morphTarget"+p]&&
 (m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n[p]]),k(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+p],3,m.FLOAT,!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[n[p]]),k(c["morphNormal"+p]),m.vertexAttribPointer(c["morphNormal"+p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[n[p]],p++}else{n=[];g=f.morphTargetInfluences;var r,s=g.length;for(r=0;r<s;r++)p=g[r],0<p&&n.push([p,r]);n.length>d.numSupportedMorphTargets?
 (n.sort(q),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(q):0===n.length&&n.push([0,0]);for(p=0;p<d.numSupportedMorphTargets;)n[p]?(r=n[p][1],0<=c["morphTarget"+p]&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[r]),k(c["morphTarget"+p]),m.vertexAttribPointer(c["morphTarget"+p],3,m.FLOAT,!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[r]),k(c["morphNormal"+p]),m.vertexAttribPointer(c["morphNormal"+
@@ -454,56 +457,56 @@ p],3,m.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=g[r]):f.__webglMorphTarg
 c.size,m.FLOAT,!1,0,0));0<=b.color&&(0<f.geometry.colors.length||0<f.geometry.faces.length?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglColorBuffer),k(b.color),m.vertexAttribPointer(b.color,3,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglNormalBuffer),k(b.normal),m.vertexAttribPointer(b.normal,3,m.FLOAT,!1,0,0));0<=b.tangent&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglTangentBuffer),k(b.tangent),m.vertexAttribPointer(b.tangent,
 4,m.FLOAT,!1,0,0));0<=b.uv&&(f.geometry.faceVertexUvs[0]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUVBuffer),k(b.uv),m.vertexAttribPointer(b.uv,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(f.geometry.faceVertexUvs[1]?(m.bindBuffer(m.ARRAY_BUFFER,e.__webglUV2Buffer),k(b.uv2),m.vertexAttribPointer(b.uv2,2,m.FLOAT,!1,0,0)):d.defaultAttributeValues&&m.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&
 (m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),k(b.skinIndex),m.vertexAttribPointer(b.skinIndex,4,m.FLOAT,!1,0,0),m.bindBuffer(m.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),k(b.skinWeight),m.vertexAttribPointer(b.skinWeight,4,m.FLOAT,!1,0,0));0<=b.lineDistance&&(m.bindBuffer(m.ARRAY_BUFFER,e.__webglLineDistanceBuffer),k(b.lineDistance),m.vertexAttribPointer(b.lineDistance,1,m.FLOAT,!1,0,0))}l();f instanceof THREE.Mesh?(f=e.__typeArray===Uint32Array?m.UNSIGNED_INT:m.UNSIGNED_SHORT,d.wireframe?
-(C(d.wireframeLinewidth),a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),m.drawElements(m.LINES,e.__webglLineCount,f,0)):(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),m.drawElements(m.TRIANGLES,e.__webglFaceCount,f,0)),P.info.render.calls++,P.info.render.vertices+=e.__webglFaceCount,P.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,C(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),P.info.render.calls++):
-f instanceof THREE.PointCloud&&(m.drawArrays(m.POINTS,0,e.__webglParticleCount),P.info.render.calls++,P.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h,k=a.__lights,l=a.fog;fa=-1;cb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Pb.multiplyMatrices(b.projectionMatrix,
-b.matrixWorldInverse);Ab.setFromMatrix(Pb);this.autoUpdateObjects&&this.initWebGLObjects(a);r(this.renderPluginsPre,a,b);P.info.render.calls=0;P.info.render.vertices=0;P.info.render.faces=0;P.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.id=d,f.render=!1,g.visible&&(!1===g.frustumCulled||!0===Ab.intersectsObject(g))){var n=g;n._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
+(H(d.wireframeLinewidth),a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),m.drawElements(m.LINES,e.__webglLineCount,f,0)):(a&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),m.drawElements(m.TRIANGLES,e.__webglFaceCount,f,0)),O.info.render.calls++,O.info.render.vertices+=e.__webglFaceCount,O.info.render.faces+=e.__webglFaceCount/3):f instanceof THREE.Line?(f=f.type===THREE.LineStrip?m.LINE_STRIP:m.LINES,H(d.linewidth),m.drawArrays(f,0,e.__webglLineCount),O.info.render.calls++):
+f instanceof THREE.PointCloud&&(m.drawArrays(m.POINTS,0,e.__webglParticleCount),O.info.render.calls++,O.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h,k=a.__lights,l=a.fog;fa=-1;cb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();void 0===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Pb.multiplyMatrices(b.projectionMatrix,
+b.matrixWorldInverse);Ab.setFromMatrix(Pb);this.autoUpdateObjects&&this.initWebGLObjects(a);r(this.renderPluginsPre,a,b);O.info.render.calls=0;O.info.render.vertices=0;O.info.render.faces=0;O.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);h=a.__webglObjects;d=0;for(e=h.length;d<e;d++)if(f=h[d],g=f.object,f.id=d,f.render=!1,g.visible&&(!1===g.frustumCulled||!0===Ab.intersectsObject(g))){var n=g;n._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
 n.matrixWorld);n._normalMatrix.getNormalMatrix(n._modelViewMatrix);var n=f,q=n.object,u=n.buffer,v=q.geometry,q=q.material;q instanceof THREE.MeshFaceMaterial?(q=q.materials[v instanceof THREE.BufferGeometry?0:u.materialIndex],q.transparent?(n.transparent=q,n.opaque=null):(n.opaque=q,n.transparent=null)):q&&(q.transparent?(n.transparent=q,n.opaque=null):(n.opaque=q,n.transparent=null));f.render=!0;!0===this.sortObjects&&(null!==g.renderDepth?f.z=g.renderDepth:(xa.setFromMatrixPosition(g.matrixWorld),
 xa.applyProjection(Pb),f.z=xa.z))}this.sortObjects&&h.sort(p);h=a.__webglObjectsImmediate;d=0;for(e=h.length;d<e;d++)f=h[d],g=f.object,g.visible&&(g._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,g.matrixWorld),g._normalMatrix.getNormalMatrix(g._modelViewMatrix),g=f.object.material,g.transparent?(f.transparent=g,f.opaque=null):(f.opaque=g,f.transparent=null));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),
-this.setDepthWrite(d.depthWrite),D(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),t(a.__webglObjects,!1,"",b,k,l,!0,d),s(a.__webglObjectsImmediate,"",b,k,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),t(a.__webglObjects,!0,"opaque",b,k,l,!1,d),s(a.__webglObjectsImmediate,"opaque",b,k,l,!1,d),t(a.__webglObjects,!1,"transparent",b,k,l,!0,d),s(a.__webglObjectsImmediate,"transparent",b,k,l,!0,d));r(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&
-c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,c.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=K(a,b,c,d,e);za=-1;P.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,
-m,Ab):e.render(function(a){P.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)n(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)y(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&
-y(h,a),n(h,a));var k=h,l=k.geometry,p=void 0,r=void 0,s=void 0;if(l instanceof THREE.BufferGeometry){var t=m.DYNAMIC_DRAW,v=l.attributes,A=void 0,B=void 0;for(A in v)B=v[A],B.needsUpdate&&("index"===A?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,B.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,B.array,t)):(m.bindBuffer(m.ARRAY_BUFFER,B.buffer),m.bufferData(m.ARRAY_BUFFER,B.array,t)),B.needsUpdate=!1)}else if(k instanceof THREE.Mesh){for(var C=0,L=l.geometryGroupsList.length;C<L;C++)if(p=l.geometryGroupsList[C],
-s=d(k,p),l.buffersNeedUpdate&&c(p,k),r=s.attributes&&w(s),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||r){var x=p,E=k,D=m.DYNAMIC_DRAW,P=!l.dynamic,H=s;if(x.__inittedArrays){var G=e(H),K=H.vertexColors?H.vertexColors:!1,M=f(H),Q=G===THREE.SmoothShading,z=void 0,F=void 0,N=void 0,I=void 0,U=void 0,fa=void 0,Y=void 0,ga=void 0,R=void 0,V=void 0,W=void 0,$=void 0,aa=void 0,ba=void 0,wa=void 0,X=void 0,
-Z=void 0,da=void 0,Ia=void 0,Ga=void 0,Ea=void 0,ia=void 0,za=void 0,ja=void 0,Ha=void 0,la=void 0,oa=void 0,qa=void 0,ra=void 0,ha=void 0,ya=void 0,Fa=void 0,Ca=void 0,Da=void 0,ma=void 0,Ka=void 0,ua=void 0,va=void 0,Oa=void 0,Ja=void 0,ab=0,bb=0,Ra=0,Sa=0,Pa=0,eb=0,Ta=0,qb=0,Ya=0,ta=0,Aa=0,O=0,Qa=void 0,fb=x.__vertexArray,cb=x.__uvArray,db=x.__uv2Array,tb=x.__normalArray,Ua=x.__tangentArray,gb=x.__colorArray,Va=x.__skinIndexArray,Wa=x.__skinWeightArray,ob=x.__morphTargetsArrays,sb=x.__morphNormalsArrays,
-pb=x.__webglCustomAttributesList,J=void 0,Tb=x.__faceArray,ub=x.__lineArray,La=E.geometry,Ab=La.elementsNeedUpdate,xb=La.uvsNeedUpdate,Db=La.normalsNeedUpdate,Gb=La.tangentsNeedUpdate,Hb=La.colorsNeedUpdate,Jb=La.morphTargetsNeedUpdate,fc=La.vertices,ea=x.faces3,hb=La.faces,Bb=La.faceVertexUvs[0],Cb=La.faceVertexUvs[1],gc=La.skinIndices,Ub=La.skinWeights,Vb=La.morphTargets,Eb=La.morphNormals;if(La.verticesNeedUpdate){z=0;for(F=ea.length;z<F;z++)I=hb[ea[z]],$=fc[I.a],aa=fc[I.b],ba=fc[I.c],fb[bb]=$.x,
-fb[bb+1]=$.y,fb[bb+2]=$.z,fb[bb+3]=aa.x,fb[bb+4]=aa.y,fb[bb+5]=aa.z,fb[bb+6]=ba.x,fb[bb+7]=ba.y,fb[bb+8]=ba.z,bb+=9;m.bindBuffer(m.ARRAY_BUFFER,x.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,fb,D)}if(Jb)for(ma=0,Ka=Vb.length;ma<Ka;ma++){z=Aa=0;for(F=ea.length;z<F;z++)Oa=ea[z],I=hb[Oa],$=Vb[ma].vertices[I.a],aa=Vb[ma].vertices[I.b],ba=Vb[ma].vertices[I.c],ua=ob[ma],ua[Aa]=$.x,ua[Aa+1]=$.y,ua[Aa+2]=$.z,ua[Aa+3]=aa.x,ua[Aa+4]=aa.y,ua[Aa+5]=aa.z,ua[Aa+6]=ba.x,ua[Aa+7]=ba.y,ua[Aa+8]=ba.z,H.morphNormals&&
-(Q?(Ja=Eb[ma].vertexNormals[Oa],da=Ja.a,Ia=Ja.b,Ga=Ja.c):Ga=Ia=da=Eb[ma].faceNormals[Oa],va=sb[ma],va[Aa]=da.x,va[Aa+1]=da.y,va[Aa+2]=da.z,va[Aa+3]=Ia.x,va[Aa+4]=Ia.y,va[Aa+5]=Ia.z,va[Aa+6]=Ga.x,va[Aa+7]=Ga.y,va[Aa+8]=Ga.z),Aa+=9;m.bindBuffer(m.ARRAY_BUFFER,x.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,ob[ma],D);H.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,x.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,sb[ma],D))}if(Ub.length){z=0;for(F=ea.length;z<F;z++)I=hb[ea[z]],
-ja=Ub[I.a],Ha=Ub[I.b],la=Ub[I.c],Wa[ta]=ja.x,Wa[ta+1]=ja.y,Wa[ta+2]=ja.z,Wa[ta+3]=ja.w,Wa[ta+4]=Ha.x,Wa[ta+5]=Ha.y,Wa[ta+6]=Ha.z,Wa[ta+7]=Ha.w,Wa[ta+8]=la.x,Wa[ta+9]=la.y,Wa[ta+10]=la.z,Wa[ta+11]=la.w,oa=gc[I.a],qa=gc[I.b],ra=gc[I.c],Va[ta]=oa.x,Va[ta+1]=oa.y,Va[ta+2]=oa.z,Va[ta+3]=oa.w,Va[ta+4]=qa.x,Va[ta+5]=qa.y,Va[ta+6]=qa.z,Va[ta+7]=qa.w,Va[ta+8]=ra.x,Va[ta+9]=ra.y,Va[ta+10]=ra.z,Va[ta+11]=ra.w,ta+=12;0<ta&&(m.bindBuffer(m.ARRAY_BUFFER,x.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Va,
-D),m.bindBuffer(m.ARRAY_BUFFER,x.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Wa,D))}if(Hb&&K){z=0;for(F=ea.length;z<F;z++)I=hb[ea[z]],Y=I.vertexColors,ga=I.color,3===Y.length&&K===THREE.VertexColors?(Ea=Y[0],ia=Y[1],za=Y[2]):za=ia=Ea=ga,gb[Ya]=Ea.r,gb[Ya+1]=Ea.g,gb[Ya+2]=Ea.b,gb[Ya+3]=ia.r,gb[Ya+4]=ia.g,gb[Ya+5]=ia.b,gb[Ya+6]=za.r,gb[Ya+7]=za.g,gb[Ya+8]=za.b,Ya+=9;0<Ya&&(m.bindBuffer(m.ARRAY_BUFFER,x.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,gb,D))}if(Gb&&La.hasTangents){z=0;for(F=
-ea.length;z<F;z++)I=hb[ea[z]],R=I.vertexTangents,wa=R[0],X=R[1],Z=R[2],Ua[Ta]=wa.x,Ua[Ta+1]=wa.y,Ua[Ta+2]=wa.z,Ua[Ta+3]=wa.w,Ua[Ta+4]=X.x,Ua[Ta+5]=X.y,Ua[Ta+6]=X.z,Ua[Ta+7]=X.w,Ua[Ta+8]=Z.x,Ua[Ta+9]=Z.y,Ua[Ta+10]=Z.z,Ua[Ta+11]=Z.w,Ta+=12;m.bindBuffer(m.ARRAY_BUFFER,x.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,Ua,D)}if(Db&&G){z=0;for(F=ea.length;z<F;z++)if(I=hb[ea[z]],U=I.vertexNormals,fa=I.normal,3===U.length&&Q)for(ha=0;3>ha;ha++)Fa=U[ha],tb[eb]=Fa.x,tb[eb+1]=Fa.y,tb[eb+2]=Fa.z,eb+=3;else for(ha=
-0;3>ha;ha++)tb[eb]=fa.x,tb[eb+1]=fa.y,tb[eb+2]=fa.z,eb+=3;m.bindBuffer(m.ARRAY_BUFFER,x.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,tb,D)}if(xb&&Bb&&M){z=0;for(F=ea.length;z<F;z++)if(N=ea[z],V=Bb[N],void 0!==V)for(ha=0;3>ha;ha++)Ca=V[ha],cb[Ra]=Ca.x,cb[Ra+1]=Ca.y,Ra+=2;0<Ra&&(m.bindBuffer(m.ARRAY_BUFFER,x.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,cb,D))}if(xb&&Cb&&M){z=0;for(F=ea.length;z<F;z++)if(N=ea[z],W=Cb[N],void 0!==W)for(ha=0;3>ha;ha++)Da=W[ha],db[Sa]=Da.x,db[Sa+1]=Da.y,Sa+=2;0<Sa&&
-(m.bindBuffer(m.ARRAY_BUFFER,x.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,db,D))}if(Ab){z=0;for(F=ea.length;z<F;z++)Tb[Pa]=ab,Tb[Pa+1]=ab+1,Tb[Pa+2]=ab+2,Pa+=3,ub[qb]=ab,ub[qb+1]=ab+1,ub[qb+2]=ab,ub[qb+3]=ab+2,ub[qb+4]=ab+1,ub[qb+5]=ab+2,qb+=6,ab+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,x.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,Tb,D);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,x.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,ub,D)}if(pb)for(ha=0,ya=pb.length;ha<ya;ha++)if(J=pb[ha],
-J.__original.needsUpdate){O=0;if(1===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo)for(z=0,F=ea.length;z<F;z++)I=hb[ea[z]],J.array[O]=J.value[I.a],J.array[O+1]=J.value[I.b],J.array[O+2]=J.value[I.c],O+=3;else{if("faces"===J.boundTo)for(z=0,F=ea.length;z<F;z++)Qa=J.value[ea[z]],J.array[O]=Qa,J.array[O+1]=Qa,J.array[O+2]=Qa,O+=3}else if(2===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo)for(z=0,F=ea.length;z<F;z++)I=hb[ea[z]],$=J.value[I.a],aa=J.value[I.b],ba=J.value[I.c],J.array[O]=$.x,
-J.array[O+1]=$.y,J.array[O+2]=aa.x,J.array[O+3]=aa.y,J.array[O+4]=ba.x,J.array[O+5]=ba.y,O+=6;else{if("faces"===J.boundTo)for(z=0,F=ea.length;z<F;z++)ba=aa=$=Qa=J.value[ea[z]],J.array[O]=$.x,J.array[O+1]=$.y,J.array[O+2]=aa.x,J.array[O+3]=aa.y,J.array[O+4]=ba.x,J.array[O+5]=ba.y,O+=6}else if(3===J.size){var sa;sa="c"===J.type?["r","g","b"]:["x","y","z"];if(void 0===J.boundTo||"vertices"===J.boundTo)for(z=0,F=ea.length;z<F;z++)I=hb[ea[z]],$=J.value[I.a],aa=J.value[I.b],ba=J.value[I.c],J.array[O]=$[sa[0]],
-J.array[O+1]=$[sa[1]],J.array[O+2]=$[sa[2]],J.array[O+3]=aa[sa[0]],J.array[O+4]=aa[sa[1]],J.array[O+5]=aa[sa[2]],J.array[O+6]=ba[sa[0]],J.array[O+7]=ba[sa[1]],J.array[O+8]=ba[sa[2]],O+=9;else if("faces"===J.boundTo)for(z=0,F=ea.length;z<F;z++)ba=aa=$=Qa=J.value[ea[z]],J.array[O]=$[sa[0]],J.array[O+1]=$[sa[1]],J.array[O+2]=$[sa[2]],J.array[O+3]=aa[sa[0]],J.array[O+4]=aa[sa[1]],J.array[O+5]=aa[sa[2]],J.array[O+6]=ba[sa[0]],J.array[O+7]=ba[sa[1]],J.array[O+8]=ba[sa[2]],O+=9;else if("faceVertices"===
-J.boundTo)for(z=0,F=ea.length;z<F;z++)Qa=J.value[ea[z]],$=Qa[0],aa=Qa[1],ba=Qa[2],J.array[O]=$[sa[0]],J.array[O+1]=$[sa[1]],J.array[O+2]=$[sa[2]],J.array[O+3]=aa[sa[0]],J.array[O+4]=aa[sa[1]],J.array[O+5]=aa[sa[2]],J.array[O+6]=ba[sa[0]],J.array[O+7]=ba[sa[1]],J.array[O+8]=ba[sa[2]],O+=9}else if(4===J.size)if(void 0===J.boundTo||"vertices"===J.boundTo)for(z=0,F=ea.length;z<F;z++)I=hb[ea[z]],$=J.value[I.a],aa=J.value[I.b],ba=J.value[I.c],J.array[O]=$.x,J.array[O+1]=$.y,J.array[O+2]=$.z,J.array[O+3]=
-$.w,J.array[O+4]=aa.x,J.array[O+5]=aa.y,J.array[O+6]=aa.z,J.array[O+7]=aa.w,J.array[O+8]=ba.x,J.array[O+9]=ba.y,J.array[O+10]=ba.z,J.array[O+11]=ba.w,O+=12;else if("faces"===J.boundTo)for(z=0,F=ea.length;z<F;z++)ba=aa=$=Qa=J.value[ea[z]],J.array[O]=$.x,J.array[O+1]=$.y,J.array[O+2]=$.z,J.array[O+3]=$.w,J.array[O+4]=aa.x,J.array[O+5]=aa.y,J.array[O+6]=aa.z,J.array[O+7]=aa.w,J.array[O+8]=ba.x,J.array[O+9]=ba.y,J.array[O+10]=ba.z,J.array[O+11]=ba.w,O+=12;else if("faceVertices"===J.boundTo)for(z=0,F=
-ea.length;z<F;z++)Qa=J.value[ea[z]],$=Qa[0],aa=Qa[1],ba=Qa[2],J.array[O]=$.x,J.array[O+1]=$.y,J.array[O+2]=$.z,J.array[O+3]=$.w,J.array[O+4]=aa.x,J.array[O+5]=aa.y,J.array[O+6]=aa.z,J.array[O+7]=aa.w,J.array[O+8]=ba.x,J.array[O+9]=ba.y,J.array[O+10]=ba.z,J.array[O+11]=ba.w,O+=12;m.bindBuffer(m.ARRAY_BUFFER,J.buffer);m.bufferData(m.ARRAY_BUFFER,J.array,D)}P&&(delete x.__inittedArrays,delete x.__colorArray,delete x.__normalArray,delete x.__tangentArray,delete x.__uvArray,delete x.__uv2Array,delete x.__faceArray,
-delete x.__vertexArray,delete x.__lineArray,delete x.__skinIndexArray,delete x.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;s.attributes&&u(s)}else if(k instanceof THREE.Line){s=d(k,l);r=s.attributes&&w(s);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||r){var Xa=l,Wb=m.DYNAMIC_DRAW,Lb=void 0,Mb=void 0,Nb=void 0,Xb=
+this.setDepthWrite(d.depthWrite),C(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),t(a.__webglObjects,!1,"",b,k,l,!0,d),s(a.__webglObjectsImmediate,"",b,k,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),t(a.__webglObjects,!0,"opaque",b,k,l,!1,d),s(a.__webglObjectsImmediate,"opaque",b,k,l,!1,d),t(a.__webglObjects,!1,"transparent",b,k,l,!0,d),s(a.__webglObjectsImmediate,"transparent",b,k,l,!0,d));r(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&
+c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(m.bindTexture(m.TEXTURE_CUBE_MAP,c.__webglTexture),m.generateMipmap(m.TEXTURE_CUBE_MAP),m.bindTexture(m.TEXTURE_CUBE_MAP,null)):(m.bindTexture(m.TEXTURE_2D,c.__webglTexture),m.generateMipmap(m.TEXTURE_2D),m.bindTexture(m.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=B(a,b,c,d,e);za=-1;O.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,
+m,Ab):e.render(function(a){O.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)n(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)x(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,g=a.__webglObjects.length;b<g;b++){var h=a.__webglObjects[b].object;void 0===h.__webglInit&&(void 0!==h.__webglActive&&
+x(h,a),n(h,a));var k=h,l=k.geometry,p=void 0,r=void 0,s=void 0;if(l instanceof THREE.BufferGeometry){var t=m.DYNAMIC_DRAW,v=l.attributes,z=void 0,K=void 0;for(z in v)K=v[z],K.needsUpdate&&("index"===z?(m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,K.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,K.array,t)):(m.bindBuffer(m.ARRAY_BUFFER,K.buffer),m.bufferData(m.ARRAY_BUFFER,K.array,t)),K.needsUpdate=!1)}else if(k instanceof THREE.Mesh){for(var B=0,E=l.geometryGroupsList.length;B<E;B++)if(p=l.geometryGroupsList[B],
+s=d(k,p),l.buffersNeedUpdate&&c(p,k),r=s.attributes&&w(s),l.verticesNeedUpdate||l.morphTargetsNeedUpdate||l.elementsNeedUpdate||l.uvsNeedUpdate||l.normalsNeedUpdate||l.colorsNeedUpdate||l.tangentsNeedUpdate||r){var A=p,H=k,C=m.DYNAMIC_DRAW,G=!l.dynamic,O=s;if(A.__inittedArrays){var F=e(O),J=O.vertexColors?O.vertexColors:!1,L=f(O),P=F===THREE.SmoothShading,y=void 0,D=void 0,Q=void 0,M=void 0,R=void 0,fa=void 0,Y=void 0,ga=void 0,S=void 0,V=void 0,W=void 0,$=void 0,aa=void 0,ba=void 0,wa=void 0,X=void 0,
+Z=void 0,da=void 0,Ia=void 0,Ga=void 0,Ea=void 0,ia=void 0,za=void 0,ja=void 0,Ha=void 0,la=void 0,oa=void 0,qa=void 0,ra=void 0,ha=void 0,ya=void 0,Fa=void 0,Ca=void 0,Da=void 0,ma=void 0,Ka=void 0,ua=void 0,va=void 0,Oa=void 0,Ja=void 0,ab=0,bb=0,Ra=0,Sa=0,Pa=0,eb=0,Ta=0,qb=0,Ya=0,ta=0,Aa=0,N=0,Qa=void 0,fb=A.__vertexArray,cb=A.__uvArray,db=A.__uv2Array,tb=A.__normalArray,Ua=A.__tangentArray,gb=A.__colorArray,Va=A.__skinIndexArray,Wa=A.__skinWeightArray,ob=A.__morphTargetsArrays,sb=A.__morphNormalsArrays,
+pb=A.__webglCustomAttributesList,I=void 0,Tb=A.__faceArray,ub=A.__lineArray,La=H.geometry,Ab=La.elementsNeedUpdate,xb=La.uvsNeedUpdate,Db=La.normalsNeedUpdate,Gb=La.tangentsNeedUpdate,Hb=La.colorsNeedUpdate,Jb=La.morphTargetsNeedUpdate,fc=La.vertices,ea=A.faces3,hb=La.faces,Bb=La.faceVertexUvs[0],Cb=La.faceVertexUvs[1],gc=La.skinIndices,Ub=La.skinWeights,Vb=La.morphTargets,Eb=La.morphNormals;if(La.verticesNeedUpdate){y=0;for(D=ea.length;y<D;y++)M=hb[ea[y]],$=fc[M.a],aa=fc[M.b],ba=fc[M.c],fb[bb]=$.x,
+fb[bb+1]=$.y,fb[bb+2]=$.z,fb[bb+3]=aa.x,fb[bb+4]=aa.y,fb[bb+5]=aa.z,fb[bb+6]=ba.x,fb[bb+7]=ba.y,fb[bb+8]=ba.z,bb+=9;m.bindBuffer(m.ARRAY_BUFFER,A.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,fb,C)}if(Jb)for(ma=0,Ka=Vb.length;ma<Ka;ma++){y=Aa=0;for(D=ea.length;y<D;y++)Oa=ea[y],M=hb[Oa],$=Vb[ma].vertices[M.a],aa=Vb[ma].vertices[M.b],ba=Vb[ma].vertices[M.c],ua=ob[ma],ua[Aa]=$.x,ua[Aa+1]=$.y,ua[Aa+2]=$.z,ua[Aa+3]=aa.x,ua[Aa+4]=aa.y,ua[Aa+5]=aa.z,ua[Aa+6]=ba.x,ua[Aa+7]=ba.y,ua[Aa+8]=ba.z,O.morphNormals&&
+(P?(Ja=Eb[ma].vertexNormals[Oa],da=Ja.a,Ia=Ja.b,Ga=Ja.c):Ga=Ia=da=Eb[ma].faceNormals[Oa],va=sb[ma],va[Aa]=da.x,va[Aa+1]=da.y,va[Aa+2]=da.z,va[Aa+3]=Ia.x,va[Aa+4]=Ia.y,va[Aa+5]=Ia.z,va[Aa+6]=Ga.x,va[Aa+7]=Ga.y,va[Aa+8]=Ga.z),Aa+=9;m.bindBuffer(m.ARRAY_BUFFER,A.__webglMorphTargetsBuffers[ma]);m.bufferData(m.ARRAY_BUFFER,ob[ma],C);O.morphNormals&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglMorphNormalsBuffers[ma]),m.bufferData(m.ARRAY_BUFFER,sb[ma],C))}if(Ub.length){y=0;for(D=ea.length;y<D;y++)M=hb[ea[y]],
+ja=Ub[M.a],Ha=Ub[M.b],la=Ub[M.c],Wa[ta]=ja.x,Wa[ta+1]=ja.y,Wa[ta+2]=ja.z,Wa[ta+3]=ja.w,Wa[ta+4]=Ha.x,Wa[ta+5]=Ha.y,Wa[ta+6]=Ha.z,Wa[ta+7]=Ha.w,Wa[ta+8]=la.x,Wa[ta+9]=la.y,Wa[ta+10]=la.z,Wa[ta+11]=la.w,oa=gc[M.a],qa=gc[M.b],ra=gc[M.c],Va[ta]=oa.x,Va[ta+1]=oa.y,Va[ta+2]=oa.z,Va[ta+3]=oa.w,Va[ta+4]=qa.x,Va[ta+5]=qa.y,Va[ta+6]=qa.z,Va[ta+7]=qa.w,Va[ta+8]=ra.x,Va[ta+9]=ra.y,Va[ta+10]=ra.z,Va[ta+11]=ra.w,ta+=12;0<ta&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglSkinIndicesBuffer),m.bufferData(m.ARRAY_BUFFER,Va,
+C),m.bindBuffer(m.ARRAY_BUFFER,A.__webglSkinWeightsBuffer),m.bufferData(m.ARRAY_BUFFER,Wa,C))}if(Hb&&J){y=0;for(D=ea.length;y<D;y++)M=hb[ea[y]],Y=M.vertexColors,ga=M.color,3===Y.length&&J===THREE.VertexColors?(Ea=Y[0],ia=Y[1],za=Y[2]):za=ia=Ea=ga,gb[Ya]=Ea.r,gb[Ya+1]=Ea.g,gb[Ya+2]=Ea.b,gb[Ya+3]=ia.r,gb[Ya+4]=ia.g,gb[Ya+5]=ia.b,gb[Ya+6]=za.r,gb[Ya+7]=za.g,gb[Ya+8]=za.b,Ya+=9;0<Ya&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,gb,C))}if(Gb&&La.hasTangents){y=0;for(D=
+ea.length;y<D;y++)M=hb[ea[y]],S=M.vertexTangents,wa=S[0],X=S[1],Z=S[2],Ua[Ta]=wa.x,Ua[Ta+1]=wa.y,Ua[Ta+2]=wa.z,Ua[Ta+3]=wa.w,Ua[Ta+4]=X.x,Ua[Ta+5]=X.y,Ua[Ta+6]=X.z,Ua[Ta+7]=X.w,Ua[Ta+8]=Z.x,Ua[Ta+9]=Z.y,Ua[Ta+10]=Z.z,Ua[Ta+11]=Z.w,Ta+=12;m.bindBuffer(m.ARRAY_BUFFER,A.__webglTangentBuffer);m.bufferData(m.ARRAY_BUFFER,Ua,C)}if(Db&&F){y=0;for(D=ea.length;y<D;y++)if(M=hb[ea[y]],R=M.vertexNormals,fa=M.normal,3===R.length&&P)for(ha=0;3>ha;ha++)Fa=R[ha],tb[eb]=Fa.x,tb[eb+1]=Fa.y,tb[eb+2]=Fa.z,eb+=3;else for(ha=
+0;3>ha;ha++)tb[eb]=fa.x,tb[eb+1]=fa.y,tb[eb+2]=fa.z,eb+=3;m.bindBuffer(m.ARRAY_BUFFER,A.__webglNormalBuffer);m.bufferData(m.ARRAY_BUFFER,tb,C)}if(xb&&Bb&&L){y=0;for(D=ea.length;y<D;y++)if(Q=ea[y],V=Bb[Q],void 0!==V)for(ha=0;3>ha;ha++)Ca=V[ha],cb[Ra]=Ca.x,cb[Ra+1]=Ca.y,Ra+=2;0<Ra&&(m.bindBuffer(m.ARRAY_BUFFER,A.__webglUVBuffer),m.bufferData(m.ARRAY_BUFFER,cb,C))}if(xb&&Cb&&L){y=0;for(D=ea.length;y<D;y++)if(Q=ea[y],W=Cb[Q],void 0!==W)for(ha=0;3>ha;ha++)Da=W[ha],db[Sa]=Da.x,db[Sa+1]=Da.y,Sa+=2;0<Sa&&
+(m.bindBuffer(m.ARRAY_BUFFER,A.__webglUV2Buffer),m.bufferData(m.ARRAY_BUFFER,db,C))}if(Ab){y=0;for(D=ea.length;y<D;y++)Tb[Pa]=ab,Tb[Pa+1]=ab+1,Tb[Pa+2]=ab+2,Pa+=3,ub[qb]=ab,ub[qb+1]=ab+1,ub[qb+2]=ab,ub[qb+3]=ab+2,ub[qb+4]=ab+1,ub[qb+5]=ab+2,qb+=6,ab+=3;m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,A.__webglFaceBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,Tb,C);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,A.__webglLineBuffer);m.bufferData(m.ELEMENT_ARRAY_BUFFER,ub,C)}if(pb)for(ha=0,ya=pb.length;ha<ya;ha++)if(I=pb[ha],
+I.__original.needsUpdate){N=0;if(1===I.size)if(void 0===I.boundTo||"vertices"===I.boundTo)for(y=0,D=ea.length;y<D;y++)M=hb[ea[y]],I.array[N]=I.value[M.a],I.array[N+1]=I.value[M.b],I.array[N+2]=I.value[M.c],N+=3;else{if("faces"===I.boundTo)for(y=0,D=ea.length;y<D;y++)Qa=I.value[ea[y]],I.array[N]=Qa,I.array[N+1]=Qa,I.array[N+2]=Qa,N+=3}else if(2===I.size)if(void 0===I.boundTo||"vertices"===I.boundTo)for(y=0,D=ea.length;y<D;y++)M=hb[ea[y]],$=I.value[M.a],aa=I.value[M.b],ba=I.value[M.c],I.array[N]=$.x,
+I.array[N+1]=$.y,I.array[N+2]=aa.x,I.array[N+3]=aa.y,I.array[N+4]=ba.x,I.array[N+5]=ba.y,N+=6;else{if("faces"===I.boundTo)for(y=0,D=ea.length;y<D;y++)ba=aa=$=Qa=I.value[ea[y]],I.array[N]=$.x,I.array[N+1]=$.y,I.array[N+2]=aa.x,I.array[N+3]=aa.y,I.array[N+4]=ba.x,I.array[N+5]=ba.y,N+=6}else if(3===I.size){var sa;sa="c"===I.type?["r","g","b"]:["x","y","z"];if(void 0===I.boundTo||"vertices"===I.boundTo)for(y=0,D=ea.length;y<D;y++)M=hb[ea[y]],$=I.value[M.a],aa=I.value[M.b],ba=I.value[M.c],I.array[N]=$[sa[0]],
+I.array[N+1]=$[sa[1]],I.array[N+2]=$[sa[2]],I.array[N+3]=aa[sa[0]],I.array[N+4]=aa[sa[1]],I.array[N+5]=aa[sa[2]],I.array[N+6]=ba[sa[0]],I.array[N+7]=ba[sa[1]],I.array[N+8]=ba[sa[2]],N+=9;else if("faces"===I.boundTo)for(y=0,D=ea.length;y<D;y++)ba=aa=$=Qa=I.value[ea[y]],I.array[N]=$[sa[0]],I.array[N+1]=$[sa[1]],I.array[N+2]=$[sa[2]],I.array[N+3]=aa[sa[0]],I.array[N+4]=aa[sa[1]],I.array[N+5]=aa[sa[2]],I.array[N+6]=ba[sa[0]],I.array[N+7]=ba[sa[1]],I.array[N+8]=ba[sa[2]],N+=9;else if("faceVertices"===
+I.boundTo)for(y=0,D=ea.length;y<D;y++)Qa=I.value[ea[y]],$=Qa[0],aa=Qa[1],ba=Qa[2],I.array[N]=$[sa[0]],I.array[N+1]=$[sa[1]],I.array[N+2]=$[sa[2]],I.array[N+3]=aa[sa[0]],I.array[N+4]=aa[sa[1]],I.array[N+5]=aa[sa[2]],I.array[N+6]=ba[sa[0]],I.array[N+7]=ba[sa[1]],I.array[N+8]=ba[sa[2]],N+=9}else if(4===I.size)if(void 0===I.boundTo||"vertices"===I.boundTo)for(y=0,D=ea.length;y<D;y++)M=hb[ea[y]],$=I.value[M.a],aa=I.value[M.b],ba=I.value[M.c],I.array[N]=$.x,I.array[N+1]=$.y,I.array[N+2]=$.z,I.array[N+3]=
+$.w,I.array[N+4]=aa.x,I.array[N+5]=aa.y,I.array[N+6]=aa.z,I.array[N+7]=aa.w,I.array[N+8]=ba.x,I.array[N+9]=ba.y,I.array[N+10]=ba.z,I.array[N+11]=ba.w,N+=12;else if("faces"===I.boundTo)for(y=0,D=ea.length;y<D;y++)ba=aa=$=Qa=I.value[ea[y]],I.array[N]=$.x,I.array[N+1]=$.y,I.array[N+2]=$.z,I.array[N+3]=$.w,I.array[N+4]=aa.x,I.array[N+5]=aa.y,I.array[N+6]=aa.z,I.array[N+7]=aa.w,I.array[N+8]=ba.x,I.array[N+9]=ba.y,I.array[N+10]=ba.z,I.array[N+11]=ba.w,N+=12;else if("faceVertices"===I.boundTo)for(y=0,D=
+ea.length;y<D;y++)Qa=I.value[ea[y]],$=Qa[0],aa=Qa[1],ba=Qa[2],I.array[N]=$.x,I.array[N+1]=$.y,I.array[N+2]=$.z,I.array[N+3]=$.w,I.array[N+4]=aa.x,I.array[N+5]=aa.y,I.array[N+6]=aa.z,I.array[N+7]=aa.w,I.array[N+8]=ba.x,I.array[N+9]=ba.y,I.array[N+10]=ba.z,I.array[N+11]=ba.w,N+=12;m.bindBuffer(m.ARRAY_BUFFER,I.buffer);m.bufferData(m.ARRAY_BUFFER,I.array,C)}G&&(delete A.__inittedArrays,delete A.__colorArray,delete A.__normalArray,delete A.__tangentArray,delete A.__uvArray,delete A.__uv2Array,delete A.__faceArray,
+delete A.__vertexArray,delete A.__lineArray,delete A.__skinIndexArray,delete A.__skinWeightArray)}}l.verticesNeedUpdate=!1;l.morphTargetsNeedUpdate=!1;l.elementsNeedUpdate=!1;l.uvsNeedUpdate=!1;l.normalsNeedUpdate=!1;l.colorsNeedUpdate=!1;l.tangentsNeedUpdate=!1;l.buffersNeedUpdate=!1;s.attributes&&u(s)}else if(k instanceof THREE.Line){s=d(k,l);r=s.attributes&&w(s);if(l.verticesNeedUpdate||l.colorsNeedUpdate||l.lineDistancesNeedUpdate||r){var Xa=l,Wb=m.DYNAMIC_DRAW,Lb=void 0,Mb=void 0,Nb=void 0,Xb=
 void 0,pa=void 0,Yb=void 0,Fb=Xa.vertices,Ib=Xa.colors,Kb=Xa.lineDistances,Qb=Fb.length,Rb=Ib.length,Sb=Kb.length,Zb=Xa.__vertexArray,$b=Xa.__colorArray,lc=Xa.__lineDistanceArray,dc=Xa.colorsNeedUpdate,ec=Xa.lineDistancesNeedUpdate,hc=Xa.__webglCustomAttributesList,ac=void 0,mc=void 0,Ba=void 0,yb=void 0,Ma=void 0,na=void 0;if(Xa.verticesNeedUpdate){for(Lb=0;Lb<Qb;Lb++)Xb=Fb[Lb],pa=3*Lb,Zb[pa]=Xb.x,Zb[pa+1]=Xb.y,Zb[pa+2]=Xb.z;m.bindBuffer(m.ARRAY_BUFFER,Xa.__webglVertexBuffer);m.bufferData(m.ARRAY_BUFFER,
 Zb,Wb)}if(dc){for(Mb=0;Mb<Rb;Mb++)Yb=Ib[Mb],pa=3*Mb,$b[pa]=Yb.r,$b[pa+1]=Yb.g,$b[pa+2]=Yb.b;m.bindBuffer(m.ARRAY_BUFFER,Xa.__webglColorBuffer);m.bufferData(m.ARRAY_BUFFER,$b,Wb)}if(ec){for(Nb=0;Nb<Sb;Nb++)lc[Nb]=Kb[Nb];m.bindBuffer(m.ARRAY_BUFFER,Xa.__webglLineDistanceBuffer);m.bufferData(m.ARRAY_BUFFER,lc,Wb)}if(hc)for(ac=0,mc=hc.length;ac<mc;ac++)if(na=hc[ac],na.needsUpdate&&(void 0===na.boundTo||"vertices"===na.boundTo)){pa=0;yb=na.value.length;if(1===na.size)for(Ba=0;Ba<yb;Ba++)na.array[Ba]=na.value[Ba];
 else if(2===na.size)for(Ba=0;Ba<yb;Ba++)Ma=na.value[Ba],na.array[pa]=Ma.x,na.array[pa+1]=Ma.y,pa+=2;else if(3===na.size)if("c"===na.type)for(Ba=0;Ba<yb;Ba++)Ma=na.value[Ba],na.array[pa]=Ma.r,na.array[pa+1]=Ma.g,na.array[pa+2]=Ma.b,pa+=3;else for(Ba=0;Ba<yb;Ba++)Ma=na.value[Ba],na.array[pa]=Ma.x,na.array[pa+1]=Ma.y,na.array[pa+2]=Ma.z,pa+=3;else if(4===na.size)for(Ba=0;Ba<yb;Ba++)Ma=na.value[Ba],na.array[pa]=Ma.x,na.array[pa+1]=Ma.y,na.array[pa+2]=Ma.z,na.array[pa+3]=Ma.w,pa+=4;m.bindBuffer(m.ARRAY_BUFFER,
-na.buffer);m.bufferData(m.ARRAY_BUFFER,na.array,Wb)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;s.attributes&&u(s)}else if(k instanceof THREE.PointCloud){s=d(k,l);r=s.attributes&&w(s);if(l.verticesNeedUpdate||l.colorsNeedUpdate||k.sortParticles||r){var ib=l,ic=m.DYNAMIC_DRAW,Ob=k,Na=void 0,jb=void 0,kb=void 0,T=void 0,lb=void 0,rb=void 0,bc=ib.vertices,jc=bc.length,kc=ib.colors,nc=kc.length,vb=ib.__vertexArray,wb=ib.__colorArray,mb=ib.__sortArray,oc=ib.verticesNeedUpdate,
-pc=ib.colorsNeedUpdate,nb=ib.__webglCustomAttributesList,Za=void 0,zb=void 0,ca=void 0,$a=void 0,ka=void 0,S=void 0;if(Ob.sortParticles){cc.copy(Pb);cc.multiply(Ob.matrixWorld);for(Na=0;Na<jc;Na++)kb=bc[Na],xa.copy(kb),xa.applyProjection(cc),mb[Na]=[xa.z,Na];mb.sort(q);for(Na=0;Na<jc;Na++)kb=bc[mb[Na][1]],T=3*Na,vb[T]=kb.x,vb[T+1]=kb.y,vb[T+2]=kb.z;for(jb=0;jb<nc;jb++)T=3*jb,rb=kc[mb[jb][1]],wb[T]=rb.r,wb[T+1]=rb.g,wb[T+2]=rb.b;if(nb)for(Za=0,zb=nb.length;Za<zb;Za++)if(S=nb[Za],void 0===S.boundTo||
-"vertices"===S.boundTo)if(T=0,$a=S.value.length,1===S.size)for(ca=0;ca<$a;ca++)lb=mb[ca][1],S.array[ca]=S.value[lb];else if(2===S.size)for(ca=0;ca<$a;ca++)lb=mb[ca][1],ka=S.value[lb],S.array[T]=ka.x,S.array[T+1]=ka.y,T+=2;else if(3===S.size)if("c"===S.type)for(ca=0;ca<$a;ca++)lb=mb[ca][1],ka=S.value[lb],S.array[T]=ka.r,S.array[T+1]=ka.g,S.array[T+2]=ka.b,T+=3;else for(ca=0;ca<$a;ca++)lb=mb[ca][1],ka=S.value[lb],S.array[T]=ka.x,S.array[T+1]=ka.y,S.array[T+2]=ka.z,T+=3;else if(4===S.size)for(ca=0;ca<
-$a;ca++)lb=mb[ca][1],ka=S.value[lb],S.array[T]=ka.x,S.array[T+1]=ka.y,S.array[T+2]=ka.z,S.array[T+3]=ka.w,T+=4}else{if(oc)for(Na=0;Na<jc;Na++)kb=bc[Na],T=3*Na,vb[T]=kb.x,vb[T+1]=kb.y,vb[T+2]=kb.z;if(pc)for(jb=0;jb<nc;jb++)rb=kc[jb],T=3*jb,wb[T]=rb.r,wb[T+1]=rb.g,wb[T+2]=rb.b;if(nb)for(Za=0,zb=nb.length;Za<zb;Za++)if(S=nb[Za],S.needsUpdate&&(void 0===S.boundTo||"vertices"===S.boundTo))if($a=S.value.length,T=0,1===S.size)for(ca=0;ca<$a;ca++)S.array[ca]=S.value[ca];else if(2===S.size)for(ca=0;ca<$a;ca++)ka=
-S.value[ca],S.array[T]=ka.x,S.array[T+1]=ka.y,T+=2;else if(3===S.size)if("c"===S.type)for(ca=0;ca<$a;ca++)ka=S.value[ca],S.array[T]=ka.r,S.array[T+1]=ka.g,S.array[T+2]=ka.b,T+=3;else for(ca=0;ca<$a;ca++)ka=S.value[ca],S.array[T]=ka.x,S.array[T+1]=ka.y,S.array[T+2]=ka.z,T+=3;else if(4===S.size)for(ca=0;ca<$a;ca++)ka=S.value[ca],S.array[T]=ka.x,S.array[T+1]=ka.y,S.array[T+2]=ka.z,S.array[T+3]=ka.w,T+=4}if(oc||Ob.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,ib.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,
-vb,ic);if(pc||Ob.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,ib.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,wb,ic);if(nb)for(Za=0,zb=nb.length;Za<zb;Za++)if(S=nb[Za],S.needsUpdate||Ob.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,S.buffer),m.bufferData(m.ARRAY_BUFFER,S.array,ic)}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;s.attributes&&u(s)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Sb);var k,l,n,p;a instanceof THREE.MeshDepthMaterial?p="depth":a instanceof THREE.MeshNormalMaterial?
+na.buffer);m.bufferData(m.ARRAY_BUFFER,na.array,Wb)}}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;l.lineDistancesNeedUpdate=!1;s.attributes&&u(s)}else if(k instanceof THREE.PointCloud){s=d(k,l);r=s.attributes&&w(s);if(l.verticesNeedUpdate||l.colorsNeedUpdate||k.sortParticles||r){var ib=l,ic=m.DYNAMIC_DRAW,Ob=k,Na=void 0,jb=void 0,kb=void 0,U=void 0,lb=void 0,rb=void 0,bc=ib.vertices,jc=bc.length,kc=ib.colors,nc=kc.length,vb=ib.__vertexArray,wb=ib.__colorArray,mb=ib.__sortArray,oc=ib.verticesNeedUpdate,
+pc=ib.colorsNeedUpdate,nb=ib.__webglCustomAttributesList,Za=void 0,zb=void 0,ca=void 0,$a=void 0,ka=void 0,T=void 0;if(Ob.sortParticles){cc.copy(Pb);cc.multiply(Ob.matrixWorld);for(Na=0;Na<jc;Na++)kb=bc[Na],xa.copy(kb),xa.applyProjection(cc),mb[Na]=[xa.z,Na];mb.sort(q);for(Na=0;Na<jc;Na++)kb=bc[mb[Na][1]],U=3*Na,vb[U]=kb.x,vb[U+1]=kb.y,vb[U+2]=kb.z;for(jb=0;jb<nc;jb++)U=3*jb,rb=kc[mb[jb][1]],wb[U]=rb.r,wb[U+1]=rb.g,wb[U+2]=rb.b;if(nb)for(Za=0,zb=nb.length;Za<zb;Za++)if(T=nb[Za],void 0===T.boundTo||
+"vertices"===T.boundTo)if(U=0,$a=T.value.length,1===T.size)for(ca=0;ca<$a;ca++)lb=mb[ca][1],T.array[ca]=T.value[lb];else if(2===T.size)for(ca=0;ca<$a;ca++)lb=mb[ca][1],ka=T.value[lb],T.array[U]=ka.x,T.array[U+1]=ka.y,U+=2;else if(3===T.size)if("c"===T.type)for(ca=0;ca<$a;ca++)lb=mb[ca][1],ka=T.value[lb],T.array[U]=ka.r,T.array[U+1]=ka.g,T.array[U+2]=ka.b,U+=3;else for(ca=0;ca<$a;ca++)lb=mb[ca][1],ka=T.value[lb],T.array[U]=ka.x,T.array[U+1]=ka.y,T.array[U+2]=ka.z,U+=3;else if(4===T.size)for(ca=0;ca<
+$a;ca++)lb=mb[ca][1],ka=T.value[lb],T.array[U]=ka.x,T.array[U+1]=ka.y,T.array[U+2]=ka.z,T.array[U+3]=ka.w,U+=4}else{if(oc)for(Na=0;Na<jc;Na++)kb=bc[Na],U=3*Na,vb[U]=kb.x,vb[U+1]=kb.y,vb[U+2]=kb.z;if(pc)for(jb=0;jb<nc;jb++)rb=kc[jb],U=3*jb,wb[U]=rb.r,wb[U+1]=rb.g,wb[U+2]=rb.b;if(nb)for(Za=0,zb=nb.length;Za<zb;Za++)if(T=nb[Za],T.needsUpdate&&(void 0===T.boundTo||"vertices"===T.boundTo))if($a=T.value.length,U=0,1===T.size)for(ca=0;ca<$a;ca++)T.array[ca]=T.value[ca];else if(2===T.size)for(ca=0;ca<$a;ca++)ka=
+T.value[ca],T.array[U]=ka.x,T.array[U+1]=ka.y,U+=2;else if(3===T.size)if("c"===T.type)for(ca=0;ca<$a;ca++)ka=T.value[ca],T.array[U]=ka.r,T.array[U+1]=ka.g,T.array[U+2]=ka.b,U+=3;else for(ca=0;ca<$a;ca++)ka=T.value[ca],T.array[U]=ka.x,T.array[U+1]=ka.y,T.array[U+2]=ka.z,U+=3;else if(4===T.size)for(ca=0;ca<$a;ca++)ka=T.value[ca],T.array[U]=ka.x,T.array[U+1]=ka.y,T.array[U+2]=ka.z,T.array[U+3]=ka.w,U+=4}if(oc||Ob.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,ib.__webglVertexBuffer),m.bufferData(m.ARRAY_BUFFER,
+vb,ic);if(pc||Ob.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,ib.__webglColorBuffer),m.bufferData(m.ARRAY_BUFFER,wb,ic);if(nb)for(Za=0,zb=nb.length;Za<zb;Za++)if(T=nb[Za],T.needsUpdate||Ob.sortParticles)m.bindBuffer(m.ARRAY_BUFFER,T.buffer),m.bufferData(m.ARRAY_BUFFER,T.array,ic)}l.verticesNeedUpdate=!1;l.colorsNeedUpdate=!1;s.attributes&&u(s)}}};this.initMaterial=function(a,b,c,d){var e,f,g,h;a.addEventListener("dispose",Sb);var k,l,n,p;a instanceof THREE.MeshDepthMaterial?p="depth":a instanceof THREE.MeshNormalMaterial?
 p="normal":a instanceof THREE.MeshBasicMaterial?p="basic":a instanceof THREE.MeshLambertMaterial?p="lambert":a instanceof THREE.MeshPhongMaterial?p="phong":a instanceof THREE.LineBasicMaterial?p="basic":a instanceof THREE.LineDashedMaterial?p="dashed":a instanceof THREE.PointCloudMaterial&&(p="particle_basic");p&&(e=THREE.ShaderLib[p],a.uniforms=THREE.UniformsUtils.clone(e.uniforms),a.vertexShader=e.vertexShader,a.fragmentShader=e.fragmentShader);n=h=g=f=e=0;for(var r=b.length;n<r;n++){var q=b[n];
 q.onlyShadow||!1===q.visible||(q instanceof THREE.DirectionalLight&&e++,q instanceof THREE.PointLight&&f++,q instanceof THREE.SpotLight&&g++,q instanceof THREE.HemisphereLight&&h++)}r=n=0;for(q=b.length;r<q;r++){var s=b[r];s.castShadow&&(s instanceof THREE.SpotLight&&n++,s instanceof THREE.DirectionalLight&&!s.shadowCascade&&n++)}b=n;Gb&&d&&d.skeleton&&d.skeleton.useVertexTexture?n=1024:(n=m.getParameter(m.MAX_VERTEX_UNIFORM_VECTORS),n=Math.floor((n-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&
-(n=Math.min(d.skeleton.bones.length,n),n<d.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.skeleton.bones.length+", this GPU supports just "+n+" (try OpenGL instead of ANGLE)")));c={precision:Q,supportsVertexTextures:Jb,map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,logarithmicDepthBuffer:da,
+(n=Math.min(d.skeleton.bones.length,n),n<d.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.skeleton.bones.length+", this GPU supports just "+n+" (try OpenGL instead of ANGLE)")));c={precision:P,supportsVertexTextures:Jb,map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,logarithmicDepthBuffer:da,
 skinning:a.skinning,maxBones:n,useVertexTexture:Gb&&d&&d.skeleton&&d.skeleton.useVertexTexture,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:g,maxHemiLights:h,maxShadows:b,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow&&0<b,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,metal:a.metal,
-wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide};d=[];p?d.push(p):(d.push(a.fragmentShader),d.push(a.vertexShader));for(var u in a.defines)d.push(u),d.push(a.defines[u]);for(l in c)d.push(l),d.push(c[l]);p=d.join();var t;l=0;for(u=ga.length;l<u;l++)if(d=ga[l],d.code===p){t=d;t.usedTimes++;break}void 0===t&&(t=new THREE.WebGLProgram(this,p,a,c),ga.push(t),P.info.memory.programs=ga.length);a.program=t;t=a.program.attributes;if(a.morphTargets)for(a.numSupportedMorphTargets=
-0,u="morphTarget",l=0;l<this.maxMorphTargets;l++)p=u+l,0<=t[p]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=0,u="morphNormal",l=0;l<this.maxMorphNormals;l++)p=u+l,0<=t[p]&&a.numSupportedMorphNormals++;a.uniformsList=[];for(k in a.uniforms)a.uniformsList.push([a.uniforms[k],k])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):
+wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide};d=[];p?d.push(p):(d.push(a.fragmentShader),d.push(a.vertexShader));for(var t in a.defines)d.push(t),d.push(a.defines[t]);for(l in c)d.push(l),d.push(c[l]);p=d.join();var u;l=0;for(t=ga.length;l<t;l++)if(d=ga[l],d.code===p){u=d;u.usedTimes++;break}void 0===u&&(u=new THREE.WebGLProgram(this,p,a,c),ga.push(u),O.info.memory.programs=ga.length);a.program=u;u=a.program.attributes;if(a.morphTargets)for(a.numSupportedMorphTargets=
+0,t="morphTarget",l=0;l<this.maxMorphTargets;l++)p=t+l,0<=u[p]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(a.numSupportedMorphNormals=0,t="morphNormal",l=0;l<this.maxMorphNormals;l++)p=t+l,0<=u[p]&&a.numSupportedMorphNormals++;a.uniformsList=[];for(k in a.uniforms)a.uniformsList.push([a.uniforms[k],k])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?m.disable(m.CULL_FACE):(b===THREE.FrontFaceDirectionCW?m.frontFace(m.CW):m.frontFace(m.CCW),a===THREE.CullFaceBack?m.cullFace(m.BACK):
 a===THREE.CullFaceFront?m.cullFace(m.FRONT):m.cullFace(m.FRONT_AND_BACK),m.enable(m.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;Ga!==b&&(b?m.disable(m.CULL_FACE):m.enable(m.CULL_FACE),Ga=b);ha!==a&&(a?m.frontFace(m.CW):m.frontFace(m.CCW),ha=a)};this.setDepthTest=function(a){ia!==a&&(a?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST),ia=a)};this.setDepthWrite=function(a){ma!==a&&(m.depthMask(a),ma=a)};this.setBlending=function(a,b,c,d){a!==
 Oa&&(a===THREE.NoBlending?m.disable(m.BLEND):a===THREE.AdditiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.SRC_ALPHA,m.ONE)):a===THREE.SubtractiveBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(m.enable(m.BLEND),m.blendEquation(m.FUNC_ADD),m.blendFunc(m.ZERO,m.SRC_COLOR)):a===THREE.CustomBlending?m.enable(m.BLEND):(m.enable(m.BLEND),m.blendEquationSeparate(m.FUNC_ADD,m.FUNC_ADD),m.blendFuncSeparate(m.SRC_ALPHA,
-m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Oa=a);if(a===THREE.CustomBlending){if(b!==Ra&&(m.blendEquation(z(b)),Ra=b),c!==Sa||d!==Fa)m.blendFunc(z(c),z(d)),Sa=c,Fa=d}else Fa=Sa=Ra=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Hb),a.__webglTexture=m.createTexture(),P.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
-a.premultiplyAlpha);m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=z(a.format),f=z(a.type);M(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=
+m.ONE_MINUS_SRC_ALPHA,m.ONE,m.ONE_MINUS_SRC_ALPHA)),Oa=a);if(a===THREE.CustomBlending){if(b!==Ra&&(m.blendEquation(L(b)),Ra=b),c!==Sa||d!==Fa)m.blendFunc(L(c),L(d)),Sa=c,Fa=d}else Fa=Sa=Ra=null};this.setTexture=function(a,b){if(a.needsUpdate){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",Hb),a.__webglTexture=m.createTexture(),O.info.memory.textures++);m.activeTexture(m.TEXTURE0+b);m.bindTexture(m.TEXTURE_2D,a.__webglTexture);m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,a.flipY);m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
+a.premultiplyAlpha);m.pixelStorei(m.UNPACK_ALIGNMENT,a.unpackAlignment);var c=a.image,d=THREE.Math.isPowerOfTwo(c.width)&&THREE.Math.isPowerOfTwo(c.height),e=L(a.format),f=L(a.type);Q(m.TEXTURE_2D,a,d);var g=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<g.length&&d){for(var h=0,k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data);else if(a instanceof THREE.CompressedTexture)for(h=
 0,k=g.length;h<k;h++)c=g[h],a.format!==THREE.RGBAFormat?m.compressedTexImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,c.data):m.texImage2D(m.TEXTURE_2D,h,e,c.width,c.height,0,e,f,c.data);else if(0<g.length&&d){h=0;for(k=g.length;h<k;h++)c=g[h],m.texImage2D(m.TEXTURE_2D,h,e,e,f,c);a.generateMipmaps=!1}else m.texImage2D(m.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&m.generateMipmap(m.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()}else m.activeTexture(m.TEXTURE0+b),m.bindTexture(m.TEXTURE_2D,
-a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Rb);a.__webglTexture=m.createTexture();P.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=z(a.format),e=z(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);
-M(m.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);N(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),
-a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),M(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):
-a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):N(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Da,a=Ja,d=Ca,e=va);b!==Ha&&(m.bindFramebuffer(m.FRAMEBUFFER,
+a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Rb);a.__webglTexture=m.createTexture();O.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=L(a.format),e=L(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];m.bindTexture(m.TEXTURE_CUBE_MAP,a.__webglTexture);
+Q(m.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=m.createFramebuffer();a.__webglRenderbuffer[f]=m.createRenderbuffer();m.texImage2D(m.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=m.TEXTURE_CUBE_MAP_POSITIVE_X+f;m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer[f]);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,h,g.__webglTexture,0);D(a.__webglRenderbuffer[f],a)}c&&m.generateMipmap(m.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=m.createFramebuffer(),
+a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:m.createRenderbuffer(),m.bindTexture(m.TEXTURE_2D,a.__webglTexture),Q(m.TEXTURE_2D,a,c),m.texImage2D(m.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=m.TEXTURE_2D,m.bindFramebuffer(m.FRAMEBUFFER,a.__webglFramebuffer),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):
+a.depthBuffer&&a.stencilBuffer&&m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_STENCIL_ATTACHMENT,m.RENDERBUFFER,a.__webglRenderbuffer):D(a.__webglRenderbuffer,a),c&&m.generateMipmap(m.TEXTURE_2D);b?m.bindTexture(m.TEXTURE_CUBE_MAP,null):m.bindTexture(m.TEXTURE_2D,null);m.bindRenderbuffer(m.RENDERBUFFER,null);m.bindFramebuffer(m.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Da,a=Ja,d=Ca,e=va);b!==Ha&&(m.bindFramebuffer(m.FRAMEBUFFER,
 b),m.viewport(d,e,c,a),Ha=b);ja=c;ra=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
 THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};
 THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;
@@ -534,8 +537,8 @@ h]=f,e[3*h+1]=g,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.need
 String(a).split(""),f=e.length,g=[];for(a=0;a<f;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f=[],g,h,k,l,p,q,r,t,s,n,v,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),l=b.length,a=0;a<l;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;p=b[a++]*c;e.moveTo(k,p);break;case "l":k=b[a++]*c+d;p=b[a++]*c;e.lineTo(k,p);break;case "q":k=b[a++]*
 c+d;p=b[a++]*c;t=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(t,s,k,p);if(g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++){var u=g/h;THREE.Shape.Utils.b2(u,q,t,k);THREE.Shape.Utils.b2(u,r,s,p)}break;case "b":if(k=b[a++]*c+d,p=b[a++]*c,t=b[a++]*c+d,s=b[a++]*-c,n=b[a++]*c+d,v=b[a++]*-c,e.bezierCurveTo(k,p,t,s,n,v),g=f[f.length-1])for(q=g.x,r=g.y,g=1,h=this.divisions;g<=h;g++)u=g/h,THREE.Shape.Utils.b3(u,q,t,n,k),THREE.Shape.Utils.b3(u,r,s,v,p)}return{offset:w.ha*c,path:e}}}};
 THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=f;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(f=c.length;e<f;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
-(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,p;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var q=2*e;for(l=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);p=l+1;e<=p&&(p=0);var r;a:{var t=r=void 0,s=void 0,n=void 0,v=void 0,w=void 0,u=void 0,y=void 0,L=
-void 0,t=a[g[k]].x,s=a[g[k]].y,n=a[g[l]].x,v=a[g[l]].y,w=a[g[p]].x,u=a[g[p]].y;if(1E-10>(n-t)*(u-s)-(v-s)*(w-t))r=!1;else{var A=void 0,K=void 0,B=void 0,E=void 0,G=void 0,C=void 0,D=void 0,M=void 0,N=void 0,I=void 0,N=M=D=L=y=void 0,A=w-n,K=u-v,B=t-w,E=s-u,G=n-t,C=v-s;for(r=0;r<e;r++)if(y=a[g[r]].x,L=a[g[r]].y,!(y===t&&L===s||y===n&&L===v||y===w&&L===u)&&(D=y-t,M=L-s,N=y-n,I=L-v,y-=w,L-=u,N=A*I-K*N,D=G*M-C*D,M=B*L-E*y,-1E-10<=N&&-1E-10<=M&&-1E-10<=D)){r=!1;break a}r=!0}}if(r){f.push([a[g[k]],a[g[l]],
+(function(a){var b=function(a){for(var b=a.length,e=0,f=b-1,g=0;g<b;f=g++)e+=a[f].x*a[g].y-a[g].x*a[f].y;return 0.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var f=[],g=[],h=[],k,l,p;if(0<b(a))for(l=0;l<e;l++)g[l]=l;else for(l=0;l<e;l++)g[l]=e-1-l;var q=2*e;for(l=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);p=l+1;e<=p&&(p=0);var r;a:{var t=r=void 0,s=void 0,n=void 0,v=void 0,w=void 0,u=void 0,x=void 0,K=
+void 0,t=a[g[k]].x,s=a[g[k]].y,n=a[g[l]].x,v=a[g[l]].y,w=a[g[p]].x,u=a[g[p]].y;if(1E-10>(n-t)*(u-s)-(v-s)*(w-t))r=!1;else{var z=void 0,B=void 0,A=void 0,E=void 0,F=void 0,H=void 0,C=void 0,Q=void 0,D=void 0,R=void 0,D=Q=C=K=x=void 0,z=w-n,B=u-v,A=t-w,E=s-u,F=n-t,H=v-s;for(r=0;r<e;r++)if(x=a[g[r]].x,K=a[g[r]].y,!(x===t&&K===s||x===n&&K===v||x===w&&K===u)&&(C=x-t,Q=K-s,D=x-n,R=K-v,x-=w,K-=u,D=z*R-B*D,C=F*Q-H*C,Q=A*K-E*x,-1E-10<=D&&-1E-10<=Q&&-1E-10<=C)){r=!1;break a}r=!0}}if(r){f.push([a[g[k]],a[g[l]],
 a[g[p]]]);h.push([g[k],g[l],g[p]]);k=l;for(p=l+1;p<e;k++,p++)g[k]=g[p];e--;q=2*e}}return d?h:f};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(a){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){a=this.getUtoTmapping(a);return this.getPoint(a)};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c};
 THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++)c=this.getPoint(e/a),f+=c.distanceTo(d),b.push(f),d=c;return this.cacheArcLengths=b};
 THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0;this.getLengths()};THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var g=0,h=e-1,k;g<=h;)if(d=Math.floor(g+(h-g)/2),k=c[d]-f,0>k)g=d+1;else if(0<k)h=d-1;else{h=d;break}d=h;if(c[d]==f)return d/(e-1);g=c[d];return c=(d+(f-g)/(c[d+1]-g))/(e-1)};THREE.Curve.prototype.getTangent=function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()};
@@ -566,11 +569,11 @@ h=[];var p=[],q=[],r=0,t;p[r]=void 0;q[r]=[];var s,n;s=0;for(n=e.length;s<n;s++)
 hole:l}),t?(t=!1,h[v].push(r)):s=!0);t&&h[g].push(r)}0<n.length&&(s||(q=h))}s=0;for(n=p.length;s<n;s++)for(h=p[s].s,k.push(h),g=q[s],e=0,f=g.length;e<f;e++)h.holes.push(g[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};
 THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};
 THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,p=a.x-d.x,q=a.y-d.y,B=h*k-g*l,E=h*p-g*q;if(1E-10<Math.abs(B)){if(0<B){if(0>E||E>B)return[];k=l*p-k*q;if(0>k||k>B)return[]}else{if(0<E||E<B)return[];k=l*p-k*q;if(0<k||k<B)return[]}if(0==k)return!f||0!=E&&E!=B?[a]:[];if(k==B)return!f||0!=E&&E!=B?[b]:[];if(0==E)return[d];
-if(E==B)return[e];f=k/B;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=E||l*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,B=d.x,l=e,d=e.x):(b=e,B=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,B=d.y,l=e,d=e.y):(b=e,B=e.y,l=d,d=d.y));return k<=B?a<B?[]:a==B?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,p=a.x-d.x,q=a.y-d.y,A=h*k-g*l,E=h*p-g*q;if(1E-10<Math.abs(A)){if(0<A){if(0>E||E>A)return[];k=l*p-k*q;if(0>k||k>A)return[]}else{if(0<E||E<A)return[];k=l*p-k*q;if(0<k||k<A)return[]}if(0==k)return!f||0!=E&&E!=A?[a]:[];if(k==A)return!f||0!=E&&E!=A?[b]:[];if(0==E)return[d];
+if(E==A)return[e];f=k/A;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=E||l*p!=k*q)return[];h=0==g&&0==h;k=0==k&&0==l;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,A=d.x,l=e,d=e.x):(b=e,A=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,A=d.y,l=e,d=e.y):(b=e,A=e.y,l=d,d=d.y));return k<=A?a<A?[]:a==A?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
 [g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var f,g,h,k,l,p={};h=a.concat();f=0;for(g=b.length;f<g;f++)Array.prototype.push.apply(h,b[f]);f=0;for(g=h.length;f<g;f++)l=h[f].x+":"+h[f].y,void 0!==p[l]&&console.log("Duplicate point",l),p[l]=f;f=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;
-d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],p,q,K,B,E,G=[],C,D,M,N=0;for(p=b.length;N<p;N++)l.push(N);C=0;for(var I=2*l.length;0<l.length;){I--;if(0>I){console.log("Infinite Loop! Holes left:"+
-l.length+", Probably Hole outside Shape!");break}for(q=C;q<h.length;q++){K=h[q];p=-1;for(N=0;N<l.length;N++)if(B=l[N],E=K.x+":"+K.y+":"+B,void 0===G[E]){k=b[B];for(D=0;D<k.length;D++)if(B=k[D],c(q,D)&&!f(K,B)&&!g(K,B)){p=D;l.splice(N,1);C=h.slice(0,q+1);B=h.slice(q);D=k.slice(p);M=k.slice(0,p+1);h=C.concat(D).concat(M).concat(B);C=q;break}if(0<=p)break;G[E]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,
+d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],p,q,B,A,E,F=[],H,C,Q,D=0;for(p=b.length;D<p;D++)l.push(D);H=0;for(var R=2*l.length;0<l.length;){R--;if(0>R){console.log("Infinite Loop! Holes left:"+
+l.length+", Probably Hole outside Shape!");break}for(q=H;q<h.length;q++){B=h[q];p=-1;for(D=0;D<l.length;D++)if(A=l[D],E=B.x+":"+B.y+":"+A,void 0===F[E]){k=b[A];for(C=0;C<k.length;C++)if(A=k[C],c(q,C)&&!f(B,A)&&!g(B,A)){p=C;l.splice(D,1);H=h.slice(0,q+1);A=h.slice(q);C=k.slice(p);Q=k.slice(0,p+1);h=H.concat(C).concat(Q).concat(A);H=q;break}if(0<=p)break;F[E]=!0}if(0<=p)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(f,!1);f=0;for(g=q.length;f<g;f++)for(k=q[f],h=0;3>h;h++)l=k[h].x+":"+k[h].y,
 l=p[l],void 0!==l&&(k[h]=l);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
 b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};
 THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};
@@ -607,21 +610,21 @@ THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspe
 THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2};THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.updateProjectionMatrix=function(){this.inPerspectiveMode?this.toPerspective():(this.toPerspective(),this.toOrthographic())};
 THREE.CombinedCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);var c=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPerspectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};
 THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=!1};
-THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,n){var v,w=h.widthSegments,u=h.heightSegments,y=e/2,L=f/2,A=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var K=w+1,B=u+1,E=e/w,G=f/u,C=new THREE.Vector3;C[v]=0<g?1:-1;for(e=0;e<B;e++)for(f=0;f<K;f++){var D=new THREE.Vector3;D[a]=(f*E-y)*c;D[b]=(e*G-L)*d;D[v]=g;h.vertices.push(D)}for(e=
-0;e<u;e++)for(f=0;f<w;f++)L=f+K*e,a=f+K*(e+1),b=f+1+K*(e+1),c=f+1+K*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),y=new THREE.Vector2((f+1)/w,1-e/u),L=new THREE.Face3(L+A,a+A,c+A),L.normal.copy(C),L.vertexNormals.push(C.clone(),C.clone(),C.clone()),L.materialIndex=n,h.faces.push(L),h.faceVertexUvs[0].push([d,g,y]),L=new THREE.Face3(a+A,b+A,c+A),L.normal.copy(C),L.vertexNormals.push(C.clone(),C.clone(),C.clone()),L.materialIndex=n,h.faces.push(L),
-h.faceVertexUvs[0].push([g.clone(),v,y.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,0,1);for(e=1;e<=
+THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=!1};THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,n){var v,w=h.widthSegments,u=h.heightSegments,x=e/2,K=f/2,z=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var B=w+1,A=u+1,E=e/w,F=f/u,H=new THREE.Vector3;H[v]=0<g?1:-1;for(e=0;e<A;e++)for(f=0;f<B;f++){var C=new THREE.Vector3;C[a]=(f*E-x)*c;C[b]=(e*F-K)*d;C[v]=g;h.vertices.push(C)}for(e=
+0;e<u;e++)for(f=0;f<w;f++)K=f+B*e,a=f+B*(e+1),b=f+1+B*(e+1),c=f+1+B*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),x=new THREE.Vector2((f+1)/w,1-e/u),K=new THREE.Face3(K+z,a+z,c+z),K.normal.copy(H),K.vertexNormals.push(H.clone(),H.clone(),H.clone()),K.materialIndex=n,h.faces.push(K),h.faceVertexUvs[0].push([d,g,x]),K=new THREE.Face3(a+z,b+z,c+z),K.normal.copy(H),K.vertexNormals.push(H.clone(),H.clone(),H.clone()),K.materialIndex=n,h.faces.push(K),
+h.faceVertexUvs[0].push([g.clone(),v,x.clone()])}THREE.Geometry.call(this);this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=f||1;var h=this;d=a/2;e=b/2;f=c/2;g("z","y",-1,-1,c,b,d,0);g("z","y",1,-1,c,b,-d,1);g("x","z",1,1,a,c,e,2);g("x","z",1,-1,a,c,-e,3);g("x","y",1,-1,a,b,f,4);g("x","y",-1,-1,a,b,-f,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(0.5,0.5);this.vertices.push(e);f.push(g);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,0,1);for(e=1;e<=
 b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,f){console.warn("THEE.CubeGeometry has been renamed to THREE.BoxGeometry.");return new THREE.BoxGeometry(a,b,c,d,e,f)};THREE.CylinderGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this);this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;f=void 0!==f?f:!1;var g=c/2,h,k,l=[],p=[];for(k=0;k<=e;k++){var q=[],r=[],t=k/e,s=t*(b-a)+a;for(h=0;h<=d;h++){var n=h/d,v=new THREE.Vector3;v.x=s*Math.sin(n*Math.PI*2);v.y=-t*c+g;v.z=s*Math.cos(n*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-1);r.push(new THREE.Vector2(n,
-1-t))}l.push(q);p.push(r)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[l[0][h]].clone(),r=this.vertices[l[0][h+1]].clone()):(q=this.vertices[l[1][h]].clone(),r=this.vertices[l[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),k=0;k<e;k++){var t=l[k][h],s=l[k+1][h],n=l[k+1][h+1],v=l[k][h+1],w=q.clone(),u=q.clone(),y=r.clone(),L=r.clone(),A=p[k][h].clone(),K=p[k+1][h].clone(),B=p[k+1][h+1].clone(),E=p[k][h+1].clone();this.faces.push(new THREE.Face3(t,
-s,v,[w,u,L]));this.faceVertexUvs[0].push([A,K,E]);this.faces.push(new THREE.Face3(s,n,v,[u.clone(),y,L.clone()]));this.faceVertexUvs[0].push([K.clone(),B,E.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)t=l[0][h],s=l[0][h+1],n=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),A=p[0][h].clone(),K=p[0][h+1].clone(),B=new THREE.Vector2(K.x,0),this.faces.push(new THREE.Face3(t,s,n,[w,u,y])),this.faceVertexUvs[0].push([A,
-K,B]);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],n=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),A=p[k][h+1].clone(),K=p[k][h].clone(),B=new THREE.Vector2(K.x,1),this.faces.push(new THREE.Face3(t,s,n,[w,u,y])),this.faceVertexUvs[0].push([A,K,B]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
+1-t))}l.push(q);p.push(r)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[l[0][h]].clone(),r=this.vertices[l[0][h+1]].clone()):(q=this.vertices[l[1][h]].clone(),r=this.vertices[l[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),k=0;k<e;k++){var t=l[k][h],s=l[k+1][h],n=l[k+1][h+1],v=l[k][h+1],w=q.clone(),u=q.clone(),x=r.clone(),K=r.clone(),z=p[k][h].clone(),B=p[k+1][h].clone(),A=p[k+1][h+1].clone(),E=p[k][h+1].clone();this.faces.push(new THREE.Face3(t,
+s,v,[w,u,K]));this.faceVertexUvs[0].push([z,B,E]);this.faces.push(new THREE.Face3(s,n,v,[u.clone(),x,K.clone()]));this.faceVertexUvs[0].push([B.clone(),A,E.clone()])}if(!1===f&&0<a)for(this.vertices.push(new THREE.Vector3(0,g,0)),h=0;h<d;h++)t=l[0][h],s=l[0][h+1],n=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),x=new THREE.Vector3(0,1,0),z=p[0][h].clone(),B=p[0][h+1].clone(),A=new THREE.Vector2(B.x,0),this.faces.push(new THREE.Face3(t,s,n,[w,u,x])),this.faceVertexUvs[0].push([z,
+B,A]);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],n=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),x=new THREE.Vector3(0,-1,0),z=p[k][h+1].clone(),B=p[k][h].clone(),A=new THREE.Vector2(B.x,1),this.faces.push(new THREE.Face3(t,s,n,[w,u,x])),this.faceVertexUvs[0].push([z,B,A]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.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(F=c.length;0<=--F;){e=F;f=F-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*p,g=0;g<h;g++){var k=la*g,l=la*(g+1),n=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,n=n+M,k=k+M,q=q+M,l=l+M;D.faces.push(new THREE.Face3(n,k,l,null,null,u));D.faces.push(new THREE.Face3(k,q,l,null,null,u));n=y.generateSideWallUV(D,a,r,b,n,k,q,l,s,v,w,x);D.faceVertexUvs[0].push([n[0],n[1],
-n[3]]);D.faceVertexUvs[0].push([n[1],n[2],n[3]])}}}function f(a,b,c){D.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=M;d+=M;e+=M;D.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?y.generateBottomUV(D,a,b,c,d,e):y.generateTopUV(D,a,b,c,d,e);D.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,p=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,n,v=!1,w=b.material,u=b.extrudeMaterial,y=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,L,A,K,B;s&&(n=s.getSpacedPoints(t),v=!0,q=!1,L=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),A=new THREE.Vector3,K=new THREE.Vector3,B=new THREE.Vector3);q||(l=k=p=0);var E,G,C,D=this,M=this.vertices.length,s=a.extractPoints(r),r=s.shape,N=s.holes;if(s=!THREE.Shape.Utils.isClockWise(r)){r=
-r.reverse();G=0;for(C=N.length;G<C;G++)E=N[G],THREE.Shape.Utils.isClockWise(E)&&(N[G]=E.reverse());s=!1}var I=THREE.Shape.Utils.triangulateShape(r,N),z=r;G=0;for(C=N.length;G<C;G++)E=N[G],r=r.concat(E);var x,H,Q,Y,U,la=r.length,W,R=I.length,s=[],F=0;Q=z.length;x=Q-1;for(H=F+1;F<Q;F++,x++,H++)x===Q&&(x=0),H===Q&&(H=0),s[F]=d(z[F],z[x],z[H]);var da=[],V,X=s.concat();G=0;for(C=N.length;G<C;G++){E=N[G];V=[];F=0;Q=E.length;x=Q-1;for(H=F+1;F<Q;F++,x++,H++)x===Q&&(x=0),H===Q&&(H=0),V[F]=d(E[F],E[x],E[H]);
-da.push(V);X=X.concat(V)}for(x=0;x<p;x++){Q=x/p;Y=k*(1-Q);H=l*Math.sin(Q*Math.PI/2);F=0;for(Q=z.length;F<Q;F++)U=c(z[F],s[F],H),f(U.x,U.y,-Y);G=0;for(C=N.length;G<C;G++)for(E=N[G],V=da[G],F=0,Q=E.length;F<Q;F++)U=c(E[F],V[F],H),f(U.x,U.y,-Y)}H=l;for(F=0;F<la;F++)U=q?c(r[F],X[F],H):r[F],v?(K.copy(L.normals[0]).multiplyScalar(U.x),A.copy(L.binormals[0]).multiplyScalar(U.y),B.copy(n[0]).add(K).add(A),f(B.x,B.y,B.z)):f(U.x,U.y,0);for(Q=1;Q<=t;Q++)for(F=0;F<la;F++)U=q?c(r[F],X[F],H):r[F],v?(K.copy(L.normals[Q]).multiplyScalar(U.x),
-A.copy(L.binormals[Q]).multiplyScalar(U.y),B.copy(n[Q]).add(K).add(A),f(B.x,B.y,B.z)):f(U.x,U.y,h/t*Q);for(x=p-1;0<=x;x--){Q=x/p;Y=k*(1-Q);H=l*Math.sin(Q*Math.PI/2);F=0;for(Q=z.length;F<Q;F++)U=c(z[F],s[F],H),f(U.x,U.y,h+Y);G=0;for(C=N.length;G<C;G++)for(E=N[G],V=da[G],F=0,Q=E.length;F<Q;F++)U=c(E[F],V[F],H),v?f(U.x,U.y+n[t-1].y,n[t-1].x+Y):f(U.x,U.y,h+Y)}(function(){if(q){var a;a=0*la;for(F=0;F<R;F++)W=I[F],g(W[2]+a,W[1]+a,W[0]+a,!0);a=t+2*p;a*=la;for(F=0;F<R;F++)W=I[F],g(W[0]+a,W[1]+a,W[2]+a,!1)}else{for(F=
-0;F<R;F++)W=I[F],g(W[2],W[1],W[0],!0);for(F=0;F<R;F++)W=I[F],g(W[0]+la*t,W[1]+la*t,W[2]+la*t,!1)}})();(function(){var a=0;e(z,a);a+=z.length;G=0;for(C=N.length;G<C;G++)E=N[G],e(E,a),a+=E.length})()};
+(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(y=c.length;0<=--y;){e=y;f=y-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*p,g=0;g<h;g++){var k=la*g,l=la*(g+1),n=d+e+k,k=d+f+k,q=d+f+l,l=d+e+l,r=c,s=g,v=h,w=e,A=f,n=n+Q,k=k+Q,q=q+Q,l=l+Q;C.faces.push(new THREE.Face3(n,k,l,null,null,u));C.faces.push(new THREE.Face3(k,q,l,null,null,u));n=x.generateSideWallUV(C,a,r,b,n,k,q,l,s,v,w,A);C.faceVertexUvs[0].push([n[0],n[1],
+n[3]]);C.faceVertexUvs[0].push([n[1],n[2],n[3]])}}}function f(a,b,c){C.vertices.push(new THREE.Vector3(a,b,c))}function g(c,d,e,f){c+=Q;d+=Q;e+=Q;C.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?x.generateBottomUV(C,a,b,c,d,e):x.generateTopUV(C,a,b,c,d,e);C.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,p=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,n,v=!1,w=b.material,u=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,K,z,B,A;s&&(n=s.getSpacedPoints(t),v=!0,q=!1,K=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),z=new THREE.Vector3,B=new THREE.Vector3,A=new THREE.Vector3);q||(l=k=p=0);var E,F,H,C=this,Q=this.vertices.length,s=a.extractPoints(r),r=s.shape,D=s.holes;if(s=!THREE.Shape.Utils.isClockWise(r)){r=
+r.reverse();F=0;for(H=D.length;F<H;F++)E=D[F],THREE.Shape.Utils.isClockWise(E)&&(D[F]=E.reverse());s=!1}var R=THREE.Shape.Utils.triangulateShape(r,D),L=r;F=0;for(H=D.length;F<H;F++)E=D[F],r=r.concat(E);var J,G,P,Y,M,la=r.length,W,S=R.length,s=[],y=0;P=L.length;J=P-1;for(G=y+1;y<P;y++,J++,G++)J===P&&(J=0),G===P&&(G=0),s[y]=d(L[y],L[J],L[G]);var da=[],V,X=s.concat();F=0;for(H=D.length;F<H;F++){E=D[F];V=[];y=0;P=E.length;J=P-1;for(G=y+1;y<P;y++,J++,G++)J===P&&(J=0),G===P&&(G=0),V[y]=d(E[y],E[J],E[G]);
+da.push(V);X=X.concat(V)}for(J=0;J<p;J++){P=J/p;Y=k*(1-P);G=l*Math.sin(P*Math.PI/2);y=0;for(P=L.length;y<P;y++)M=c(L[y],s[y],G),f(M.x,M.y,-Y);F=0;for(H=D.length;F<H;F++)for(E=D[F],V=da[F],y=0,P=E.length;y<P;y++)M=c(E[y],V[y],G),f(M.x,M.y,-Y)}G=l;for(y=0;y<la;y++)M=q?c(r[y],X[y],G):r[y],v?(B.copy(K.normals[0]).multiplyScalar(M.x),z.copy(K.binormals[0]).multiplyScalar(M.y),A.copy(n[0]).add(B).add(z),f(A.x,A.y,A.z)):f(M.x,M.y,0);for(P=1;P<=t;P++)for(y=0;y<la;y++)M=q?c(r[y],X[y],G):r[y],v?(B.copy(K.normals[P]).multiplyScalar(M.x),
+z.copy(K.binormals[P]).multiplyScalar(M.y),A.copy(n[P]).add(B).add(z),f(A.x,A.y,A.z)):f(M.x,M.y,h/t*P);for(J=p-1;0<=J;J--){P=J/p;Y=k*(1-P);G=l*Math.sin(P*Math.PI/2);y=0;for(P=L.length;y<P;y++)M=c(L[y],s[y],G),f(M.x,M.y,h+Y);F=0;for(H=D.length;F<H;F++)for(E=D[F],V=da[F],y=0,P=E.length;y<P;y++)M=c(E[y],V[y],G),v?f(M.x,M.y+n[t-1].y,n[t-1].x+Y):f(M.x,M.y,h+Y)}(function(){if(q){var a;a=0*la;for(y=0;y<S;y++)W=R[y],g(W[2]+a,W[1]+a,W[0]+a,!0);a=t+2*p;a*=la;for(y=0;y<S;y++)W=R[y],g(W[0]+a,W[1]+a,W[2]+a,!1)}else{for(y=
+0;y<S;y++)W=R[y],g(W[2],W[1],W[0],!0);for(y=0;y<S;y++)W=R[y],g(W[0]+la*t,W[1]+la*t,W[2]+la*t,!1)}})();(function(){var a=0;e(L,a);a+=L.length;F=0;for(H=D.length;F<H;F++)E=D[F],e(E,a),a+=E.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,p,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;
 p=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(p,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.shapebb=a[a.length-1].getBoundingBox();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};
@@ -683,29 +686,29 @@ f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetI
 e[s++]=0;e[s++]=0;e[s++]=1;e[s++]=-1;e[s++]=1;e[s++]=0;e[s++]=1;e[s++]=1;e[s++]=1;e[s++]=1;e[s++]=-1;e[s++]=1;e[s++]=0;e[s++]=1;s=0;f[s++]=0;f[s++]=1;f[s++]=2;f[s++]=0;f[s++]=2;f[s++]=3;g=b.createBuffer();h=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,g);b.bufferData(b.ARRAY_BUFFER,e,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.bufferData(b.ELEMENT_ARRAY_BUFFER,f,b.STATIC_DRAW);k=b.createTexture();l=b.createTexture();b.bindTexture(b.TEXTURE_2D,k);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,
 0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,l);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);
 b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);0>=b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(p=!1,q=a(THREE.ShaderFlares.lensFlare,d)):(p=!0,q=a(THREE.ShaderFlares.lensFlareVertexTexture,d));r={};t={};r.vertex=b.getAttribLocation(q,"position");r.uv=b.getAttribLocation(q,"uv");t.renderType=b.getUniformLocation(q,"renderType");t.map=b.getUniformLocation(q,"map");t.occlusionMap=b.getUniformLocation(q,"occlusionMap");t.opacity=
-b.getUniformLocation(q,"opacity");t.color=b.getUniformLocation(q,"color");t.scale=b.getUniformLocation(q,"scale");t.rotation=b.getUniformLocation(q,"rotation");t.screenPosition=b.getUniformLocation(q,"screenPosition")};this.render=function(a,d,e,f){a=a.__webglFlares;var u=a.length;if(u){var y=new THREE.Vector3,L=f/e,A=0.5*e,K=0.5*f,B=16/f,E=new THREE.Vector2(B*L,B),G=new THREE.Vector3(1,1,0),C=new THREE.Vector2(1,1),D=t,B=r;b.useProgram(q);b.enableVertexAttribArray(r.vertex);b.enableVertexAttribArray(r.uv);
-b.uniform1i(D.occlusionMap,0);b.uniform1i(D.map,1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(B.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(B.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var M,N,I,z,x;for(M=0;M<u;M++)if(B=16/f,E.set(B*L,B),z=a[M],!1!==z.visible&&(y.set(z.matrixWorld.elements[12],z.matrixWorld.elements[13],z.matrixWorld.elements[14]),y.applyMatrix4(d.matrixWorldInverse),y.applyProjection(d.projectionMatrix),G.copy(y),
-C.x=G.x*A+A,C.y=G.y*K+K,p||0<C.x&&C.x<e&&0<C.y&&C.y<f))for(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,C.x-8,C.y-8,16,16,0),b.uniform1i(D.renderType,0),b.uniform2f(D.scale,E.x,E.y),b.uniform3f(D.screenPosition,G.x,G.y,G.z),b.disable(b.BLEND),b.enable(b.DEPTH_TEST),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,C.x-8,C.y-8,16,16,0),b.uniform1i(D.renderType,
-1),b.disable(b.DEPTH_TEST),b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),z.positionScreen.copy(G),z.customUpdateCallback?z.customUpdateCallback(z):z.updateLensFlares(),b.uniform1i(D.renderType,2),b.enable(b.BLEND),N=0,I=z.lensFlares.length;N<I;N++)x=z.lensFlares[N],0.001<x.opacity&&0.001<x.scale&&(G.x=x.x,G.y=x.y,G.z=x.z,B=x.size*x.scale/f,E.x=B*L,E.y=B,b.uniform3f(D.screenPosition,G.x,G.y,G.z),b.uniform2f(D.scale,E.x,E.y),b.uniform1f(D.rotation,
-x.rotation),b.uniform1f(D.opacity,x.opacity),b.uniform3f(D.color,x.color.r,x.color.g,x.color.b),c.setBlending(x.blending,x.blendEquation,x.blendSrc,x.blendDst),c.setTexture(x.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,p=new THREE.Vector3;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
-vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(q,r){var t,s,n,v,w,u,y,L,A,K=[];v=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
-a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);t=0;for(s=q.__lights.length;t<s;t++)if(n=q.__lights[t],n.castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(w=0;w<n.shadowCascadeCount;w++){var B;if(n.shadowCascadeArray[w])B=n.shadowCascadeArray[w];else{A=n;y=w;B=new THREE.DirectionalLight;B.isVirtual=!0;B.onlyShadow=!0;B.castShadow=!0;B.shadowCameraNear=A.shadowCameraNear;B.shadowCameraFar=A.shadowCameraFar;B.shadowCameraLeft=A.shadowCameraLeft;B.shadowCameraRight=A.shadowCameraRight;
-B.shadowCameraBottom=A.shadowCameraBottom;B.shadowCameraTop=A.shadowCameraTop;B.shadowCameraVisible=A.shadowCameraVisible;B.shadowDarkness=A.shadowDarkness;B.shadowBias=A.shadowCascadeBias[y];B.shadowMapWidth=A.shadowCascadeWidth[y];B.shadowMapHeight=A.shadowCascadeHeight[y];B.pointsWorld=[];B.pointsFrustum=[];var E=B.pointsWorld;u=B.pointsFrustum;for(L=0;8>L;L++)E[L]=new THREE.Vector3,u[L]=new THREE.Vector3;E=A.shadowCascadeNearZ[y];A=A.shadowCascadeFarZ[y];u[0].set(-1,-1,E);u[1].set(1,-1,E);u[2].set(-1,
-1,E);u[3].set(1,1,E);u[4].set(-1,-1,A);u[5].set(1,-1,A);u[6].set(-1,1,A);u[7].set(1,1,A);B.originalCamera=r;u=new THREE.Gyroscope;u.position.copy(n.shadowCascadeOffset);u.add(B);u.add(B.target);r.add(u);n.shadowCascadeArray[w]=B;console.log("Created virtualLight",B)}y=n;E=w;A=y.shadowCascadeArray[E];A.position.copy(y.position);A.target.position.copy(y.target.position);A.lookAt(A.target);A.shadowCameraVisible=y.shadowCameraVisible;A.shadowDarkness=y.shadowDarkness;A.shadowBias=y.shadowCascadeBias[E];
-u=y.shadowCascadeNearZ[E];y=y.shadowCascadeFarZ[E];A=A.pointsFrustum;A[0].z=u;A[1].z=u;A[2].z=u;A[3].z=u;A[4].z=y;A[5].z=y;A[6].z=y;A[7].z=y;K[v]=B;v++}else K[v]=n,v++;t=0;for(s=K.length;t<s;t++){n=K[t];n.shadowMap||(w=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(w=THREE.NearestFilter),n.shadowMap=new THREE.WebGLRenderTarget(n.shadowMapWidth,n.shadowMapHeight,{minFilter:w,magFilter:w,format:THREE.RGBAFormat}),n.shadowMapSize=new THREE.Vector2(n.shadowMapWidth,n.shadowMapHeight),n.shadowMatrix=
+b.getUniformLocation(q,"opacity");t.color=b.getUniformLocation(q,"color");t.scale=b.getUniformLocation(q,"scale");t.rotation=b.getUniformLocation(q,"rotation");t.screenPosition=b.getUniformLocation(q,"screenPosition")};this.render=function(a,d,e,f){a=a.__webglFlares;var u=a.length;if(u){var x=new THREE.Vector3,K=f/e,z=0.5*e,B=0.5*f,A=16/f,E=new THREE.Vector2(A*K,A),F=new THREE.Vector3(1,1,0),H=new THREE.Vector2(1,1),C=t,A=r;b.useProgram(q);b.enableVertexAttribArray(r.vertex);b.enableVertexAttribArray(r.uv);
+b.uniform1i(C.occlusionMap,0);b.uniform1i(C.map,1);b.bindBuffer(b.ARRAY_BUFFER,g);b.vertexAttribPointer(A.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(A.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h);b.disable(b.CULL_FACE);b.depthMask(!1);var Q,D,R,L,J;for(Q=0;Q<u;Q++)if(A=16/f,E.set(A*K,A),L=a[Q],!1!==L.visible&&(x.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),x.applyMatrix4(d.matrixWorldInverse),x.applyProjection(d.projectionMatrix),F.copy(x),
+H.x=F.x*z+z,H.y=F.y*B+B,p||0<H.x&&H.x<e&&0<H.y&&H.y<f))for(b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,H.x-8,H.y-8,16,16,0),b.uniform1i(C.renderType,0),b.uniform2f(C.scale,E.x,E.y),b.uniform3f(C.screenPosition,F.x,F.y,F.z),b.disable(b.BLEND),b.enable(b.DEPTH_TEST),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,l),b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,H.x-8,H.y-8,16,16,0),b.uniform1i(C.renderType,
+1),b.disable(b.DEPTH_TEST),b.activeTexture(b.TEXTURE1),b.bindTexture(b.TEXTURE_2D,k),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0),L.positionScreen.copy(F),L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares(),b.uniform1i(C.renderType,2),b.enable(b.BLEND),D=0,R=L.lensFlares.length;D<R;D++)J=L.lensFlares[D],0.001<J.opacity&&0.001<J.scale&&(F.x=J.x,F.y=J.y,F.z=J.z,A=J.size*J.scale/f,E.x=A*K,E.y=A,b.uniform3f(C.screenPosition,F.x,F.y,F.z),b.uniform2f(C.scale,E.x,E.y),b.uniform1f(C.rotation,
+J.rotation),b.uniform1f(C.opacity,J.opacity),b.uniform3f(C.color,J.color.r,J.color.g,J.color.b),c.setBlending(J.blending,J.blendEquation,J.blendSrc,J.blendDst),c.setTexture(J.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0));b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4,k=new THREE.Vector3,l=new THREE.Vector3,p=new THREE.Vector3;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(q,r){var t,s,n,v,w,u,x,K,z,B=[];v=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
+a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);t=0;for(s=q.__lights.length;t<s;t++)if(n=q.__lights[t],n.castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(w=0;w<n.shadowCascadeCount;w++){var A;if(n.shadowCascadeArray[w])A=n.shadowCascadeArray[w];else{z=n;x=w;A=new THREE.DirectionalLight;A.isVirtual=!0;A.onlyShadow=!0;A.castShadow=!0;A.shadowCameraNear=z.shadowCameraNear;A.shadowCameraFar=z.shadowCameraFar;A.shadowCameraLeft=z.shadowCameraLeft;A.shadowCameraRight=z.shadowCameraRight;
+A.shadowCameraBottom=z.shadowCameraBottom;A.shadowCameraTop=z.shadowCameraTop;A.shadowCameraVisible=z.shadowCameraVisible;A.shadowDarkness=z.shadowDarkness;A.shadowBias=z.shadowCascadeBias[x];A.shadowMapWidth=z.shadowCascadeWidth[x];A.shadowMapHeight=z.shadowCascadeHeight[x];A.pointsWorld=[];A.pointsFrustum=[];var E=A.pointsWorld;u=A.pointsFrustum;for(K=0;8>K;K++)E[K]=new THREE.Vector3,u[K]=new THREE.Vector3;E=z.shadowCascadeNearZ[x];z=z.shadowCascadeFarZ[x];u[0].set(-1,-1,E);u[1].set(1,-1,E);u[2].set(-1,
+1,E);u[3].set(1,1,E);u[4].set(-1,-1,z);u[5].set(1,-1,z);u[6].set(-1,1,z);u[7].set(1,1,z);A.originalCamera=r;u=new THREE.Gyroscope;u.position.copy(n.shadowCascadeOffset);u.add(A);u.add(A.target);r.add(u);n.shadowCascadeArray[w]=A;console.log("Created virtualLight",A)}x=n;E=w;z=x.shadowCascadeArray[E];z.position.copy(x.position);z.target.position.copy(x.target.position);z.lookAt(z.target);z.shadowCameraVisible=x.shadowCameraVisible;z.shadowDarkness=x.shadowDarkness;z.shadowBias=x.shadowCascadeBias[E];
+u=x.shadowCascadeNearZ[E];x=x.shadowCascadeFarZ[E];z=z.pointsFrustum;z[0].z=u;z[1].z=u;z[2].z=u;z[3].z=u;z[4].z=x;z[5].z=x;z[6].z=x;z[7].z=x;B[v]=A;v++}else B[v]=n,v++;t=0;for(s=B.length;t<s;t++){n=B[t];n.shadowMap||(w=THREE.LinearFilter,b.shadowMapType===THREE.PCFSoftShadowMap&&(w=THREE.NearestFilter),n.shadowMap=new THREE.WebGLRenderTarget(n.shadowMapWidth,n.shadowMapHeight,{minFilter:w,magFilter:w,format:THREE.RGBAFormat}),n.shadowMapSize=new THREE.Vector2(n.shadowMapWidth,n.shadowMapHeight),n.shadowMatrix=
 new THREE.Matrix4);if(!n.shadowCamera){if(n instanceof THREE.SpotLight)n.shadowCamera=new THREE.PerspectiveCamera(n.shadowCameraFov,n.shadowMapWidth/n.shadowMapHeight,n.shadowCameraNear,n.shadowCameraFar);else if(n instanceof THREE.DirectionalLight)n.shadowCamera=new THREE.OrthographicCamera(n.shadowCameraLeft,n.shadowCameraRight,n.shadowCameraTop,n.shadowCameraBottom,n.shadowCameraNear,n.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}q.add(n.shadowCamera);!0===
-q.autoUpdate&&q.updateMatrixWorld()}n.shadowCameraVisible&&!n.cameraHelper&&(n.cameraHelper=new THREE.CameraHelper(n.shadowCamera),n.shadowCamera.add(n.cameraHelper));if(n.isVirtual&&B.originalCamera==r){w=r;v=n.shadowCamera;u=n.pointsFrustum;A=n.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(y=0;8>y;y++)E=A[y],E.copy(u[y]),THREE.ShadowMapPlugin.__projector.unprojectVector(E,w),E.applyMatrix4(v.matrixWorldInverse),E.x<k.x&&(k.x=E.x),E.x>l.x&&(l.x=E.x),E.y<k.y&&
+q.autoUpdate&&q.updateMatrixWorld()}n.shadowCameraVisible&&!n.cameraHelper&&(n.cameraHelper=new THREE.CameraHelper(n.shadowCamera),n.shadowCamera.add(n.cameraHelper));if(n.isVirtual&&A.originalCamera==r){w=r;v=n.shadowCamera;u=n.pointsFrustum;z=n.pointsWorld;k.set(Infinity,Infinity,Infinity);l.set(-Infinity,-Infinity,-Infinity);for(x=0;8>x;x++)E=z[x],E.copy(u[x]),THREE.ShadowMapPlugin.__projector.unprojectVector(E,w),E.applyMatrix4(v.matrixWorldInverse),E.x<k.x&&(k.x=E.x),E.x>l.x&&(l.x=E.x),E.y<k.y&&
 (k.y=E.y),E.y>l.y&&(l.y=E.y),E.z<k.z&&(k.z=E.z),E.z>l.z&&(l.z=E.z);v.left=k.x;v.right=l.x;v.top=l.y;v.bottom=k.y;v.updateProjectionMatrix()}v=n.shadowMap;u=n.shadowMatrix;w=n.shadowCamera;w.position.setFromMatrixPosition(n.matrixWorld);p.setFromMatrixPosition(n.target.matrixWorld);w.lookAt(p);w.updateMatrixWorld();w.matrixWorldInverse.getInverse(w.matrixWorld);n.cameraHelper&&(n.cameraHelper.visible=n.shadowCameraVisible);n.shadowCameraVisible&&n.cameraHelper.update();u.set(0.5,0,0,0.5,0,0.5,0,0.5,
-0,0,0.5,0.5,0,0,0,1);u.multiply(w.projectionMatrix);u.multiply(w.matrixWorldInverse);h.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(v);b.clear();A=q.__webglObjects;n=0;for(v=A.length;n<v;n++)y=A[n],u=y.object,y.render=!1,u.visible&&u.castShadow&&(!1===u.frustumCulled||!0===g.intersectsObject(u))&&(u._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,u.matrixWorld),y.render=!0);var G;n=0;for(v=A.length;n<v;n++)y=A[n],y.render&&(u=y.object,y=y.buffer,
-E=u.material instanceof THREE.MeshFaceMaterial?u.material.materials[0]:u.material,L=void 0!==u.geometry.morphTargets&&0<u.geometry.morphTargets.length&&E.morphTargets,G=u instanceof THREE.SkinnedMesh&&E.skinning,L=u.customDepthMaterial?u.customDepthMaterial:G?L?f:e:L?d:c,b.setMaterialFaces(E),y instanceof THREE.BufferGeometry?b.renderBufferDirect(w,q.__lights,null,L,y,u):b.renderBuffer(w,q.__lights,null,L,y,u));A=q.__webglObjectsImmediate;n=0;for(v=A.length;n<v;n++)y=A[n],u=y.object,u.visible&&u.castShadow&&
-(u._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,u.matrixWorld),b.renderImmediateObject(w,q.__lights,null,c,u))}t=b.getClearColor();s=b.getClearAlpha();a.clearColor(t.r,t.g,t.b,s);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,p,q,r,t,s,n,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,y,L,A,K,B,E,G;this.init=function(w){u=w.context;y=w;A=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);K=new Uint16Array([0,1,2,0,2,3]);B=u.createBuffer();E=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,B);u.bufferData(u.ARRAY_BUFFER,A,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,E);u.bufferData(u.ELEMENT_ARRAY_BUFFER,K,u.STATIC_DRAW);w=u.createProgram();
-var D=u.createShader(u.VERTEX_SHADER),M=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(D,["precision "+y.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
-u.shaderSource(M,["precision "+y.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
-u.compileShader(D);u.compileShader(M);u.attachShader(w,D);u.attachShader(w,M);u.linkProgram(w);G=w;n=u.getAttribLocation(G,"position");v=u.getAttribLocation(G,"uv");a=u.getUniformLocation(G,"uvOffset");b=u.getUniformLocation(G,"uvScale");c=u.getUniformLocation(G,"rotation");d=u.getUniformLocation(G,"scale");e=u.getUniformLocation(G,"color");f=u.getUniformLocation(G,"map");g=u.getUniformLocation(G,"opacity");h=u.getUniformLocation(G,"modelViewMatrix");k=u.getUniformLocation(G,"projectionMatrix");l=
-u.getUniformLocation(G,"fogType");p=u.getUniformLocation(G,"fogDensity");q=u.getUniformLocation(G,"fogNear");r=u.getUniformLocation(G,"fogFar");t=u.getUniformLocation(G,"fogColor");s=u.getUniformLocation(G,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;D=w.getContext("2d");D.fillStyle="#ffffff";D.fillRect(0,0,w.width,w.height);L=new THREE.Texture(w);L.needsUpdate=!0};this.render=function(A,D,K,N){K=A.__webglSprites;if(N=K.length){u.useProgram(G);u.enableVertexAttribArray(n);
-u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,B);u.vertexAttribPointer(n,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,E);u.uniformMatrix4fv(k,!1,D.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);var I=0,z=0,x=A.fog;x?(u.uniform3f(t,x.color.r,x.color.g,x.color.b),x instanceof THREE.Fog?(u.uniform1f(q,x.near),u.uniform1f(r,x.far),u.uniform1i(l,1),z=I=1):x instanceof THREE.FogExp2&&
-(u.uniform1f(p,x.density),u.uniform1i(l,2),z=I=2)):(u.uniform1i(l,0),z=I=0);for(var H,Q=[],x=0;x<N;x++)H=K[x],!1!==H.visible&&(H._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,H.matrixWorld),H.z=-H._modelViewMatrix.elements[14]);K.sort(w);for(x=0;x<N;x++)H=K[x],!1!==H.visible&&(D=H.material,u.uniform1f(s,D.alphaTest),u.uniformMatrix4fv(h,!1,H._modelViewMatrix.elements),Q[0]=H.scale.x,Q[1]=H.scale.y,H=A.fog&&D.fog?z:0,I!==H&&(u.uniform1i(l,H),I=H),null!==D.map?(u.uniform2f(a,D.map.offset.x,
-D.map.offset.y),u.uniform2f(b,D.map.repeat.x,D.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(g,D.opacity),u.uniform3f(e,D.color.r,D.color.g,D.color.b),u.uniform1f(c,D.rotation),u.uniform2fv(d,Q),y.setBlending(D.blending,D.blendEquation,D.blendSrc,D.blendDst),y.setDepthTest(D.depthTest),y.setDepthWrite(D.depthWrite),D.map&&D.map.image&&D.map.image.width?y.setTexture(D.map,0):y.setTexture(L,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,0));u.enable(u.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
+0,0,0.5,0.5,0,0,0,1);u.multiply(w.projectionMatrix);u.multiply(w.matrixWorldInverse);h.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(v);b.clear();z=q.__webglObjects;n=0;for(v=z.length;n<v;n++)x=z[n],u=x.object,x.render=!1,u.visible&&u.castShadow&&(!1===u.frustumCulled||!0===g.intersectsObject(u))&&(u._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,u.matrixWorld),x.render=!0);var F;n=0;for(v=z.length;n<v;n++)x=z[n],x.render&&(u=x.object,x=x.buffer,
+E=u.material instanceof THREE.MeshFaceMaterial?u.material.materials[0]:u.material,K=void 0!==u.geometry.morphTargets&&0<u.geometry.morphTargets.length&&E.morphTargets,F=u instanceof THREE.SkinnedMesh&&E.skinning,K=u.customDepthMaterial?u.customDepthMaterial:F?K?f:e:K?d:c,b.setMaterialFaces(E),x instanceof THREE.BufferGeometry?b.renderBufferDirect(w,q.__lights,null,K,x,u):b.renderBuffer(w,q.__lights,null,K,x,u));z=q.__webglObjectsImmediate;n=0;for(v=z.length;n<v;n++)x=z[n],u=x.object,u.visible&&u.castShadow&&
+(u._modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,u.matrixWorld),b.renderImmediateObject(w,q.__lights,null,c,u))}t=b.getClearColor();s=b.getClearAlpha();a.clearColor(t.r,t.g,t.b,s);a.enable(a.BLEND);b.shadowMapCullFace===THREE.CullFaceFront&&a.cullFace(a.BACK)}};THREE.ShadowMapPlugin.__projector=new THREE.Projector;THREE.SpritePlugin=function(){var a,b,c,d,e,f,g,h,k,l,p,q,r,t,s,n,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,x,K,z,B,A,E,F;this.init=function(w){u=w.context;x=w;z=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);B=new Uint16Array([0,1,2,0,2,3]);A=u.createBuffer();E=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,A);u.bufferData(u.ARRAY_BUFFER,z,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,E);u.bufferData(u.ELEMENT_ARRAY_BUFFER,B,u.STATIC_DRAW);w=u.createProgram();
+var C=u.createShader(u.VERTEX_SHADER),Q=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(C,["precision "+x.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
+u.shaderSource(Q,["precision "+x.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
+u.compileShader(C);u.compileShader(Q);u.attachShader(w,C);u.attachShader(w,Q);u.linkProgram(w);F=w;n=u.getAttribLocation(F,"position");v=u.getAttribLocation(F,"uv");a=u.getUniformLocation(F,"uvOffset");b=u.getUniformLocation(F,"uvScale");c=u.getUniformLocation(F,"rotation");d=u.getUniformLocation(F,"scale");e=u.getUniformLocation(F,"color");f=u.getUniformLocation(F,"map");g=u.getUniformLocation(F,"opacity");h=u.getUniformLocation(F,"modelViewMatrix");k=u.getUniformLocation(F,"projectionMatrix");l=
+u.getUniformLocation(F,"fogType");p=u.getUniformLocation(F,"fogDensity");q=u.getUniformLocation(F,"fogNear");r=u.getUniformLocation(F,"fogFar");t=u.getUniformLocation(F,"fogColor");s=u.getUniformLocation(F,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;C=w.getContext("2d");C.fillStyle="#ffffff";C.fillRect(0,0,w.width,w.height);K=new THREE.Texture(w);K.needsUpdate=!0};this.render=function(z,C,B,D){B=z.__webglSprites;if(D=B.length){u.useProgram(F);u.enableVertexAttribArray(n);
+u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,A);u.vertexAttribPointer(n,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,E);u.uniformMatrix4fv(k,!1,C.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(f,0);var R=0,L=0,J=z.fog;J?(u.uniform3f(t,J.color.r,J.color.g,J.color.b),J instanceof THREE.Fog?(u.uniform1f(q,J.near),u.uniform1f(r,J.far),u.uniform1i(l,1),L=R=1):J instanceof THREE.FogExp2&&
+(u.uniform1f(p,J.density),u.uniform1i(l,2),L=R=2)):(u.uniform1i(l,0),L=R=0);for(var G,P=[],J=0;J<D;J++)G=B[J],!1!==G.visible&&(G._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,G.matrixWorld),G.z=-G._modelViewMatrix.elements[14]);B.sort(w);for(J=0;J<D;J++)G=B[J],!1!==G.visible&&(C=G.material,u.uniform1f(s,C.alphaTest),u.uniformMatrix4fv(h,!1,G._modelViewMatrix.elements),P[0]=G.scale.x,P[1]=G.scale.y,G=z.fog&&C.fog?L:0,R!==G&&(u.uniform1i(l,G),R=G),null!==C.map?(u.uniform2f(a,C.map.offset.x,
+C.map.offset.y),u.uniform2f(b,C.map.repeat.x,C.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(g,C.opacity),u.uniform3f(e,C.color.r,C.color.g,C.color.b),u.uniform1f(c,C.rotation),u.uniform2fv(d,P),x.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),x.setDepthTest(C.depthTest),x.setDepthWrite(C.depthWrite),C.map&&C.map.image&&C.map.image.width?x.setTexture(C.map,0):x.setTexture(K,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,0));u.enable(u.CULL_FACE)}}};THREE.DepthPassPlugin=function(){this.enabled=!1;this.renderTarget=null;var a,b,c,d,e,f,g=new THREE.Frustum,h=new THREE.Matrix4;this.init=function(g){a=g.context;b=g;g=THREE.ShaderLib.depthRGBA;var h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
 vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(k,l){var p,q,r,t,s,n;a.clearColor(1,1,1,1);a.disable(a.BLEND);b.setDepthTest(!0);!0===k.autoUpdate&&k.updateMatrixWorld();l.matrixWorldInverse.getInverse(l.matrixWorld);h.multiplyMatrices(l.projectionMatrix,
 l.matrixWorldInverse);g.setFromMatrix(h);b.setRenderTarget(this.renderTarget);b.clear();n=k.__webglObjects;p=0;for(q=n.length;p<q;p++)r=n[p],s=r.object,r.render=!1,!s.visible||!1!==s.frustumCulled&&!0!==g.intersectsObject(s)||(s._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,s.matrixWorld),r.render=!0);var v;p=0;for(q=n.length;p<q;p++)r=n[p],r.render&&(s=r.object,r=r.buffer,s instanceof THREE.PointCloud&&!s.customDepthMaterial||((v=s.material instanceof THREE.MeshFaceMaterial?s.material.materials[0]:
 s.material)&&b.setMaterialFaces(s.material),t=void 0!==s.geometry.morphTargets&&0<s.geometry.morphTargets.length&&v.morphTargets,v=s instanceof THREE.SkinnedMesh&&v.skinning,t=s.customDepthMaterial?s.customDepthMaterial:v?t?f:e:t?d:c,r instanceof THREE.BufferGeometry?b.renderBufferDirect(l,k.__lights,null,t,r,s):b.renderBuffer(l,k.__lights,null,t,r,s)));n=k.__webglObjectsImmediate;p=0;for(q=n.length;p<q;p++)r=n[p],s=r.object,s.visible&&(s._modelViewMatrix.multiplyMatrices(l.matrixWorldInverse,s.matrixWorld),

部分文件因为文件数量过多而无法显示