123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 |
- // Three.js r37 - http://github.com/mrdoob/three.js
- var THREE=THREE||{};THREE.Color=function(a){this.setHex(a)};
- THREE.Color.prototype={autoUpdate:!0,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;this.hex=a.hex;this.__styleString=a.__styleString},setRGB:function(a,c,b){this.r=a;this.g=c;this.b=b;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,c,b){var d,f,g,j,k,m;if(b==0)d=f=g=0;else{j=Math.floor(a*6);k=a*6-j;a=b*(1-c);m=b*(1-c*k);c=b*(1-c*(1-k));switch(j){case 1:d=m;f=b;g=a;break;case 2:d=a;f=b;g=c;break;case 3:d=a;f=m;g=b;break;case 4:d=c;f=a;g=b;break;case 5:d=b;f=a;
- g=m;break;case 6:case 0:d=b;f=c;g=a}}this.r=d;this.g=f;this.b=g;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*
- 255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)}};THREE.Vector2=function(a,c){this.set(a||0,c||0)};
- THREE.Vector2.prototype={set:function(a,c){this.x=a;this.y=c;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,c){this.set(a.x+c.x,a.y+c.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,c){this.set(a.x-c.x,a.y-c.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/
- this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,c,b){this.set(a||0,c||0,b||0)};
- THREE.Vector3.prototype={set:function(a,c,b){this.x=a;this.y=c;this.z=b;return this},copy:function(a){this.set(a.x,a.y,a.z);return this},add:function(a,c){this.set(a.x+c.x,a.y+c.y,a.z+c.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,c){this.set(a.x-c.x,a.y-c.y,a.z-c.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a,
- c){this.set(a.y*c.z-a.z*c.y,a.z*c.x-a.x*c.z,a.x*c.y-a.y*c.x);return this},crossSelf:function(a){var c=this.x,b=this.y,d=this.z;this.set(b*a.z-d*a.y,d*a.x-c*a.z,c*a.y-b*a.x);return this},multiply:function(a,c){this.set(a.x*c.x,a.y*c.y,a.z*c.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/
- a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var c=this.x-a.x,b=this.y-a.y;a=this.z-a.z;return c*c+b*b+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a=
- this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){this.y=Math.asin(a.n13);var c=Math.cos(this.y);if(Math.abs(c)>1.0E-5){this.x=Math.atan2(-a.n23/c,a.n33/c);this.z=Math.atan2(-a.n13/c,a.n11/c)}else{this.x=0;this.z=Math.atan2(a.n21,a.n22)}},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<
- 1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,c,b,d){this.set(a||0,c||0,b||0,d||1)};
- THREE.Vector4.prototype={set:function(a,c,b,d){this.x=a;this.y=c;this.z=b;this.w=d;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,c){this.set(a.x+c.x,a.y+c.y,a.z+c.z,a.w+c.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,c){this.set(a.x-c.x,a.y-c.y,a.z-c.z,a.w-c.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x*
- a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,c){this.set(this.x+(a.x-this.x)*c,this.y+(a.y-this.y)*c,this.z+(a.z-this.z)*c,this.w+(a.w-this.w)*c)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Ray=function(a,c){this.origin=a||new THREE.Vector3;this.direction=c||new THREE.Vector3};
- THREE.Ray.prototype={intersectScene:function(a){var c,b,d=a.objects,f=[];a=0;for(c=d.length;a<c;a++){b=d[a];b instanceof THREE.Mesh&&(f=f.concat(this.intersectObject(b)))}f.sort(function(g,j){return g.distance-j.distance});return f},intersectObject:function(a){function c(G,I,R,D){D=D.clone().subSelf(I);R=R.clone().subSelf(I);var M=G.clone().subSelf(I);G=D.dot(D);I=D.dot(R);D=D.dot(M);var L=R.dot(R);R=R.dot(M);M=1/(G*L-I*I);L=(L*D-I*R)*M;G=(G*R-I*D)*M;return L>0&&G>0&&L+G<1}var b,d,f,g,j,k,m,o,n,x,
- z,y=a.geometry,B=y.vertices,F=[];b=0;for(d=y.faces.length;b<d;b++){f=y.faces[b];x=this.origin.clone();z=this.direction.clone();m=a.matrixWorld;g=m.multiplyVector3(B[f.a].position.clone());j=m.multiplyVector3(B[f.b].position.clone());k=m.multiplyVector3(B[f.c].position.clone());m=f instanceof THREE.Face4?m.multiplyVector3(B[f.d].position.clone()):null;o=a.matrixRotationWorld.multiplyVector3(f.normal.clone());n=z.dot(o);if(n<0){o=o.dot((new THREE.Vector3).sub(g,x))/n;x=x.addSelf(z.multiplyScalar(o));
- if(f instanceof THREE.Face3){if(c(x,g,j,k)){f={distance:this.origin.distanceTo(x),point:x,face:f,object:a};F.push(f)}}else if(f instanceof THREE.Face4&&(c(x,g,j,m)||c(x,j,k,m))){f={distance:this.origin.distanceTo(x),point:x,face:f,object:a};F.push(f)}}}return F}};
- THREE.Rectangle=function(){function a(){g=d-c;j=f-b}var c,b,d,f,g,j,k=!0;this.getX=function(){return c};this.getY=function(){return b};this.getWidth=function(){return g};this.getHeight=function(){return j};this.getLeft=function(){return c};this.getTop=function(){return b};this.getRight=function(){return d};this.getBottom=function(){return f};this.set=function(m,o,n,x){k=!1;c=m;b=o;d=n;f=x;a()};this.addPoint=function(m,o){if(k){k=!1;c=m;b=o;d=m;f=o}else{c=c<m?c:m;b=b<o?b:o;d=d>m?d:m;f=f>o?f:o}a()};
- this.add3Points=function(m,o,n,x,z,y){if(k){k=!1;c=m<n?m<z?m:z:n<z?n:z;b=o<x?o<y?o:y:x<y?x:y;d=m>n?m>z?m:z:n>z?n:z;f=o>x?o>y?o:y:x>y?x:y}else{c=m<n?m<z?m<c?m:c:z<c?z:c:n<z?n<c?n:c:z<c?z:c;b=o<x?o<y?o<b?o:b:y<b?y:b:x<y?x<b?x:b:y<b?y:b;d=m>n?m>z?m>d?m:d:z>d?z:d:n>z?n>d?n:d:z>d?z:d;f=o>x?o>y?o>f?o:f:y>f?y:f:x>y?x>f?x:f:y>f?y:f}a()};this.addRectangle=function(m){if(k){k=!1;c=m.getLeft();b=m.getTop();d=m.getRight();f=m.getBottom()}else{c=c<m.getLeft()?c:m.getLeft();b=b<m.getTop()?b:m.getTop();d=d>m.getRight()?
- d:m.getRight();f=f>m.getBottom()?f:m.getBottom()}a()};this.inflate=function(m){c-=m;b-=m;d+=m;f+=m;a()};this.minSelf=function(m){c=c>m.getLeft()?c:m.getLeft();b=b>m.getTop()?b:m.getTop();d=d<m.getRight()?d:m.getRight();f=f<m.getBottom()?f:m.getBottom();a()};this.instersects=function(m){return Math.min(d,m.getRight())-Math.max(c,m.getLeft())>=0&&Math.min(f,m.getBottom())-Math.max(b,m.getTop())>=0};this.empty=function(){k=!0;f=d=b=c=0;a()};this.isEmpty=function(){return k}};
- THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,c=this.m;a=c[1];c[1]=c[3];c[3]=a;a=c[2];c[2]=c[6];c[6]=a;a=c[5];c[5]=c[7];c[7]=a;return this},transposeIntoArray:function(a){var c=this.m;a[0]=c[0];a[1]=c[3];a[2]=c[6];a[3]=c[1];a[4]=c[4];a[5]=c[7];a[6]=c[2];a[7]=c[5];a[8]=c[8];return this}};
- THREE.Matrix4=function(a,c,b,d,f,g,j,k,m,o,n,x,z,y,B,F){this.set(a||1,c||0,b||0,d||0,f||0,g||1,j||0,k||0,m||0,o||0,n||1,x||0,z||0,y||0,B||0,F||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
- THREE.Matrix4.prototype={set:function(a,c,b,d,f,g,j,k,m,o,n,x,z,y,B,F){this.n11=a;this.n12=c;this.n13=b;this.n14=d;this.n21=f;this.n22=g;this.n23=j;this.n24=k;this.n31=m;this.n32=o;this.n33=n;this.n34=x;this.n41=z;this.n42=y;this.n43=B;this.n44=F;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,c,b){var d=THREE.Matrix4.__v1,
- f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,c).normalize();if(g.length()===0)g.z=1;d.cross(b,g).normalize();if(d.length()===0){g.x+=1.0E-4;d.cross(b,g).normalize()}f.cross(g,d).normalize();this.n11=d.x;this.n12=f.x;this.n13=g.x;this.n21=d.y;this.n22=f.y;this.n23=g.y;this.n31=d.z;this.n32=f.z;this.n33=g.z;return this},multiplyVector3:function(a){var c=a.x,b=a.y,d=a.z,f=1/(this.n41*c+this.n42*b+this.n43*d+this.n44);a.x=(this.n11*c+this.n12*b+this.n13*d+this.n14)*f;a.y=(this.n21*c+this.n22*b+this.n23*
- d+this.n24)*f;a.z=(this.n31*c+this.n32*b+this.n33*d+this.n34)*f;return a},multiplyVector4:function(a){var c=a.x,b=a.y,d=a.z,f=a.w;a.x=this.n11*c+this.n12*b+this.n13*d+this.n14*f;a.y=this.n21*c+this.n22*b+this.n23*d+this.n24*f;a.z=this.n31*c+this.n32*b+this.n33*d+this.n34*f;a.w=this.n41*c+this.n42*b+this.n43*d+this.n44*f;return a},rotateAxis:function(a){var c=a.x,b=a.y,d=a.z;a.x=c*this.n11+b*this.n12+d*this.n13;a.y=c*this.n21+b*this.n22+d*this.n23;a.z=c*this.n31+b*this.n32+d*this.n33;a.normalize();
- return a},crossVector:function(a){var c=new THREE.Vector4;c.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;c.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;c.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;c.w=a.w?this.n41*a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return c},multiply:function(a,c){var b=a.n11,d=a.n12,f=a.n13,g=a.n14,j=a.n21,k=a.n22,m=a.n23,o=a.n24,n=a.n31,x=a.n32,z=a.n33,y=a.n34,B=a.n41,F=a.n42,G=a.n43,I=a.n44,R=c.n11,D=c.n12,M=c.n13,L=c.n14,N=c.n21,ma=c.n22,
- e=c.n23,la=c.n24,V=c.n31,$=c.n32,X=c.n33,sa=c.n34;this.n11=b*R+d*N+f*V;this.n12=b*D+d*ma+f*$;this.n13=b*M+d*e+f*X;this.n14=b*L+d*la+f*sa+g;this.n21=j*R+k*N+m*V;this.n22=j*D+k*ma+m*$;this.n23=j*M+k*e+m*X;this.n24=j*L+k*la+m*sa+o;this.n31=n*R+x*N+z*V;this.n32=n*D+x*ma+z*$;this.n33=n*M+x*e+z*X;this.n34=n*L+x*la+z*sa+y;this.n41=B*R+F*N+G*V;this.n42=B*D+F*ma+G*$;this.n43=B*M+F*e+G*X;this.n44=B*L+F*la+G*sa+I;return this},multiplyToArray:function(a,c,b){this.multiply(a,c);b[0]=this.n11;b[1]=this.n21;b[2]=
- this.n31;b[3]=this.n41;b[4]=this.n12;b[5]=this.n22;b[6]=this.n32;b[7]=this.n42;b[8]=this.n13;b[9]=this.n23;b[10]=this.n33;b[11]=this.n43;b[12]=this.n14;b[13]=this.n24;b[14]=this.n34;b[15]=this.n44;return this},multiplySelf:function(a){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},
- determinant:function(){var a=this.n11,c=this.n12,b=this.n13,d=this.n14,f=this.n21,g=this.n22,j=this.n23,k=this.n24,m=this.n31,o=this.n32,n=this.n33,x=this.n34,z=this.n41,y=this.n42,B=this.n43,F=this.n44;return d*j*o*z-b*k*o*z-d*g*n*z+c*k*n*z+b*g*x*z-c*j*x*z-d*j*m*y+b*k*m*y+d*f*n*y-a*k*n*y-b*f*x*y+a*j*x*y+d*g*m*B-c*k*m*B-d*f*o*B+a*k*o*B+c*f*x*B-a*g*x*B-b*g*m*F+c*j*m*F+b*f*o*F-a*j*o*F-c*f*n*F+a*g*n*F},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;this.n31=this.n13;this.n13=
- a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=this.n11;
- this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;
- a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,c){a[c]=this.n11;a[c+1]=this.n21;a[c+2]=this.n31;a[c+3]=this.n41;a[c+4]=this.n12;a[c+5]=this.n22;a[c+6]=this.n32;a[c+7]=this.n42;a[c+8]=this.n13;a[c+9]=this.n23;a[c+10]=this.n33;a[c+11]=this.n43;a[c+12]=this.n14;a[c+13]=this.n24;a[c+14]=this.n34;a[c+15]=this.n44;return a},setTranslation:function(a,c,b){this.set(1,0,0,a,0,1,0,c,0,0,1,b,0,0,0,1);return this},
- setScale:function(a,c,b){this.set(a,0,0,0,0,c,0,0,0,0,b,0,0,0,0,1);return this},setRotationX:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,c,-a,0,0,a,c,0,0,0,0,1);return this},setRotationY:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,0,a,0,0,1,0,0,-a,0,c,0,0,0,0,1);return this},setRotationZ:function(a){var c=Math.cos(a);a=Math.sin(a);this.set(c,-a,0,0,a,c,0,0,0,0,1,0,0,0,0,1);return this},setRotationAxis:function(a,c){var b=Math.cos(c),d=Math.sin(c),f=1-b,g=a.x,j=a.y,k=
- a.z,m=f*g,o=f*j;this.set(m*g+b,m*j-d*k,m*k+d*j,0,m*j+d*k,o*j+b,o*k-d*g,0,m*k-d*j,o*k+d*g,f*k*k+b,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},setRotationFromEuler:function(a){var c=a.x,b=a.y,d=a.z;a=Math.cos(c);c=Math.sin(c);var f=Math.cos(b);b=Math.sin(b);var g=Math.cos(d);d=Math.sin(d);var j=a*b,k=c*b;this.n11=f*g;this.n12=-f*d;this.n13=b;this.n21=k*g+a*d;this.n22=-k*d+a*g;this.n23=-c*f;this.n31=-j*g+c*d;this.n32=j*d+c*g;this.n33=a*f;return this},
- setRotationFromQuaternion:function(a){var c=a.x,b=a.y,d=a.z,f=a.w,g=c+c,j=b+b,k=d+d;a=c*g;var m=c*j;c*=k;var o=b*j;b*=k;d*=k;g*=f;j*=f;f*=k;this.n11=1-(o+d);this.n12=m-f;this.n13=c+j;this.n21=m+f;this.n22=1-(a+d);this.n23=b-g;this.n31=c-j;this.n32=b+g;this.n33=1-(a+o);return this},scale:function(a){var c=a.x,b=a.y;a=a.z;this.n11*=c;this.n12*=b;this.n13*=a;this.n21*=c;this.n22*=b;this.n23*=a;this.n31*=c;this.n32*=b;this.n33*=a;this.n41*=c;this.n42*=b;this.n43*=a;return this},extractPosition:function(a){this.n14=
- a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,c){var b=1/c.x,d=1/c.y,f=1/c.z;this.n11=a.n11*b;this.n21=a.n21*b;this.n31=a.n31*b;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*f;this.n23=a.n23*f;this.n33=a.n33*f}};
- THREE.Matrix4.makeInvert=function(a,c){var b=a.n11,d=a.n12,f=a.n13,g=a.n14,j=a.n21,k=a.n22,m=a.n23,o=a.n24,n=a.n31,x=a.n32,z=a.n33,y=a.n34,B=a.n41,F=a.n42,G=a.n43,I=a.n44;c===undefined&&(c=new THREE.Matrix4);c.n11=m*y*F-o*z*F+o*x*G-k*y*G-m*x*I+k*z*I;c.n12=g*z*F-f*y*F-g*x*G+d*y*G+f*x*I-d*z*I;c.n13=f*o*F-g*m*F+g*k*G-d*o*G-f*k*I+d*m*I;c.n14=g*m*x-f*o*x-g*k*z+d*o*z+f*k*y-d*m*y;c.n21=o*z*B-m*y*B-o*n*G+j*y*G+m*n*I-j*z*I;c.n22=f*y*B-g*z*B+g*n*G-b*y*G-f*n*I+b*z*I;c.n23=g*m*B-f*o*B-g*j*G+b*o*G+f*j*I-b*m*I;
- c.n24=f*o*n-g*m*n+g*j*z-b*o*z-f*j*y+b*m*y;c.n31=k*y*B-o*x*B+o*n*F-j*y*F-k*n*I+j*x*I;c.n32=g*x*B-d*y*B-g*n*F+b*y*F+d*n*I-b*x*I;c.n33=f*o*B-g*k*B+g*j*F-b*o*F-d*j*I+b*k*I;c.n34=g*k*n-d*o*n-g*j*x+b*o*x+d*j*y-b*k*y;c.n41=m*x*B-k*z*B-m*n*F+j*z*F+k*n*G-j*x*G;c.n42=d*z*B-f*x*B+f*n*F-b*z*F-d*n*G+b*x*G;c.n43=f*k*B-d*m*B-f*j*F+b*m*F+d*j*G-b*k*G;c.n44=d*m*n-f*k*n+f*j*x-b*m*x-d*j*z+b*k*z;c.multiplyScalar(1/a.determinant());return c};
- THREE.Matrix4.makeInvert3x3=function(a){var c=a.m33,b=c.m,d=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,j=-a.n33*a.n12+a.n32*a.n13,k=a.n33*a.n11-a.n31*a.n13,m=-a.n32*a.n11+a.n31*a.n12,o=a.n23*a.n12-a.n22*a.n13,n=-a.n23*a.n11+a.n21*a.n13,x=a.n22*a.n11-a.n21*a.n12;a=a.n11*d+a.n21*j+a.n31*o;if(a==0)throw"matrix not invertible";a=1/a;b[0]=a*d;b[1]=a*f;b[2]=a*g;b[3]=a*j;b[4]=a*k;b[5]=a*m;b[6]=a*o;b[7]=a*n;b[8]=a*x;return c};
- THREE.Matrix4.makeFrustum=function(a,c,b,d,f,g){var j;j=new THREE.Matrix4;j.n11=2*f/(c-a);j.n12=0;j.n13=(c+a)/(c-a);j.n14=0;j.n21=0;j.n22=2*f/(d-b);j.n23=(d+b)/(d-b);j.n24=0;j.n31=0;j.n32=0;j.n33=-(g+f)/(g-f);j.n34=-2*g*f/(g-f);j.n41=0;j.n42=0;j.n43=-1;j.n44=0;return j};THREE.Matrix4.makePerspective=function(a,c,b,d){var f;a=b*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*c,a*c,f,a,b,d)};
- THREE.Matrix4.makeOrtho=function(a,c,b,d,f,g){var j,k,m,o;j=new THREE.Matrix4;k=c-a;m=b-d;o=g-f;j.n11=2/k;j.n12=0;j.n13=0;j.n14=-((c+a)/k);j.n21=0;j.n22=2/m;j.n23=0;j.n24=-((b+d)/m);j.n31=0;j.n32=0;j.n33=-2/o;j.n34=-((g+f)/o);j.n41=0;j.n42=0;j.n43=0;j.n44=1;return j};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;
- THREE.Object3D=function(){this.parent=undefined;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=
- !0;this._vector=new THREE.Vector3};
- THREE.Object3D.prototype={translate:function(a,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===-1){a.parent!==
- undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var c=this;c instanceof THREE.Scene===!1&&c!==undefined;)c=c.parent;c!==undefined&&c.addChildRecurse(a)}},removeChild:function(a){var c=this.children.indexOf(a);if(c!==-1){a.parent=undefined;this.children.splice(c,1)}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation);if(this.scale.x!==1||this.scale.y!==
- 1||this.scale.z!==1){this.matrix.scale(this.scale);this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z))}this.matrixWorldNeedsUpdate=!0},update:function(a,c,b){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||c){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale);this.matrixWorldNeedsUpdate=!1;c=!0}a=0;for(var d=this.children.length;a<d;a++)this.children[a].update(this.matrixWorld,
- c,b)}};THREE.Quaternion=function(a,c,b,d){this.set(a||0,c||0,b||0,d!==undefined?d:1)};
- THREE.Quaternion.prototype={set:function(a,c,b,d){this.x=a;this.y=c;this.z=b;this.w=d;return this},setFromEuler:function(a){var c=0.5*Math.PI/360,b=a.x*c,d=a.y*c,f=a.z*c;a=Math.cos(d);d=Math.sin(d);c=Math.cos(-f);f=Math.sin(-f);var g=Math.cos(b);b=Math.sin(b);var j=a*c,k=d*f;this.w=j*g-k*b;this.x=j*b+k*g;this.y=d*c*g+a*f*b;this.z=a*f*g-d*c*b;return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=
- -1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a==0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x*=a;this.y*=a;this.z*=a;this.w*=a}return this},multiplySelf:function(a){var c=this.x,b=this.y,d=this.z,f=this.w,g=a.x,j=a.y,k=a.z;a=a.w;this.x=c*a+f*g+b*k-d*j;this.y=b*a+f*j+d*g-c*k;this.z=d*a+f*k+c*j-b*g;this.w=f*a-c*g-b*j-d*k;return this},
- multiplyVector3:function(a,c){c||(c=a);var b=a.x,d=a.y,f=a.z,g=this.x,j=this.y,k=this.z,m=this.w,o=m*b+j*f-k*d,n=m*d+k*b-g*f,x=m*f+g*d-j*b;b=-g*b-j*d-k*f;c.x=o*m+b*-g+n*-k-x*-j;c.y=n*m+b*-j+x*-g-o*-k;c.z=x*m+b*-k+o*-j-n*-g;return c}};
- THREE.Quaternion.slerp=function(a,c,b,d){var f=a.w*c.w+a.x*c.x+a.y*c.y+a.z*c.z;if(Math.abs(f)>=1){b.w=a.w;b.x=a.x;b.y=a.y;b.z=a.z;return b}var g=Math.acos(f),j=Math.sqrt(1-f*f);if(Math.abs(j)<0.0010){b.w=0.5*(a.w+c.w);b.x=0.5*(a.x+c.x);b.y=0.5*(a.y+c.y);b.z=0.5*(a.z+c.z);return b}f=Math.sin((1-d)*g)/j;d=Math.sin(d*g)/j;b.w=a.w*f+c.w*d;b.x=a.x*f+c.x*d;b.y=a.y*f+c.y*d;b.z=a.z*f+c.z*d;return b};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
- THREE.Face3=function(a,c,b,d,f,g){this.a=a;this.b=c;this.c=b;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materials=g instanceof Array?g:[g];this.centroid=new THREE.Vector3};
- THREE.Face4=function(a,c,b,d,f,g,j){this.a=a;this.b=c;this.c=b;this.d=d;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materials=j instanceof Array?j:[j];this.centroid=new THREE.Vector3};THREE.UV=function(a,c){this.set(a||0,c||0)};
- THREE.UV.prototype={set:function(a,c){this.u=a;this.v=c;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
- THREE.Geometry.prototype={computeCentroids:function(){var a,c,b;a=0;for(c=this.faces.length;a<c;a++){b=this.faces[a];b.centroid.set(0,0,0);if(b instanceof THREE.Face3){b.centroid.addSelf(this.vertices[b.a].position);b.centroid.addSelf(this.vertices[b.b].position);b.centroid.addSelf(this.vertices[b.c].position);b.centroid.divideScalar(3)}else if(b instanceof THREE.Face4){b.centroid.addSelf(this.vertices[b.a].position);b.centroid.addSelf(this.vertices[b.b].position);b.centroid.addSelf(this.vertices[b.c].position);
- b.centroid.addSelf(this.vertices[b.d].position);b.centroid.divideScalar(4)}}},computeFaceNormals:function(a){var c,b,d,f,g,j,k=new THREE.Vector3,m=new THREE.Vector3;d=0;for(f=this.faces.length;d<f;d++){g=this.faces[d];if(a&&g.vertexNormals.length){k.set(0,0,0);c=0;for(b=g.vertexNormals.length;c<b;c++)k.addSelf(g.vertexNormals[c]);k.divideScalar(3)}else{c=this.vertices[g.a];b=this.vertices[g.b];j=this.vertices[g.c];k.sub(j.position,b.position);m.sub(c.position,b.position);k.crossSelf(m)}k.isZero()||
- k.normalize();g.normal.copy(k)}},computeVertexNormals:function(){var a,c,b,d;if(this.__tmpVertices==undefined){d=this.__tmpVertices=Array(this.vertices.length);a=0;for(c=this.vertices.length;a<c;a++)d[a]=new THREE.Vector3;a=0;for(c=this.faces.length;a<c;a++){b=this.faces[a];if(b instanceof THREE.Face3)b.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(b instanceof THREE.Face4)b.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}}else{d=
- this.__tmpVertices;a=0;for(c=this.vertices.length;a<c;a++)d[a].set(0,0,0)}a=0;for(c=this.faces.length;a<c;a++){b=this.faces[a];if(b instanceof THREE.Face3){d[b.a].addSelf(b.normal);d[b.b].addSelf(b.normal);d[b.c].addSelf(b.normal)}else if(b instanceof THREE.Face4){d[b.a].addSelf(b.normal);d[b.b].addSelf(b.normal);d[b.c].addSelf(b.normal);d[b.d].addSelf(b.normal)}}a=0;for(c=this.vertices.length;a<c;a++)d[a].normalize();a=0;for(c=this.faces.length;a<c;a++){b=this.faces[a];if(b instanceof THREE.Face3){b.vertexNormals[0].copy(d[b.a]);
- b.vertexNormals[1].copy(d[b.b]);b.vertexNormals[2].copy(d[b.c])}else if(b instanceof THREE.Face4){b.vertexNormals[0].copy(d[b.a]);b.vertexNormals[1].copy(d[b.b]);b.vertexNormals[2].copy(d[b.c]);b.vertexNormals[3].copy(d[b.d])}}},computeTangents:function(){function a(T,fa,qa,Z,S,da,ua){k=T.vertices[fa].position;m=T.vertices[qa].position;o=T.vertices[Z].position;n=j[S];x=j[da];z=j[ua];y=m.x-k.x;B=o.x-k.x;F=m.y-k.y;G=o.y-k.y;I=m.z-k.z;R=o.z-k.z;D=x.u-n.u;M=z.u-n.u;L=x.v-n.v;N=z.v-n.v;ma=1/(D*N-M*L);
- $.set((N*y-L*B)*ma,(N*F-L*G)*ma,(N*I-L*R)*ma);X.set((D*B-M*y)*ma,(D*G-M*F)*ma,(D*R-M*I)*ma);la[fa].addSelf($);la[qa].addSelf($);la[Z].addSelf($);V[fa].addSelf(X);V[qa].addSelf(X);V[Z].addSelf(X)}var c,b,d,f,g,j,k,m,o,n,x,z,y,B,F,G,I,R,D,M,L,N,ma,e,la=[],V=[],$=new THREE.Vector3,X=new THREE.Vector3,sa=new THREE.Vector3,va=new THREE.Vector3,wa=new THREE.Vector3;c=0;for(b=this.vertices.length;c<b;c++){la[c]=new THREE.Vector3;V[c]=new THREE.Vector3}c=0;for(b=this.faces.length;c<b;c++){g=this.faces[c];
- j=this.faceVertexUvs[0][c];if(g instanceof THREE.Face3)a(this,g.a,g.b,g.c,0,1,2);else if(g instanceof THREE.Face4){a(this,g.a,g.b,g.c,0,1,2);a(this,g.a,g.b,g.d,0,1,3)}}var ia=["a","b","c","d"];c=0;for(b=this.faces.length;c<b;c++){g=this.faces[c];for(d=0;d<g.vertexNormals.length;d++){wa.copy(g.vertexNormals[d]);f=g[ia[d]];e=la[f];sa.copy(e);sa.subSelf(wa.multiplyScalar(wa.dot(e))).normalize();va.cross(g.vertexNormals[d],e);f=va.dot(V[f]);f=f<0?-1:1;g.vertexTangents[d]=new THREE.Vector4(sa.x,sa.y,sa.z,
- f)}}this.hasTangents=!0},computeBoundingBox:function(){var a;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var c=1,b=this.vertices.length;c<b;c++){a=this.vertices[c];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;
- if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,c=0,b=this.vertices.length;c<b;c++)a=Math.max(a,this.vertices[c].position.length());this.boundingSphere=
- {radius:a}}};THREE.GeometryIdCounter=0;
- THREE.Spline=function(a){function c(y,B,F,G,I,R,D){y=(F-y)*0.5;G=(G-B)*0.5;return(2*(B-F)+y+G)*D+(-3*(B-F)-2*y-G)*R+y*I+B}this.points=a;var b=[],d={x:0,y:0,z:0},f,g,j,k,m,o,n,x,z;this.initFromArray=function(y){this.points=[];for(var B=0;B<y.length;B++)this.points[B]={x:y[B][0],y:y[B][1],z:y[B][2]}};this.getPoint=function(y){f=(this.points.length-1)*y;g=Math.floor(f);j=f-g;b[0]=g==0?g:g-1;b[1]=g;b[2]=g>this.points.length-2?g:g+1;b[3]=g>this.points.length-3?g:g+2;o=this.points[b[0]];n=this.points[b[1]];
- x=this.points[b[2]];z=this.points[b[3]];k=j*j;m=j*k;d.x=c(o.x,n.x,x.x,z.x,j,k,m);d.y=c(o.y,n.y,x.y,z.y,j,k,m);d.z=c(o.z,n.z,x.z,z.z,j,k,m);return d};this.getControlPointsArray=function(){var y,B,F=this.points.length,G=[];for(y=0;y<F;y++){B=this.points[y];G[y]=[B.x,B.y,B.z]}return G};this.getLength=function(y){var B,F,G=B=B=0,I=new THREE.Vector3,R=new THREE.Vector3,D=[],M=0;D[0]=0;y||(y=100);F=this.points.length*y;I.copy(this.points[0]);for(y=1;y<F;y++){B=y/F;position=this.getPoint(B);R.copy(position);
- M+=R.distanceTo(I);I.copy(position);B*=this.points.length-1;B=Math.floor(B);if(B!=G){D[B]=M;G=B}}D[D.length]=M;return{chunks:D,total:M}};this.reparametrizeByArcLength=function(y){var B,F,G,I,R,D,M=[],L=new THREE.Vector3,N=this.getLength();M.push(L.copy(this.points[0]).clone());for(B=1;B<this.points.length;B++){F=N.chunks[B]-N.chunks[B-1];D=Math.ceil(y*F/N.total);I=(B-1)/(this.points.length-1);R=B/(this.points.length-1);for(F=1;F<D-1;F++){G=I+F*(1/D)*(R-I);position=this.getPoint(G);M.push(L.copy(position).clone())}M.push(L.copy(this.points[B]).clone())}this.points=
- M}};
- THREE.AnimationHandler=function(){var a=[],c={},b={};b.update=function(f){for(var g=0;g<a.length;g++)a[g].update(f)};b.addToUpdate=function(f){a.indexOf(f)===-1&&a.push(f)};b.removeFromUpdate=function(f){f=a.indexOf(f);f!==-1&&a.splice(f,1)};b.add=function(f){c[f.name]!==undefined&&console.log("THREE.AnimationHandler.add: Warning! "+f.name+" already exists in library. Overwriting.");c[f.name]=f;if(f.initialized!==!0){for(var g=0;g<f.hierarchy.length;g++){for(var j=0;j<f.hierarchy[g].keys.length;j++){if(f.hierarchy[g].keys[j].time<0)f.hierarchy[g].keys[j].time=
- 0;if(f.hierarchy[g].keys[j].rot!==undefined&&!(f.hierarchy[g].keys[j].rot instanceof THREE.Quaternion)){var k=f.hierarchy[g].keys[j].rot;f.hierarchy[g].keys[j].rot=new THREE.Quaternion(k[0],k[1],k[2],k[3])}}if(f.hierarchy[g].keys[0].morphTargets!==undefined){k={};for(j=0;j<f.hierarchy[g].keys.length;j++)for(var m=0;m<f.hierarchy[g].keys[j].morphTargets.length;m++){var o=f.hierarchy[g].keys[j].morphTargets[m];k[o]=-1}f.hierarchy[g].usedMorphTargets=k;for(j=0;j<f.hierarchy[g].keys.length;j++){var n=
- {};for(o in k){for(m=0;m<f.hierarchy[g].keys[j].morphTargets.length;m++)if(f.hierarchy[g].keys[j].morphTargets[m]===o){n[o]=f.hierarchy[g].keys[j].morphTargetsInfluences[m];break}m===f.hierarchy[g].keys[j].morphTargets.length&&(n[o]=0)}f.hierarchy[g].keys[j].morphTargetsInfluences=n}}for(j=1;j<f.hierarchy[g].keys.length;j++)if(f.hierarchy[g].keys[j].time===f.hierarchy[g].keys[j-1].time){f.hierarchy[g].keys.splice(j,1);j--}for(j=1;j<f.hierarchy[g].keys.length;j++)f.hierarchy[g].keys[j].index=j}j=parseInt(f.length*
- f.fps,10);f.JIT={};f.JIT.hierarchy=[];for(g=0;g<f.hierarchy.length;g++)f.JIT.hierarchy.push(Array(j));f.initialized=!0}};b.get=function(f){if(typeof f==="string")if(c[f])return c[f];else{console.log("THREE.AnimationHandler.get: Couldn't find animation "+f);return null}};b.parse=function(f){var g=[];if(f instanceof THREE.SkinnedMesh)for(var j=0;j<f.bones.length;j++)g.push(f.bones[j]);else d(f,g);return g};var d=function(f,g){g.push(f);for(var j=0;j<f.children.length;j++)d(f.children[j],g)};b.LINEAR=
- 0;b.CATMULLROM=1;b.CATMULLROM_FORWARD=2;return b}();THREE.Animation=function(a,c,b,d){this.root=a;this.data=THREE.AnimationHandler.get(c);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.isPaused=!0;this.loop=!0;this.interpolationType=b!==undefined?b:THREE.AnimationHandler.LINEAR;this.JITCompile=d!==undefined?d:!0;this.points=[];this.target=new THREE.Vector3};
- THREE.Animation.prototype.play=function(a,c){if(!this.isPlaying){this.isPlaying=!0;this.loop=a!==undefined?a:!0;this.currentTime=c!==undefined?c:0;var b,d=this.hierarchy.length,f;for(b=0;b<d;b++){f=this.hierarchy[b];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)f.useQuaternion=!0;f.matrixAutoUpdate=!0;if(f.animationCache===undefined){f.animationCache={};f.animationCache.prevKey={pos:0,rot:0,scl:0};f.animationCache.nextKey={pos:0,rot:0,scl:0};f.animationCache.originalMatrix=
- f instanceof THREE.Bone?f.skinMatrix:f.matrix}var g=f.animationCache.prevKey;f=f.animationCache.nextKey;g.pos=this.data.hierarchy[b].keys[0];g.rot=this.data.hierarchy[b].keys[0];g.scl=this.data.hierarchy[b].keys[0];f.pos=this.getNextKeyWith("pos",b,1);f.rot=this.getNextKeyWith("rot",b,1);f.scl=this.getNextKeyWith("scl",b,1)}this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};
- THREE.Animation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
- THREE.Animation.prototype.stop=function(){this.isPlaying=!1;this.isPaused=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var a=0;a<this.hierarchy.length;a++)if(this.hierarchy[a].animationCache!==undefined){if(this.hierarchy[a]instanceof THREE.Bone)this.hierarchy[a].skinMatrix=this.hierarchy[a].animationCache.originalMatrix;else this.hierarchy[a].matrix=this.hierarchy[a].animationCache.originalMatrix;delete this.hierarchy[a].animationCache}};
- THREE.Animation.prototype.update=function(a){if(this.isPlaying){var c=["pos","rot","scl"],b,d,f,g,j,k,m,o,n=this.data.JIT.hierarchy,x,z;this.currentTime+=a*this.timeScale;z=this.currentTime;x=this.currentTime%=this.data.length;o=parseInt(Math.min(x*this.data.fps,this.data.length*this.data.fps),10);for(var y=0,B=this.hierarchy.length;y<B;y++){a=this.hierarchy[y];m=a.animationCache;if(this.JITCompile&&n[y][o]!==undefined)if(a instanceof THREE.Bone){a.skinMatrix=n[y][o];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=
- !1}else{a.matrix=n[y][o];a.matrixAutoUpdate=!1;a.matrixWorldNeedsUpdate=!0}else{if(this.JITCompile)if(a instanceof THREE.Bone)a.skinMatrix=a.animationCache.originalMatrix;else a.matrix=a.animationCache.originalMatrix;for(var F=0;F<3;F++){b=c[F];j=m.prevKey[b];k=m.nextKey[b];if(k.time<=z){if(x<z)if(this.loop){j=this.data.hierarchy[y].keys[0];for(k=this.getNextKeyWith(b,y,1);k.time<x;){j=k;k=this.getNextKeyWith(b,y,k.index+1)}}else{this.stop();return}else{do{j=k;k=this.getNextKeyWith(b,y,k.index+1)}while(k.time<
- x)}m.prevKey[b]=j;m.nextKey[b]=k}a.matrixAutoUpdate=!0;a.matrixWorldNeedsUpdate=!0;d=(x-j.time)/(k.time-j.time);f=j[b];g=k[b];if(d<0||d>1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+y);d=d<0?0:1}if(b==="pos"){b=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){b.x=f[0]+(g[0]-f[0])*d;b.y=f[1]+(g[1]-f[1])*d;b.z=f[2]+(g[2]-f[2])*d}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=
- this.getPrevKeyWith("pos",y,j.index-1).pos;this.points[1]=f;this.points[2]=g;this.points[3]=this.getNextKeyWith("pos",y,k.index+1).pos;d=d*0.33+0.33;f=this.interpolateCatmullRom(this.points,d);b.x=f[0];b.y=f[1];b.z=f[2];if(this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){d=this.interpolateCatmullRom(this.points,d*1.01);this.target.set(d[0],d[1],d[2]);this.target.subSelf(b);this.target.y=0;this.target.normalize();d=Math.atan2(this.target.x,this.target.z);a.rotation.set(0,d,0)}}}else if(b===
- "rot")THREE.Quaternion.slerp(f,g,a.quaternion,d);else if(b==="scl"){b=a.scale;b.x=f[0]+(g[0]-f[0])*d;b.y=f[1]+(g[1]-f[1])*d;b.z=f[2]+(g[2]-f[2])*d}}}}if(this.JITCompile&&n[0][o]===undefined){this.hierarchy[0].update(undefined,!0);for(y=0;y<this.hierarchy.length;y++)n[y][o]=this.hierarchy[y]instanceof THREE.Bone?this.hierarchy[y].skinMatrix.clone():this.hierarchy[y].matrix.clone()}}};
- THREE.Animation.prototype.interpolateCatmullRom=function(a,c){var b=[],d=[],f,g,j,k,m,o;f=(a.length-1)*c;g=Math.floor(f);f-=g;b[0]=g==0?g:g-1;b[1]=g;b[2]=g>a.length-2?g:g+1;b[3]=g>a.length-3?g:g+2;g=a[b[0]];k=a[b[1]];m=a[b[2]];o=a[b[3]];b=f*f;j=f*b;d[0]=this.interpolate(g[0],k[0],m[0],o[0],f,b,j);d[1]=this.interpolate(g[1],k[1],m[1],o[1],f,b,j);d[2]=this.interpolate(g[2],k[2],m[2],o[2],f,b,j);return d};
- THREE.Animation.prototype.interpolate=function(a,c,b,d,f,g,j){a=(b-a)*0.5;d=(d-c)*0.5;return(2*(c-b)+a+d)*j+(-3*(c-b)-2*a-d)*g+a*f+c};THREE.Animation.prototype.getNextKeyWith=function(a,c,b){var d=this.data.hierarchy[c].keys;if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)b=b<d.length-1?b:d.length-1;else b%=d.length;for(;b<d.length;b++)if(d[b][a]!==undefined)return d[b];return this.data.hierarchy[c].keys[0]};
- THREE.Animation.prototype.getPrevKeyWith=function(a,c,b){var d=this.data.hierarchy[c].keys;for(b=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?b>0?b:0:b>=0?b:b+d.length;b>=0;b--)if(d[b][a]!==undefined)return d[b];return this.data.hierarchy[c].keys[d.length-1]};
- THREE.Camera=function(a,c,b,d,f){THREE.Object3D.call(this);this.fov=a||50;this.aspect=c||1;this.near=b||0.1;this.far=d||2E3;this.target=f||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;
- THREE.Camera.prototype.translate=function(a,c){this.matrix.rotateAxis(c);this.position.addSelf(c.multiplyScalar(a));this.target.position.addSelf(c.multiplyScalar(a))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Camera.prototype.updateMatrix=function(){this.update(undefined,!0)};
- THREE.Camera.prototype.update=function(a,c,b){if(this.useTarget){this.matrix.lookAt(this.position,this.target.position,this.up);this.matrix.setPosition(this.position);a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);c=!0}else{this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=
- !1;c=!0;THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse)}}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,c,b)};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;
- THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;THREE.DirectionalLight=function(a,c,b){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1;this.distance=b||0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,c,b){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=c||1;this.distance=b||0};THREE.PointLight.prototype=new THREE.Light;
- THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.MaterialCounter={value:0};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
- THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};
- THREE.LineBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;this.depthTest=!0;this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.linewidth!==undefined)this.linewidth=
- a.linewidth;if(a.linecap!==undefined)this.linecap=a.linecap;if(a.linejoin!==undefined)this.linejoin=a.linejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors}};
- THREE.MeshBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;this.morphTargets=!1;
- if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.lightMap!==undefined)this.lightMap=a.lightMap;if(a.envMap!==undefined)this.envMap=a.envMap;if(a.combine!==undefined)this.combine=a.combine;if(a.reflectivity!==undefined)this.reflectivity=a.reflectivity;if(a.refractionRatio!==undefined)this.refractionRatio=a.refractionRatio;if(a.fog!==undefined)this.fog=a.fog;if(a.shading!==undefined)this.shading=a.shading;
- if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==undefined)this.wireframeLinewidth=a.wireframeLinewidth;if(a.wireframeLinecap!==undefined)this.wireframeLinecap=a.wireframeLinecap;if(a.wireframeLinejoin!==undefined)this.wireframeLinejoin=a.wireframeLinejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors;if(a.skinning!==undefined)this.skinning=a.skinning;
- if(a.morphTargets!==undefined)this.morphTargets=a.morphTargets}};
- THREE.MeshLambertMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;this.morphTargets=
- !1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.lightMap!==undefined)this.lightMap=a.lightMap;if(a.envMap!==undefined)this.envMap=a.envMap;if(a.combine!==undefined)this.combine=a.combine;if(a.reflectivity!==undefined)this.reflectivity=a.reflectivity;if(a.refractionRatio!==undefined)this.refractionRatio=a.refractionRatio;if(a.fog!==undefined)this.fog=a.fog;if(a.shading!==undefined)this.shading=a.shading;
- if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==undefined)this.wireframeLinewidth=a.wireframeLinewidth;if(a.wireframeLinecap!==undefined)this.wireframeLinecap=a.wireframeLinecap;if(a.wireframeLinejoin!==undefined)this.wireframeLinejoin=a.wireframeLinejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors;if(a.skinning!==undefined)this.skinning=a.skinning;
- if(a.morphTargets!==undefined)this.morphTargets=a.morphTargets}};
- THREE.MeshPhongMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(328965);this.specular=new THREE.Color(1118481);this.shininess=30;this.opacity=1;this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=
- this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;this.morphTargets=!1;if(a){if(a.color!==undefined)this.color=new THREE.Color(a.color);if(a.ambient!==undefined)this.ambient=new THREE.Color(a.ambient);if(a.specular!==undefined)this.specular=new THREE.Color(a.specular);if(a.shininess!==undefined)this.shininess=a.shininess;if(a.opacity!==undefined)this.opacity=a.opacity;if(a.lightMap!==undefined)this.lightMap=a.lightMap;if(a.map!==undefined)this.map=a.map;if(a.envMap!==undefined)this.envMap=
- a.envMap;if(a.combine!==undefined)this.combine=a.combine;if(a.reflectivity!==undefined)this.reflectivity=a.reflectivity;if(a.refractionRatio!==undefined)this.refractionRatio=a.refractionRatio;if(a.fog!==undefined)this.fog=a.fog;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==undefined)this.wireframeLinewidth=a.wireframeLinewidth;
- if(a.wireframeLinecap!==undefined)this.wireframeLinecap=a.wireframeLinecap;if(a.wireframeLinejoin!==undefined)this.wireframeLinejoin=a.wireframeLinejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors;if(a.skinning!==undefined)this.skinning=a.skinning;if(a.morphTargets!==undefined)this.morphTargets=a.morphTargets}};
- THREE.MeshDepthMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.opacity=1;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;if(a){if(a.opacity!==undefined)this.opacity=a.opacity;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==
- undefined)this.wireframeLinewidth=a.wireframeLinewidth}};
- THREE.MeshNormalMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.opacity=1;this.shading=THREE.FlatShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;if(a){if(a.opacity!==undefined)this.opacity=a.opacity;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==
- undefined)this.wireframeLinewidth=a.wireframeLinewidth}};THREE.MeshFaceMaterial=function(){};
- THREE.MeshShaderMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.vertexShader=this.fragmentShader="void main() {}";this.uniforms={};this.opacity=1;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.lights=!1;this.vertexColors=!1;this.skinning=!1;this.morphTargets=!1;if(a){if(a.fragmentShader!==undefined)this.fragmentShader=a.fragmentShader;if(a.vertexShader!==
- undefined)this.vertexShader=a.vertexShader;if(a.uniforms!==undefined)this.uniforms=a.uniforms;if(a.opacity!==undefined)this.opacity=a.opacity;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==undefined)this.wireframeLinewidth=a.wireframeLinewidth;if(a.wireframeLinecap!==undefined)this.wireframeLinecap=a.wireframeLinecap;
- if(a.wireframeLinejoin!==undefined)this.wireframeLinejoin=a.wireframeLinejoin;if(a.lights!==undefined)this.lights=a.lights;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors;if(a.skinning!==undefined)this.skinning=a.skinning;if(a.morphTargets!==undefined)this.morphTargets=a.morphTargets}};
- THREE.ShadowVolumeDynamicMaterial=function(){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.FlatShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;this.morphTargets=
- !1};
- THREE.ParticleBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.map=null;this.size=1;this.sizeAttenuation=!0;this.blending=THREE.NormalBlending;this.depthTest=!0;this.offset=new THREE.Vector2;this.vertexColors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.size!==undefined)this.size=a.size;if(a.sizeAttenuation!==undefined)this.sizeAttenuation=a.sizeAttenuation;
- if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors}};
- THREE.ParticleCanvasMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.program=function(){};this.opacity=1;this.blending=THREE.NormalBlending;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.program!==undefined)this.program=a.program;if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending}};THREE.ParticleDOMMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.domElement=a};
- THREE.Texture=function(a,c,b,d,f,g){this.image=a;this.mapping=c!==undefined?c:new THREE.UVMapping;this.wrapS=b!==undefined?b:THREE.ClampToEdgeWrapping;this.wrapT=d!==undefined?d:THREE.ClampToEdgeWrapping;this.magFilter=f!==undefined?f:THREE.LinearFilter;this.minFilter=g!==undefined?g:THREE.LinearMipMapLinearFilter;this.needsUpdate=!1};THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter)}};
- THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;
- THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;
- THREE.RenderTarget=function(a,c,b){this.width=a;this.height=c;b=b||{};this.wrapS=b.wrapS!==undefined?b.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=b.wrapT!==undefined?b.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=b.magFilter!==undefined?b.magFilter:THREE.LinearFilter;this.minFilter=b.minFilter!==undefined?b.minFilter:THREE.LinearMipMapLinearFilter;this.format=b.format!==undefined?b.format:THREE.RGBFormat;this.type=b.type!==undefined?b.type:THREE.UnsignedByteType};
- var Uniforms={clone:function(a){var c,b,d,f={};for(c in a){f[c]={};for(b in a[c]){d=a[c][b];f[c][b]=d instanceof THREE.Color||d instanceof THREE.Vector3||d instanceof THREE.Texture?d.clone():d}}return f},merge:function(a){var c,b,d,f={};for(c=0;c<a.length;c++){d=this.clone(a[c]);for(b in d)f[b]=d[b]}return f}};THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a];this.matrixAutoUpdate=!1};THREE.Particle.prototype=new THREE.Object3D;
- THREE.Particle.prototype.constructor=THREE.Particle;THREE.ParticleSystem=function(a,c){THREE.Object3D.call(this);this.geometry=a;this.materials=c instanceof Array?c:[c];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(a,c,b){THREE.Object3D.call(this);this.geometry=a;this.materials=c instanceof Array?c:[c];this.type=b!=undefined?b:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;
- THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
- THREE.Mesh=function(a,c){THREE.Object3D.call(this);this.geometry=a;this.materials=c&&c.length?c:[c];this.flipSided=!1;this.doubleSided=!1;this.overdraw=!1;if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var b=0;b<this.geometry.morphTargets.length;b++){this.morphTargetInfluences.push(0);
- this.morphTargetDictionary[this.geometry.morphTargets[b].name]=b}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==undefined)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
- THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
- THREE.Bone.prototype.update=function(a,c,b){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;c=!0}var d,f=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(d=0;d<f;d++){a=this.children[d];a instanceof THREE.Bone?a.update(this.skinMatrix,c,b):a.update(this.matrixWorld,!0,b)}}else for(d=0;d<f;d++)this.children[d].update(this.skinMatrix,
- c,b)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};if(!window.Float32Array)window.Float32Array=Array;
- THREE.SkinnedMesh=function(a,c){THREE.Mesh.call(this,a,c);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var b,d,f,g,j,k;if(this.geometry.bones!==undefined){for(b=0;b<this.geometry.bones.length;b++){f=this.geometry.bones[b];g=f.pos;j=f.rotq;k=f.scl;d=this.addBone();d.name=f.name;d.position.set(g[0],g[1],g[2]);d.quaternion.set(j[0],j[1],j[2],j[3]);d.useQuaternion=!0;k!==undefined?d.scale.set(k[0],k[1],k[2]):d.scale.set(1,1,1)}for(b=0;b<this.bones.length;b++){f=this.geometry.bones[b];
- d=this.bones[b];f.parent===-1?this.addChild(d):this.bones[f.parent].addChild(d)}this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
- THREE.SkinnedMesh.prototype.update=function(a,c,b){if(this.visible){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;c=!0}var d,f=this.children.length;for(d=0;d<f;d++){a=this.children[d];a instanceof THREE.Bone?a.update(this.identityMatrix,!1,b):a.update(this.matrixWorld,c,b)}b=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(c=0;c<b;c++)ba[c].skinMatrix.flattenToArrayOffset(bm,
- c*16)}};THREE.SkinnedMesh.prototype.addBone=function(a){a===undefined&&(a=new THREE.Bone(this));this.bones.push(a);return a};
- THREE.SkinnedMesh.prototype.pose=function(){this.update(undefined,!0);for(var a,c=[],b=0;b<this.bones.length;b++){a=this.bones[b];c.push(THREE.Matrix4.makeInvert(a.skinMatrix));a.skinMatrix.flattenToArrayOffset(this.boneMatrices,b*16)}if(this.geometry.skinVerticesA===undefined){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var d;for(a=0;a<this.geometry.skinIndices.length;a++){b=this.geometry.vertices[a].position;var f=this.geometry.skinIndices[a].x,g=this.geometry.skinIndices[a].y;
- d=new THREE.Vector3(b.x,b.y,b.z);this.geometry.skinVerticesA.push(c[f].multiplyVector3(d));d=new THREE.Vector3(b.x,b.y,b.z);this.geometry.skinVerticesB.push(c[g].multiplyVector3(d));if(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1){b=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5;this.geometry.skinWeights[a].x+=b;this.geometry.skinWeights[a].y+=b}}}};
- THREE.Ribbon=function(a,c){THREE.Object3D.call(this);this.geometry=a;this.materials=c instanceof Array?c:[c];this.flipSided=!1;this.doubleSided=!1};THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;
- THREE.Sound=function(a,c,b,d){THREE.Object3D.call(this);this.isLoaded=!1;this.isAddedToDOM=!1;this.isPlaying=!1;this.duration=-1;this.radius=c!==undefined?Math.abs(c):100;this.volume=Math.min(1,Math.max(0,b!==undefined?b:1));this.domElement=document.createElement("audio");this.domElement.volume=0;this.domElement.pan=0;this.domElement.loop=d!==undefined?d:!0;this.sources=a instanceof Array?a:[a];var f;b=this.sources.length;for(a=0;a<b;a++){c=this.sources[a];c.toLowerCase();if(c.indexOf(".mp3")!==-1)f=
- "audio/mpeg";else if(c.indexOf(".ogg")!==-1)f="audio/ogg";else c.indexOf(".wav")!==-1&&(f="audio/wav");if(this.domElement.canPlayType(f)){f=document.createElement("source");f.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(f);this.domElement.addEventListener("canplay",this.onLoad,!0);this.domElement.load();break}}};THREE.Sound.prototype=new THREE.Object3D;THREE.Sound.prototype.constructor=THREE.Sound;THREE.Sound.prototype.supr=THREE.Object3D.prototype;
- THREE.Sound.prototype.onLoad=function(){var a=this.THREESound;if(!a.isLoaded){this.removeEventListener("canplay",this.onLoad,!0);a.isLoaded=!0;a.duration=this.duration;a.isPlaying&&a.play()}};THREE.Sound.prototype.addToDOM=function(a){this.isAddedToDOM=!0;a.appendChild(this.domElement)};THREE.Sound.prototype.play=function(a){this.isPlaying=!0;if(this.isLoaded){this.domElement.play();if(a)this.domElement.currentTime=a%this.duration}};THREE.Sound.prototype.pause=function(){this.isPlaying=!1;this.domElement.pause()};
- THREE.Sound.prototype.stop=function(){this.isPlaying=!1;this.domElement.pause();this.domElement.currentTime=0};THREE.Sound.prototype.calculateVolumeAndPan=function(a){a=a.length();this.domElement.volume=a<=this.radius?this.volume*(1-a/this.radius):0};
- THREE.Sound.prototype.update=function(a,c,b){if(this.matrixAutoUpdate){this.matrix.setPosition(this.position);c=!0}if(c||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;c=!0}var d=this.children.length;for(a=0;a<d;a++)this.children[a].update(this.matrixWorld,c,b)};THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;
- THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.add=function(a,c){c===undefined&&(c=0);c=Math.abs(c);for(var b=0;b<this.LODs.length;b++)if(c<this.LODs[b].visibleAtDistance)break;this.LODs.splice(b,0,{visibleAtDistance:c,object3D:a});this.addChild(a)};
- THREE.LOD.prototype.update=function(a,c,b){this.matrixAutoUpdate&&(c|=this.updateMatrix());if(c||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;c=!0}if(this.LODs.length>1){a=b.matrixWorldInverse;a=-(a.n31*this.position.x+a.n32*this.position.y+a.n33*this.position.z+a.n34);this.LODs[0].object3D.visible=!0;for(var d=1;d<this.LODs.length;d++)if(a>=this.LODs[d].visibleAtDistance){this.LODs[d-1].object3D.visible=
- !1;this.LODs[d].object3D.visible=!0}else break;for(;d<this.LODs.length;d++)this.LODs[d].object3D.visible=!1}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,c,b)};THREE.ShadowVolume=function(a,c){THREE.Mesh.call(this,a.geometry,c?[new THREE.ShadowVolumeDynamicMaterial]:[new THREE.ShadowVolumeDynamicMaterial]);a.addChild(this);this.calculateShadowVolumeGeometry(a.geometry)};THREE.ShadowVolume.prototype=new THREE.Mesh;THREE.ShadowVolume.prototype.constructor=THREE.ShadowVolume;
- THREE.ShadowVolume.prototype.supr=THREE.Mesh.prototype;
- THREE.ShadowVolume.prototype.calculateShadowVolumeGeometry=function(a){this.geometry=new THREE.Geometry;this.geometry.boundingSphere=a.boundingSphere;this.geometry.edgeFaces=[];var c=this.geometry.vertices,b=this.geometry.faces,d=this.geometry.edgeFaces,f=a.faces;a=a.vertices;var g=f.length,j,k,m,o,n,x=["a","b","c","d"];for(m=0;m<g;m++){k=c.length;j=f[m];if(j instanceof THREE.Face4){o=4;k=new THREE.Face4(k,k+1,k+2,k+3)}else{o=3;k=new THREE.Face3(k,k+1,k+2)}k.normal.copy(j.normal);b.push(k);for(k=
- 0;k<o;k++){n=a[j[x[k]]];c.push(new THREE.Vertex(n.position.clone()))}}for(g=0;g<f.length-1;g++){a=b[g];for(j=g+1;j<f.length;j++){k=b[j];k=this.facesShareEdge(c,a,k);if(k!==undefined){k=new THREE.Face4(k.indices[0],k.indices[3],k.indices[2],k.indices[1]);k.normal.set(1,0,0);d.push(k)}}}};
- THREE.ShadowVolume.prototype.facesShareEdge=function(a,c,b){var d,f,g,j,k,m,o,n,x,z,y,B,F,G=0,I=["a","b","c","d"];d=c instanceof THREE.Face4?4:3;f=b instanceof THREE.Face4?4:3;for(B=0;B<d;B++){g=c[I[B]];k=a[g];for(F=0;F<f;F++){j=b[I[F]];m=a[j];if(Math.abs(k.position.x-m.position.x)<1.0E-4&&Math.abs(k.position.y-m.position.y)<1.0E-4&&Math.abs(k.position.z-m.position.z)<1.0E-4){G++;if(G===1){o=k;n=m;x=g;z=j;y=I[B]}if(G===2){y+=I[B];return y==="ad"||y==="ac"?{faces:[c,b],vertices:[o,n,m,k],indices:[x,
- z,j,g],vertexTypes:[1,2,2,1],extrudable:!0}:{faces:[c,b],vertices:[o,k,m,n],indices:[x,g,j,z],vertexTypes:[1,1,2,2],extrudable:!0}}}}}};THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;
- THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1){this.objects.push(a);this.__objectsAdded.push(a)}for(var c=0;c<a.children.length;c++)this.addChildRecurse(a.children[c])};
- THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var c=this.lights.indexOf(a);c!==-1&&this.lights.splice(c,1)}else if(a instanceof THREE.Sound){c=this.sounds.indexOf(a);c!==-1&&this.sounds.splice(c,1)}else if(!(a instanceof THREE.Camera)){c=this.objects.indexOf(a);if(c!==-1){this.objects.splice(c,1);this.__objectsRemoved.push(a)}}for(c=0;c<a.children.length;c++)this.removeChildRecurse(a.children[c])};
- THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(a,c,b){this.color=new THREE.Color(a);this.near=c||1;this.far=b||1E3};THREE.FogExp2=function(a,c){this.color=new THREE.Color(a);this.density=c!==undefined?c:2.5E-4};
- THREE.Projector=function(){function a(){var $=m[k]=m[k]||new THREE.RenderableVertex;k++;return $}function c($,X){return X.z-$.z}function b($,X){var sa=0,va=1,wa=$.z+$.w,ia=X.z+X.w,T=-$.z+$.w,fa=-X.z+X.w;if(wa>=0&&ia>=0&&T>=0&&fa>=0)return!0;else if(wa<0&&ia<0||T<0&&fa<0)return!1;else{if(wa<0)sa=Math.max(sa,wa/(wa-ia));else ia<0&&(va=Math.min(va,wa/(wa-ia)));if(T<0)sa=Math.max(sa,T/(T-fa));else fa<0&&(va=Math.min(va,T/(T-fa)));if(va<sa)return!1;else{$.lerpSelf(X,sa);X.lerpSelf($,1-va);return!0}}}var d,
- f,g=[],j,k,m=[],o,n,x=[],z,y=[],B,F,G=[],I,R,D=[],M=new THREE.Vector4,L=new THREE.Vector4,N=new THREE.Matrix4,ma=new THREE.Matrix4,e=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],la=new THREE.Vector4,V=new THREE.Vector4;this.projectVector=function($,X){N.multiply(X.projectionMatrix,X.matrixWorldInverse);N.multiplyVector3($);return $};this.unprojectVector=function($,X){N.multiply(X.matrixWorld,THREE.Matrix4.makeInvert(X.projectionMatrix));
- N.multiplyVector3($);return $};this.projectObjects=function($,X,sa){X=[];var va,wa,ia;f=0;wa=$.objects;$=0;for(va=wa.length;$<va;$++){ia=wa[$];var T;if(!(T=!ia.visible))if(T=ia instanceof THREE.Mesh){a:{T=void 0;for(var fa=ia.matrixWorld,qa=-ia.geometry.boundingSphere.radius*Math.max(ia.scale.x,Math.max(ia.scale.y,ia.scale.z)),Z=0;Z<6;Z++){T=e[Z].x*fa.n14+e[Z].y*fa.n24+e[Z].z*fa.n34+e[Z].w;if(T<=qa){T=!1;break a}}T=!0}T=!T}if(!T){T=g[f]=g[f]||new THREE.RenderableObject;f++;d=T;M.copy(ia.position);
- N.multiplyVector3(M);d.object=ia;d.z=M.z;X.push(d)}}sa&&X.sort(c);return X};this.projectScene=function($,X,sa){var va=[],wa=X.near,ia=X.far,T,fa,qa,Z,S,da,ua,ca,ga,xa,Ka,Xa,Ya,Aa,h,t,w;R=F=z=n=0;X.matrixAutoUpdate&&X.updateMatrix();$.update(undefined,!1,X);N.multiply(X.projectionMatrix,X.matrixWorldInverse);e[0].set(N.n41-N.n11,N.n42-N.n12,N.n43-N.n13,N.n44-N.n14);e[1].set(N.n41+N.n11,N.n42+N.n12,N.n43+N.n13,N.n44+N.n14);e[2].set(N.n41+N.n21,N.n42+N.n22,N.n43+N.n23,N.n44+N.n24);e[3].set(N.n41-N.n21,
- N.n42-N.n22,N.n43-N.n23,N.n44-N.n24);e[4].set(N.n41-N.n31,N.n42-N.n32,N.n43-N.n33,N.n44-N.n34);e[5].set(N.n41+N.n31,N.n42+N.n32,N.n43+N.n33,N.n44+N.n34);for(T=0;T<6;T++){ga=e[T];ga.divideScalar(Math.sqrt(ga.x*ga.x+ga.y*ga.y+ga.z*ga.z))}ga=this.projectObjects($,X,!0);$=0;for(T=ga.length;$<T;$++){xa=ga[$].object;if(xa.visible){Ka=xa.matrixWorld;Xa=xa.matrixRotationWorld;Ya=xa.materials;Aa=xa.overdraw;k=0;if(xa instanceof THREE.Mesh){h=xa.geometry;Z=h.vertices;t=h.faces;h=h.faceVertexUvs;fa=0;for(qa=
- Z.length;fa<qa;fa++){j=a();j.positionWorld.copy(Z[fa].position);Ka.multiplyVector3(j.positionWorld);j.positionScreen.copy(j.positionWorld);N.multiplyVector4(j.positionScreen);j.positionScreen.x/=j.positionScreen.w;j.positionScreen.y/=j.positionScreen.w;j.visible=j.positionScreen.z>wa&&j.positionScreen.z<ia}Z=0;for(fa=t.length;Z<fa;Z++){qa=t[Z];if(qa instanceof THREE.Face3){S=m[qa.a];da=m[qa.b];ua=m[qa.c];if(S.visible&&da.visible&&ua.visible&&(xa.doubleSided||xa.flipSided!=(ua.positionScreen.x-S.positionScreen.x)*
- (da.positionScreen.y-S.positionScreen.y)-(ua.positionScreen.y-S.positionScreen.y)*(da.positionScreen.x-S.positionScreen.x)<0)){ca=x[n]=x[n]||new THREE.RenderableFace3;n++;o=ca;o.v1.copy(S);o.v2.copy(da);o.v3.copy(ua)}else continue}else if(qa instanceof THREE.Face4){S=m[qa.a];da=m[qa.b];ua=m[qa.c];ca=m[qa.d];if(S.visible&&da.visible&&ua.visible&&ca.visible&&(xa.doubleSided||xa.flipSided!=((ca.positionScreen.x-S.positionScreen.x)*(da.positionScreen.y-S.positionScreen.y)-(ca.positionScreen.y-S.positionScreen.y)*
- (da.positionScreen.x-S.positionScreen.x)<0||(da.positionScreen.x-ua.positionScreen.x)*(ca.positionScreen.y-ua.positionScreen.y)-(da.positionScreen.y-ua.positionScreen.y)*(ca.positionScreen.x-ua.positionScreen.x)<0))){w=y[z]=y[z]||new THREE.RenderableFace4;z++;o=w;o.v1.copy(S);o.v2.copy(da);o.v3.copy(ua);o.v4.copy(ca)}else continue}o.normalWorld.copy(qa.normal);Xa.multiplyVector3(o.normalWorld);o.centroidWorld.copy(qa.centroid);Ka.multiplyVector3(o.centroidWorld);o.centroidScreen.copy(o.centroidWorld);
- N.multiplyVector3(o.centroidScreen);ua=qa.vertexNormals;S=0;for(da=ua.length;S<da;S++){ca=o.vertexNormalsWorld[S];ca.copy(ua[S]);Xa.multiplyVector3(ca)}S=0;for(da=h.length;S<da;S++)if(w=h[S][Z]){ua=0;for(ca=w.length;ua<ca;ua++)o.uvs[S][ua]=w[ua]}o.meshMaterials=Ya;o.faceMaterials=qa.materials;o.overdraw=Aa;o.z=o.centroidScreen.z;va.push(o)}}else if(xa instanceof THREE.Line){ma.multiply(N,Ka);Z=xa.geometry.vertices;S=a();S.positionScreen.copy(Z[0].position);ma.multiplyVector4(S.positionScreen);fa=
- 1;for(qa=Z.length;fa<qa;fa++){S=a();S.positionScreen.copy(Z[fa].position);ma.multiplyVector4(S.positionScreen);da=m[k-2];la.copy(S.positionScreen);V.copy(da.positionScreen);if(b(la,V)){la.multiplyScalar(1/la.w);V.multiplyScalar(1/V.w);Ka=G[F]=G[F]||new THREE.RenderableLine;F++;B=Ka;B.v1.positionScreen.copy(la);B.v2.positionScreen.copy(V);B.z=Math.max(la.z,V.z);B.materials=xa.materials;va.push(B)}}}else if(xa instanceof THREE.Particle){L.set(xa.position.x,xa.position.y,xa.position.z,1);N.multiplyVector4(L);
- L.z/=L.w;if(L.z>0&&L.z<1){Ka=D[R]=D[R]||new THREE.RenderableParticle;R++;I=Ka;I.x=L.x/L.w;I.y=L.y/L.w;I.z=L.z;I.rotation=xa.rotation.z;I.scale.x=xa.scale.x*Math.abs(I.x-(L.x+X.projectionMatrix.n11)/(L.w+X.projectionMatrix.n14));I.scale.y=xa.scale.y*Math.abs(I.y-(L.y+X.projectionMatrix.n22)/(L.w+X.projectionMatrix.n24));I.materials=xa.materials;va.push(I)}}}}sa&&va.sort(c);return va}};
- THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,c=new THREE.Projector,b,d,f,g;this.domElement=document.createElement("div");this.setSize=function(j,k){b=j;d=k;f=b/2;g=d/2};this.render=function(j,k){var m,o,n,x,z,y,B,F;a=c.projectScene(j,k);m=0;for(o=a.length;m<o;m++){z=a[m];if(z instanceof THREE.RenderableParticle){B=z.x*f+f;F=z.y*g+g;n=0;for(x=z.material.length;n<x;n++){y=z.material[n];if(y instanceof THREE.ParticleDOMMaterial){y=y.domElement;y.style.left=B+"px";y.style.top=F+"px"}}}}}};
- THREE.CanvasRenderer=function(){function a(za){if(y!=za)n.globalAlpha=y=za}function c(za){if(B!=za){switch(za){case THREE.NormalBlending:n.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:n.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:n.globalCompositeOperation="darker"}B=za}}function b(za){if(F!=za)n.strokeStyle=F=za}var d=null,f=new THREE.Projector,g=document.createElement("canvas"),j,k,m,o,n=g.getContext("2d"),x=new THREE.Color(0),z=0,y=1,B=0,
- F=null,G=null,I=null,R=null,D=null,M,L,N,ma,e=new THREE.RenderableVertex,la=new THREE.RenderableVertex,V,$,X,sa,va,wa,ia,T,fa,qa,Z,S,da=new THREE.Color,ua=new THREE.Color,ca=new THREE.Color,ga=new THREE.Color,xa=new THREE.Color,Ka,Xa,Ya,Aa,h,t,w,p,C,H,K=new THREE.Rectangle,E=new THREE.Rectangle,A=new THREE.Rectangle,aa=!1,J=new THREE.Color,Y=new THREE.Color,ha=new THREE.Color,ra=new THREE.Color,ja=new THREE.Vector3,Ha,ya,Ba,W,ea,na,Ia=16;Ha=document.createElement("canvas");Ha.width=Ha.height=2;ya=
- Ha.getContext("2d");ya.fillStyle="rgba(0,0,0,1)";ya.fillRect(0,0,2,2);Ba=ya.getImageData(0,0,2,2);W=Ba.data;ea=document.createElement("canvas");ea.width=ea.height=Ia;na=ea.getContext("2d");na.translate(-Ia/2,-Ia/2);na.scale(Ia,Ia);Ia--;this.domElement=g;this.autoClear=!0;this.sortObjects=!0;this.sortElements=!0;this.setSize=function(za,Va){j=za;k=Va;m=j/2;o=k/2;g.width=j;g.height=k;K.set(-m,-o,m,o);y=1;B=0;D=R=I=G=F=null};this.setClearColor=function(za,Va){x=za;z=Va};this.setClearColorHex=function(za,
- Va){x.setHex(za);z=Va};this.clear=function(){n.setTransform(1,0,0,-1,m,o);if(!E.isEmpty()){E.inflate(1);E.minSelf(K);if(x.hex==0&&z==0)n.clearRect(E.getX(),E.getY(),E.getWidth(),E.getHeight());else{c(THREE.NormalBlending);a(1);n.fillStyle="rgba("+Math.floor(x.r*255)+","+Math.floor(x.g*255)+","+Math.floor(x.b*255)+","+z+")";n.fillRect(E.getX(),E.getY(),E.getWidth(),E.getHeight())}E.empty()}};this.render=function(za,Va){function Qa(P){var ka,oa,U,Fa=P.lights;Y.setRGB(0,0,0);ha.setRGB(0,0,0);ra.setRGB(0,
- 0,0);P=0;for(ka=Fa.length;P<ka;P++){oa=Fa[P];U=oa.color;if(oa instanceof THREE.AmbientLight){Y.r+=U.r;Y.g+=U.g;Y.b+=U.b}else if(oa instanceof THREE.DirectionalLight){ha.r+=U.r;ha.g+=U.g;ha.b+=U.b}else if(oa instanceof THREE.PointLight){ra.r+=U.r;ra.g+=U.g;ra.b+=U.b}}}function Da(P,ka,oa,U){var Fa,Ca,pa,Q,Na=P.lights;P=0;for(Fa=Na.length;P<Fa;P++){Ca=Na[P];pa=Ca.color;if(Ca instanceof THREE.DirectionalLight){Q=oa.dot(Ca.position);if(!(Q<=0)){Q*=Ca.intensity;U.r+=pa.r*Q;U.g+=pa.g*Q;U.b+=pa.b*Q}}else if(Ca instanceof
- THREE.PointLight){Q=oa.dot(ja.sub(Ca.position,ka).normalize());if(!(Q<=0)){Q*=Ca.distance==0?1:1-Math.min(ka.distanceTo(Ca.position)/Ca.distance,1);if(Q!=0){Q*=Ca.intensity;U.r+=pa.r*Q;U.g+=pa.g*Q;U.b+=pa.b*Q}}}}}function Ta(P,ka,oa){a(oa.opacity);c(oa.blending);var U,Fa,Ca,pa,Q,Na;if(oa instanceof THREE.ParticleBasicMaterial){if(oa.map){pa=oa.map.image;Q=pa.width>>1;Na=pa.height>>1;oa=ka.scale.x*m;Ca=ka.scale.y*o;U=oa*Q;Fa=Ca*Na;A.set(P.x-U,P.y-Fa,P.x+U,P.y+Fa);if(K.instersects(A)){n.save();n.translate(P.x,
- P.y);n.rotate(-ka.rotation);n.scale(oa,-Ca);n.translate(-Q,-Na);n.drawImage(pa,0,0);n.restore()}}}else if(oa instanceof THREE.ParticleCanvasMaterial){U=ka.scale.x*m;Fa=ka.scale.y*o;A.set(P.x-U,P.y-Fa,P.x+U,P.y+Fa);if(K.instersects(A)){b(oa.color.__styleString);Ca=oa.color.__styleString;if(G!=Ca)n.fillStyle=G=Ca;n.save();n.translate(P.x,P.y);n.rotate(-ka.rotation);n.scale(U,Fa);oa.program(n);n.restore()}}}function kb(P,ka,oa,U){a(U.opacity);c(U.blending);n.beginPath();n.moveTo(P.positionScreen.x,P.positionScreen.y);
- n.lineTo(ka.positionScreen.x,ka.positionScreen.y);n.closePath();if(U instanceof THREE.LineBasicMaterial){da.__styleString=U.color.__styleString;P=U.linewidth;if(I!=P)n.lineWidth=I=P;P=U.linecap;if(R!=P)n.lineCap=R=P;P=U.linejoin;if(D!=P)n.lineJoin=D=P;b(da.__styleString);n.stroke();A.inflate(U.linewidth*2)}}function fb(P,ka,oa,U,Fa,Ca,pa,Q,Na){a(Q.opacity);c(Q.blending);V=P.positionScreen.x;$=P.positionScreen.y;X=ka.positionScreen.x;sa=ka.positionScreen.y;va=oa.positionScreen.x;wa=oa.positionScreen.y;
- Za(V,$,X,sa,va,wa);if(Q instanceof THREE.MeshBasicMaterial)if(Q.map){if(Q.map.mapping instanceof THREE.UVMapping){Aa=pa.uvs[0];O(V,$,X,sa,va,wa,Q.map.image,Aa[U].u,Aa[U].v,Aa[Fa].u,Aa[Fa].v,Aa[Ca].u,Aa[Ca].v)}}else if(Q.envMap){if(Q.envMap.mapping instanceof THREE.SphericalReflectionMapping){P=Va.matrixWorldInverse;ja.copy(pa.vertexNormalsWorld[0]);h=(ja.x*P.n11+ja.y*P.n12+ja.z*P.n13)*0.5+0.5;t=-(ja.x*P.n21+ja.y*P.n22+ja.z*P.n23)*0.5+0.5;ja.copy(pa.vertexNormalsWorld[1]);w=(ja.x*P.n11+ja.y*P.n12+
- ja.z*P.n13)*0.5+0.5;p=-(ja.x*P.n21+ja.y*P.n22+ja.z*P.n23)*0.5+0.5;ja.copy(pa.vertexNormalsWorld[2]);C=(ja.x*P.n11+ja.y*P.n12+ja.z*P.n13)*0.5+0.5;H=-(ja.x*P.n21+ja.y*P.n22+ja.z*P.n23)*0.5+0.5;O(V,$,X,sa,va,wa,Q.envMap.image,h,t,w,p,C,H)}}else Q.wireframe?Ua(Q.color.__styleString,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Oa(Q.color.__styleString);else if(Q instanceof THREE.MeshLambertMaterial){if(Q.map&&!Q.wireframe){if(Q.map.mapping instanceof THREE.UVMapping){Aa=pa.uvs[0];O(V,$,
- X,sa,va,wa,Q.map.image,Aa[U].u,Aa[U].v,Aa[Fa].u,Aa[Fa].v,Aa[Ca].u,Aa[Ca].v)}c(THREE.SubtractiveBlending)}if(aa)if(!Q.wireframe&&Q.shading==THREE.SmoothShading&&pa.vertexNormalsWorld.length==3){ua.r=ca.r=ga.r=Y.r;ua.g=ca.g=ga.g=Y.g;ua.b=ca.b=ga.b=Y.b;Da(Na,pa.v1.positionWorld,pa.vertexNormalsWorld[0],ua);Da(Na,pa.v2.positionWorld,pa.vertexNormalsWorld[1],ca);Da(Na,pa.v3.positionWorld,pa.vertexNormalsWorld[2],ga);xa.r=(ca.r+ga.r)*0.5;xa.g=(ca.g+ga.g)*0.5;xa.b=(ca.b+ga.b)*0.5;Ya=Sa(ua,ca,ga,xa);O(V,
- $,X,sa,va,wa,Ya,0,0,1,0,0,1)}else{J.r=Y.r;J.g=Y.g;J.b=Y.b;Da(Na,pa.centroidWorld,pa.normalWorld,J);da.r=Q.color.r*J.r;da.g=Q.color.g*J.g;da.b=Q.color.b*J.b;da.updateStyleString();Q.wireframe?Ua(da.__styleString,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Oa(da.__styleString)}else Q.wireframe?Ua(Q.color.__styleString,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Oa(Q.color.__styleString)}else if(Q instanceof THREE.MeshDepthMaterial){Ka=Va.near;Xa=Va.far;ua.r=ua.g=ua.b=
- 1-Ra(P.positionScreen.z,Ka,Xa);ca.r=ca.g=ca.b=1-Ra(ka.positionScreen.z,Ka,Xa);ga.r=ga.g=ga.b=1-Ra(oa.positionScreen.z,Ka,Xa);xa.r=(ca.r+ga.r)*0.5;xa.g=(ca.g+ga.g)*0.5;xa.b=(ca.b+ga.b)*0.5;Ya=Sa(ua,ca,ga,xa);O(V,$,X,sa,va,wa,Ya,0,0,1,0,0,1)}else if(Q instanceof THREE.MeshNormalMaterial){da.r=gb(pa.normalWorld.x);da.g=gb(pa.normalWorld.y);da.b=gb(pa.normalWorld.z);da.updateStyleString();Q.wireframe?Ua(da.__styleString,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Oa(da.__styleString)}}
- function $a(P,ka,oa,U,Fa,Ca,pa,Q,Na){a(Q.opacity);c(Q.blending);if(Q.map||Q.envMap){fb(P,ka,U,0,1,3,pa,Q,Na);fb(Fa,oa,Ca,1,2,3,pa,Q,Na)}else{V=P.positionScreen.x;$=P.positionScreen.y;X=ka.positionScreen.x;sa=ka.positionScreen.y;va=oa.positionScreen.x;wa=oa.positionScreen.y;ia=U.positionScreen.x;T=U.positionScreen.y;fa=Fa.positionScreen.x;qa=Fa.positionScreen.y;Z=Ca.positionScreen.x;S=Ca.positionScreen.y;if(Q instanceof THREE.MeshBasicMaterial){La(V,$,X,sa,va,wa,ia,T);Q.wireframe?Ua(Q.color.__styleString,
- Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Oa(Q.color.__styleString)}else if(Q instanceof THREE.MeshLambertMaterial)if(aa)if(!Q.wireframe&&Q.shading==THREE.SmoothShading&&pa.vertexNormalsWorld.length==4){ua.r=ca.r=ga.r=xa.r=Y.r;ua.g=ca.g=ga.g=xa.g=Y.g;ua.b=ca.b=ga.b=xa.b=Y.b;Da(Na,pa.v1.positionWorld,pa.vertexNormalsWorld[0],ua);Da(Na,pa.v2.positionWorld,pa.vertexNormalsWorld[1],ca);Da(Na,pa.v4.positionWorld,pa.vertexNormalsWorld[3],ga);Da(Na,pa.v3.positionWorld,pa.vertexNormalsWorld[2],
- xa);Ya=Sa(ua,ca,ga,xa);Za(V,$,X,sa,ia,T);O(V,$,X,sa,ia,T,Ya,0,0,1,0,0,1);Za(fa,qa,va,wa,Z,S);O(fa,qa,va,wa,Z,S,Ya,1,0,1,1,0,1)}else{J.r=Y.r;J.g=Y.g;J.b=Y.b;Da(Na,pa.centroidWorld,pa.normalWorld,J);da.r=Q.color.r*J.r;da.g=Q.color.g*J.g;da.b=Q.color.b*J.b;da.updateStyleString();La(V,$,X,sa,va,wa,ia,T);Q.wireframe?Ua(da.__styleString,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Oa(da.__styleString)}else{La(V,$,X,sa,va,wa,ia,T);Q.wireframe?Ua(Q.color.__styleString,Q.wireframeLinewidth,
- Q.wireframeLinecap,Q.wireframeLinejoin):Oa(Q.color.__styleString)}else if(Q instanceof THREE.MeshNormalMaterial){da.r=gb(pa.normalWorld.x);da.g=gb(pa.normalWorld.y);da.b=gb(pa.normalWorld.z);da.updateStyleString();La(V,$,X,sa,va,wa,ia,T);Q.wireframe?Ua(da.__styleString,Q.wireframeLinewidth,Q.wireframeLinecap,Q.wireframeLinejoin):Oa(da.__styleString)}else if(Q instanceof THREE.MeshDepthMaterial){Ka=Va.near;Xa=Va.far;ua.r=ua.g=ua.b=1-Ra(P.positionScreen.z,Ka,Xa);ca.r=ca.g=ca.b=1-Ra(ka.positionScreen.z,
- Ka,Xa);ga.r=ga.g=ga.b=1-Ra(U.positionScreen.z,Ka,Xa);xa.r=xa.g=xa.b=1-Ra(oa.positionScreen.z,Ka,Xa);Ya=Sa(ua,ca,ga,xa);Za(V,$,X,sa,ia,T);O(V,$,X,sa,ia,T,Ya,0,0,1,0,0,1);Za(fa,qa,va,wa,Z,S);O(fa,qa,va,wa,Z,S,Ya,1,0,1,1,0,1)}}}function Za(P,ka,oa,U,Fa,Ca){n.beginPath();n.moveTo(P,ka);n.lineTo(oa,U);n.lineTo(Fa,Ca);n.lineTo(P,ka);n.closePath()}function La(P,ka,oa,U,Fa,Ca,pa,Q){n.beginPath();n.moveTo(P,ka);n.lineTo(oa,U);n.lineTo(Fa,Ca);n.lineTo(pa,Q);n.lineTo(P,ka);n.closePath()}function Ua(P,ka,oa,
- U){if(I!=ka)n.lineWidth=I=ka;if(R!=oa)n.lineCap=R=oa;if(D!=U)n.lineJoin=D=U;b(P);n.stroke();A.inflate(ka*2)}function Oa(P){if(G!=P)n.fillStyle=G=P;n.fill()}function O(P,ka,oa,U,Fa,Ca,pa,Q,Na,eb,cb,bb,mb){var hb,ib;hb=pa.width-1;ib=pa.height-1;Q*=hb;Na*=ib;eb*=hb;cb*=ib;bb*=hb;mb*=ib;oa-=P;U-=ka;Fa-=P;Ca-=ka;eb-=Q;cb-=Na;bb-=Q;mb-=Na;hb=eb*mb-bb*cb;if(hb!=0){ib=1/hb;hb=(mb*oa-cb*Fa)*ib;cb=(mb*U-cb*Ca)*ib;oa=(eb*Fa-bb*oa)*ib;U=(eb*Ca-bb*U)*ib;P=P-hb*Q-oa*Na;ka=ka-cb*Q-U*Na;n.save();n.transform(hb,cb,
- oa,U,P,ka);n.clip();n.drawImage(pa,0,0);n.restore()}}function Sa(P,ka,oa,U){var Fa=~~(P.r*255),Ca=~~(P.g*255);P=~~(P.b*255);var pa=~~(ka.r*255),Q=~~(ka.g*255);ka=~~(ka.b*255);var Na=~~(oa.r*255),eb=~~(oa.g*255);oa=~~(oa.b*255);var cb=~~(U.r*255),bb=~~(U.g*255);U=~~(U.b*255);W[0]=Fa<0?0:Fa>255?255:Fa;W[1]=Ca<0?0:Ca>255?255:Ca;W[2]=P<0?0:P>255?255:P;W[4]=pa<0?0:pa>255?255:pa;W[5]=Q<0?0:Q>255?255:Q;W[6]=ka<0?0:ka>255?255:ka;W[8]=Na<0?0:Na>255?255:Na;W[9]=eb<0?0:eb>255?255:eb;W[10]=oa<0?0:oa>255?255:
- oa;W[12]=cb<0?0:cb>255?255:cb;W[13]=bb<0?0:bb>255?255:bb;W[14]=U<0?0:U>255?255:U;ya.putImageData(Ba,0,0);na.drawImage(Ha,0,0);return ea}function Ra(P,ka,oa){P=(P-ka)/(oa-ka);return P*P*(3-2*P)}function gb(P){P=(P+1)*0.5;return P<0?0:P>1?1:P}function db(P,ka){var oa=ka.x-P.x,U=ka.y-P.y,Fa=1/Math.sqrt(oa*oa+U*U);oa*=Fa;U*=Fa;ka.x+=oa;ka.y+=U;P.x-=oa;P.y-=U}var ab,Pa,ta,Ea,Ga,Ja,Ma,Wa;this.autoClear?this.clear():n.setTransform(1,0,0,-1,m,o);d=f.projectScene(za,Va,this.sortElements);(aa=za.lights.length>
- 0)&&Qa(za);ab=0;for(Pa=d.length;ab<Pa;ab++){ta=d[ab];A.empty();if(ta instanceof THREE.RenderableParticle){M=ta;M.x*=m;M.y*=o;Ea=0;for(Ga=ta.materials.length;Ea<Ga;){Wa=ta.materials[Ea++];Wa.opacity!=0&&Ta(M,ta,Wa,za)}}else if(ta instanceof THREE.RenderableLine){M=ta.v1;L=ta.v2;M.positionScreen.x*=m;M.positionScreen.y*=o;L.positionScreen.x*=m;L.positionScreen.y*=o;A.addPoint(M.positionScreen.x,M.positionScreen.y);A.addPoint(L.positionScreen.x,L.positionScreen.y);if(K.instersects(A)){Ea=0;for(Ga=ta.materials.length;Ea<
- Ga;){Wa=ta.materials[Ea++];Wa.opacity!=0&&kb(M,L,ta,Wa,za)}}}else if(ta instanceof THREE.RenderableFace3){M=ta.v1;L=ta.v2;N=ta.v3;M.positionScreen.x*=m;M.positionScreen.y*=o;L.positionScreen.x*=m;L.positionScreen.y*=o;N.positionScreen.x*=m;N.positionScreen.y*=o;if(ta.overdraw){db(M.positionScreen,L.positionScreen);db(L.positionScreen,N.positionScreen);db(N.positionScreen,M.positionScreen)}A.add3Points(M.positionScreen.x,M.positionScreen.y,L.positionScreen.x,L.positionScreen.y,N.positionScreen.x,N.positionScreen.y);
- if(K.instersects(A)){Ea=0;for(Ga=ta.meshMaterials.length;Ea<Ga;){Wa=ta.meshMaterials[Ea++];if(Wa instanceof THREE.MeshFaceMaterial){Ja=0;for(Ma=ta.faceMaterials.length;Ja<Ma;)(Wa=ta.faceMaterials[Ja++])&&Wa.opacity!=0&&fb(M,L,N,0,1,2,ta,Wa,za)}else Wa.opacity!=0&&fb(M,L,N,0,1,2,ta,Wa,za)}}}else if(ta instanceof THREE.RenderableFace4){M=ta.v1;L=ta.v2;N=ta.v3;ma=ta.v4;M.positionScreen.x*=m;M.positionScreen.y*=o;L.positionScreen.x*=m;L.positionScreen.y*=o;N.positionScreen.x*=m;N.positionScreen.y*=o;
- ma.positionScreen.x*=m;ma.positionScreen.y*=o;e.positionScreen.copy(L.positionScreen);la.positionScreen.copy(ma.positionScreen);if(ta.overdraw){db(M.positionScreen,L.positionScreen);db(L.positionScreen,ma.positionScreen);db(ma.positionScreen,M.positionScreen);db(N.positionScreen,e.positionScreen);db(N.positionScreen,la.positionScreen)}A.addPoint(M.positionScreen.x,M.positionScreen.y);A.addPoint(L.positionScreen.x,L.positionScreen.y);A.addPoint(N.positionScreen.x,N.positionScreen.y);A.addPoint(ma.positionScreen.x,
- ma.positionScreen.y);if(K.instersects(A)){Ea=0;for(Ga=ta.meshMaterials.length;Ea<Ga;){Wa=ta.meshMaterials[Ea++];if(Wa instanceof THREE.MeshFaceMaterial){Ja=0;for(Ma=ta.faceMaterials.length;Ja<Ma;)(Wa=ta.faceMaterials[Ja++])&&Wa.opacity!=0&&$a(M,L,N,ma,e,la,ta,Wa,za)}else Wa.opacity!=0&&$a(M,L,N,ma,e,la,ta,Wa,za)}}}E.addRectangle(A)}n.setTransform(1,0,0,1,0,0)}};
- THREE.SVGRenderer=function(){function a(ia,T,fa){var qa,Z,S,da;qa=0;for(Z=ia.lights.length;qa<Z;qa++){S=ia.lights[qa];if(S instanceof THREE.DirectionalLight){da=T.normalWorld.dot(S.position)*S.intensity;if(da>0){fa.r+=S.color.r*da;fa.g+=S.color.g*da;fa.b+=S.color.b*da}}else if(S instanceof THREE.PointLight){la.sub(S.position,T.centroidWorld);la.normalize();da=T.normalWorld.dot(la)*S.intensity;if(da>0){fa.r+=S.color.r*da;fa.g+=S.color.g*da;fa.b+=S.color.b*da}}}}function c(ia,T,fa,qa,Z,S){X=d(sa++);
- X.setAttribute("d","M "+ia.positionScreen.x+" "+ia.positionScreen.y+" L "+T.positionScreen.x+" "+T.positionScreen.y+" L "+fa.positionScreen.x+","+fa.positionScreen.y+"z");if(Z instanceof THREE.MeshBasicMaterial)D.__styleString=Z.color.__styleString;else if(Z instanceof THREE.MeshLambertMaterial)if(R){M.r=L.r;M.g=L.g;M.b=L.b;a(S,qa,M);D.r=Z.color.r*M.r;D.g=Z.color.g*M.g;D.b=Z.color.b*M.b;D.updateStyleString()}else D.__styleString=Z.color.__styleString;else if(Z instanceof THREE.MeshDepthMaterial){e=
- 1-Z.__2near/(Z.__farPlusNear-qa.z*Z.__farMinusNear);D.setRGB(e,e,e)}else Z instanceof THREE.MeshNormalMaterial&&D.setRGB(f(qa.normalWorld.x),f(qa.normalWorld.y),f(qa.normalWorld.z));Z.wireframe?X.setAttribute("style","fill: none; stroke: "+D.__styleString+"; stroke-width: "+Z.wireframeLinewidth+"; stroke-opacity: "+Z.opacity+"; stroke-linecap: "+Z.wireframeLinecap+"; stroke-linejoin: "+Z.wireframeLinejoin):X.setAttribute("style","fill: "+D.__styleString+"; fill-opacity: "+Z.opacity);k.appendChild(X)}
- function b(ia,T,fa,qa,Z,S,da){X=d(sa++);X.setAttribute("d","M "+ia.positionScreen.x+" "+ia.positionScreen.y+" L "+T.positionScreen.x+" "+T.positionScreen.y+" L "+fa.positionScreen.x+","+fa.positionScreen.y+" L "+qa.positionScreen.x+","+qa.positionScreen.y+"z");if(S instanceof THREE.MeshBasicMaterial)D.__styleString=S.color.__styleString;else if(S instanceof THREE.MeshLambertMaterial)if(R){M.r=L.r;M.g=L.g;M.b=L.b;a(da,Z,M);D.r=S.color.r*M.r;D.g=S.color.g*M.g;D.b=S.color.b*M.b;D.updateStyleString()}else D.__styleString=
- S.color.__styleString;else if(S instanceof THREE.MeshDepthMaterial){e=1-S.__2near/(S.__farPlusNear-Z.z*S.__farMinusNear);D.setRGB(e,e,e)}else S instanceof THREE.MeshNormalMaterial&&D.setRGB(f(Z.normalWorld.x),f(Z.normalWorld.y),f(Z.normalWorld.z));S.wireframe?X.setAttribute("style","fill: none; stroke: "+D.__styleString+"; stroke-width: "+S.wireframeLinewidth+"; stroke-opacity: "+S.opacity+"; stroke-linecap: "+S.wireframeLinecap+"; stroke-linejoin: "+S.wireframeLinejoin):X.setAttribute("style","fill: "+
- D.__styleString+"; fill-opacity: "+S.opacity);k.appendChild(X)}function d(ia){if(V[ia]==null){V[ia]=document.createElementNS("http://www.w3.org/2000/svg","path");wa==0&&V[ia].setAttribute("shape-rendering","crispEdges")}return V[ia]}function f(ia){return ia<0?Math.min((1+ia)*0.5,0.5):0.5+Math.min(ia*0.5,0.5)}var g=null,j=new THREE.Projector,k=document.createElementNS("http://www.w3.org/2000/svg","svg"),m,o,n,x,z,y,B,F,G=new THREE.Rectangle,I=new THREE.Rectangle,R=!1,D=new THREE.Color(16777215),M=
- new THREE.Color(16777215),L=new THREE.Color(0),N=new THREE.Color(0),ma=new THREE.Color(0),e,la=new THREE.Vector3,V=[],$=[],X,sa,va,wa=1;this.domElement=k;this.autoClear=!0;this.sortObjects=!0;this.sortElements=!0;this.setQuality=function(ia){switch(ia){case "high":wa=1;break;case "low":wa=0}};this.setSize=function(ia,T){m=ia;o=T;n=m/2;x=o/2;k.setAttribute("viewBox",-n+" "+-x+" "+m+" "+o);k.setAttribute("width",m);k.setAttribute("height",o);G.set(-n,-x,n,x)};this.clear=function(){for(;k.childNodes.length>
- 0;)k.removeChild(k.childNodes[0])};this.render=function(ia,T){var fa,qa,Z,S,da,ua,ca,ga;this.autoClear&&this.clear();g=j.projectScene(ia,T,this.sortElements);va=sa=0;if(R=ia.lights.length>0){ca=ia.lights;L.setRGB(0,0,0);N.setRGB(0,0,0);ma.setRGB(0,0,0);fa=0;for(qa=ca.length;fa<qa;fa++){Z=ca[fa];S=Z.color;if(Z instanceof THREE.AmbientLight){L.r+=S.r;L.g+=S.g;L.b+=S.b}else if(Z instanceof THREE.DirectionalLight){N.r+=S.r;N.g+=S.g;N.b+=S.b}else if(Z instanceof THREE.PointLight){ma.r+=S.r;ma.g+=S.g;ma.b+=
- S.b}}}fa=0;for(qa=g.length;fa<qa;fa++){ca=g[fa];I.empty();if(ca instanceof THREE.RenderableParticle){z=ca;z.x*=n;z.y*=-x;Z=0;for(S=ca.materials.length;Z<S;)Z++}else if(ca instanceof THREE.RenderableLine){z=ca.v1;y=ca.v2;z.positionScreen.x*=n;z.positionScreen.y*=-x;y.positionScreen.x*=n;y.positionScreen.y*=-x;I.addPoint(z.positionScreen.x,z.positionScreen.y);I.addPoint(y.positionScreen.x,y.positionScreen.y);if(G.instersects(I)){Z=0;for(S=ca.materials.length;Z<S;)if((ga=ca.materials[Z++])&&ga.opacity!=
- 0){da=z;ua=y;var xa=va++;if($[xa]==null){$[xa]=document.createElementNS("http://www.w3.org/2000/svg","line");wa==0&&$[xa].setAttribute("shape-rendering","crispEdges")}X=$[xa];X.setAttribute("x1",da.positionScreen.x);X.setAttribute("y1",da.positionScreen.y);X.setAttribute("x2",ua.positionScreen.x);X.setAttribute("y2",ua.positionScreen.y);if(ga instanceof THREE.LineBasicMaterial){D.__styleString=ga.color.__styleString;X.setAttribute("style","fill: none; stroke: "+D.__styleString+"; stroke-width: "+
- ga.linewidth+"; stroke-opacity: "+ga.opacity+"; stroke-linecap: "+ga.linecap+"; stroke-linejoin: "+ga.linejoin);k.appendChild(X)}}}}else if(ca instanceof THREE.RenderableFace3){z=ca.v1;y=ca.v2;B=ca.v3;z.positionScreen.x*=n;z.positionScreen.y*=-x;y.positionScreen.x*=n;y.positionScreen.y*=-x;B.positionScreen.x*=n;B.positionScreen.y*=-x;I.addPoint(z.positionScreen.x,z.positionScreen.y);I.addPoint(y.positionScreen.x,y.positionScreen.y);I.addPoint(B.positionScreen.x,B.positionScreen.y);if(G.instersects(I)){Z=
- 0;for(S=ca.meshMaterials.length;Z<S;){ga=ca.meshMaterials[Z++];if(ga instanceof THREE.MeshFaceMaterial){da=0;for(ua=ca.faceMaterials.length;da<ua;)(ga=ca.faceMaterials[da++])&&ga.opacity!=0&&c(z,y,B,ca,ga,ia)}else ga&&ga.opacity!=0&&c(z,y,B,ca,ga,ia)}}}else if(ca instanceof THREE.RenderableFace4){z=ca.v1;y=ca.v2;B=ca.v3;F=ca.v4;z.positionScreen.x*=n;z.positionScreen.y*=-x;y.positionScreen.x*=n;y.positionScreen.y*=-x;B.positionScreen.x*=n;B.positionScreen.y*=-x;F.positionScreen.x*=n;F.positionScreen.y*=
- -x;I.addPoint(z.positionScreen.x,z.positionScreen.y);I.addPoint(y.positionScreen.x,y.positionScreen.y);I.addPoint(B.positionScreen.x,B.positionScreen.y);I.addPoint(F.positionScreen.x,F.positionScreen.y);if(G.instersects(I)){Z=0;for(S=ca.meshMaterials.length;Z<S;){ga=ca.meshMaterials[Z++];if(ga instanceof THREE.MeshFaceMaterial){da=0;for(ua=ca.faceMaterials.length;da<ua;)(ga=ca.faceMaterials[da++])&&ga.opacity!=0&&b(z,y,B,F,ca,ga,ia)}else ga&&ga.opacity!=0&&b(z,y,B,F,ca,ga,ia)}}}}}};
- THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
- envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",
- envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",
- map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\nuniform sampler2D lightMap;\n#endif",lightmap_pars_vertex:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\n#endif",
- lightmap_fragment:"#ifdef USE_LIGHTMAP\ngl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\n#endif",lightmap_vertex:"#ifdef USE_LIGHTMAP\nvUv2 = uv2;\n#endif",lights_pars_vertex:"uniform bool enableLighting;\nuniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#ifdef PHONG\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#endif",
- lights_vertex:"if ( !enableLighting ) {\nvLightWeighting = vec3( 1.0 );\n} else {\nvLightWeighting = ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nfloat directionalLightWeighting = max( dot( transformedNormal, normalize( lDirection.xyz ) ), 0.0 );\nvLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;\n}\n#endif\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nfloat pointLightWeighting = max( dot( transformedNormal, lVector ), 0.0 );\nvLightWeighting += pointLightColor[ i ] * pointLightWeighting * lDistance;\n#ifdef PHONG\nvPointLight[ i ] = vec4( lVector, lDistance );\n#endif\n}\n#endif\n}",
- lights_pars_fragment:"#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",lights_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\nvec4 mColor = vec4( diffuse, opacity );\nvec4 mSpecular = vec4( specular, opacity );\n#if MAX_POINT_LIGHTS > 0\nvec4 pointDiffuse = vec4( 0.0 );\nvec4 pointSpecular = vec4( 0.0 );\nfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nvec3 pointHalfVector = normalize( vPointLight[ i ].xyz + vViewPosition );\nfloat pointDistance = vPointLight[ i ].w;\nfloat pointDotNormalHalf = dot( normal, pointHalfVector );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = 0.0;\nif ( pointDotNormalHalf >= 0.0 )\npointSpecularWeight = pow( pointDotNormalHalf, shininess );\npointDiffuse += mColor * pointDiffuseWeight * pointDistance;\npointSpecular += mSpecular * pointSpecularWeight * pointDistance;\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec4 dirDiffuse = vec4( 0.0 );\nvec4 dirSpecular = vec4( 0.0 );\nfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nvec3 dirHalfVector = normalize( lDirection.xyz + vViewPosition );\nfloat dirDotNormalHalf = dot( normal, dirHalfVector );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = 0.0;\nif ( dirDotNormalHalf >= 0.0 )\ndirSpecularWeight = pow( dirDotNormalHalf, shininess );\ndirDiffuse += mColor * dirDiffuseWeight;\ndirSpecular += mSpecular * dirSpecularWeight;\n}\n#endif\nvec4 totalLight = vec4( ambient, opacity );\n#if MAX_DIR_LIGHTS > 0\ntotalLight += dirDiffuse + dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalLight += pointDiffuse + pointSpecular;\n#endif\ngl_FragColor = gl_FragColor * totalLight;",
- color_pars_fragment:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_fragment:"#ifdef USE_COLOR\ngl_FragColor = gl_FragColor * vec4( vColor, opacity );\n#endif",color_pars_vertex:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\nvColor = color;\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\nuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n#endif",skinning_vertex:"#ifdef USE_SKINNING\ngl_Position = ( boneGlobalMatrices[ int( skinIndex.x ) ] * skinVertexA ) * skinWeight.x;\ngl_Position += ( boneGlobalMatrices[ int( skinIndex.y ) ] * skinVertexB ) * skinWeight.y;\ngl_Position = projectionMatrix * viewMatrix * objectMatrix * gl_Position;\n#endif",
- morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInfluences[ 8 ];\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\nvec3 morphed = vec3( 0.0, 0.0, 0.0 );\nmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\nmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\nmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\nmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\nmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\nmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\nmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\nmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\nmorphed += position;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( morphed, 1.0 );\n#endif",
- default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif"};
- THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},lightMap:{type:"t",value:2,texture:null},envMap:{type:"t",value:1,texture:null},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)},morphTargetInfluences:{type:"f",
- value:0}},lights:{enableLighting:{type:"i",value:1},ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},
- fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}}};
- THREE.ShaderLib={shadowPost:{vertexShader:"uniform \tmat4 \tprojectionMatrix;\nattribute \tvec3 \tposition;\nvoid main(void)\n{\ngl_Position = projectionMatrix * vec4( position, 1.0 );\n}",fragmentShader:"#ifdef GL_ES\nprecision highp float;\n#endif\nvoid main( void )\n{\ngl_FragColor = vec4( 0, 0, 0, 0.5 );\n}"},shadowVolumeDynamic:{uniforms:{directionalLightDirection:{type:"fv",value:[]}},vertexShader:"uniform \tvec3 \tdirectionalLightDirection;\nvoid main() {\nvec4 pos = objectMatrix * vec4( position, 1.0 );\nvec3 norm = mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal;\nvec4 extruded = vec4( directionalLightDirection * 5000.0 * step( 0.0, dot( directionalLightDirection, norm )), 0.0 );\ngl_Position = projectionMatrix * viewMatrix * ( pos + extruded );\n}",
- fragmentShader:"void main() {\ngl_FragColor = vec4( 1, 1, 1, 1 );\n}"},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},fragmentShader:"uniform float mNear;\nuniform float mFar;\nuniform float opacity;\nvoid main() {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat color = 1.0 - smoothstep( mNear, mFar, depth );\ngl_FragColor = vec4( vec3( color ), opacity );\n}",vertexShader:"void main() {\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},
- normal:{uniforms:{opacity:{type:"f",value:1}},fragmentShader:"uniform float opacity;\nvarying vec3 vNormal;\nvoid main() {\ngl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n}",vertexShader:"varying vec3 vNormal;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvNormal = normalize( normalMatrix * normal );\ngl_Position = projectionMatrix * mvPosition;\n}"},basic:{uniforms:THREE.UniformsLib.common,fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;",
- THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:[THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,
- THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")},lambert:{uniforms:Uniforms.merge([THREE.UniformsLib.common,
- THREE.UniformsLib.lights]),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vLightWeighting;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );\ngl_FragColor = gl_FragColor * vec4( vLightWeighting, 1.0 );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,
- THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["varying vec3 vLightWeighting;",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,
- THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,"vec3 transformedNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")},phong:{uniforms:Uniforms.merge([THREE.UniformsLib.common,THREE.UniformsLib.lights,{ambient:{type:"c",value:new THREE.Color(328965)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30}}]),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform vec3 ambient;\nuniform vec3 specular;\nuniform float shininess;\nvarying vec3 vLightWeighting;",
- THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_pars_fragment,"void main() {\ngl_FragColor = vec4( vLightWeighting, 1.0 );",THREE.ShaderChunk.lights_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),
- vertexShader:["#define PHONG\nvarying vec3 vLightWeighting;\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,
- THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,"#ifndef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\n#endif\nvViewPosition = cameraPosition - mPosition.xyz;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = transformedNormal;",THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsLib.particle,fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",
- THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;\n}"].join("\n")}};
- THREE.WebGLRenderer=function(a){function c(h,t,w){var p,C,H,K=h.vertices,E=K.length,A=h.colors,aa=A.length,J=h.__vertexArray,Y=h.__colorArray,ha=h.__sortArray,ra=h.__dirtyVertices,ja=h.__dirtyColors;if(w.sortParticles){da.multiplySelf(w.matrixWorld);for(p=0;p<E;p++){C=K[p].position;ga.copy(C);da.multiplyVector3(ga);ha[p]=[ga.z,p]}ha.sort(function(Ha,ya){return ya[0]-Ha[0]});for(p=0;p<E;p++){C=K[ha[p][1]].position;H=p*3;J[H]=C.x;J[H+1]=C.y;J[H+2]=C.z}for(p=0;p<aa;p++){H=p*3;color=A[ha[p][1]];Y[H]=
- color.r;Y[H+1]=color.g;Y[H+2]=color.b}}else{if(ra)for(p=0;p<E;p++){C=K[p].position;H=p*3;J[H]=C.x;J[H+1]=C.y;J[H+2]=C.z}if(ja)for(p=0;p<aa;p++){color=A[p];H=p*3;Y[H]=color.r;Y[H+1]=color.g;Y[H+2]=color.b}}if(ra||w.sortParticles){e.bindBuffer(e.ARRAY_BUFFER,h.__webglVertexBuffer);e.bufferData(e.ARRAY_BUFFER,J,t)}if(ja||w.sortParticles){e.bindBuffer(e.ARRAY_BUFFER,h.__webglColorBuffer);e.bufferData(e.ARRAY_BUFFER,Y,t)}}function b(h,t){h.uniforms=Uniforms.clone(t.uniforms);h.vertexShader=t.vertexShader;
- h.fragmentShader=t.fragmentShader}function d(h,t,w,p,C){p.__webglProgram||X.initMaterial(p,t,w,C);var H=p.program,K=H.uniforms,E=p.uniforms;if(H!=V){e.useProgram(H);V=H}e.uniformMatrix4fv(K.projectionMatrix,!1,ua);if(w&&(p instanceof THREE.MeshBasicMaterial||p instanceof THREE.MeshLambertMaterial||p instanceof THREE.MeshPhongMaterial||p instanceof THREE.LineBasicMaterial||p instanceof THREE.ParticleBasicMaterial)){E.fogColor.value.setHex(w.color.hex);if(w instanceof THREE.Fog){E.fogNear.value=w.near;
- E.fogFar.value=w.far}else if(w instanceof THREE.FogExp2)E.fogDensity.value=w.density}if(p instanceof THREE.MeshPhongMaterial||p instanceof THREE.MeshLambertMaterial||p.lights){var A,aa,J=0,Y=0,ha=0,ra,ja,Ha,ya,Ba=xa,W=Ba.directional.colors,ea=Ba.directional.positions,na=Ba.point.colors,Ia=Ba.point.positions,za=Ba.point.distances,Va=0,Qa=0;w=aa=ya=0;for(A=t.length;w<A;w++){aa=t[w];ra=aa.color;ja=aa.position;Ha=aa.intensity;ya=aa.distance;if(aa instanceof THREE.AmbientLight){J+=ra.r;Y+=ra.g;ha+=ra.b}else if(aa instanceof
- THREE.DirectionalLight){ya=Va*3;W[ya]=ra.r*Ha;W[ya+1]=ra.g*Ha;W[ya+2]=ra.b*Ha;ea[ya]=ja.x;ea[ya+1]=ja.y;ea[ya+2]=ja.z;Va+=1}else if(aa instanceof THREE.PointLight){aa=Qa*3;na[aa]=ra.r*Ha;na[aa+1]=ra.g*Ha;na[aa+2]=ra.b*Ha;Ia[aa]=ja.x;Ia[aa+1]=ja.y;Ia[aa+2]=ja.z;za[Qa]=ya;Qa+=1}}for(w=Va*3;w<W.length;w++)W[w]=0;for(w=Qa*3;w<na.length;w++)na[w]=0;Ba.point.length=Qa;Ba.directional.length=Va;Ba.ambient[0]=J;Ba.ambient[1]=Y;Ba.ambient[2]=ha;w=xa;E.enableLighting.value=w.directional.length+w.point.length;
- E.ambientLightColor.value=w.ambient;E.directionalLightColor.value=w.directional.colors;E.directionalLightDirection.value=w.directional.positions;E.pointLightColor.value=w.point.colors;E.pointLightPosition.value=w.point.positions;E.pointLightDistance.value=w.point.distances}if(p instanceof THREE.MeshBasicMaterial||p instanceof THREE.MeshLambertMaterial||p instanceof THREE.MeshPhongMaterial){E.diffuse.value.setRGB(p.color.r,p.color.g,p.color.b);E.opacity.value=p.opacity;E.map.texture=p.map;E.lightMap.texture=
- p.lightMap;E.envMap.texture=p.envMap;E.reflectivity.value=p.reflectivity;E.refractionRatio.value=p.refractionRatio;E.combine.value=p.combine;E.useRefract.value=p.envMap&&p.envMap.mapping instanceof THREE.CubeRefractionMapping}if(p instanceof THREE.LineBasicMaterial){E.diffuse.value.setRGB(p.color.r,p.color.g,p.color.b);E.opacity.value=p.opacity}else if(p instanceof THREE.ParticleBasicMaterial){E.psColor.value.setRGB(p.color.r,p.color.g,p.color.b);E.opacity.value=p.opacity;E.size.value=p.size;E.scale.value=
- la.height/2;E.map.texture=p.map}else if(p instanceof THREE.MeshPhongMaterial){E.ambient.value.setRGB(p.ambient.r,p.ambient.g,p.ambient.b);E.specular.value.setRGB(p.specular.r,p.specular.g,p.specular.b);E.shininess.value=p.shininess}else if(p instanceof THREE.MeshDepthMaterial){E.mNear.value=h.near;E.mFar.value=h.far;E.opacity.value=p.opacity}else if(p instanceof THREE.MeshNormalMaterial)E.opacity.value=p.opacity;for(var Da in E)if(Y=H.uniforms[Da]){A=E[Da];J=A.type;w=A.value;if(J=="i")e.uniform1i(Y,
- w);else if(J=="f")e.uniform1f(Y,w);else if(J=="fv1")e.uniform1fv(Y,w);else if(J=="fv")e.uniform3fv(Y,w);else if(J=="v2")e.uniform2f(Y,w.x,w.y);else if(J=="v3")e.uniform3f(Y,w.x,w.y,w.z);else if(J=="c")e.uniform3f(Y,w.r,w.g,w.b);else if(J=="t"){e.uniform1i(Y,w);if(A=A.texture)if(A.image instanceof Array&&A.image.length==6){if(A.image.length==6){if(A.needsUpdate){if(A.__webglInit){e.bindTexture(e.TEXTURE_CUBE_MAP,A.image.__webglTextureCube);for(J=0;J<6;++J)e.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+
- J,0,0,0,e.RGBA,e.UNSIGNED_BYTE,A.image[J])}else{A.image.__webglTextureCube=e.createTexture();e.bindTexture(e.TEXTURE_CUBE_MAP,A.image.__webglTextureCube);for(J=0;J<6;++J)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+J,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,A.image[J]);A.__webglInit=!0}D(e.TEXTURE_CUBE_MAP,A,A.image[0]);e.bindTexture(e.TEXTURE_CUBE_MAP,null);A.needsUpdate=!1}e.activeTexture(e.TEXTURE0+w);e.bindTexture(e.TEXTURE_CUBE_MAP,A.image.__webglTextureCube)}}else{if(A.needsUpdate){if(A.__webglInit){e.bindTexture(e.TEXTURE_2D,
- A.__webglTexture);e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,A.image)}else{A.__webglTexture=e.createTexture();e.bindTexture(e.TEXTURE_2D,A.__webglTexture);e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,A.image);A.__webglInit=!0}D(e.TEXTURE_2D,A,A.image);e.bindTexture(e.TEXTURE_2D,null);A.needsUpdate=!1}e.activeTexture(e.TEXTURE0+w);e.bindTexture(e.TEXTURE_2D,A.__webglTexture)}}}e.uniformMatrix4fv(K.modelViewMatrix,!1,C._modelViewMatrixArray);e.uniformMatrix3fv(K.normalMatrix,
- !1,C._normalMatrixArray);(p instanceof THREE.MeshShaderMaterial||p instanceof THREE.MeshPhongMaterial||p.envMap)&&e.uniform3f(K.cameraPosition,h.position.x,h.position.y,h.position.z);(p instanceof THREE.MeshShaderMaterial||p.envMap||p.skinning)&&e.uniformMatrix4fv(K.objectMatrix,!1,C._objectMatrixArray);(p instanceof THREE.MeshPhongMaterial||p instanceof THREE.MeshLambertMaterial||p instanceof THREE.MeshShaderMaterial||p.skinning)&&e.uniformMatrix4fv(K.viewMatrix,!1,ca);if(p instanceof THREE.ShadowVolumeDynamicMaterial){h=
- E.directionalLightDirection.value;h[0]=-t.position.x;h[1]=-t.position.y;h[2]=-t.position.z;e.uniform3fv(K.directionalLightDirection,h);e.uniformMatrix4fv(K.objectMatrix,!1,C._objectMatrixArray);e.uniformMatrix4fv(K.viewMatrix,!1,ca)}if(p.skinning){e.uniformMatrix4fv(K.cameraInverseMatrix,!1,ca);e.uniformMatrix4fv(K.boneGlobalMatrices,!1,C.boneMatrices)}return H}function f(h,t,w,p,C,H){if(p.opacity!=0){h=d(h,t,w,p,H).attributes;if(p.morphTargets){t=p.program.attributes;H.morphTargetBase!==-1?e.bindBuffer(e.ARRAY_BUFFER,
- C.__webglMorphTargetsBuffers[H.morphTargetBase]):e.bindBuffer(e.ARRAY_BUFFER,C.__webglVertexBuffer);e.vertexAttribPointer(t.position,3,e.FLOAT,!1,0,0);if(H.morphTargetForcedOrder.length){w=0;for(var K=H.morphTargetForcedOrder,E=H.morphTargetInfluences;w<p.numSupportedMorphTargets&&w<K.length;){e.bindBuffer(e.ARRAY_BUFFER,C.__webglMorphTargetsBuffers[K[w]]);e.vertexAttribPointer(t["morphTarget"+w],3,e.FLOAT,!1,0,0);H.__webglMorphTargetInfluences[w]=E[K[w]];w++}}else{K=[];var A=-1,aa=0;E=H.morphTargetInfluences;
- var J,Y=E.length;w=0;for(H.morphTargetBase!==-1&&(K[H.morphTargetBase]=!0);w<p.numSupportedMorphTargets;){for(J=0;J<Y;J++)if(!K[J]&&E[J]>A){aa=J;A=E[aa]}e.bindBuffer(e.ARRAY_BUFFER,C.__webglMorphTargetsBuffers[aa]);e.vertexAttribPointer(t["morphTarget"+w],3,e.FLOAT,!1,0,0);H.__webglMorphTargetInfluences[w]=A;K[aa]=1;A=-1;w++}}e.uniform1fv(p.program.uniforms.morphTargetInfluences,H.__webglMorphTargetInfluences)}else{e.bindBuffer(e.ARRAY_BUFFER,C.__webglVertexBuffer);e.vertexAttribPointer(h.position,
- 3,e.FLOAT,!1,0,0)}if(h.color>=0){e.bindBuffer(e.ARRAY_BUFFER,C.__webglColorBuffer);e.vertexAttribPointer(h.color,3,e.FLOAT,!1,0,0)}if(h.normal>=0){e.bindBuffer(e.ARRAY_BUFFER,C.__webglNormalBuffer);e.vertexAttribPointer(h.normal,3,e.FLOAT,!1,0,0)}if(h.tangent>=0){e.bindBuffer(e.ARRAY_BUFFER,C.__webglTangentBuffer);e.vertexAttribPointer(h.tangent,4,e.FLOAT,!1,0,0)}if(h.uv>=0)if(C.__webglUVBuffer){e.bindBuffer(e.ARRAY_BUFFER,C.__webglUVBuffer);e.vertexAttribPointer(h.uv,2,e.FLOAT,!1,0,0);e.enableVertexAttribArray(h.uv)}else e.disableVertexAttribArray(h.uv);
- if(h.uv2>=0)if(C.__webglUV2Buffer){e.bindBuffer(e.ARRAY_BUFFER,C.__webglUV2Buffer);e.vertexAttribPointer(h.uv2,2,e.FLOAT,!1,0,0);e.enableVertexAttribArray(h.uv2)}else e.disableVertexAttribArray(h.uv2);if(p.skinning&&h.skinVertexA>=0&&h.skinVertexB>=0&&h.skinIndex>=0&&h.skinWeight>=0){e.bindBuffer(e.ARRAY_BUFFER,C.__webglSkinVertexABuffer);e.vertexAttribPointer(h.skinVertexA,4,e.FLOAT,!1,0,0);e.bindBuffer(e.ARRAY_BUFFER,C.__webglSkinVertexBBuffer);e.vertexAttribPointer(h.skinVertexB,4,e.FLOAT,!1,0,
- 0);e.bindBuffer(e.ARRAY_BUFFER,C.__webglSkinIndicesBuffer);e.vertexAttribPointer(h.skinIndex,4,e.FLOAT,!1,0,0);e.bindBuffer(e.ARRAY_BUFFER,C.__webglSkinWeightsBuffer);e.vertexAttribPointer(h.skinWeight,4,e.FLOAT,!1,0,0)}if(H instanceof THREE.Mesh)if(p.wireframe){e.lineWidth(p.wireframeLinewidth);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,C.__webglLineBuffer);e.drawElements(e.LINES,C.__webglLineCount,e.UNSIGNED_SHORT,0)}else{e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,C.__webglFaceBuffer);e.drawElements(e.TRIANGLES,
- C.__webglFaceCount,e.UNSIGNED_SHORT,0)}else if(H instanceof THREE.Line){H=H.type==THREE.LineStrip?e.LINE_STRIP:e.LINES;e.lineWidth(p.linewidth);e.drawArrays(H,0,C.__webglLineCount)}else if(H instanceof THREE.ParticleSystem)e.drawArrays(e.POINTS,0,C.__webglParticleCount);else H instanceof THREE.Ribbon&&e.drawArrays(e.TRIANGLE_STRIP,0,C.__webglVertexCount)}}function g(h,t){if(!h.__webglVertexBuffer)h.__webglVertexBuffer=e.createBuffer();if(!h.__webglNormalBuffer)h.__webglNormalBuffer=e.createBuffer();
- if(h.hasPos){e.bindBuffer(e.ARRAY_BUFFER,h.__webglVertexBuffer);e.bufferData(e.ARRAY_BUFFER,h.positionArray,e.DYNAMIC_DRAW);e.enableVertexAttribArray(t.attributes.position);e.vertexAttribPointer(t.attributes.position,3,e.FLOAT,!1,0,0)}if(h.hasNormal){e.bindBuffer(e.ARRAY_BUFFER,h.__webglNormalBuffer);e.bufferData(e.ARRAY_BUFFER,h.normalArray,e.DYNAMIC_DRAW);e.enableVertexAttribArray(t.attributes.normal);e.vertexAttribPointer(t.attributes.normal,3,e.FLOAT,!1,0,0)}e.drawArrays(e.TRIANGLES,0,h.count);
- h.count=0}function j(h){if(sa!=h.doubleSided){h.doubleSided?e.disable(e.CULL_FACE):e.enable(e.CULL_FACE);sa=h.doubleSided}if(va!=h.flipSided){h.flipSided?e.frontFace(e.CW):e.frontFace(e.CCW);va=h.flipSided}}function k(h){if(ia!=h){h?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST);ia=h}}function m(h){S[0].set(h.n41-h.n11,h.n42-h.n12,h.n43-h.n13,h.n44-h.n14);S[1].set(h.n41+h.n11,h.n42+h.n12,h.n43+h.n13,h.n44+h.n14);S[2].set(h.n41+h.n21,h.n42+h.n22,h.n43+h.n23,h.n44+h.n24);S[3].set(h.n41-h.n21,h.n42-
- h.n22,h.n43-h.n23,h.n44-h.n24);S[4].set(h.n41-h.n31,h.n42-h.n32,h.n43-h.n33,h.n44-h.n34);S[5].set(h.n41+h.n31,h.n42+h.n32,h.n43+h.n33,h.n44+h.n34);var t;for(h=0;h<6;h++){t=S[h];t.divideScalar(Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z))}}function o(h){for(var t=h.matrixWorld,w=-h.geometry.boundingSphere.radius*Math.max(h.scale.x,Math.max(h.scale.y,h.scale.z)),p=0;p<6;p++){h=S[p].x*t.n14+S[p].y*t.n24+S[p].z*t.n34+S[p].w;if(h<=w)return!1}return!0}function n(h,t){h.list[h.count]=t;h.count+=1}function x(h){var t,
- w,p=h.object,C=h.opaque,H=h.transparent;H.count=0;h=C.count=0;for(t=p.materials.length;h<t;h++){w=p.materials[h];w.opacity&&w.opacity<1||w.blending!=THREE.NormalBlending?n(H,w):n(C,w)}}function z(h){var t,w,p,C,H=h.object,K=h.buffer,E=h.opaque,A=h.transparent;A.count=0;h=E.count=0;for(p=H.materials.length;h<p;h++){t=H.materials[h];if(t instanceof THREE.MeshFaceMaterial){t=0;for(w=K.materials.length;t<w;t++)(C=K.materials[t])&&(C.opacity&&C.opacity<1||C.blending!=THREE.NormalBlending?n(A,C):n(E,C))}else{C=
- t;C.opacity&&C.opacity<1||C.blending!=THREE.NormalBlending?n(A,C):n(E,C)}}}function y(h,t){return t.z-h.z}function B(h,t){h._modelViewMatrix.multiplyToArray(t.matrixWorldInverse,h.matrixWorld,h._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(h._modelViewMatrix).transposeIntoArray(h._normalMatrixArray)}function F(h){var t,w,p;if(h instanceof THREE.Mesh){w=h.geometry;for(t in w.geometryGroups){p=w.geometryGroups[t];if(w.__dirtyVertices||w.__dirtyMorphTargets||w.__dirtyElements||w.__dirtyUvs||w.__dirtyNormals||
- w.__dirtyColors||w.__dirtyTangents){var C=e.DYNAMIC_DRAW,H=void 0,K=void 0,E=void 0,A=void 0;E=void 0;var aa=void 0,J=void 0,Y=void 0,ha=void 0,ra=void 0,ja=void 0,Ha=void 0,ya=void 0,Ba=void 0,W=void 0,ea=void 0,na=void 0,Ia=void 0;J=void 0;Y=void 0;A=void 0;ha=void 0;A=void 0;W=void 0;ea=void 0;J=void 0;W=void 0;ea=void 0;na=void 0;Ia=void 0;W=void 0;ea=void 0;na=void 0;Ia=void 0;W=void 0;ea=void 0;na=void 0;Ia=void 0;W=void 0;ea=void 0;na=void 0;A=void 0;ha=void 0;aa=void 0;E=void 0;E=void 0;var za=
- void 0,Va=void 0,Qa=void 0,Da=0,Ta=0,kb=0,fb=0,$a=0,Za=0,La=0,Ua=0,Oa=0,O=0,Sa=0,Ra=p.__vertexArray,gb=p.__uvArray,db=p.__uv2Array,ab=p.__normalArray,Pa=p.__tangentArray,ta=p.__colorArray,Ea=p.__skinVertexAArray,Ga=p.__skinVertexBArray,Ja=p.__skinIndexArray,Ma=p.__skinWeightArray,Wa=p.__morphTargetsArrays,P=p.__faceArray,ka=p.__lineArray,oa=p.__needsSmoothNormals;ja=p.__vertexColorType;ra=p.__uvType;Ha=p.__normalType;var U=h.geometry,Fa=U.__dirtyVertices,Ca=U.__dirtyElements,pa=U.__dirtyUvs,Q=U.__dirtyNormals,
- Na=U.__dirtyTangents,eb=U.__dirtyColors,cb=U.__dirtyMorphTargets,bb=U.vertices,mb=p.faces,hb=U.faces,ib=U.faceVertexUvs[0],rb=U.faceVertexUvs[1],ob=U.skinVerticesA,pb=U.skinVerticesB,qb=U.skinIndices,lb=U.skinWeights,nb=U.edgeFaces,jb=U.morphTargets;H=0;for(K=mb.length;H<K;H++){E=mb[H];A=hb[E];ib&&(ya=ib[E]);rb&&(Ba=rb[E]);E=A.vertexNormals;aa=A.normal;J=A.vertexColors;Y=A.color;ha=A.vertexTangents;if(A instanceof THREE.Face3){if(Fa){W=bb[A.a].position;ea=bb[A.b].position;na=bb[A.c].position;Ra[Ta]=
- W.x;Ra[Ta+1]=W.y;Ra[Ta+2]=W.z;Ra[Ta+3]=ea.x;Ra[Ta+4]=ea.y;Ra[Ta+5]=ea.z;Ra[Ta+6]=na.x;Ra[Ta+7]=na.y;Ra[Ta+8]=na.z;Ta+=9}if(cb){za=0;for(Va=jb.length;za<Va;za++){W=jb[za].vertices[A.a].position;ea=jb[za].vertices[A.b].position;na=jb[za].vertices[A.c].position;Qa=Wa[za];Qa[Sa+0]=W.x;Qa[Sa+1]=W.y;Qa[Sa+2]=W.z;Qa[Sa+3]=ea.x;Qa[Sa+4]=ea.y;Qa[Sa+5]=ea.z;Qa[Sa+6]=na.x;Qa[Sa+7]=na.y;Qa[Sa+8]=na.z}Sa+=9}if(lb.length){W=lb[A.a];ea=lb[A.b];na=lb[A.c];Ma[O]=W.x;Ma[O+1]=W.y;Ma[O+2]=W.z;Ma[O+3]=W.w;Ma[O+4]=ea.x;
- Ma[O+5]=ea.y;Ma[O+6]=ea.z;Ma[O+7]=ea.w;Ma[O+8]=na.x;Ma[O+9]=na.y;Ma[O+10]=na.z;Ma[O+11]=na.w;W=qb[A.a];ea=qb[A.b];na=qb[A.c];Ja[O]=W.x;Ja[O+1]=W.y;Ja[O+2]=W.z;Ja[O+3]=W.w;Ja[O+4]=ea.x;Ja[O+5]=ea.y;Ja[O+6]=ea.z;Ja[O+7]=ea.w;Ja[O+8]=na.x;Ja[O+9]=na.y;Ja[O+10]=na.z;Ja[O+11]=na.w;W=ob[A.a];ea=ob[A.b];na=ob[A.c];Ea[O]=W.x;Ea[O+1]=W.y;Ea[O+2]=W.z;Ea[O+3]=1;Ea[O+4]=ea.x;Ea[O+5]=ea.y;Ea[O+6]=ea.z;Ea[O+7]=1;Ea[O+8]=na.x;Ea[O+9]=na.y;Ea[O+10]=na.z;Ea[O+11]=1;W=pb[A.a];ea=pb[A.b];na=pb[A.c];Ga[O]=W.x;Ga[O+1]=
- W.y;Ga[O+2]=W.z;Ga[O+3]=1;Ga[O+4]=ea.x;Ga[O+5]=ea.y;Ga[O+6]=ea.z;Ga[O+7]=1;Ga[O+8]=na.x;Ga[O+9]=na.y;Ga[O+10]=na.z;Ga[O+11]=1;O+=12}if(eb&&ja){if(J.length==3&&ja==THREE.VertexColors){A=J[0];W=J[1];ea=J[2]}else ea=W=A=Y;ta[Oa]=A.r;ta[Oa+1]=A.g;ta[Oa+2]=A.b;ta[Oa+3]=W.r;ta[Oa+4]=W.g;ta[Oa+5]=W.b;ta[Oa+6]=ea.r;ta[Oa+7]=ea.g;ta[Oa+8]=ea.b;Oa+=9}if(Na&&U.hasTangents){J=ha[0];Y=ha[1];A=ha[2];Pa[La]=J.x;Pa[La+1]=J.y;Pa[La+2]=J.z;Pa[La+3]=J.w;Pa[La+4]=Y.x;Pa[La+5]=Y.y;Pa[La+6]=Y.z;Pa[La+7]=Y.w;Pa[La+8]=A.x;
- Pa[La+9]=A.y;Pa[La+10]=A.z;Pa[La+11]=A.w;La+=12}if(Q&&Ha)if(E.length==3&&oa)for(ha=0;ha<3;ha++){aa=E[ha];ab[Za]=aa.x;ab[Za+1]=aa.y;ab[Za+2]=aa.z;Za+=3}else for(ha=0;ha<3;ha++){ab[Za]=aa.x;ab[Za+1]=aa.y;ab[Za+2]=aa.z;Za+=3}if(pa&&ya!==undefined&&ra)for(ha=0;ha<3;ha++){E=ya[ha];gb[kb]=E.u;gb[kb+1]=E.v;kb+=2}if(pa&&Ba!==undefined&&ra)for(ha=0;ha<3;ha++){E=Ba[ha];db[fb]=E.u;db[fb+1]=E.v;fb+=2}if(Ca){P[$a]=Da;P[$a+1]=Da+1;P[$a+2]=Da+2;$a+=3;ka[Ua]=Da;ka[Ua+1]=Da+1;ka[Ua+2]=Da;ka[Ua+3]=Da+2;ka[Ua+4]=Da+
- 1;ka[Ua+5]=Da+2;Ua+=6;Da+=3}}else if(A instanceof THREE.Face4){if(Fa){W=bb[A.a].position;ea=bb[A.b].position;na=bb[A.c].position;Ia=bb[A.d].position;Ra[Ta]=W.x;Ra[Ta+1]=W.y;Ra[Ta+2]=W.z;Ra[Ta+3]=ea.x;Ra[Ta+4]=ea.y;Ra[Ta+5]=ea.z;Ra[Ta+6]=na.x;Ra[Ta+7]=na.y;Ra[Ta+8]=na.z;Ra[Ta+9]=Ia.x;Ra[Ta+10]=Ia.y;Ra[Ta+11]=Ia.z;Ta+=12}if(cb){za=0;for(Va=jb.length;za<Va;za++){W=jb[za].vertices[A.a].position;ea=jb[za].vertices[A.b].position;na=jb[za].vertices[A.c].position;Ia=jb[za].vertices[A.d].position;Qa=Wa[za];
- Qa[Sa+0]=W.x;Qa[Sa+1]=W.y;Qa[Sa+2]=W.z;Qa[Sa+3]=ea.x;Qa[Sa+4]=ea.y;Qa[Sa+5]=ea.z;Qa[Sa+6]=na.x;Qa[Sa+7]=na.y;Qa[Sa+8]=na.z;Qa[Sa+9]=Ia.x;Qa[Sa+10]=Ia.y;Qa[Sa+11]=Ia.z}Sa+=12}if(lb.length){W=lb[A.a];ea=lb[A.b];na=lb[A.c];Ia=lb[A.d];Ma[O]=W.x;Ma[O+1]=W.y;Ma[O+2]=W.z;Ma[O+3]=W.w;Ma[O+4]=ea.x;Ma[O+5]=ea.y;Ma[O+6]=ea.z;Ma[O+7]=ea.w;Ma[O+8]=na.x;Ma[O+9]=na.y;Ma[O+10]=na.z;Ma[O+11]=na.w;Ma[O+12]=Ia.x;Ma[O+13]=Ia.y;Ma[O+14]=Ia.z;Ma[O+15]=Ia.w;W=qb[A.a];ea=qb[A.b];na=qb[A.c];Ia=qb[A.d];Ja[O]=W.x;Ja[O+1]=W.y;
- Ja[O+2]=W.z;Ja[O+3]=W.w;Ja[O+4]=ea.x;Ja[O+5]=ea.y;Ja[O+6]=ea.z;Ja[O+7]=ea.w;Ja[O+8]=na.x;Ja[O+9]=na.y;Ja[O+10]=na.z;Ja[O+11]=na.w;Ja[O+12]=Ia.x;Ja[O+13]=Ia.y;Ja[O+14]=Ia.z;Ja[O+15]=Ia.w;W=ob[A.a];ea=ob[A.b];na=ob[A.c];Ia=ob[A.d];Ea[O]=W.x;Ea[O+1]=W.y;Ea[O+2]=W.z;Ea[O+3]=1;Ea[O+4]=ea.x;Ea[O+5]=ea.y;Ea[O+6]=ea.z;Ea[O+7]=1;Ea[O+8]=na.x;Ea[O+9]=na.y;Ea[O+10]=na.z;Ea[O+11]=1;Ea[O+12]=Ia.x;Ea[O+13]=Ia.y;Ea[O+14]=Ia.z;Ea[O+15]=1;W=pb[A.a];ea=pb[A.b];na=pb[A.c];A=pb[A.d];Ga[O]=W.x;Ga[O+1]=W.y;Ga[O+2]=W.z;
- Ga[O+3]=1;Ga[O+4]=ea.x;Ga[O+5]=ea.y;Ga[O+6]=ea.z;Ga[O+7]=1;Ga[O+8]=na.x;Ga[O+9]=na.y;Ga[O+10]=na.z;Ga[O+11]=1;Ga[O+12]=A.x;Ga[O+13]=A.y;Ga[O+14]=A.z;Ga[O+15]=1;O+=16}if(eb&&ja){if(J.length==4&&ja==THREE.VertexColors){A=J[0];W=J[1];ea=J[2];J=J[3]}else J=ea=W=A=Y;ta[Oa]=A.r;ta[Oa+1]=A.g;ta[Oa+2]=A.b;ta[Oa+3]=W.r;ta[Oa+4]=W.g;ta[Oa+5]=W.b;ta[Oa+6]=ea.r;ta[Oa+7]=ea.g;ta[Oa+8]=ea.b;ta[Oa+9]=J.r;ta[Oa+10]=J.g;ta[Oa+11]=J.b;Oa+=12}if(Na&&U.hasTangents){J=ha[0];Y=ha[1];A=ha[2];ha=ha[3];Pa[La]=J.x;Pa[La+1]=
- J.y;Pa[La+2]=J.z;Pa[La+3]=J.w;Pa[La+4]=Y.x;Pa[La+5]=Y.y;Pa[La+6]=Y.z;Pa[La+7]=Y.w;Pa[La+8]=A.x;Pa[La+9]=A.y;Pa[La+10]=A.z;Pa[La+11]=A.w;Pa[La+12]=ha.x;Pa[La+13]=ha.y;Pa[La+14]=ha.z;Pa[La+15]=ha.w;La+=16}if(Q&&Ha)if(E.length==4&&oa)for(ha=0;ha<4;ha++){aa=E[ha];ab[Za]=aa.x;ab[Za+1]=aa.y;ab[Za+2]=aa.z;Za+=3}else for(ha=0;ha<4;ha++){ab[Za]=aa.x;ab[Za+1]=aa.y;ab[Za+2]=aa.z;Za+=3}if(pa&&ya!==undefined&&ra)for(ha=0;ha<4;ha++){E=ya[ha];gb[kb]=E.u;gb[kb+1]=E.v;kb+=2}if(pa&&Ba!==undefined&&ra)for(ha=0;ha<4;ha++){E=
- Ba[ha];db[fb]=E.u;db[fb+1]=E.v;fb+=2}if(Ca){P[$a]=Da;P[$a+1]=Da+1;P[$a+2]=Da+3;P[$a+3]=Da+1;P[$a+4]=Da+2;P[$a+5]=Da+3;$a+=6;ka[Ua]=Da;ka[Ua+1]=Da+1;ka[Ua+2]=Da;ka[Ua+3]=Da+3;ka[Ua+4]=Da+1;ka[Ua+5]=Da+2;ka[Ua+6]=Da+2;ka[Ua+7]=Da+3;Ua+=8;Da+=4}}}if(nb){H=0;for(K=nb.length;H<K;H++){P[$a]=nb[H].a;P[$a+1]=nb[H].b;P[$a+2]=nb[H].c;P[$a+3]=nb[H].a;P[$a+4]=nb[H].c;P[$a+5]=nb[H].d;$a+=6}}if(Fa){e.bindBuffer(e.ARRAY_BUFFER,p.__webglVertexBuffer);e.bufferData(e.ARRAY_BUFFER,Ra,C)}if(cb){za=0;for(Va=jb.length;za<
- Va;za++){e.bindBuffer(e.ARRAY_BUFFER,p.__webglMorphTargetsBuffers[za]);e.bufferData(e.ARRAY_BUFFER,Wa[za],C)}}if(eb&&Oa>0){e.bindBuffer(e.ARRAY_BUFFER,p.__webglColorBuffer);e.bufferData(e.ARRAY_BUFFER,ta,C)}if(Q){e.bindBuffer(e.ARRAY_BUFFER,p.__webglNormalBuffer);e.bufferData(e.ARRAY_BUFFER,ab,C)}if(Na&&U.hasTangents){e.bindBuffer(e.ARRAY_BUFFER,p.__webglTangentBuffer);e.bufferData(e.ARRAY_BUFFER,Pa,C)}if(pa&&kb>0){e.bindBuffer(e.ARRAY_BUFFER,p.__webglUVBuffer);e.bufferData(e.ARRAY_BUFFER,gb,C)}if(pa&&
- fb>0){e.bindBuffer(e.ARRAY_BUFFER,p.__webglUV2Buffer);e.bufferData(e.ARRAY_BUFFER,db,C)}if(Ca){e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,p.__webglFaceBuffer);e.bufferData(e.ELEMENT_ARRAY_BUFFER,P,C);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,p.__webglLineBuffer);e.bufferData(e.ELEMENT_ARRAY_BUFFER,ka,C)}if(O>0){e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinVertexABuffer);e.bufferData(e.ARRAY_BUFFER,Ea,C);e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinVertexBBuffer);e.bufferData(e.ARRAY_BUFFER,Ga,C);e.bindBuffer(e.ARRAY_BUFFER,
- p.__webglSkinIndicesBuffer);e.bufferData(e.ARRAY_BUFFER,Ja,C);e.bindBuffer(e.ARRAY_BUFFER,p.__webglSkinWeightsBuffer);e.bufferData(e.ARRAY_BUFFER,Ma,C)}}}w.__dirtyVertices=!1;w.__dirtyMorphTargets=!1;w.__dirtyElements=!1;w.__dirtyUvs=!1;w.__dirtyNormals=!1;w.__dirtyTangents=!1;w.__dirtyColors=!1}else if(h instanceof THREE.Ribbon){w=h.geometry;if(w.__dirtyVertices||w.__dirtyColors){h=w;t=e.DYNAMIC_DRAW;Ha=h.vertices;C=h.colors;ya=Ha.length;H=C.length;Ba=h.__vertexArray;K=h.__colorArray;Da=h.__dirtyColors;
- if(h.__dirtyVertices){for(ra=0;ra<ya;ra++){ja=Ha[ra].position;p=ra*3;Ba[p]=ja.x;Ba[p+1]=ja.y;Ba[p+2]=ja.z}e.bindBuffer(e.ARRAY_BUFFER,h.__webglVertexBuffer);e.bufferData(e.ARRAY_BUFFER,Ba,t)}if(Da){for(ra=0;ra<H;ra++){color=C[ra];p=ra*3;K[p]=color.r;K[p+1]=color.g;K[p+2]=color.b}e.bindBuffer(e.ARRAY_BUFFER,h.__webglColorBuffer);e.bufferData(e.ARRAY_BUFFER,K,t)}}w.__dirtyVertices=!1;w.__dirtyColors=!1}else if(h instanceof THREE.Line){w=h.geometry;if(w.__dirtyVertices||w.__dirtyColors){h=w;t=e.DYNAMIC_DRAW;
- Ha=h.vertices;C=h.colors;ya=Ha.length;H=C.length;Ba=h.__vertexArray;K=h.__colorArray;Da=h.__dirtyColors;if(h.__dirtyVertices){for(ra=0;ra<ya;ra++){ja=Ha[ra].position;p=ra*3;Ba[p]=ja.x;Ba[p+1]=ja.y;Ba[p+2]=ja.z}e.bindBuffer(e.ARRAY_BUFFER,h.__webglVertexBuffer);e.bufferData(e.ARRAY_BUFFER,Ba,t)}if(Da){for(ra=0;ra<H;ra++){color=C[ra];p=ra*3;K[p]=color.r;K[p+1]=color.g;K[p+2]=color.b}e.bindBuffer(e.ARRAY_BUFFER,h.__webglColorBuffer);e.bufferData(e.ARRAY_BUFFER,K,t)}}w.__dirtyVertices=!1;w.__dirtyColors=
- !1}else if(h instanceof THREE.ParticleSystem){w=h.geometry;(w.__dirtyVertices||w.__dirtyColors||h.sortParticles)&&c(w,e.DYNAMIC_DRAW,h);w.__dirtyVertices=!1;w.__dirtyColors=!1}}function G(h){function t(ha){var ra=[];w=0;for(p=ha.length;w<p;w++)ha[w]==undefined?ra.push("undefined"):ra.push(ha[w].id);return ra.join("_")}var w,p,C,H,K,E,A,aa,J={},Y=h.morphTargets!==undefined?h.morphTargets.length:0;h.geometryGroups={};C=0;for(H=h.faces.length;C<H;C++){K=h.faces[C];E=K.materials;A=t(E);J[A]==undefined&&
- (J[A]={hash:A,counter:0});aa=J[A].hash+"_"+J[A].counter;h.geometryGroups[aa]==undefined&&(h.geometryGroups[aa]={faces:[],materials:E,vertices:0,numMorphTargets:Y});K=K instanceof THREE.Face3?3:4;if(h.geometryGroups[aa].vertices+K>65535){J[A].counter+=1;aa=J[A].hash+"_"+J[A].counter;h.geometryGroups[aa]==undefined&&(h.geometryGroups[aa]={faces:[],materials:E,vertices:0,numMorphTargets:Y})}h.geometryGroups[aa].faces.push(C);h.geometryGroups[aa].vertices+=K}}function I(h,t,w){h.push({buffer:t,object:w,
- opaque:{list:[],count:0},transparent:{list:[],count:0}})}function R(h){if(h!=wa){switch(h){case THREE.AdditiveBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE);break;case THREE.SubtractiveBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD);e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}wa=
- h}}function D(h,t,w){if((w.width&w.width-1)==0&&(w.height&w.height-1)==0){e.texParameteri(h,e.TEXTURE_WRAP_S,ma(t.wrapS));e.texParameteri(h,e.TEXTURE_WRAP_T,ma(t.wrapT));e.texParameteri(h,e.TEXTURE_MAG_FILTER,ma(t.magFilter));e.texParameteri(h,e.TEXTURE_MIN_FILTER,ma(t.minFilter));e.generateMipmap(h)}else{e.texParameteri(h,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE);e.texParameteri(h,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);e.texParameteri(h,e.TEXTURE_MAG_FILTER,N(t.magFilter));e.texParameteri(h,e.TEXTURE_MIN_FILTER,
- N(t.minFilter))}}function M(h){if(h&&!h.__webglFramebuffer){h.__webglFramebuffer=e.createFramebuffer();h.__webglRenderbuffer=e.createRenderbuffer();h.__webglTexture=e.createTexture();e.bindRenderbuffer(e.RENDERBUFFER,h.__webglRenderbuffer);e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,h.width,h.height);e.bindTexture(e.TEXTURE_2D,h.__webglTexture);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,ma(h.wrapS));e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,ma(h.wrapT));e.texParameteri(e.TEXTURE_2D,
- e.TEXTURE_MAG_FILTER,ma(h.magFilter));e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,ma(h.minFilter));e.texImage2D(e.TEXTURE_2D,0,ma(h.format),h.width,h.height,0,ma(h.format),ma(h.type),null);e.bindFramebuffer(e.FRAMEBUFFER,h.__webglFramebuffer);e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,h.__webglTexture,0);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,h.__webglRenderbuffer);e.bindTexture(e.TEXTURE_2D,null);e.bindRenderbuffer(e.RENDERBUFFER,
- null);e.bindFramebuffer(e.FRAMEBUFFER,null)}var t,w;if(h){t=h.__webglFramebuffer;w=h.width;h=h.height}else{t=null;w=qa;h=Z}if(t!=$){e.bindFramebuffer(e.FRAMEBUFFER,t);e.viewport(T,fa,w,h);$=t}}function L(h,t){var w;if(h=="fragment")w=e.createShader(e.FRAGMENT_SHADER);else h=="vertex"&&(w=e.createShader(e.VERTEX_SHADER));e.shaderSource(w,t);e.compileShader(w);if(!e.getShaderParameter(w,e.COMPILE_STATUS)){console.error(e.getShaderInfoLog(w));console.error(t);return null}return w}function N(h){switch(h){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return e.NEAREST;
- default:return e.LINEAR}}function ma(h){switch(h){case THREE.RepeatWrapping:return e.REPEAT;case THREE.ClampToEdgeWrapping:return e.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return e.MIRRORED_REPEAT;case THREE.NearestFilter:return e.NEAREST;case THREE.NearestMipMapNearestFilter:return e.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return e.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return e.LINEAR;case THREE.LinearMipMapNearestFilter:return e.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return e.LINEAR_MIPMAP_LINEAR;
- case THREE.ByteType:return e.BYTE;case THREE.UnsignedByteType:return e.UNSIGNED_BYTE;case THREE.ShortType:return e.SHORT;case THREE.UnsignedShortType:return e.UNSIGNED_SHORT;case THREE.IntType:return e.INT;case THREE.UnsignedShortType:return e.UNSIGNED_INT;case THREE.FloatType:return e.FLOAT;case THREE.AlphaFormat:return e.ALPHA;case THREE.RGBFormat:return e.RGB;case THREE.RGBAFormat:return e.RGBA;case THREE.LuminanceFormat:return e.LUMINANCE;case THREE.LuminanceAlphaFormat:return e.LUMINANCE_ALPHA}return 0}
- var e,la=document.createElement("canvas"),V=null,$=null,X=this,sa=null,va=null,wa=null,ia=null,T=0,fa=0,qa=0,Z=0,S=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],da=new THREE.Matrix4,ua=new Float32Array(16),ca=new Float32Array(16),ga=new THREE.Vector4,xa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},Ka=!0,Xa=new THREE.Color(0),Ya=0;if(a){if(a.antialias!==undefined)Ka=
- a.antialias;a.clearColor!==undefined&&Xa.setHex(a.clearColor);if(a.clearAlpha!==undefined)Ya=a.clearAlpha}this.maxMorphTargets=8;this.domElement=la;this.autoClear=!0;this.sortObjects=!0;(function(h,t,w){try{if(!(e=la.getContext("experimental-webgl",{antialias:h,stencil:!0})))throw"Error creating WebGL context.";}catch(p){console.error(p)}e.clearColor(0,0,0,1);e.clearDepth(1);e.enable(e.DEPTH_TEST);e.depthFunc(e.LEQUAL);e.frontFace(e.CCW);e.cullFace(e.BACK);e.enable(e.CULL_FACE);e.enable(e.BLEND);
- e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA);e.clearColor(t.r,t.g,t.b,w)})(Ka,Xa,Ya);this.context=e;var Aa={};a=[];Ka=[];a[0]=-2;a[1]=-1;a[2]=-1;a[3]=2;a[4]=-1;a[5]=-1;a[6]=2;a[7]=1;a[8]=-1;a[9]=-2;a[10]=1;a[11]=-1;Ka[0]=0;Ka[1]=1;Ka[2]=2;Ka[3]=0;Ka[4]=2;Ka[5]=3;Aa.vertexBuffer=e.createBuffer();Aa.elementBuffer=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,Aa.vertexBuffer);e.bufferData(e.ARRAY_BUFFER,new Float32Array(a),e.STATIC_DRAW);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,
- Aa.elementBuffer);e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Uint16Array(Ka),e.STATIC_DRAW);Aa.program=e.createProgram();e.attachShader(Aa.program,L("fragment",THREE.ShaderLib.shadowPost.fragmentShader));e.attachShader(Aa.program,L("vertex",THREE.ShaderLib.shadowPost.vertexShader));e.linkProgram(Aa.program);Aa.vertexLocation=e.getAttribLocation(Aa.program,"position");Aa.projectionLocation=e.getUniformLocation(Aa.program,"projectionMatrix");this.setSize=function(h,t){la.width=h;la.height=t;this.setViewport(0,
- 0,la.width,la.height)};this.setViewport=function(h,t,w,p){T=h;fa=t;qa=w;Z=p;e.viewport(T,fa,qa,Z)};this.setScissor=function(h,t,w,p){e.scissor(h,t,w,p)};this.enableScissorTest=function(h){h?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST)};this.enableDepthBufferWrite=function(h){e.depthMask(h)};this.setClearColorHex=function(h,t){var w=new THREE.Color(h);e.clearColor(w.r,w.g,w.b,t)};this.setClearColor=function(h,t){e.clearColor(h.r,h.g,h.b,t)};this.clear=function(){e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|
- e.STENCIL_BUFFER_BIT)};this.initMaterial=function(h,t,w,p){var C,H,K,E;if(h instanceof THREE.MeshDepthMaterial)b(h,THREE.ShaderLib.depth);else if(h instanceof THREE.ShadowVolumeDynamicMaterial)b(h,THREE.ShaderLib.shadowVolumeDynamic);else if(h instanceof THREE.MeshNormalMaterial)b(h,THREE.ShaderLib.normal);else if(h instanceof THREE.MeshBasicMaterial)b(h,THREE.ShaderLib.basic);else if(h instanceof THREE.MeshLambertMaterial)b(h,THREE.ShaderLib.lambert);else if(h instanceof THREE.MeshPhongMaterial)b(h,
- THREE.ShaderLib.phong);else if(h instanceof THREE.LineBasicMaterial)b(h,THREE.ShaderLib.basic);else h instanceof THREE.ParticleBasicMaterial&&b(h,THREE.ShaderLib.particle_basic);if(!h.program){var A,aa,J;A=J=E=0;for(K=t.length;A<K;A++){aa=t[A];aa instanceof THREE.DirectionalLight&&J++;aa instanceof THREE.PointLight&&E++}if(E+J<=4)t=J;else{t=Math.ceil(4*J/(E+J));E=4-t}E={directional:t,point:E};t=50;if(p!==undefined&&p instanceof THREE.SkinnedMesh)t=p.bones.length;K={map:h.map,envMap:h.envMap,lightMap:h.lightMap,
- vertexColors:h.vertexColors,fog:w,sizeAttenuation:h.sizeAttenuation,skinning:h.skinning,morphTargets:h.morphTargets,maxDirLights:E.directional,maxPointLights:E.point,maxBones:t};w=h.fragmentShader;E=h.vertexShader;t=e.createProgram();A=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+K.maxDirLights,"#define MAX_POINT_LIGHTS "+K.maxPointLights,K.fog?"#define USE_FOG":"",K.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",K.map?"#define USE_MAP":"",K.envMap?"#define USE_ENVMAP":
- "",K.lightMap?"#define USE_LIGHTMAP":"",K.vertexColors?"#define USE_COLOR":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");K=[e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+K.maxDirLights,"#define MAX_POINT_LIGHTS "+K.maxPointLights,"#define MAX_BONES "+K.maxBones,K.map?"#define USE_MAP":"",K.envMap?"#define USE_ENVMAP":"",K.lightMap?"#define USE_LIGHTMAP":"",K.vertexColors?"#define USE_COLOR":"",K.skinning?"#define USE_SKINNING":
- "",K.morphTargets?"#define USE_MORPHTARGETS":"",K.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
- e.attachShader(t,L("fragment",A+w));e.attachShader(t,L("vertex",K+E));e.linkProgram(t);e.getProgramParameter(t,e.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+e.getProgramParameter(t,e.VALIDATE_STATUS)+", gl error ["+e.getError()+"]");t.uniforms={};t.attributes={};h.program=t;w=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(C in h.uniforms)w.push(C);
- C=h.program;E=0;for(t=w.length;E<t;E++){A=w[E];C.uniforms[A]=e.getUniformLocation(C,A)}w=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(C=0;C<this.maxMorphTargets;C++)w.push("morphTarget"+C);for(H in h.attributes)w.push(H);H=h.program;C=w;w=0;for(E=C.length;w<E;w++){t=C[w];H.attributes[t]=e.getAttribLocation(H,t)}H=h.program.attributes;e.enableVertexAttribArray(H.position);H.color>=0&&e.enableVertexAttribArray(H.color);H.normal>=0&&e.enableVertexAttribArray(H.normal);
- H.tangent>=0&&e.enableVertexAttribArray(H.tangent);if(h.skinning&&H.skinVertexA>=0&&H.skinVertexB>=0&&H.skinIndex>=0&&H.skinWeight>=0){e.enableVertexAttribArray(H.skinVertexA);e.enableVertexAttribArray(H.skinVertexB);e.enableVertexAttribArray(H.skinIndex);e.enableVertexAttribArray(H.skinWeight)}if(h.morphTargets){h.numSupportedMorphTargets=0;if(H.morphTarget0>=0){e.enableVertexAttribArray(H.morphTarget0);h.numSupportedMorphTargets++}if(H.morphTarget1>=0){e.enableVertexAttribArray(H.morphTarget1);
- h.numSupportedMorphTargets++}if(H.morphTarget2>=0){e.enableVertexAttribArray(H.morphTarget2);h.numSupportedMorphTargets++}if(H.morphTarget3>=0){e.enableVertexAttribArray(H.morphTarget3);h.numSupportedMorphTargets++}if(H.morphTarget4>=0){e.enableVertexAttribArray(H.morphTarget4);h.numSupportedMorphTargets++}if(H.morphTarget5>=0){e.enableVertexAttribArray(H.morphTarget5);h.numSupportedMorphTargets++}if(H.morphTarget6>=0){e.enableVertexAttribArray(H.morphTarget6);h.numSupportedMorphTargets++}if(H.morphTarget7>=
- 0){e.enableVertexAttribArray(H.morphTarget7);h.numSupportedMorphTargets++}p.__webglMorphTargetInfluences=new Float32Array(this.maxMorphTargets);C=0;for(H=this.maxMorphTargets;C<H;C++)p.__webglMorphTargetInfluences[C]=0}}h.__webglProgram=!0};this.render=function(h,t,w,p){var C,H,K,E,A,aa,J,Y,ha=h.lights,ra=h.fog;t.matrixAutoUpdate&&t.updateMatrix();h.update(undefined,!1,t);t.matrixWorldInverse.flattenToArray(ca);t.projectionMatrix.flattenToArray(ua);da.multiply(t.projectionMatrix,t.matrixWorldInverse);
- m(da);this.initWebGLObjects(h);M(w);(this.autoClear||p)&&this.clear();p=h.__webglObjects.length;for(A=0;A<p;A++){E=h.__webglObjects[A];J=E.object;if(J.visible)if(!(J instanceof THREE.Mesh)||o(J)){J.matrixWorld.flattenToArray(J._objectMatrixArray);B(J,t);z(E);E.render=!0;if(this.sortObjects){ga.copy(J.position);da.multiplyVector3(ga);E.z=ga.z}}else E.render=!1;else E.render=!1}this.sortObjects&&h.__webglObjects.sort(y);aa=h.__webglObjectsImmediate.length;for(A=0;A<aa;A++){E=h.__webglObjectsImmediate[A];
- J=E.object;if(J.visible){J.matrixAutoUpdate&&J.matrixWorld.flattenToArray(J._objectMatrixArray);B(J,t);x(E)}}R(THREE.NormalBlending);for(A=0;A<p;A++){E=h.__webglObjects[A];if(E.render){J=E.object;Y=E.buffer;K=E.opaque;j(J);for(C=0;C<K.count;C++){E=K.list[C];k(E.depthTest);f(t,ha,ra,E,Y,J)}}}for(A=0;A<aa;A++){E=h.__webglObjectsImmediate[A];J=E.object;if(J.visible){K=E.opaque;j(J);for(C=0;C<K.count;C++){E=K.list[C];k(E.depthTest);H=d(t,ha,ra,E,J);J.render(function(ja){g(ja,H)})}}}for(A=0;A<p;A++){E=
- h.__webglObjects[A];if(E.render){J=E.object;Y=E.buffer;K=E.transparent;j(J);for(C=0;C<K.count;C++){E=K.list[C];R(E.blending);k(E.depthTest);f(t,ha,ra,E,Y,J)}}}for(A=0;A<aa;A++){E=h.__webglObjectsImmediate[A];J=E.object;if(J.visible){K=E.transparent;j(J);for(C=0;C<K.count;C++){E=K.list[C];R(E.blending);k(E.depthTest);H=d(t,ha,ra,E,J);J.render(function(ja){g(ja,H)})}}}if(h.__webglShadowVolumes.length&&h.lights.length){e.enable(e.POLYGON_OFFSET_FILL);e.polygonOffset(0.1,1);e.enable(e.STENCIL_TEST);e.depthMask(!1);
- e.colorMask(!1,!1,!1,!1);e.stencilFunc(e.ALWAYS,1,255);e.stencilOpSeparate(e.BACK,e.KEEP,e.INCR,e.KEEP);e.stencilOpSeparate(e.FRONT,e.KEEP,e.DECR,e.KEEP);aa=h.lights.length;Y=[];p=h.__webglShadowVolumes.length;for(t=0;t<aa;t++){A=h.lights[t];if(A instanceof THREE.DirectionalLight){Y[0]=-A.position.x;Y[1]=-A.position.y;Y[2]=-A.position.z;for(A=0;A<p;A++){J=h.__webglShadowVolumes[A].object;C=h.__webglShadowVolumes[A].buffer;E=J.materials[0];E.program||X.initMaterial(E,ha,ra,J);H=E.program;E=H.uniforms;
- K=H.attributes;if(V!==H){e.useProgram(H);V=H;e.uniformMatrix4fv(E.projectionMatrix,!1,ua);e.uniformMatrix4fv(E.viewMatrix,!1,ca);e.uniform3fv(E.directionalLightDirection,Y)}J.matrixWorld.flattenToArray(J._objectMatrixArray);e.uniformMatrix4fv(E.objectMatrix,!1,J._objectMatrixArray);e.bindBuffer(e.ARRAY_BUFFER,C.__webglVertexBuffer);e.vertexAttribPointer(K.position,3,e.FLOAT,!1,0,0);e.bindBuffer(e.ARRAY_BUFFER,C.__webglNormalBuffer);e.vertexAttribPointer(K.normal,3,e.FLOAT,!1,0,0);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,
- C.__webglFaceBuffer);e.cullFace(e.FRONT);e.drawElements(e.TRIANGLES,C.__webglFaceCount,e.UNSIGNED_SHORT,0);e.cullFace(e.BACK);e.drawElements(e.TRIANGLES,C.__webglFaceCount,e.UNSIGNED_SHORT,0)}}}e.disable(e.POLYGON_OFFSET_FILL);e.colorMask(!0,!0,!0,!0);e.stencilFunc(e.NOTEQUAL,0,255);e.stencilOp(e.KEEP,e.KEEP,e.KEEP);e.disable(e.DEPTH_TEST);e.enable(e.BLEND);e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA);e.blendEquation(e.FUNC_ADD);wa="";V=Aa.program;e.useProgram(Aa.program);e.uniformMatrix4fv(Aa.projectionLocation,
- !1,ua);e.bindBuffer(e.ARRAY_BUFFER,Aa.vertexBuffer);e.vertexAttribPointer(Aa.vertexLocation,3,e.FLOAT,!1,0,0);e.enableVertexAttribArray(Aa.vertexLocation);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,Aa.elementBuffer);e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0);e.disable(e.STENCIL_TEST);e.enable(e.DEPTH_TEST);e.disable(e.BLEND);e.depthMask(!0)}if(w&&w.minFilter!==THREE.NearestFilter&&w.minFilter!==THREE.LinearFilter){e.bindTexture(e.TEXTURE_2D,w.__webglTexture);e.generateMipmap(e.TEXTURE_2D);e.bindTexture(e.TEXTURE_2D,
- null)}};this.initWebGLObjects=function(h){if(!h.__webglObjects){h.__webglObjects=[];h.__webglObjectsImmediate=[];h.__webglShadowVolumes=[]}for(;h.__objectsAdded.length;){var t=h.__objectsAdded[0],w=h,p=void 0,C=void 0,H=void 0;if(t._modelViewMatrix==undefined){t._modelViewMatrix=new THREE.Matrix4;t._normalMatrixArray=new Float32Array(9);t._modelViewMatrixArray=new Float32Array(16);t._objectMatrixArray=new Float32Array(16);t.matrixWorld.flattenToArray(t._objectMatrixArray)}if(t instanceof THREE.Mesh){C=
- t.geometry;C.geometryGroups==undefined&&G(C);for(p in C.geometryGroups){H=C.geometryGroups[p];if(!H.__webglVertexBuffer){var K=H;K.__webglVertexBuffer=e.createBuffer();K.__webglNormalBuffer=e.createBuffer();K.__webglTangentBuffer=e.createBuffer();K.__webglColorBuffer=e.createBuffer();K.__webglUVBuffer=e.createBuffer();K.__webglUV2Buffer=e.createBuffer();K.__webglSkinVertexABuffer=e.createBuffer();K.__webglSkinVertexBBuffer=e.createBuffer();K.__webglSkinIndicesBuffer=e.createBuffer();K.__webglSkinWeightsBuffer=
- e.createBuffer();K.__webglFaceBuffer=e.createBuffer();K.__webglLineBuffer=e.createBuffer();if(K.numMorphTargets){var E=void 0,A=void 0;K.__webglMorphTargetsBuffers=[];E=0;for(A=K.numMorphTargets;E<A;E++)K.__webglMorphTargetsBuffers.push(e.createBuffer())}K=H;E=t;var aa=void 0,J=void 0,Y=void 0;Y=void 0;var ha=A=0,ra=0;aa=void 0;J=void 0;var ja=void 0;J=void 0;var Ha=E.geometry;ja=Ha.faces;var ya=K.faces;aa=0;for(J=ya.length;aa<J;aa++){Y=ya[aa];Y=ja[Y];if(Y instanceof THREE.Face3){A+=3;ha+=1;ra+=3}else if(Y instanceof
- THREE.Face4){A+=4;ha+=2;ra+=4}}aa=K;J=E;ja=void 0;ya=void 0;var Ba=void 0,W=void 0;Ba=void 0;Y=[];ja=0;for(ya=J.materials.length;ja<ya;ja++){Ba=J.materials[ja];if(Ba instanceof THREE.MeshFaceMaterial){Ba=0;for(l=aa.materials.length;Ba<l;Ba++)(W=aa.materials[Ba])&&Y.push(W)}else(W=Ba)&&Y.push(W)}J=Y;a:{aa=void 0;ja=void 0;ya=J.length;for(aa=0;aa<ya;aa++){ja=J[aa];if(ja.map||ja.lightMap||ja instanceof THREE.MeshShaderMaterial){aa=!0;break a}}aa=!1}a:{ja=J;ya=void 0;Y=void 0;Ba=ja.length;for(ya=0;ya<
- Ba;ya++){Y=ja[ya];if(!(Y instanceof THREE.MeshBasicMaterial&&!Y.envMap||Y instanceof THREE.MeshDepthMaterial)){ja=Y&&Y.shading!=undefined&&Y.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}}ja=!1}a:{ya=void 0;Y=void 0;Ba=J.length;for(ya=0;ya<Ba;ya++){Y=J[ya];if(Y.vertexColors){J=Y.vertexColors;break a}}J=!1}K.__vertexArray=new Float32Array(A*3);if(ja)K.__normalArray=new Float32Array(A*3);if(Ha.hasTangents)K.__tangentArray=new Float32Array(A*4);if(J)K.__colorArray=new Float32Array(A*
- 3);if(aa){if(Ha.faceUvs.length>0||Ha.faceVertexUvs.length>0)K.__uvArray=new Float32Array(A*2);if(Ha.faceUvs.length>1||Ha.faceVertexUvs.length>1)K.__uv2Array=new Float32Array(A*2)}if(E.geometry.skinWeights.length&&E.geometry.skinIndices.length){K.__skinVertexAArray=new Float32Array(A*4);K.__skinVertexBArray=new Float32Array(A*4);K.__skinIndexArray=new Float32Array(A*4);K.__skinWeightArray=new Float32Array(A*4)}K.__faceArray=new Uint16Array(ha*3+(E.geometry.edgeFaces?E.geometry.edgeFaces.length*6:0));
- K.__lineArray=new Uint16Array(ra*2);if(K.numMorphTargets){Ha=void 0;ya=void 0;K.__morphTargetsArrays=[];Ha=0;for(ya=K.numMorphTargets;Ha<ya;Ha++)K.__morphTargetsArrays.push(new Float32Array(A*3))}K.__needsSmoothNormals=ja==THREE.SmoothShading;K.__uvType=aa;K.__vertexColorType=J;K.__normalType=ja;K.__webglFaceCount=ha*3+(E.geometry.edgeFaces?E.geometry.edgeFaces.length*6:0);K.__webglLineCount=ra*2;C.__dirtyVertices=!0;C.__dirtyMorphTargets=!0;C.__dirtyElements=!0;C.__dirtyUvs=!0;C.__dirtyNormals=!0;
- C.__dirtyTangents=!0;C.__dirtyColors=!0}t instanceof THREE.ShadowVolume?I(w.__webglShadowVolumes,H,t):I(w.__webglObjects,H,t)}}else if(t instanceof THREE.Ribbon){C=t.geometry;if(!C.__webglVertexBuffer){p=C;p.__webglVertexBuffer=e.createBuffer();p.__webglColorBuffer=e.createBuffer();p=C;H=p.vertices.length;p.__vertexArray=new Float32Array(H*3);p.__colorArray=new Float32Array(H*3);p.__webglVertexCount=H;C.__dirtyVertices=!0;C.__dirtyColors=!0}I(w.__webglObjects,C,t)}else if(t instanceof THREE.Line){C=
- t.geometry;if(!C.__webglVertexBuffer){p=C;p.__webglVertexBuffer=e.createBuffer();p.__webglColorBuffer=e.createBuffer();p=C;H=p.vertices.length;p.__vertexArray=new Float32Array(H*3);p.__colorArray=new Float32Array(H*3);p.__webglLineCount=H;C.__dirtyVertices=!0;C.__dirtyColors=!0}I(w.__webglObjects,C,t)}else if(t instanceof THREE.ParticleSystem){C=t.geometry;if(!C.__webglVertexBuffer){p=C;p.__webglVertexBuffer=e.createBuffer();p.__webglColorBuffer=e.createBuffer();p=C;H=p.vertices.length;p.__vertexArray=
- new Float32Array(H*3);p.__colorArray=new Float32Array(H*3);p.__sortArray=[];p.__webglParticleCount=H;C.__dirtyVertices=!0;C.__dirtyColors=!0}I(w.__webglObjects,C,t)}else THREE.MarchingCubes!==undefined&&t instanceof THREE.MarchingCubes&&w.__webglObjectsImmediate.push({object:t,opaque:{list:[],count:0},transparent:{list:[],count:0}});h.__objectsAdded.splice(0,1)}for(;h.__objectsRemoved.length;){t=h.__objectsRemoved[0];w=h;C=void 0;p=void 0;for(C=w.__webglObjects.length-1;C>=0;C--){p=w.__webglObjects[C].object;
- t==p&&w.__webglObjects.splice(C,1)}h.__objectsRemoved.splice(0,1)}t=0;for(w=h.__webglObjects.length;t<w;t++)F(h.__webglObjects[t].object,h);t=0;for(w=h.__webglShadowVolumes.length;t<w;t++)F(h.__webglShadowVolumes[t].object,h)};this.setFaceCulling=function(h,t){if(h){!t||t=="ccw"?e.frontFace(e.CCW):e.frontFace(e.CW);if(h=="back")e.cullFace(e.BACK);else h=="front"?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK);e.enable(e.CULL_FACE)}else e.disable(e.CULL_FACE)};this.supportsVertexTextures=function(){return e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>
- 0}};THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,c,b){b&&a.update(undefined,!1,c);b=a.sounds;var d,f=b.length;for(d=0;d<f;d++){a=b[d];this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34);this.soundPosition.subSelf(c.position);if(a.isPlaying&&a.isLoaded){a.isAddedToDOM||a.addToDOM(this.domElement);a.calculateVolumeAndPan(this.soundPosition)}}}};
- THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)};
- THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
- THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[[]];this.z=null};
- THREE.RenderableObject=function(){this.z=this.object=null};THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.materials=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.materials=null};
- var GeometryUtils={merge:function(a,c){var b=c instanceof THREE.Mesh,d=a.vertices.length,f=b?c.geometry:c,g=a.vertices,j=f.vertices,k=a.faces,m=f.faces,o=a.faceVertexUvs[0];f=f.faceVertexUvs[0];b&&c.matrixAutoUpdate&&c.updateMatrix();for(var n=0,x=j.length;n<x;n++){var z=new THREE.Vertex(j[n].position.clone());b&&c.matrix.multiplyVector3(z.position);g.push(z)}n=0;for(x=m.length;n<x;n++){j=m[n];var y,B,F=j.vertexNormals;z=j.vertexColors;if(j instanceof THREE.Face3)y=new THREE.Face3(j.a+d,j.b+d,j.c+
- d);else j instanceof THREE.Face4&&(y=new THREE.Face4(j.a+d,j.b+d,j.c+d,j.d+d));y.normal.copy(j.normal);b=0;for(g=F.length;b<g;b++){B=F[b];y.vertexNormals.push(B.clone())}y.color.copy(j.color);b=0;for(g=z.length;b<g;b++){B=z[b];y.vertexColors.push(B.clone())}y.materials=j.materials.slice();y.centroid.copy(j.centroid);k.push(y)}n=0;for(x=f.length;n<x;n++){d=f[n];k=[];b=0;for(g=d.length;b<g;b++)k.push(new THREE.UV(d[b].u,d[b].v));o.push(k)}}},ImageUtils={loadTexture:function(a,c,b){var d=new Image,f=
- new THREE.Texture(d,c);d.onload=function(){f.needsUpdate=!0;b&&b(this)};d.src=a;return f},loadTextureCube:function(a,c,b){var d,f=[],g=new THREE.Texture(f,c);c=f.loadCount=0;for(d=a.length;c<d;++c){f[c]=new Image;f[c].onload=function(){f.loadCount+=1;if(f.loadCount==6)g.needsUpdate=!0;b&&b(this)};f[c].src=a[c]}return g}},SceneUtils={loadScene:function(a,c,b,d){var f=new Worker(a);f.postMessage(0);var g=THREE.Loader.prototype.extractUrlbase(a);f.onmessage=function(j){function k(qa,Z){return Z=="relativeToHTML"?
- qa:g+"/"+qa}function m(){for(y in V.objects)if(!T.objects[y]){R=V.objects[y];if(N=T.geometries[R.geometry]){la=[];for(fa=0;fa<R.materials.length;fa++)la[fa]=T.materials[R.materials[fa]];D=R.position;r=R.rotation;q=R.quaternion;s=R.scale;q=0;la.length==0&&(la[0]=new THREE.MeshFaceMaterial);object=new THREE.Mesh(N,la);object.position.set(D[0],D[1],D[2]);if(q){object.quaternion.set(q[0],q[1],q[2],q[3]);object.useQuaternion=!0}else object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);
- object.visible=R.visible;T.scene.addObject(object);T.objects[y]=object}}}function o(qa){return function(Z){T.geometries[qa]=Z;m();sa-=1;n()}}function n(){d({total_models:wa,total_textures:ia,loaded_models:wa-sa,loaded_textures:ia-va},T);sa==0&&va==0&&b(T)}var x,z,y,B,F,G,I,R,D,M,L,N,ma,e,la,V,$,X,sa,va,wa,ia,T;V=j.data;$=new THREE.BinaryLoader;X=new THREE.JSONLoader;va=sa=0;T={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{}};j=function(){va-=1;
- n()};for(F in V.cameras){M=V.cameras[F];if(M.type=="perspective")ma=new THREE.Camera(M.fov,M.aspect,M.near,M.far);else if(M.type=="ortho"){ma=new THREE.Camera;ma.projectionMatrix=THREE.Matrix4.makeOrtho(M.left,M.right,M.top,M.bottom,M.near,M.far)}D=M.position;M=M.target;ma.position.set(D[0],D[1],D[2]);ma.target.position.set(M[0],M[1],M[2]);T.cameras[F]=ma}for(B in V.lights){F=V.lights[B];ma=F.color!==undefined?F.color:16777215;M=F.intensity!==undefined?F.intensity:1;if(F.type=="directional"){D=F.direction;
- light=new THREE.DirectionalLight(ma,M);light.position.set(D[0],D[1],D[2]);light.position.normalize()}else if(F.type=="point"){D=F.position;light=new THREE.PointLight(ma,M);light.position.set(D[0],D[1],D[2])}T.scene.addLight(light);T.lights[B]=light}for(G in V.fogs){B=V.fogs[G];if(B.type=="linear")e=new THREE.Fog(0,B.near,B.far);else B.type=="exp2"&&(e=new THREE.FogExp2(0,B.density));M=B.color;e.color.setRGB(M[0],M[1],M[2]);T.fogs[G]=e}if(T.cameras&&V.defaults.camera)T.currentCamera=T.cameras[V.defaults.camera];
- if(T.fogs&&V.defaults.fog)T.scene.fog=T.fogs[V.defaults.fog];M=V.defaults.bgcolor;T.bgColor=new THREE.Color;T.bgColor.setRGB(M[0],M[1],M[2]);T.bgColorAlpha=V.defaults.bgalpha;for(x in V.geometries){G=V.geometries[x];if(G.type=="bin_mesh"||G.type=="ascii_mesh")sa+=1}wa=sa;for(x in V.geometries){G=V.geometries[x];if(G.type=="cube"){N=new Cube(G.width,G.height,G.depth,G.segmentsWidth,G.segmentsHeight,G.segmentsDepth,null,G.flipped,G.sides);T.geometries[x]=N}else if(G.type=="plane"){N=new Plane(G.width,
- G.height,G.segmentsWidth,G.segmentsHeight);T.geometries[x]=N}else if(G.type=="sphere"){N=new Sphere(G.radius,G.segmentsWidth,G.segmentsHeight);T.geometries[x]=N}else if(G.type=="cylinder"){N=new Cylinder(G.numSegs,G.topRad,G.botRad,G.height,G.topOffset,G.botOffset);T.geometries[x]=N}else if(G.type=="torus"){N=new Torus(G.radius,G.tube,G.segmentsR,G.segmentsT);T.geometries[x]=N}else if(G.type=="icosahedron"){N=new Icosahedron(G.subdivisions);T.geometries[x]=N}else if(G.type=="bin_mesh")$.load({model:k(G.url,
- V.urlBaseType),callback:o(x)});else G.type=="ascii_mesh"&&X.load({model:k(G.url,V.urlBaseType),callback:o(x)})}for(I in V.textures){x=V.textures[I];va+=x.url instanceof Array?x.url.length:1}ia=va;for(I in V.textures){x=V.textures[I];if(x.mapping!=undefined&&THREE[x.mapping]!=undefined)x.mapping=new THREE[x.mapping];if(x.url instanceof Array){G=[];for(var fa=0;fa<x.url.length;fa++)G[fa]=k(x.url[fa],V.urlBaseType);G=ImageUtils.loadTextureCube(G,x.mapping,j)}else{G=ImageUtils.loadTexture(k(x.url,V.urlBaseType),
- x.mapping,j);if(THREE[x.minFilter]!=undefined)G.minFilter=THREE[x.minFilter];if(THREE[x.magFilter]!=undefined)G.magFilter=THREE[x.magFilter]}T.textures[I]=G}for(z in V.materials){I=V.materials[z];for(L in I.parameters)if(L=="envMap"||L=="map"||L=="lightMap")I.parameters[L]=T.textures[I.parameters[L]];else if(L=="shading")I.parameters[L]=I.parameters[L]=="flat"?THREE.FlatShading:THREE.SmoothShading;else if(L=="blending")I.parameters[L]=THREE[I.parameters[L]]?THREE[I.parameters[L]]:THREE.NormalBlending;
- else L=="combine"&&(I.parameters[L]=I.parameters[L]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation);I=new THREE[I.type](I.parameters);T.materials[z]=I}m();c(T)}},addMesh:function(a,c,b,d,f,g,j,k,m,o){c=new THREE.Mesh(c,o);c.scale.x=c.scale.y=c.scale.z=b;c.position.x=d;c.position.y=f;c.position.z=g;c.rotation.x=j;c.rotation.y=k;c.rotation.z=m;a.addObject(c);return c},addPanoramaCubeWebGL:function(a,c,b){var d=ShaderUtils.lib.cube;d.uniforms.tCube.texture=b;b=new THREE.MeshShaderMaterial({fragmentShader:d.fragmentShader,
- vertexShader:d.vertexShader,uniforms:d.uniforms});c=new THREE.Mesh(new Cube(c,c,c,1,1,1,null,!0),b);a.addObject(c);return c},addPanoramaCube:function(a,c,b){var d=[];d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[0])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[1])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[2])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[3])}));d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[4])}));
- d.push(new THREE.MeshBasicMaterial({map:new THREE.Texture(b[5])}));c=new THREE.Mesh(new Cube(c,c,c,1,1,d,!0),new THREE.MeshFaceMaterial);a.addObject(c);return c},addPanoramaCubePlanes:function(a,c,b){var d=c/2;c=new Plane(c,c);var f=Math.PI,g=Math.PI/2;SceneUtils.addMesh(a,c,1,0,0,-d,0,0,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[5])}));SceneUtils.addMesh(a,c,1,-d,0,0,0,g,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[0])}));SceneUtils.addMesh(a,c,1,d,0,0,0,-g,0,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[1])}));
- SceneUtils.addMesh(a,c,1,0,d,0,g,0,f,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[2])}));SceneUtils.addMesh(a,c,1,0,-d,0,-g,0,f,new THREE.MeshBasicMaterial({map:new THREE.Texture(b[3])}))},showHierarchy:function(a,c){SceneUtils.traverseHierarchy(a,function(b){b.visible=c})},traverseHierarchy:function(a,c){var b,d,f=a.children.length;for(d=0;d<f;d++){b=a.children[d];c(b);SceneUtils.traverseHierarchy(b,c)}}},ShaderUtils={lib:{fresnel:{uniforms:{mRefractionRatio:{type:"f",value:1.02},mFresnelBias:{type:"f",
- value:0.1},mFresnelPower:{type:"f",value:2},mFresnelScale:{type:"f",value:1},tCube:{type:"t",value:1,texture:null}},fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\nvec4 refractedColor = vec4( 1.0, 1.0, 1.0, 1.0 );\nrefractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;\nrefractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;\nrefractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;\nrefractedColor.a = 1.0;\ngl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );\n}",
- vertexShader:"uniform float mRefractionRatio;\nuniform float mFresnelBias;\nuniform float mFresnelScale;\nuniform float mFresnelPower;\nvarying vec3 vReflect;\nvarying vec3 vRefract[3];\nvarying float vReflectionFactor;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );\nvec3 I = mPosition.xyz - cameraPosition;\nvReflect = reflect( I, nWorld );\nvRefract[0] = refract( normalize( I ), nWorld, mRefractionRatio );\nvRefract[1] = refract( normalize( I ), nWorld, mRefractionRatio * 0.99 );\nvRefract[2] = refract( normalize( I ), nWorld, mRefractionRatio * 0.98 );\nvReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), nWorld ), mFresnelPower );\ngl_Position = projectionMatrix * mvPosition;\n}"},
- normal:{uniforms:{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},tDiffuse:{type:"t",value:0,texture:null},tNormal:{type:"t",value:2,texture:null},tAO:{type:"t",value:3,texture:null},uNormalScale:{type:"f",value:1},tDisplacement:{type:"t",value:4,texture:null},uDisplacementBias:{type:"f",value:-0.5},uDisplacementScale:{type:"f",value:2.5},uPointLightPos:{type:"v3",value:new THREE.Vector3},uPointLightColor:{type:"c",value:new THREE.Color(15658734)},uDirLightPos:{type:"v3",value:new THREE.Vector3},
- uDirLightColor:{type:"c",value:new THREE.Color(15658734)},uAmbientLightColor:{type:"c",value:new THREE.Color(328965)},uDiffuseColor:{type:"c",value:new THREE.Color(15658734)},uSpecularColor:{type:"c",value:new THREE.Color(1118481)},uAmbientColor:{type:"c",value:new THREE.Color(328965)},uShininess:{type:"f",value:30}},fragmentShader:"uniform vec3 uDirLightPos;\nuniform vec3 uAmbientLightColor;\nuniform vec3 uDirLightColor;\nuniform vec3 uPointLightColor;\nuniform vec3 uAmbientColor;\nuniform vec3 uDiffuseColor;\nuniform vec3 uSpecularColor;\nuniform float uShininess;\nuniform bool enableDiffuse;\nuniform bool enableAO;\nuniform sampler2D tDiffuse;\nuniform sampler2D tNormal;\nuniform sampler2D tAO;\nuniform float uNormalScale;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vPointLightVector;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 diffuseTex = vec3( 1.0, 1.0, 1.0 );\nvec3 aoTex = vec3( 1.0, 1.0, 1.0 );\nvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\nnormalTex.xy *= uNormalScale;\nnormalTex = normalize( normalTex );\nif( enableDiffuse )\ndiffuseTex = texture2D( tDiffuse, vUv ).xyz;\nif( enableAO )\naoTex = texture2D( tAO, vUv ).xyz;\nmat3 tsb = mat3( vTangent, vBinormal, vNormal );\nvec3 finalNormal = tsb * normalTex;\nvec3 normal = normalize( finalNormal );\nvec3 viewPosition = normalize( vViewPosition );\nvec4 pointDiffuse = vec4( 0.0, 0.0, 0.0, 0.0 );\nvec4 pointSpecular = vec4( 0.0, 0.0, 0.0, 0.0 );\nvec3 pointVector = normalize( vPointLightVector );\nvec3 pointHalfVector = normalize( vPointLightVector + vViewPosition );\nfloat pointDotNormalHalf = dot( normal, pointHalfVector );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = 0.0;\nif ( pointDotNormalHalf >= 0.0 )\npointSpecularWeight = pow( pointDotNormalHalf, uShininess );\npointDiffuse += vec4( uDiffuseColor, 1.0 ) * pointDiffuseWeight;\npointSpecular += vec4( uSpecularColor, 1.0 ) * pointSpecularWeight;\nvec4 dirDiffuse = vec4( 0.0, 0.0, 0.0, 0.0 );\nvec4 dirSpecular = vec4( 0.0, 0.0, 0.0, 0.0 );\nvec4 lDirection = viewMatrix * vec4( uDirLightPos, 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nvec3 dirHalfVector = normalize( lDirection.xyz + vViewPosition );\nfloat dirDotNormalHalf = dot( normal, dirHalfVector );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = 0.0;\nif ( dirDotNormalHalf >= 0.0 )\ndirSpecularWeight = pow( dirDotNormalHalf, uShininess );\ndirDiffuse += vec4( uDiffuseColor, 1.0 ) * dirDiffuseWeight;\ndirSpecular += vec4( uSpecularColor, 1.0 ) * dirSpecularWeight;\nvec4 totalLight = vec4( uAmbientLightColor * uAmbientColor, 1.0 );\ntotalLight += vec4( uDirLightColor, 1.0 ) * ( dirDiffuse + dirSpecular );\ntotalLight += vec4( uPointLightColor, 1.0 ) * ( pointDiffuse + pointSpecular );\ngl_FragColor = vec4( totalLight.xyz * aoTex * diffuseTex, 1.0 );\n}",
- vertexShader:"attribute vec4 tangent;\nuniform vec3 uPointLightPos;\n#ifdef VERTEX_TEXTURES\nuniform sampler2D tDisplacement;\nuniform float uDisplacementScale;\nuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\nvarying vec3 vPointLightVector;\nvarying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvNormal = normalize( normalMatrix * normal );\nvTangent = normalize( normalMatrix * tangent.xyz );\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvBinormal = normalize( vBinormal );\nvUv = uv;\nvec4 lPosition = viewMatrix * vec4( uPointLightPos, 1.0 );\nvPointLightVector = normalize( lPosition.xyz - mvPosition.xyz );\n#ifdef VERTEX_TEXTURES\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\nvec4 displacedPosition = vec4( vNormal.xyz * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif\n}"},
- cube:{uniforms:{tCube:{type:"t",value:1,texture:null}},vertexShader:"varying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( - wPos.x, wPos.yz ) );\n}"},convolution:{uniforms:{tDiffuse:{type:"t",
- value:0,texture:null},uImageIncrement:{type:"v2",value:new THREE.Vector2(0.001953125,0)},cKernel:{type:"fv1",value:[]}},vertexShader:"varying vec2 vUv;\nuniform vec2 uImageIncrement;\nvoid main(void) {\nvUv = uv - ((KERNEL_SIZE - 1.0) / 2.0) * uImageIncrement;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"varying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform vec2 uImageIncrement;\nuniform float cKernel[KERNEL_SIZE];\nvoid main(void) {\nvec2 imageCoord = vUv;\nvec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );\nfor( int i=0; i<KERNEL_SIZE; ++i ) {\nsum += texture2D( tDiffuse, imageCoord ) * cKernel[i];\nimageCoord += uImageIncrement;\n}\ngl_FragColor = sum;\n}"},
- film:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},time:{type:"f",value:0},nIntensity:{type:"f",value:0.5},sIntensity:{type:"f",value:0.05},sCount:{type:"f",value:4096},grayscale:{type:"i",value:1}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"varying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform float time;\nuniform bool grayscale;\nuniform float nIntensity;\nuniform float sIntensity;\nuniform float sCount;\nvoid main() {\nvec4 cTextureScreen = texture2D( tDiffuse, vUv );\nfloat x = vUv.x * vUv.y * time * 1000.0;\nx = mod( x, 13.0 ) * mod( x, 123.0 );\nfloat dx = mod( x, 0.01 );\nvec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );\nvec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );\ncResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;\ncResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );\nif( grayscale ) {\ncResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );\n}\ngl_FragColor = vec4( cResult, cTextureScreen.a );\n}"},
- screen:{uniforms:{tDiffuse:{type:"t",value:0,texture:null},opacity:{type:"f",value:1}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"varying vec2 vUv;\nuniform sampler2D tDiffuse;\nuniform float opacity;\nvoid main() {\nvec4 texel = texture2D( tDiffuse, vUv );\ngl_FragColor = opacity * texel;\n}"},basic:{uniforms:{},vertexShader:"void main() {\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
- fragmentShader:"void main() {\ngl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );\n}"}},buildKernel:function(a){var c,b,d,f,g=2*Math.ceil(a*3)+1;g>25&&(g=25);f=(g-1)*0.5;b=Array(g);for(c=d=0;c<g;++c){b[c]=Math.exp(-((c-f)*(c-f))/(2*a*a));d+=b[c]}for(c=0;c<g;++c)b[c]/=d;return b}};
- THREE.QuakeCamera=function(a){function c(b,d){return function(){d.apply(b,arguments)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.movementSpeed=1;this.lookSpeed=0.0050;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.domElement=document;if(a){if(a.movementSpeed!==undefined)this.movementSpeed=a.movementSpeed;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.noFly!==undefined)this.noFly=
- a.noFly;if(a.lookVertical!==undefined)this.lookVertical=a.lookVertical;if(a.autoForward!==undefined)this.autoForward=a.autoForward;if(a.activeLook!==undefined)this.activeLook=a.activeLook;if(a.heightSpeed!==undefined)this.heightSpeed=a.heightSpeed;if(a.heightCoef!==undefined)this.heightCoef=a.heightCoef;if(a.heightMin!==undefined)this.heightMin=a.heightMin;if(a.heightMax!==undefined)this.heightMax=a.heightMax;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=this.lat=
- this.mouseY=this.mouseX=this.autoSpeedFactor=0;this.moveForward=!1;this.moveBackward=!1;this.moveLeft=!1;this.moveRight=!1;this.mouseDragOn=!1;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;this.onMouseDown=function(b){b.preventDefault();b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0};this.onMouseUp=function(b){b.preventDefault();b.stopPropagation();if(this.activeLook)switch(b.button){case 0:this.moveForward=
- !1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1};this.onMouseMove=function(b){this.mouseX=b.clientX-this.windowHalfX;this.mouseY=b.clientY-this.windowHalfY};this.onKeyDown=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0}};this.onKeyUp=function(b){switch(b.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=
- !1;break;case 39:case 68:this.moveRight=!1}};this.update=function(){this.autoSpeedFactor=this.heightSpeed?((this.position.y<this.heightMin?this.heightMin:this.position.y>this.heightMax?this.heightMax:this.position.y)-this.heightMin)*this.heightCoef:0;(this.moveForward||this.autoForward)&&this.translateZ(-(this.movementSpeed+this.autoSpeedFactor));this.moveBackward&&this.translateZ(this.movementSpeed);this.moveLeft&&this.translateX(-this.movementSpeed);this.moveRight&&this.translateX(this.movementSpeed);
- var b=this.lookSpeed;this.activeLook||(b=0);this.lon+=this.mouseX*b;this.lookVertical&&(this.lat-=this.mouseY*b);this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;b=this.target.position;var d=this.position;b.x=d.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=d.y+100*Math.cos(this.phi);b.z=d.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},
- !1);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),!1);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),!1);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),!1);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),!1);this.domElement.addEventListener("keyup",c(this,this.onKeyUp),!1)};THREE.QuakeCamera.prototype=new THREE.Camera;THREE.QuakeCamera.prototype.constructor=THREE.QuakeCamera;THREE.QuakeCamera.prototype.supr=THREE.Camera.prototype;
- THREE.QuakeCamera.prototype.translate=function(a,c){this.matrix.rotateAxis(c);if(this.noFly)c.y=0;this.position.addSelf(c.multiplyScalar(a));this.target.position.addSelf(c.multiplyScalar(a))};
- THREE.PathCamera=function(a){function c(o,n,x,z){var y={name:x,fps:0.6,length:z,hierarchy:[]},B,F=n.getControlPointsArray(),G=n.getLength(),I=F.length,R=0;B=I-1;n={parent:-1,keys:[]};n.keys[0]={time:0,pos:F[0],rot:[0,0,0,1],scl:[1,1,1]};n.keys[B]={time:z,pos:F[B],rot:[0,0,0,1],scl:[1,1,1]};for(B=1;B<I-1;B++){R=z*G.chunks[B]/G.total;n.keys[B]={time:R,pos:F[B]}}y.hierarchy[0]=n;THREE.AnimationHandler.add(y);return new THREE.Animation(o,x,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function b(o,n){var x,
- z,y=new THREE.Geometry;for(x=0;x<o.points.length*n;x++){z=x/(o.points.length*n);z=o.getPoint(z);y.vertices[x]=new THREE.Vertex(new THREE.Vector3(z.x,z.y,z.z))}return y}function d(o,n){var x=b(n,10),z=b(n,10),y=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(x,y);particleObj=new THREE.ParticleSystem(z,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);o.addChild(lineObj);particleObj.scale.set(1,1,1);o.addChild(particleObj);z=new Sphere(1,
- 16,8);y=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<n.points.length;i++){x=new THREE.Mesh(z,y);x.position.copy(n.points[i]);x.updateMatrix();o.addChild(x)}}THREE.Camera.call(this,a.fov,a.aspect,a.near,a.far,a.target);this.id="PathCamera"+THREE.PathCameraIdCounter++;this.duration=1E4;this.waypoints=[];this.useConstantSpeed=!0;this.resamplingCoef=50;this.debugPath=new THREE.Object3D;this.debugDummy=new THREE.Object3D;this.animationParent=new THREE.Object3D;this.lookSpeed=0.0050;this.lookVertical=
- !0;this.lookHorizontal=!0;this.verticalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.horizontalAngleMap={srcRange:[0,6.28],dstRange:[0,6.28]};this.domElement=document;if(a){if(a.duration!==undefined)this.duration=a.duration*1E3;if(a.waypoints!==undefined)this.waypoints=a.waypoints;if(a.useConstantSpeed!==undefined)this.useConstantSpeed=a.useConstantSpeed;if(a.resamplingCoef!==undefined)this.resamplingCoef=a.resamplingCoef;if(a.createDebugPath!==undefined)this.createDebugPath=a.createDebugPath;
- if(a.createDebugDummy!==undefined)this.createDebugDummy=a.createDebugDummy;if(a.lookSpeed!==undefined)this.lookSpeed=a.lookSpeed;if(a.lookVertical!==undefined)this.lookVertical=a.lookVertical;if(a.lookHorizontal!==undefined)this.lookHorizontal=a.lookHorizontal;if(a.verticalAngleMap!==undefined)this.verticalAngleMap=a.verticalAngleMap;if(a.horizontalAngleMap!==undefined)this.horizontalAngleMap=a.horizontalAngleMap;if(a.domElement!==undefined)this.domElement=a.domElement}this.theta=this.phi=this.lon=
- this.lat=this.mouseY=this.mouseX=0;this.windowHalfX=window.innerWidth/2;this.windowHalfY=window.innerHeight/2;var f=Math.PI*2,g=Math.PI/180;this.update=function(o,n,x){var z,y;this.lookHorizontal&&(this.lon+=this.mouseX*this.lookSpeed);this.lookVertical&&(this.lat-=this.mouseY*this.lookSpeed);this.lon=Math.max(0,Math.min(360,this.lon));this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*g;this.theta=this.lon*g;z=this.phi%f;this.phi=z>=0?z:z+f;z=this.verticalAngleMap.srcRange;y=this.verticalAngleMap.dstRange;
- this.phi=(this.phi-z[0])*(y[1]-y[0])/(z[1]-z[0])+y[0];z=this.horizontalAngleMap.srcRange;y=this.horizontalAngleMap.dstRange;this.theta=(this.theta-z[0])*(y[1]-y[0])/(z[1]-z[0])+y[0];z=this.target.position;z.x=100*Math.sin(this.phi)*Math.cos(this.theta);z.y=100*Math.cos(this.phi);z.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.supr.update.call(this,o,n,x)};this.onMouseMove=function(o){this.mouseX=o.clientX-this.windowHalfX;this.mouseY=o.clientY-this.windowHalfY};this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);
- this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){a=new THREE.MeshLambertMaterial({color:30719});var j=new THREE.MeshLambertMaterial({color:65280}),k=new Cube(10,10,20),m=new Cube(2,2,10);this.animationParent=new THREE.Mesh(k,a);a=new THREE.Mesh(m,j);a.position.set(0,10,0);this.animation=c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this);this.animationParent.addChild(this.target);this.animationParent.addChild(a)}else{this.animation=
- c(this.animationParent,this.spline,this.id,this.duration);this.animationParent.addChild(this.target);this.animationParent.addChild(this)}this.createDebugPath&&d(this.debugPath,this.spline);this.domElement.addEventListener("mousemove",function(o,n){return function(){n.apply(o,arguments)}}(this,this.onMouseMove),!1)};THREE.PathCamera.prototype=new THREE.Camera;THREE.PathCamera.prototype.constructor=THREE.PathCamera;THREE.PathCamera.prototype.supr=THREE.Camera.prototype;THREE.PathCameraIdCounter=0;
- var Cube=function(a,c,b,d,f,g,j,k,m){function o(G,I,R,D,M,L,N,ma){var e,la,V=d||1,$=f||1,X=M/2,sa=L/2,va=n.vertices.length;if(G=="x"&&I=="y"||G=="y"&&I=="x")e="z";else if(G=="x"&&I=="z"||G=="z"&&I=="x"){e="y";$=g||1}else if(G=="z"&&I=="y"||G=="y"&&I=="z"){e="x";V=g||1}var wa=V+1,ia=$+1;M/=V;var T=L/$;for(la=0;la<ia;la++)for(L=0;L<wa;L++){var fa=new THREE.Vector3;fa[G]=(L*M-X)*R;fa[I]=(la*T-sa)*D;fa[e]=N;n.vertices.push(new THREE.Vertex(fa))}for(la=0;la<$;la++)for(L=0;L<V;L++){n.faces.push(new THREE.Face4(L+
- wa*la+va,L+wa*(la+1)+va,L+1+wa*(la+1)+va,L+1+wa*la+va,null,null,ma));n.faceVertexUvs[0].push([new THREE.UV(L/V,la/$),new THREE.UV(L/V,(la+1)/$),new THREE.UV((L+1)/V,(la+1)/$),new THREE.UV((L+1)/V,la/$)])}}THREE.Geometry.call(this);var n=this,x=a/2,z=c/2,y=b/2;k=k?-1:1;if(j!==undefined)if(j instanceof Array)this.materials=j;else{this.materials=[];for(var B=0;B<6;B++)this.materials.push([j])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(m!=undefined)for(var F in m)this.sides[F]!=
- undefined&&(this.sides[F]=m[F]);this.sides.px&&o("z","y",1*k,-1,b,c,-x,this.materials[0]);this.sides.nx&&o("z","y",-1*k,-1,b,c,x,this.materials[1]);this.sides.py&&o("x","z",1*k,1,a,b,z,this.materials[2]);this.sides.ny&&o("x","z",1*k,-1,a,b,-z,this.materials[3]);this.sides.pz&&o("x","y",1*k,-1,a,c,y,this.materials[4]);this.sides.nz&&o("x","y",-1*k,-1,a,c,-y,this.materials[5]);(function(){for(var G=[],I=[],R=0,D=n.vertices.length;R<D;R++){for(var M=n.vertices[R],L=!1,N=0,ma=G.length;N<ma;N++){var e=
- G[N];if(M.position.x==e.position.x&&M.position.y==e.position.y&&M.position.z==e.position.z){I[R]=N;L=!0;break}}if(!L){I[R]=G.length;G.push(new THREE.Vertex(M.position.clone()))}}R=0;for(D=n.faces.length;R<D;R++){M=n.faces[R];M.a=I[M.a];M.b=I[M.b];M.c=I[M.c];M.d=I[M.d]}n.vertices=G})();this.computeCentroids();this.computeFaceNormals()};Cube.prototype=new THREE.Geometry;Cube.prototype.constructor=Cube;
- var Cylinder=function(a,c,b,d,f,g){function j(n,x,z){k.vertices.push(new THREE.Vertex(new THREE.Vector3(n,x,z)))}THREE.Geometry.call(this);var k=this,m=Math.PI,o=d/2;for(d=0;d<a;d++)j(Math.sin(2*m*d/a)*c,Math.cos(2*m*d/a)*c,-o);for(d=0;d<a;d++)j(Math.sin(2*m*d/a)*b,Math.cos(2*m*d/a)*b,o);for(d=0;d<a;d++)k.faces.push(new THREE.Face4(d,d+a,a+(d+1)%a,(d+1)%a));if(b>0){j(0,0,-o-(g||0));for(d=a;d<a+a/2;d++)k.faces.push(new THREE.Face4(2*a,(2*d-2*a)%a,(2*d-2*a+1)%a,(2*d-2*a+2)%a))}if(c>0){j(0,0,o+(f||0));
- for(d=a+a/2;d<2*a;d++)k.faces.push(new THREE.Face4(2*a+1,(2*d-2*a+2)%a+a,(2*d-2*a+1)%a+a,(2*d-2*a)%a+a))}this.computeCentroids();this.computeFaceNormals()};Cylinder.prototype=new THREE.Geometry;Cylinder.prototype.constructor=Cylinder;
- var Icosahedron=function(a){function c(x,z,y){var B=Math.sqrt(x*x+z*z+y*y);return f.vertices.push(new THREE.Vertex(new THREE.Vector3(x/B,z/B,y/B)))-1}function b(x,z,y,B){B.faces.push(new THREE.Face3(x,z,y))}function d(x,z){var y=f.vertices[x].position,B=f.vertices[z].position;return c((y.x+B.x)/2,(y.y+B.y)/2,(y.z+B.z)/2)}var f=this,g=new THREE.Geometry,j;this.subdivisions=a||0;THREE.Geometry.call(this);a=(1+Math.sqrt(5))/2;c(-1,a,0);c(1,a,0);c(-1,-a,0);c(1,-a,0);c(0,-1,a);c(0,1,a);c(0,-1,-a);c(0,
- 1,-a);c(a,0,-1);c(a,0,1);c(-a,0,-1);c(-a,0,1);b(0,11,5,g);b(0,5,1,g);b(0,1,7,g);b(0,7,10,g);b(0,10,11,g);b(1,5,9,g);b(5,11,4,g);b(11,10,2,g);b(10,7,6,g);b(7,1,8,g);b(3,9,4,g);b(3,4,2,g);b(3,2,6,g);b(3,6,8,g);b(3,8,9,g);b(4,9,5,g);b(2,4,11,g);b(6,2,10,g);b(8,6,7,g);b(9,8,1,g);for(a=0;a<this.subdivisions;a++){j=new THREE.Geometry;for(var k in g.faces){var m=d(g.faces[k].a,g.faces[k].b),o=d(g.faces[k].b,g.faces[k].c),n=d(g.faces[k].c,g.faces[k].a);b(g.faces[k].a,m,n,j);b(g.faces[k].b,o,m,j);b(g.faces[k].c,
- n,o,j);b(m,o,n,j)}g.faces=j.faces}f.faces=g.faces;delete g;delete j;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};Icosahedron.prototype=new THREE.Geometry;Icosahedron.prototype.constructor=Icosahedron;
- function Lathe(a,c,b){THREE.Geometry.call(this);this.steps=c||12;this.angle=b||2*Math.PI;c=this.angle/this.steps;for(var d=[],f=[],g=[],j=[],k=0;k<a.length;k++){this.vertices.push(new THREE.Vertex(a[k]));d[k]=a[k].clone();f[k]=this.vertices.length-1}for(var m=(new THREE.Matrix4).setRotationZ(c),o=0;o<=this.angle+0.0010;o+=c){for(k=0;k<d.length;k++)if(o<this.angle){d[k]=m.multiplyVector3(d[k].clone());this.vertices.push(new THREE.Vertex(d[k]));g[k]=this.vertices.length-1}else g=j;o==0&&(j=f);for(k=
- 0;k<f.length-1;k++){this.faces.push(new THREE.Face4(g[k],g[k+1],f[k+1],f[k]));this.faceVertexUvs[0].push([new THREE.UV(o/b,k/a.length),new THREE.UV(o/b,(k+1)/a.length),new THREE.UV((o-c)/b,(k+1)/a.length),new THREE.UV((o-c)/b,k/a.length)])}f=g;g=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()}Lathe.prototype=new THREE.Geometry;Lathe.prototype.constructor=Lathe;
- var Plane=function(a,c,b,d){THREE.Geometry.call(this);var f,g=a/2,j=c/2;b=b||1;d=d||1;var k=b+1,m=d+1;a/=b;var o=c/d;for(f=0;f<m;f++)for(c=0;c<k;c++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(c*a-g,-(f*o-j),0)));for(f=0;f<d;f++)for(c=0;c<b;c++){this.faces.push(new THREE.Face4(c+k*f,c+k*(f+1),c+1+k*(f+1),c+1+k*f));this.faceVertexUvs[0].push([new THREE.UV(c/b,f/d),new THREE.UV(c/b,(f+1)/d),new THREE.UV((c+1)/b,(f+1)/d),new THREE.UV((c+1)/b,f/d)])}this.computeCentroids();this.computeFaceNormals()};
- Plane.prototype=new THREE.Geometry;Plane.prototype.constructor=Plane;
- var Sphere=function(a,c,b){THREE.Geometry.call(this);var d,f=Math.PI,g=Math.max(3,c||8),j=Math.max(2,b||6);c=[];for(b=0;b<j+1;b++){d=b/j;var k=a*Math.cos(d*f),m=a*Math.sin(d*f),o=[],n=0;for(d=0;d<g;d++){var x=2*d/g,z=m*Math.sin(x*f);x=m*Math.cos(x*f);(b==0||b==j)&&d>0||(n=this.vertices.push(new THREE.Vertex(new THREE.Vector3(x,k,z)))-1);o.push(n)}c.push(o)}var y,B,F;f=c.length;for(b=0;b<f;b++){g=c[b].length;if(b>0)for(d=0;d<g;d++){o=d==g-1;j=c[b][o?0:d+1];k=c[b][o?g-1:d];m=c[b-1][o?g-1:d];o=c[b-1][o?
- 0:d+1];z=b/(f-1);y=(b-1)/(f-1);B=(d+1)/g;x=d/g;n=new THREE.UV(1-B,z);z=new THREE.UV(1-x,z);x=new THREE.UV(1-x,y);var G=new THREE.UV(1-B,y);if(b<c.length-1){y=this.vertices[j].position.clone();B=this.vertices[k].position.clone();F=this.vertices[m].position.clone();y.normalize();B.normalize();F.normalize();this.faces.push(new THREE.Face3(j,k,m,[new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(B.x,B.y,B.z),new THREE.Vector3(F.x,F.y,F.z)]));this.faceVertexUvs[0].push([n,z,x])}if(b>1){y=this.vertices[j].position.clone();
- B=this.vertices[m].position.clone();F=this.vertices[o].position.clone();y.normalize();B.normalize();F.normalize();this.faces.push(new THREE.Face3(j,m,o,[new THREE.Vector3(y.x,y.y,y.z),new THREE.Vector3(B.x,B.y,B.z),new THREE.Vector3(F.x,F.y,F.z)]));this.faceVertexUvs[0].push([n,x,G])}}}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:a}};Sphere.prototype=new THREE.Geometry;Sphere.prototype.constructor=Sphere;
- var Torus=function(a,c,b,d){this.radius=a||100;this.tube=c||40;this.segmentsR=b||8;this.segmentsT=d||6;a=[];THREE.Geometry.call(this);for(c=0;c<=this.segmentsR;++c)for(b=0;b<=this.segmentsT;++b){d=b/this.segmentsT*2*Math.PI;var f=c/this.segmentsR*2*Math.PI;this.vertices.push(new THREE.Vertex(new THREE.Vector3((this.radius+this.tube*Math.cos(f))*Math.cos(d),(this.radius+this.tube*Math.cos(f))*Math.sin(d),this.tube*Math.sin(f))));a.push([b/this.segmentsT,1-c/this.segmentsR])}for(c=1;c<=this.segmentsR;++c)for(b=
- 1;b<=this.segmentsT;++b){d=(this.segmentsT+1)*c+b;f=(this.segmentsT+1)*c+b-1;var g=(this.segmentsT+1)*(c-1)+b-1,j=(this.segmentsT+1)*(c-1)+b;this.faces.push(new THREE.Face4(d,f,g,j));this.faceVertexUvs[0].push([new THREE.UV(a[d][0],a[d][1]),new THREE.UV(a[f][0],a[f][1]),new THREE.UV(a[g][0],a[g][1]),new THREE.UV(a[j][0],a[j][1])])}delete a;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};Torus.prototype=new THREE.Geometry;Torus.prototype.constructor=Torus;
- var TorusKnot=function(a,c,b,d,f,g,j){function k(x,z,y,B,F,G){z=y/B*x;y=Math.cos(z);return new THREE.Vector3(F*(2+y)*0.5*Math.cos(x),F*(2+y)*Math.sin(x)*0.5,G*F*Math.sin(z)*0.5)}THREE.Geometry.call(this);this.radius=a||200;this.tube=c||40;this.segmentsR=b||64;this.segmentsT=d||8;this.p=f||2;this.q=g||3;this.heightScale=j||1;this.grid=Array(this.segmentsR);b=new THREE.Vector3;d=new THREE.Vector3;g=new THREE.Vector3;for(a=0;a<this.segmentsR;++a){this.grid[a]=Array(this.segmentsT);for(c=0;c<this.segmentsT;++c){var m=
- a/this.segmentsR*2*this.p*Math.PI;j=c/this.segmentsT*2*Math.PI;f=k(m,j,this.q,this.p,this.radius,this.heightScale);m=k(m+0.01,j,this.q,this.p,this.radius,this.heightScale);b.x=m.x-f.x;b.y=m.y-f.y;b.z=m.z-f.z;d.x=m.x+f.x;d.y=m.y+f.y;d.z=m.z+f.z;g.cross(b,d);d.cross(g,b);g.normalize();d.normalize();m=this.tube*Math.cos(j);j=this.tube*Math.sin(j);f.x+=m*d.x+j*g.x;f.y+=m*d.y+j*g.y;f.z+=m*d.z+j*g.z;this.grid[a][c]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z)))-1}}for(a=0;a<this.segmentsR;++a)for(c=
- 0;c<this.segmentsT;++c){g=(a+1)%this.segmentsR;j=(c+1)%this.segmentsT;f=this.grid[a][c];b=this.grid[g][c];d=this.grid[a][j];g=this.grid[g][j];j=new THREE.UV(a/this.segmentsR,c/this.segmentsT);m=new THREE.UV((a+1)/this.segmentsR,c/this.segmentsT);var o=new THREE.UV(a/this.segmentsR,(c+1)/this.segmentsT),n=new THREE.UV((a+1)/this.segmentsR,(c+1)/this.segmentsT);this.faces.push(new THREE.Face3(f,b,d));this.faceVertexUvs[0].push([j,m,o]);this.faces.push(new THREE.Face3(g,d,b));this.faceVertexUvs[0].push([n,
- o,m])}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};TorusKnot.prototype=new THREE.Geometry;TorusKnot.prototype.constructor=TorusKnot;THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
- THREE.Loader.prototype={addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var c="Loaded ";c+=a.total?(100*a.loaded/a.total).toFixed(0)+"%":(a.loaded/1E3).toFixed(2)+" KB";
- this.statusDomElement.innerHTML=c},extractUrlbase:function(a){a=a.split("/");a.pop();return a.join("/")},init_materials:function(a,c,b){a.materials=[];for(var d=0;d<c.length;++d)a.materials[d]=[THREE.Loader.prototype.createMaterial(c[d],b)]},createMaterial:function(a,c){function b(k){k=Math.log(k)/Math.LN2;return Math.floor(k)==k}function d(k,m){var o=new Image;o.onload=function(){if(!b(this.width)||!b(this.height)){var n=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),x=Math.pow(2,Math.round(Math.log(this.height)/
- Math.LN2));k.image.width=n;k.image.height=x;k.image.getContext("2d").drawImage(this,0,0,n,x)}else k.image=this;k.needsUpdate=!0};o.src=m}var f,g,j;f="MeshLambertMaterial";g={color:15658734,opacity:1,map:null,lightMap:null,vertexColors:a.vertexColors?THREE.VertexColors:!1,wireframe:a.wireframe};if(a.shading)if(a.shading=="Phong")f="MeshPhongMaterial";else a.shading=="Basic"&&(f="MeshBasicMaterial");if(a.mapDiffuse&&c){j=document.createElement("canvas");g.map=new THREE.Texture(j);g.map.sourceFile=a.mapDiffuse;
- d(g.map,c+"/"+a.mapDiffuse)}else if(a.colorDiffuse){j=(a.colorDiffuse[0]*255<<16)+(a.colorDiffuse[1]*255<<8)+a.colorDiffuse[2]*255;g.color=j;g.opacity=a.transparency}else if(a.DbgColor)g.color=a.DbgColor;if(a.mapLightmap&&c){j=document.createElement("canvas");g.lightMap=new THREE.Texture(j);g.lightMap.sourceFile=a.mapLightmap;d(g.lightMap,c+"/"+a.mapLightmap)}return new THREE[f](g)}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a)};THREE.JSONLoader.prototype=new THREE.Loader;
- THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;THREE.JSONLoader.prototype.load=function(a){var c=this,b=a.model,d=a.callback,f=a.texture_path?a.texture_path:this.extractUrlbase(b);a=new Worker(b);a.onmessage=function(g){c.createModel(g.data,d,f);c.onLoadComplete()};this.onLoadStart();a.postMessage((new Date).getTime())};
- THREE.JSONLoader.prototype.createModel=function(a,c,b){var d=new THREE.Geometry;this.init_materials(d,a.materials,b);(function(){if(a.version===undefined||a.version!=2)console.error("Deprecated file format.");else{var f,g,j,k,m,o,n,x,z,y,B=a.faces;x=a.vertices;var F=a.normals,G=a.colors,I=0;for(f=0;f<a.uvs.length;f++)a.uvs[f].length&&I++;for(f=0;f<I;f++){d.faceUvs[f]=[];d.faceVertexUvs[f]=[]}k=0;for(m=x.length;k<m;){z=new THREE.Vertex;z.position.x=x[k++];z.position.y=x[k++];z.position.z=x[k++];d.vertices.push(z)}k=
- 0;for(m=B.length;k<m;){o=B[k++];n=o&1;j=o&2;f=o&4;g=o&8;x=o&16;z=o&32;y=o&64;o&=128;if(n){n=new THREE.Face4;n.a=B[k++];n.b=B[k++];n.c=B[k++];n.d=B[k++];nVertices=4}else{n=new THREE.Face3;n.a=B[k++];n.b=B[k++];n.c=B[k++];nVertices=3}if(j){materialIndex=B[k++];n.materials=d.materials[materialIndex]}j=d.faces.length;if(f)for(f=0;f<I;f++){uvLayer=a.uvs[f];uvIndex=B[k++];u=uvLayer[uvIndex*2];v=uvLayer[uvIndex*2+1];d.faceUvs[f][j]=new THREE.UV(u,v)}if(g)for(f=0;f<I;f++){uvLayer=a.uvs[f];uvs=[];for(g=0;g<
- nVertices;g++){uvIndex=B[k++];u=uvLayer[uvIndex*2];v=uvLayer[uvIndex*2+1];uvs[g]=new THREE.UV(u,v)}d.faceVertexUvs[f][j]=uvs}if(x){normalIndex=B[k++]*3;normal=new THREE.Vector3;normal.x=F[normalIndex++];normal.y=F[normalIndex++];normal.z=F[normalIndex];n.normal=normal}if(z)for(f=0;f<nVertices;f++){normalIndex=B[k++]*3;normal=new THREE.Vector3;normal.x=F[normalIndex++];normal.y=F[normalIndex++];normal.z=F[normalIndex];n.vertexNormals.push(normal)}if(y){color=new THREE.Color(B[k++]);n.color=color}if(o)for(f=
- 0;f<nVertices;f++){colorIndex=B[k++];color=new THREE.Color(G[colorIndex]);n.vertexColors.push(color)}d.faces.push(n)}}})();(function(){var f,g,j,k;if(a.skinWeights){f=0;for(g=a.skinWeights.length;f<g;f+=2){j=a.skinWeights[f];k=a.skinWeights[f+1];d.skinWeights.push(new THREE.Vector4(j,k,0,0))}}if(a.skinIndices){f=0;for(g=a.skinIndices.length;f<g;f+=2){j=a.skinIndices[f];k=a.skinIndices[f+1];d.skinIndices.push(new THREE.Vector4(j,k,0,0))}}d.bones=a.bones;d.animation=a.animation})();(function(){if(a.morphTargets!==
- undefined){var f,g,j,k;f=0;for(g=a.morphTargets.length;f<g;f++){d.morphTargets[f]={};d.morphTargets[f].name=a.morphTargets[f].name;d.morphTargets[f].vertices=[];dstVertices=d.morphTargets[f].vertices;srcVertices=a.morphTargets[f].vertices;j=0;for(k=srcVertices.length;j<k;j+=3)dstVertices.push(new THREE.Vertex(new THREE.Vector3(srcVertices[j],srcVertices[j+1],srcVertices[j+2])))}}})();d.computeCentroids();d.computeFaceNormals();c(d)};THREE.BinaryLoader=function(a){THREE.Loader.call(this,a)};
- THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
- THREE.BinaryLoader.prototype={load:function(a){var c=a.model,b=a.callback,d=a.texture_path?a.texture_path:THREE.Loader.prototype.extractUrlbase(c),f=a.bin_path?a.bin_path:THREE.Loader.prototype.extractUrlbase(c);a=(new Date).getTime();c=new Worker(c);var g=this.showProgress?THREE.Loader.prototype.updateProgress:null;c.onmessage=function(j){THREE.BinaryLoader.prototype.loadAjaxBuffers(j.data.buffers,j.data.materials,b,f,d,g)};c.onerror=function(j){alert("worker.onerror: "+j.message+"\n"+j.data);j.preventDefault()};
- c.postMessage(a)},loadAjaxBuffers:function(a,c,b,d,f,g){var j=new XMLHttpRequest,k=d+"/"+a,m=0;j.onreadystatechange=function(){if(j.readyState==4)j.status==200||j.status==0?THREE.BinaryLoader.prototype.createBinModel(j.responseText,b,f,c):alert("Couldn't load ["+k+"] ["+j.status+"]");else if(j.readyState==3){if(g){m==0&&(m=j.getResponseHeader("Content-Length"));g({total:m,loaded:j.responseText.length})}}else j.readyState==2&&(m=j.getResponseHeader("Content-Length"))};j.open("GET",k,!0);j.overrideMimeType("text/plain; charset=x-user-defined");
- j.setRequestHeader("Content-Type","text/plain");j.send(null)},createBinModel:function(a,c,b,d){var f=function(g){function j(h,t){var w=n(h,t),p=n(h,t+1),C=n(h,t+2),H=n(h,t+3),K=(H<<1&255|C>>7)-127;w|=(C&127)<<16|p<<8;if(w==0&&K==-127)return 0;return(1-2*(H>>7))*(1+w*Math.pow(2,-23))*Math.pow(2,K)}function k(h,t){var w=n(h,t),p=n(h,t+1),C=n(h,t+2);return(n(h,t+3)<<24)+(C<<16)+(p<<8)+w}function m(h,t){var w=n(h,t);return(n(h,t+1)<<8)+w}function o(h,t){var w=n(h,t);return w>127?w-256:w}function n(h,
- t){return h.charCodeAt(t)&255}function x(h){var t,w,p;t=k(a,h);w=k(a,h+N);p=k(a,h+ma);h=m(a,h+e);THREE.BinaryLoader.prototype.f3(I,t,w,p,h)}function z(h){var t,w,p,C,H,K;t=k(a,h);w=k(a,h+N);p=k(a,h+ma);C=m(a,h+e);H=k(a,h+la);K=k(a,h+V);h=k(a,h+$);THREE.BinaryLoader.prototype.f3n(I,M,t,w,p,C,H,K,h)}function y(h){var t,w,p,C;t=k(a,h);w=k(a,h+X);p=k(a,h+sa);C=k(a,h+va);h=m(a,h+wa);THREE.BinaryLoader.prototype.f4(I,t,w,p,C,h)}function B(h){var t,w,p,C,H,K,E,A;t=k(a,h);w=k(a,h+X);p=k(a,h+sa);C=k(a,h+va);
- H=m(a,h+wa);K=k(a,h+ia);E=k(a,h+T);A=k(a,h+fa);h=k(a,h+qa);THREE.BinaryLoader.prototype.f4n(I,M,t,w,p,C,H,K,E,A,h)}function F(h){var t,w;t=k(a,h);w=k(a,h+Z);h=k(a,h+S);THREE.BinaryLoader.prototype.uv3(I.faceVertexUvs[0],L[t*2],L[t*2+1],L[w*2],L[w*2+1],L[h*2],L[h*2+1])}function G(h){var t,w,p;t=k(a,h);w=k(a,h+da);p=k(a,h+ua);h=k(a,h+ca);THREE.BinaryLoader.prototype.uv4(I.faceVertexUvs[0],L[t*2],L[t*2+1],L[w*2],L[w*2+1],L[p*2],L[p*2+1],L[h*2],L[h*2+1])}var I=this,R=0,D,M=[],L=[],N,ma,e,la,V,$,X,sa,
- va,wa,ia,T,fa,qa,Z,S,da,ua,ca,ga,xa,Ka,Xa,Ya,Aa;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(I,d,g);D={signature:a.substr(R,8),header_bytes:n(a,R+8),vertex_coordinate_bytes:n(a,R+9),normal_coordinate_bytes:n(a,R+10),uv_coordinate_bytes:n(a,R+11),vertex_index_bytes:n(a,R+12),normal_index_bytes:n(a,R+13),uv_index_bytes:n(a,R+14),material_index_bytes:n(a,R+15),nvertices:k(a,R+16),nnormals:k(a,R+16+4),nuvs:k(a,R+16+8),ntri_flat:k(a,R+16+12),ntri_smooth:k(a,R+16+16),ntri_flat_uv:k(a,
- R+16+20),ntri_smooth_uv:k(a,R+16+24),nquad_flat:k(a,R+16+28),nquad_smooth:k(a,R+16+32),nquad_flat_uv:k(a,R+16+36),nquad_smooth_uv:k(a,R+16+40)};R+=D.header_bytes;N=D.vertex_index_bytes;ma=D.vertex_index_bytes*2;e=D.vertex_index_bytes*3;la=D.vertex_index_bytes*3+D.material_index_bytes;V=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes;$=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*2;X=D.vertex_index_bytes;sa=D.vertex_index_bytes*2;va=D.vertex_index_bytes*3;wa=
- D.vertex_index_bytes*4;ia=D.vertex_index_bytes*4+D.material_index_bytes;T=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes;fa=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*2;qa=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*3;Z=D.uv_index_bytes;S=D.uv_index_bytes*2;da=D.uv_index_bytes;ua=D.uv_index_bytes*2;ca=D.uv_index_bytes*3;g=D.vertex_index_bytes*3+D.material_index_bytes;Aa=D.vertex_index_bytes*4+D.material_index_bytes;ga=D.ntri_flat*
- g;xa=D.ntri_smooth*(g+D.normal_index_bytes*3);Ka=D.ntri_flat_uv*(g+D.uv_index_bytes*3);Xa=D.ntri_smooth_uv*(g+D.normal_index_bytes*3+D.uv_index_bytes*3);Ya=D.nquad_flat*Aa;g=D.nquad_smooth*(Aa+D.normal_index_bytes*4);Aa=D.nquad_flat_uv*(Aa+D.uv_index_bytes*4);R+=function(h){for(var t,w,p,C=D.vertex_coordinate_bytes*3,H=h+D.nvertices*C;h<H;h+=C){t=j(a,h);w=j(a,h+D.vertex_coordinate_bytes);p=j(a,h+D.vertex_coordinate_bytes*2);THREE.BinaryLoader.prototype.v(I,t,w,p)}return D.nvertices*C}(R);R+=function(h){for(var t,
- w,p,C=D.normal_coordinate_bytes*3,H=h+D.nnormals*C;h<H;h+=C){t=o(a,h);w=o(a,h+D.normal_coordinate_bytes);p=o(a,h+D.normal_coordinate_bytes*2);M.push(t/127,w/127,p/127)}return D.nnormals*C}(R);R+=function(h){for(var t,w,p=D.uv_coordinate_bytes*2,C=h+D.nuvs*p;h<C;h+=p){t=j(a,h);w=j(a,h+D.uv_coordinate_bytes);L.push(t,w)}return D.nuvs*p}(R);ga=R+ga;xa=ga+xa;Ka=xa+Ka;Xa=Ka+Xa;Ya=Xa+Ya;g=Ya+g;Aa=g+Aa;(function(h){var t,w=D.vertex_index_bytes*3+D.material_index_bytes,p=w+D.uv_index_bytes*3,C=h+D.ntri_flat_uv*
- p;for(t=h;t<C;t+=p){x(t);F(t+w)}return C-h})(xa);(function(h){var t,w=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,p=w+D.uv_index_bytes*3,C=h+D.ntri_smooth_uv*p;for(t=h;t<C;t+=p){z(t);F(t+w)}return C-h})(Ka);(function(h){var t,w=D.vertex_index_bytes*4+D.material_index_bytes,p=w+D.uv_index_bytes*4,C=h+D.nquad_flat_uv*p;for(t=h;t<C;t+=p){y(t);G(t+w)}return C-h})(g);(function(h){var t,w=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*4,p=w+D.uv_index_bytes*
- 4,C=h+D.nquad_smooth_uv*p;for(t=h;t<C;t+=p){B(t);G(t+w)}return C-h})(Aa);(function(h){var t,w=D.vertex_index_bytes*3+D.material_index_bytes,p=h+D.ntri_flat*w;for(t=h;t<p;t+=w)x(t);return p-h})(R);(function(h){var t,w=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,p=h+D.ntri_smooth*w;for(t=h;t<p;t+=w)z(t);return p-h})(ga);(function(h){var t,w=D.vertex_index_bytes*4+D.material_index_bytes,p=h+D.nquad_flat*w;for(t=h;t<p;t+=w)y(t);return p-h})(Xa);(function(h){var t,w=D.vertex_index_bytes*
- 4+D.material_index_bytes+D.normal_index_bytes*4,p=h+D.nquad_smooth*w;for(t=h;t<p;t+=w)B(t);return p-h})(Ya);this.computeCentroids();this.computeFaceNormals()};f.prototype=new THREE.Geometry;f.prototype.constructor=f;c(new f(b))},v:function(a,c,b,d){a.vertices.push(new THREE.Vertex(new THREE.Vector3(c,b,d)))},f3:function(a,c,b,d,f){a.faces.push(new THREE.Face3(c,b,d,null,null,a.materials[f]))},f4:function(a,c,b,d,f,g){a.faces.push(new THREE.Face4(c,b,d,f,null,null,a.materials[g]))},f3n:function(a,
- c,b,d,f,g,j,k,m){g=a.materials[g];var o=c[k*3],n=c[k*3+1];k=c[k*3+2];var x=c[m*3],z=c[m*3+1];m=c[m*3+2];a.faces.push(new THREE.Face3(b,d,f,[new THREE.Vector3(c[j*3],c[j*3+1],c[j*3+2]),new THREE.Vector3(o,n,k),new THREE.Vector3(x,z,m)],null,g))},f4n:function(a,c,b,d,f,g,j,k,m,o,n){j=a.materials[j];var x=c[m*3],z=c[m*3+1];m=c[m*3+2];var y=c[o*3],B=c[o*3+1];o=c[o*3+2];var F=c[n*3],G=c[n*3+1];n=c[n*3+2];a.faces.push(new THREE.Face4(b,d,f,g,[new THREE.Vector3(c[k*3],c[k*3+1],c[k*3+2]),new THREE.Vector3(x,
- z,m),new THREE.Vector3(y,B,o),new THREE.Vector3(F,G,n)],null,j))},uv3:function(a,c,b,d,f,g,j){var k=[];k.push(new THREE.UV(c,b));k.push(new THREE.UV(d,f));k.push(new THREE.UV(g,j));a.push(k)},uv4:function(a,c,b,d,f,g,j,k,m){var o=[];o.push(new THREE.UV(c,b));o.push(new THREE.UV(d,f));o.push(new THREE.UV(g,j));o.push(new THREE.UV(k,m));a.push(o)}};if(!window.Int32Array){window.Int32Array=Array;window.Float32Array=Array}
- THREE.MarchingCubes=function(a,c){THREE.Object3D.call(this);this.materials=c instanceof Array?c:[c];this.init=function(b){this.isolation=80;this.size=b;this.size2=this.size*this.size;this.size3=this.size2*this.size;this.halfsize=this.size/2;this.delta=2/this.size;this.yd=this.size;this.zd=this.size2;this.field=new Float32Array(this.size3);this.normal_cache=new Float32Array(this.size3*3);this.vlist=new Float32Array(36);this.nlist=new Float32Array(36);this.firstDraw=!0;this.maxCount=4096;this.count=
- 0;this.hasPos=!1;this.hasNormal=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,d,f){return b+(d-b)*f};this.VIntX=function(b,d,f,g,j,k,m,o,n,x){j=(j-n)/(x-n);n=this.normal_cache;d[g]=k+j*this.delta;d[g+1]=m;d[g+2]=o;f[g]=this.lerp(n[b],n[b+3],j);f[g+1]=this.lerp(n[b+1],n[b+4],j);f[g+2]=this.lerp(n[b+2],n[b+5],j)};this.VIntY=function(b,d,f,g,j,k,m,o,n,x){j=(j-n)/(x-n);n=this.normal_cache;d[g]=k;d[g+1]=m+j*this.delta;d[g+
- 2]=o;d=b+this.yd*3;f[g]=this.lerp(n[b],n[d],j);f[g+1]=this.lerp(n[b+1],n[d+1],j);f[g+2]=this.lerp(n[b+2],n[d+2],j)};this.VIntZ=function(b,d,f,g,j,k,m,o,n,x){j=(j-n)/(x-n);n=this.normal_cache;d[g]=k;d[g+1]=m;d[g+2]=o+j*this.delta;d=b+this.zd*3;f[g]=this.lerp(n[b],n[d],j);f[g+1]=this.lerp(n[b+1],n[d+1],j);f[g+2]=this.lerp(n[b+2],n[d+2],j)};this.compNorm=function(b){var d=b*3;if(this.normal_cache[d]==0){this.normal_cache[d]=this.field[b-1]-this.field[b+1];this.normal_cache[d+1]=this.field[b-this.yd]-
- this.field[b+this.yd];this.normal_cache[d+2]=this.field[b-this.zd]-this.field[b+this.zd]}};this.polygonize=function(b,d,f,g,j,k){var m=g+1,o=g+this.yd,n=g+this.zd,x=m+this.yd,z=m+this.zd,y=g+this.yd+this.zd,B=m+this.yd+this.zd,F=0,G=this.field[g],I=this.field[m],R=this.field[o],D=this.field[x],M=this.field[n],L=this.field[z],N=this.field[y],ma=this.field[B];G<j&&(F|=1);I<j&&(F|=2);R<j&&(F|=8);D<j&&(F|=4);M<j&&(F|=16);L<j&&(F|=32);N<j&&(F|=128);ma<j&&(F|=64);var e=THREE.edgeTable[F];if(e==0)return 0;
- var la=this.delta,V=b+la,$=d+la;la=f+la;if(e&1){this.compNorm(g);this.compNorm(m);this.VIntX(g*3,this.vlist,this.nlist,0,j,b,d,f,G,I)}if(e&2){this.compNorm(m);this.compNorm(x);this.VIntY(m*3,this.vlist,this.nlist,3,j,V,d,f,I,D)}if(e&4){this.compNorm(o);this.compNorm(x);this.VIntX(o*3,this.vlist,this.nlist,6,j,b,$,f,R,D)}if(e&8){this.compNorm(g);this.compNorm(o);this.VIntY(g*3,this.vlist,this.nlist,9,j,b,d,f,G,R)}if(e&16){this.compNorm(n);this.compNorm(z);this.VIntX(n*3,this.vlist,this.nlist,12,j,
- b,d,la,M,L)}if(e&32){this.compNorm(z);this.compNorm(B);this.VIntY(z*3,this.vlist,this.nlist,15,j,V,d,la,L,ma)}if(e&64){this.compNorm(y);this.compNorm(B);this.VIntX(y*3,this.vlist,this.nlist,18,j,b,$,la,N,ma)}if(e&128){this.compNorm(n);this.compNorm(y);this.VIntY(n*3,this.vlist,this.nlist,21,j,b,d,la,M,N)}if(e&256){this.compNorm(g);this.compNorm(n);this.VIntZ(g*3,this.vlist,this.nlist,24,j,b,d,f,G,M)}if(e&512){this.compNorm(m);this.compNorm(z);this.VIntZ(m*3,this.vlist,this.nlist,27,j,V,d,f,I,L)}if(e&
- 1024){this.compNorm(x);this.compNorm(B);this.VIntZ(x*3,this.vlist,this.nlist,30,j,V,$,f,D,ma)}if(e&2048){this.compNorm(o);this.compNorm(y);this.VIntZ(o*3,this.vlist,this.nlist,33,j,b,$,f,R,N)}F<<=4;for(j=g=0;THREE.triTable[F+j]!=-1;){b=F+j;d=b+1;f=b+2;this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[d],3*THREE.triTable[f],k);j+=3;g++}return g};this.posnormtriv=function(b,d,f,g,j,k){var m=this.count*3;this.positionArray[m]=b[f];this.positionArray[m+1]=b[f+1];this.positionArray[m+
- 2]=b[f+2];this.positionArray[m+3]=b[g];this.positionArray[m+4]=b[g+1];this.positionArray[m+5]=b[g+2];this.positionArray[m+6]=b[j];this.positionArray[m+7]=b[j+1];this.positionArray[m+8]=b[j+2];this.normalArray[m]=d[f];this.normalArray[m+1]=d[f+1];this.normalArray[m+2]=d[f+2];this.normalArray[m+3]=d[g];this.normalArray[m+4]=d[g+1];this.normalArray[m+5]=d[g+2];this.normalArray[m+6]=d[j];this.normalArray[m+7]=d[j+1];this.normalArray[m+8]=d[j+2];this.hasPos=!0;this.hasNormal=!0;this.count+=3;this.count>=
- this.maxCount-3&&k(this)};this.begin=function(){this.count=0;this.hasPos=!1;this.hasNormal=!1};this.end=function(b){if(this.count!=0){for(var d=this.count*3;d<this.positionArray.length;d++)this.positionArray[d]=0;b(this)}};this.addBall=function(b,d,f,g,j){var k=this.size*Math.sqrt(g/j),m=f*this.size,o=d*this.size,n=b*this.size,x=Math.floor(m-k);x<1&&(x=1);m=Math.floor(m+k);m>this.size-1&&(m=this.size-1);var z=Math.floor(o-k);z<1&&(z=1);o=Math.floor(o+k);o>this.size-1&&(o=this.size-1);var y=Math.floor(n-
- k);y<1&&(y=1);k=Math.floor(n+k);k>this.size-1&&(k=this.size-1);for(var B,F,G,I,R,D;x<m;x++){n=this.size2*x;F=x/this.size-f;R=F*F;for(F=z;F<o;F++){G=n+this.size*F;B=F/this.size-d;D=B*B;for(B=y;B<k;B++){I=B/this.size-b;I=g/(1.0E-6+I*I+D+R)-j;I>0&&(this.field[G+B]+=I)}}}};this.addPlaneX=function(b,d){var f,g,j,k,m,o=this.size,n=this.yd,x=this.zd,z=this.field,y=o*Math.sqrt(b/d);y>o&&(y=o);for(f=0;f<y;f++){g=f/o;g*=g;k=b/(1.0E-4+g)-d;if(k>0)for(g=0;g<o;g++){m=f+g*n;for(j=0;j<o;j++)z[x*j+m]+=k}}};this.addPlaneY=
- function(b,d){var f,g,j,k,m,o,n=this.size,x=this.yd,z=this.zd,y=this.field,B=n*Math.sqrt(b/d);B>n&&(B=n);for(g=0;g<B;g++){f=g/n;f*=f;k=b/(1.0E-4+f)-d;if(k>0){m=g*x;for(f=0;f<n;f++){o=m+f;for(j=0;j<n;j++)y[z*j+o]+=k}}}};this.addPlaneZ=function(b,d){var f,g,j,k,m,o;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/d);dist>size&&(dist=size);for(j=0;j<dist;j++){f=j/size;f*=f;k=b/(1.0E-4+f)-d;if(k>0){m=zd*j;for(g=0;g<size;g++){o=m+g*yd;for(f=0;f<size;f++)field[o+f]+=k}}}};this.reset=
- function(){var b;for(b=0;b<this.size3;b++){this.normal_cache[b*3]=0;this.field[b]=0}};this.render=function(b){this.begin();var d,f,g,j,k,m,o,n,x,z=this.size-2;for(j=1;j<z;j++){x=this.size2*j;o=(j-this.halfsize)/this.halfsize;for(g=1;g<z;g++){n=x+this.size*g;m=(g-this.halfsize)/this.halfsize;for(f=1;f<z;f++){k=(f-this.halfsize)/this.halfsize;d=n+f;this.polygonize(k,m,o,d,this.isolation,b)}}}this.end(b)};this.generateGeometry=function(){var b=0,d=new THREE.Geometry;this.render(function(f){var g,j,k,
- m,o,n,x,z;for(g=0;g<f.count;g++){o=g*3;x=o+1;z=o+2;j=f.positionArray[o];k=f.positionArray[x];m=f.positionArray[z];n=new THREE.Vector3(j,k,m);j=f.normalArray[o];k=f.normalArray[x];m=f.normalArray[z];o=new THREE.Vector3(j,k,m);o.normalize();o=new THREE.Vertex(n,o);d.vertices.push(o)}nfaces=f.count/3;for(g=0;g<nfaces;g++){o=(b+g)*3;x=o+1;z=o+2;n=d.vertices[o].normal;j=d.vertices[x].normal;k=d.vertices[z].normal;o=new THREE.Face3(o,x,z,[n,j,k]);d.faces.push(o)}b+=nfaces;f.count=0});return d};this.init(a)};
- THREE.MarchingCubes.prototype=new THREE.Object3D;THREE.MarchingCubes.prototype.constructor=THREE.MarchingCubes;
- THREE.edgeTable=new Int32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,
- 1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,
- 419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0]);
- THREE.triTable=new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,2,10,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,8,3,2,10,8,10,9,8,-1,-1,-1,-1,-1,-1,-1,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,8,11,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,11,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,-1,1,11,2,1,9,11,9,8,11,-1,-1,-1,-1,-1,-1,-1,3,10,1,11,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,10,1,0,8,10,8,11,10,-1,-1,-1,-1,-1,-1,-1,3,9,0,3,11,9,11,10,9,-1,-1,-1,-1,-1,-1,-1,9,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,7,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,1,9,4,7,1,7,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,4,7,3,0,4,1,2,10,-1,-1,-1,-1,-1,-1,-1,9,2,10,9,0,2,8,4,7,
- -1,-1,-1,-1,-1,-1,-1,2,10,9,2,9,7,2,7,3,7,9,4,-1,-1,-1,-1,8,4,7,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,4,7,11,2,4,2,0,4,-1,-1,-1,-1,-1,-1,-1,9,0,1,8,4,7,2,3,11,-1,-1,-1,-1,-1,-1,-1,4,7,11,9,4,11,9,11,2,9,2,1,-1,-1,-1,-1,3,10,1,3,11,10,7,8,4,-1,-1,-1,-1,-1,-1,-1,1,11,10,1,4,11,1,0,4,7,11,4,-1,-1,-1,-1,4,7,8,9,0,11,9,11,10,11,0,3,-1,-1,-1,-1,4,7,11,4,11,9,9,11,10,-1,-1,-1,-1,-1,-1,-1,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,5,4,1,5,0,-1,-1,-1,-1,-1,-1,
- -1,-1,-1,-1,8,5,4,8,3,5,3,1,5,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,10,4,9,5,-1,-1,-1,-1,-1,-1,-1,5,2,10,5,4,2,4,0,2,-1,-1,-1,-1,-1,-1,-1,2,10,5,3,2,5,3,5,4,3,4,8,-1,-1,-1,-1,9,5,4,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,0,8,11,4,9,5,-1,-1,-1,-1,-1,-1,-1,0,5,4,0,1,5,2,3,11,-1,-1,-1,-1,-1,-1,-1,2,1,5,2,5,8,2,8,11,4,8,5,-1,-1,-1,-1,10,3,11,10,1,3,9,5,4,-1,-1,-1,-1,-1,-1,-1,4,9,5,0,8,1,8,10,1,8,11,10,-1,-1,-1,-1,5,4,0,5,0,11,5,11,10,11,0,3,-1,-1,-1,-1,5,4,8,5,
- 8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,9,7,8,5,7,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,3,0,9,5,3,5,7,3,-1,-1,-1,-1,-1,-1,-1,0,7,8,0,1,7,1,5,7,-1,-1,-1,-1,-1,-1,-1,1,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,7,8,9,5,7,10,1,2,-1,-1,-1,-1,-1,-1,-1,10,1,2,9,5,0,5,3,0,5,7,3,-1,-1,-1,-1,8,0,2,8,2,5,8,5,7,10,5,2,-1,-1,-1,-1,2,10,5,2,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,7,9,5,7,8,9,3,11,2,-1,-1,-1,-1,-1,-1,-1,9,5,7,9,7,2,9,2,0,2,7,11,-1,-1,-1,-1,2,3,11,0,1,8,1,7,8,1,5,7,-1,-1,-1,-1,11,2,1,11,1,7,7,1,5,-1,-1,-1,-1,-1,-1,
- -1,9,5,8,8,5,7,10,1,3,10,3,11,-1,-1,-1,-1,5,7,0,5,0,9,7,11,0,1,0,10,11,10,0,-1,11,10,0,11,0,3,10,5,0,8,0,7,5,7,0,-1,11,10,5,7,11,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,0,1,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,1,9,8,5,10,6,-1,-1,-1,-1,-1,-1,-1,1,6,5,2,6,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,6,5,1,2,6,3,0,8,-1,-1,-1,-1,-1,-1,-1,9,6,5,9,0,6,0,2,6,-1,-1,-1,-1,-1,-1,-1,5,9,8,5,8,2,5,2,6,3,2,8,-1,-1,-1,-1,2,3,11,10,6,
- 5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,0,8,11,2,0,10,6,5,-1,-1,-1,-1,-1,-1,-1,0,1,9,2,3,11,5,10,6,-1,-1,-1,-1,-1,-1,-1,5,10,6,1,9,2,9,11,2,9,8,11,-1,-1,-1,-1,6,3,11,6,5,3,5,1,3,-1,-1,-1,-1,-1,-1,-1,0,8,11,0,11,5,0,5,1,5,11,6,-1,-1,-1,-1,3,11,6,0,3,6,0,6,5,0,5,9,-1,-1,-1,-1,6,5,9,6,9,11,11,9,8,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,4,7,3,6,5,10,-1,-1,-1,-1,-1,-1,-1,1,9,0,5,10,6,8,4,7,-1,-1,-1,-1,-1,-1,-1,10,6,5,1,9,7,1,7,3,7,9,4,-1,-1,-1,-1,6,1,2,6,5,1,4,7,8,-1,-1,-1,-1,
- -1,-1,-1,1,2,5,5,2,6,3,0,4,3,4,7,-1,-1,-1,-1,8,4,7,9,0,5,0,6,5,0,2,6,-1,-1,-1,-1,7,3,9,7,9,4,3,2,9,5,9,6,2,6,9,-1,3,11,2,7,8,4,10,6,5,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,2,4,2,0,2,7,11,-1,-1,-1,-1,0,1,9,4,7,8,2,3,11,5,10,6,-1,-1,-1,-1,9,2,1,9,11,2,9,4,11,7,11,4,5,10,6,-1,8,4,7,3,11,5,3,5,1,5,11,6,-1,-1,-1,-1,5,1,11,5,11,6,1,0,11,7,11,4,0,4,11,-1,0,5,9,0,6,5,0,3,6,11,6,3,8,4,7,-1,6,5,9,6,9,11,4,7,9,7,11,9,-1,-1,-1,-1,10,4,9,6,4,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,10,6,4,9,10,0,8,3,-1,-1,-1,-1,-1,-1,-1,
- 10,0,1,10,6,0,6,4,0,-1,-1,-1,-1,-1,-1,-1,8,3,1,8,1,6,8,6,4,6,1,10,-1,-1,-1,-1,1,4,9,1,2,4,2,6,4,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,9,2,4,9,2,6,4,-1,-1,-1,-1,0,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,3,2,8,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,10,4,9,10,6,4,11,2,3,-1,-1,-1,-1,-1,-1,-1,0,8,2,2,8,11,4,9,10,4,10,6,-1,-1,-1,-1,3,11,2,0,1,6,0,6,4,6,1,10,-1,-1,-1,-1,6,4,1,6,1,10,4,8,1,2,1,11,8,11,1,-1,9,6,4,9,3,6,9,1,3,11,6,3,-1,-1,-1,-1,8,11,1,8,1,0,11,6,1,9,1,4,6,4,1,-1,3,11,6,3,6,0,0,6,4,-1,-1,-1,-1,-1,-1,-1,
- 6,4,8,11,6,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,10,6,7,8,10,8,9,10,-1,-1,-1,-1,-1,-1,-1,0,7,3,0,10,7,0,9,10,6,7,10,-1,-1,-1,-1,10,6,7,1,10,7,1,7,8,1,8,0,-1,-1,-1,-1,10,6,7,10,7,1,1,7,3,-1,-1,-1,-1,-1,-1,-1,1,2,6,1,6,8,1,8,9,8,6,7,-1,-1,-1,-1,2,6,9,2,9,1,6,7,9,0,9,3,7,3,9,-1,7,8,0,7,0,6,6,0,2,-1,-1,-1,-1,-1,-1,-1,7,3,2,6,7,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,11,10,6,8,10,8,9,8,6,7,-1,-1,-1,-1,2,0,7,2,7,11,0,9,7,6,7,10,9,10,7,-1,1,8,0,1,7,8,1,10,7,6,7,10,2,3,11,-1,11,2,1,11,1,7,10,6,1,6,7,1,-1,-1,-1,-1,
- 8,9,6,8,6,7,9,1,6,11,6,3,1,3,6,-1,0,9,1,11,6,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,8,0,7,0,6,3,11,0,11,6,0,-1,-1,-1,-1,7,11,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,1,9,8,3,1,11,7,6,-1,-1,-1,-1,-1,-1,-1,10,1,2,6,11,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,3,0,8,6,11,7,-1,-1,-1,-1,-1,-1,-1,2,9,0,2,10,9,6,11,7,-1,-1,-1,-1,-1,-1,-1,6,11,7,2,10,3,10,8,3,10,9,8,-1,-1,-1,-1,7,
- 2,3,6,2,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,0,8,7,6,0,6,2,0,-1,-1,-1,-1,-1,-1,-1,2,7,6,2,3,7,0,1,9,-1,-1,-1,-1,-1,-1,-1,1,6,2,1,8,6,1,9,8,8,7,6,-1,-1,-1,-1,10,7,6,10,1,7,1,3,7,-1,-1,-1,-1,-1,-1,-1,10,7,6,1,7,10,1,8,7,1,0,8,-1,-1,-1,-1,0,3,7,0,7,10,0,10,9,6,10,7,-1,-1,-1,-1,7,6,10,7,10,8,8,10,9,-1,-1,-1,-1,-1,-1,-1,6,8,4,11,8,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,6,11,3,0,6,0,4,6,-1,-1,-1,-1,-1,-1,-1,8,6,11,8,4,6,9,0,1,-1,-1,-1,-1,-1,-1,-1,9,4,6,9,6,3,9,3,1,11,3,6,-1,-1,-1,-1,6,8,4,6,11,8,2,10,1,-1,-1,-1,
- -1,-1,-1,-1,1,2,10,3,0,11,0,6,11,0,4,6,-1,-1,-1,-1,4,11,8,4,6,11,0,2,9,2,10,9,-1,-1,-1,-1,10,9,3,10,3,2,9,4,3,11,3,6,4,6,3,-1,8,2,3,8,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,0,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,4,2,4,6,4,3,8,-1,-1,-1,-1,1,9,4,1,4,2,2,4,6,-1,-1,-1,-1,-1,-1,-1,8,1,3,8,6,1,8,4,6,6,10,1,-1,-1,-1,-1,10,1,0,10,0,6,6,0,4,-1,-1,-1,-1,-1,-1,-1,4,6,3,4,3,8,6,10,3,0,3,9,10,9,3,-1,10,9,4,6,10,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,5,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,5,11,7,6,
- -1,-1,-1,-1,-1,-1,-1,5,0,1,5,4,0,7,6,11,-1,-1,-1,-1,-1,-1,-1,11,7,6,8,3,4,3,5,4,3,1,5,-1,-1,-1,-1,9,5,4,10,1,2,7,6,11,-1,-1,-1,-1,-1,-1,-1,6,11,7,1,2,10,0,8,3,4,9,5,-1,-1,-1,-1,7,6,11,5,4,10,4,2,10,4,0,2,-1,-1,-1,-1,3,4,8,3,5,4,3,2,5,10,5,2,11,7,6,-1,7,2,3,7,6,2,5,4,9,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,6,0,6,2,6,8,7,-1,-1,-1,-1,3,6,2,3,7,6,1,5,0,5,4,0,-1,-1,-1,-1,6,2,8,6,8,7,2,1,8,4,8,5,1,5,8,-1,9,5,4,10,1,6,1,7,6,1,3,7,-1,-1,-1,-1,1,6,10,1,7,6,1,0,7,8,7,0,9,5,4,-1,4,0,10,4,10,5,0,3,10,6,10,7,3,7,10,
- -1,7,6,10,7,10,8,5,4,10,4,8,10,-1,-1,-1,-1,6,9,5,6,11,9,11,8,9,-1,-1,-1,-1,-1,-1,-1,3,6,11,0,6,3,0,5,6,0,9,5,-1,-1,-1,-1,0,11,8,0,5,11,0,1,5,5,6,11,-1,-1,-1,-1,6,11,3,6,3,5,5,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,11,9,11,8,11,5,6,-1,-1,-1,-1,0,11,3,0,6,11,0,9,6,5,6,9,1,2,10,-1,11,8,5,11,5,6,8,0,5,10,5,2,0,2,5,-1,6,11,3,6,3,5,2,10,3,10,5,3,-1,-1,-1,-1,5,8,9,5,2,8,5,6,2,3,8,2,-1,-1,-1,-1,9,5,6,9,6,0,0,6,2,-1,-1,-1,-1,-1,-1,-1,1,5,8,1,8,0,5,6,8,3,8,2,6,2,8,-1,1,5,6,2,1,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
- 1,3,6,1,6,10,3,8,6,5,6,9,8,9,6,-1,10,1,0,10,0,6,9,5,0,5,6,0,-1,-1,-1,-1,0,3,8,5,6,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,5,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,7,5,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,11,7,5,8,3,0,-1,-1,-1,-1,-1,-1,-1,5,11,7,5,10,11,1,9,0,-1,-1,-1,-1,-1,-1,-1,10,7,5,10,11,7,9,8,1,8,3,1,-1,-1,-1,-1,11,1,2,11,7,1,7,5,1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,7,1,7,5,7,2,11,-1,-1,-1,-1,9,7,5,9,2,7,9,0,2,2,11,7,-1,-1,-1,-1,7,5,2,7,2,11,5,9,2,3,2,8,9,8,2,-1,2,5,10,2,3,5,3,7,5,-1,-1,
- -1,-1,-1,-1,-1,8,2,0,8,5,2,8,7,5,10,2,5,-1,-1,-1,-1,9,0,1,5,10,3,5,3,7,3,10,2,-1,-1,-1,-1,9,8,2,9,2,1,8,7,2,10,2,5,7,5,2,-1,1,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,7,0,7,1,1,7,5,-1,-1,-1,-1,-1,-1,-1,9,0,3,9,3,5,5,3,7,-1,-1,-1,-1,-1,-1,-1,9,8,7,5,9,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5,8,4,5,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,5,0,4,5,11,0,5,10,11,11,3,0,-1,-1,-1,-1,0,1,9,8,4,10,8,10,11,10,4,5,-1,-1,-1,-1,10,11,4,10,4,5,11,3,4,9,4,1,3,1,4,-1,2,5,1,2,8,5,2,11,8,4,5,8,-1,-1,-1,-1,0,4,11,0,11,3,4,5,11,
- 2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,
- 4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,
- -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,
- 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);
|