123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703 |
- // Three.js r46dev - http://github.com/mrdoob/three.js
- var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(b){b!==void 0&&this.setHex(b);return this};
- THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(b){this.r=b.r;this.g=b.g;this.b=b.b;return this},setRGB:function(b,e,c){this.r=b;this.g=e;this.b=c;return this},setHSV:function(b,e,c){var f,h,k;if(c==0)this.r=this.g=this.b=0;else switch(f=Math.floor(b*6),h=b*6-f,b=c*(1-e),k=c*(1-e*h),e=c*(1-e*(1-h)),f){case 1:this.r=k;this.g=c;this.b=b;break;case 2:this.r=b;this.g=c;this.b=e;break;case 3:this.r=b;this.g=k;this.b=c;break;case 4:this.r=e;this.g=b;this.b=c;break;case 5:this.r=
- c;this.g=b;this.b=k;break;case 6:case 0:this.r=c,this.g=e,this.b=b}return this},setHex:function(b){b=Math.floor(b);this.r=(b>>16&255)/255;this.g=(b>>8&255)/255;this.b=(b&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};
- THREE.Vector2=function(b,e){this.x=b||0;this.y=e||0};
- THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(b,e){this.x=b;this.y=e;return this},copy:function(b){this.x=b.x;this.y=b.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(b,e){this.x=b.x+e.x;this.y=b.y+e.y;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;return this},sub:function(b,e){this.x=b.x-e.x;this.y=b.y-e.y;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;return this},
- divideScalar:function(b){b?(this.x/=b,this.y/=b):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){var e=this.x-b.x,b=this.y-b.y;return e*e+b*b},setLength:function(b){return this.normalize().multiplyScalar(b)},
- equals:function(b){return b.x==this.x&&b.y==this.y}};THREE.Vector3=function(b,e,c){this.x=b||0;this.y=e||0;this.z=c||0};
- THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(b,e,c){this.x=b;this.y=e;this.z=c;return this},setX:function(b){this.x=b;return this},setY:function(b){this.y=b;return this},setZ:function(b){this.z=b;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(b,e){this.x=b.x+e.x;this.y=b.y+e.y;this.z=b.z+e.z;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;return this},
- addScalar:function(b){this.x+=b;this.y+=b;this.z+=b;return this},sub:function(b,e){this.x=b.x-e.x;this.y=b.y-e.y;this.z=b.z-e.z;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;return this},multiply:function(b,e){this.x=b.x*e.x;this.y=b.y*e.y;this.z=b.z*e.z;return this},multiplySelf:function(b){this.x*=b.x;this.y*=b.y;this.z*=b.z;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;return this},divideSelf:function(b){this.x/=b.x;this.y/=b.y;this.z/=b.z;return this},
- divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b):this.set(0,0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},
- cross:function(b,e){this.x=b.y*e.z-b.z*e.y;this.y=b.z*e.x-b.x*e.z;this.z=b.x*e.y-b.y*e.x;return this},crossSelf:function(b){return this.set(this.y*b.z-this.z*b.y,this.z*b.x-this.x*b.z,this.x*b.y-this.y*b.x)},distanceTo:function(b){return Math.sqrt(this.distanceToSquared(b))},distanceToSquared:function(b){return(new THREE.Vector3).sub(this,b).lengthSq()},setPositionFromMatrix:function(b){this.x=b.n14;this.y=b.n24;this.z=b.n34},setRotationFromMatrix:function(b){var e=Math.cos(this.y);this.y=Math.asin(b.n13);
- Math.abs(e)>1.0E-5?(this.x=Math.atan2(-b.n23/e,b.n33/e),this.z=Math.atan2(-b.n12/e,b.n11/e)):(this.x=0,this.z=Math.atan2(b.n21,b.n22))},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector4=function(b,e,c,f){this.x=b||0;this.y=e||0;this.z=c||0;this.w=f!==void 0?f:1};
- THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(b,e,c,f){this.x=b;this.y=e;this.z=c;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w!==void 0?b.w:1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(b,e){this.x=b.x+e.x;this.y=b.y+e.y;this.z=b.z+e.z;this.w=b.w+e.w;return this},addSelf:function(b){this.x+=b.x;this.y+=b.y;this.z+=b.z;this.w+=b.w;return this},sub:function(b,e){this.x=b.x-e.x;this.y=b.y-e.y;this.z=b.z-
- e.z;this.w=b.w-e.w;return this},subSelf:function(b){this.x-=b.x;this.y-=b.y;this.z-=b.z;this.w-=b.w;return this},multiplyScalar:function(b){this.x*=b;this.y*=b;this.z*=b;this.w*=b;return this},divideScalar:function(b){b?(this.x/=b,this.y/=b,this.z/=b,this.w/=b):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(b){return this.x*b.x+this.y*b.y+this.z*b.z+this.w*b.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
- normalize:function(){return this.divideScalar(this.length())},setLength:function(b){return this.normalize().multiplyScalar(b)},lerpSelf:function(b,e){this.x+=(b.x-this.x)*e;this.y+=(b.y-this.y)*e;this.z+=(b.z-this.z)*e;this.w+=(b.w-this.w)*e;return this}};THREE.Ray=function(b,e){this.origin=b||new THREE.Vector3;this.direction=e||new THREE.Vector3};
- THREE.Ray.prototype={constructor:THREE.Ray,intersectScene:function(b){return this.intersectObjects(b.objects)},intersectObjects:function(b){var e,c,f=[];e=0;for(c=b.length;e<c;e++)Array.prototype.push.apply(f,this.intersectObject(b[e]));f.sort(function(b,c){return b.distance-c.distance});return f},intersectObject:function(b){function e(b,c,e){var f;f=e.clone().subSelf(b).dot(c);if(f<=0)return null;b=b.clone().addSelf(c.clone().multiplyScalar(f));return e.distanceTo(b)}function c(b,c,e,f){var f=f.clone().subSelf(c),
- e=e.clone().subSelf(c),h=b.clone().subSelf(c),b=f.dot(f),c=f.dot(e),f=f.dot(h),k=e.dot(e),e=e.dot(h),h=1/(b*k-c*c),k=(k*f-c*e)*h,b=(b*e-c*f)*h;return k>0&&b>0&&k+b<1}for(var f,h=[],k=0,m=b.children.length;k<m;k++)Array.prototype.push.apply(h,this.intersectObject(b.children[k]));if(b instanceof THREE.Particle){k=e(this.origin,this.direction,b.matrixWorld.getPosition());if(k==null||k>b.scale.x)return[];f={distance:k,point:b.position,face:null,object:b};h.push(f)}else if(b instanceof THREE.Mesh){k=e(this.origin,
- this.direction,b.matrixWorld.getPosition());if(k==null||k>b.geometry.boundingSphere.radius*Math.max(b.scale.x,Math.max(b.scale.y,b.scale.z)))return h;for(var n,p,v,w,u,x,t,z,y=b.geometry,A=y.vertices,k=0,m=y.faces.length;k<m;k++)if(f=y.faces[k],t=this.origin.clone(),z=this.direction.clone(),w=b.matrixWorld,n=w.multiplyVector3(f.centroid.clone()).subSelf(t),x=n.dot(z),!(x<=0)&&(n=w.multiplyVector3(A[f.a].position.clone()),p=w.multiplyVector3(A[f.b].position.clone()),v=w.multiplyVector3(A[f.c].position.clone()),
- w=f instanceof THREE.Face4?w.multiplyVector3(A[f.d].position.clone()):null,u=b.matrixRotationWorld.multiplyVector3(f.normal.clone()),x=z.dot(u),b.doubleSided||(b.flipSided?x>0:x<0)))if(x=u.dot((new THREE.Vector3).sub(n,t))/x,t=t.addSelf(z.multiplyScalar(x)),f instanceof THREE.Face3)c(t,n,p,v)&&(f={distance:this.origin.distanceTo(t),point:t,face:f,object:b},h.push(f));else if(f instanceof THREE.Face4&&(c(t,n,p,w)||c(t,p,v,w)))f={distance:this.origin.distanceTo(t),point:t,face:f,object:b},h.push(f)}return h}};
- THREE.Rectangle=function(){function b(){k=f-e;m=h-c}var e,c,f,h,k,m,n=!0;this.getX=function(){return e};this.getY=function(){return c};this.getWidth=function(){return k};this.getHeight=function(){return m};this.getLeft=function(){return e};this.getTop=function(){return c};this.getRight=function(){return f};this.getBottom=function(){return h};this.set=function(k,m,w,u){n=!1;e=k;c=m;f=w;h=u;b()};this.addPoint=function(k,m){n?(n=!1,e=k,c=m,f=k,h=m):(e=e<k?e:k,c=c<m?c:m,f=f>k?f:k,h=h>m?h:m);b()};this.add3Points=
- function(k,m,w,u,x,t){n?(n=!1,e=k<w?k<x?k:x:w<x?w:x,c=m<u?m<t?m:t:u<t?u:t,f=k>w?k>x?k:x:w>x?w:x,h=m>u?m>t?m:t:u>t?u:t):(e=k<w?k<x?k<e?k:e:x<e?x:e:w<x?w<e?w:e:x<e?x:e,c=m<u?m<t?m<c?m:c:t<c?t:c:u<t?u<c?u:c:t<c?t:c,f=k>w?k>x?k>f?k:f:x>f?x:f:w>x?w>f?w:f:x>f?x:f,h=m>u?m>t?m>h?m:h:t>h?t:h:u>t?u>h?u:h:t>h?t:h);b()};this.addRectangle=function(k){n?(n=!1,e=k.getLeft(),c=k.getTop(),f=k.getRight(),h=k.getBottom()):(e=e<k.getLeft()?e:k.getLeft(),c=c<k.getTop()?c:k.getTop(),f=f>k.getRight()?f:k.getRight(),h=h>
- k.getBottom()?h:k.getBottom());b()};this.inflate=function(k){e-=k;c-=k;f+=k;h+=k;b()};this.minSelf=function(k){e=e>k.getLeft()?e:k.getLeft();c=c>k.getTop()?c:k.getTop();f=f<k.getRight()?f:k.getRight();h=h<k.getBottom()?h:k.getBottom();b()};this.intersects=function(b){return Math.min(f,b.getRight())-Math.max(e,b.getLeft())>=0&&Math.min(h,b.getBottom())-Math.max(c,b.getTop())>=0};this.empty=function(){n=!0;h=f=c=e=0;b()};this.isEmpty=function(){return n}};THREE.Matrix3=function(){this.m=[]};
- THREE.Matrix3.prototype={constructor:THREE.Matrix3,transpose:function(){var b,e=this.m;b=e[1];e[1]=e[3];e[3]=b;b=e[2];e[2]=e[6];e[6]=b;b=e[5];e[5]=e[7];e[7]=b;return this},transposeIntoArray:function(b){var e=this.m;b[0]=e[0];b[1]=e[3];b[2]=e[6];b[3]=e[1];b[4]=e[4];b[5]=e[7];b[6]=e[2];b[7]=e[5];b[8]=e[8];return this}};
- THREE.Matrix4=function(b,e,c,f,h,k,m,n,p,v,w,u,x,t,z,y){this.set(b!==void 0?b:1,e||0,c||0,f||0,h||0,k!==void 0?k:1,m||0,n||0,p||0,v||0,w!==void 0?w:1,u||0,x||0,t||0,z||0,y!==void 0?y:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
- THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(b,e,c,f,h,k,m,n,p,v,w,u,x,t,z,y){this.n11=b;this.n12=e;this.n13=c;this.n14=f;this.n21=h;this.n22=k;this.n23=m;this.n24=n;this.n31=p;this.n32=v;this.n33=w;this.n34=u;this.n41=x;this.n42=t;this.n43=z;this.n44=y;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(b){this.set(b.n11,b.n12,b.n13,b.n14,b.n21,b.n22,b.n23,b.n24,b.n31,b.n32,b.n33,b.n34,b.n41,b.n42,b.n43,b.n44);return this},lookAt:function(b,
- e,c){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;k.sub(b,e).normalize();if(k.length()===0)k.z=1;f.cross(c,k).normalize();f.length()===0&&(k.x+=1.0E-4,f.cross(c,k).normalize());h.cross(k,f).normalize();this.n11=f.x;this.n12=h.x;this.n13=k.x;this.n21=f.y;this.n22=h.y;this.n23=k.y;this.n31=f.z;this.n32=h.z;this.n33=k.z;return this},multiplyVector3:function(b){var e=b.x,c=b.y,f=b.z,h=1/(this.n41*e+this.n42*c+this.n43*f+this.n44);b.x=(this.n11*e+this.n12*c+this.n13*f+this.n14)*h;
- b.y=(this.n21*e+this.n22*c+this.n23*f+this.n24)*h;b.z=(this.n31*e+this.n32*c+this.n33*f+this.n34)*h;return b},multiplyVector4:function(b){var e=b.x,c=b.y,f=b.z,h=b.w;b.x=this.n11*e+this.n12*c+this.n13*f+this.n14*h;b.y=this.n21*e+this.n22*c+this.n23*f+this.n24*h;b.z=this.n31*e+this.n32*c+this.n33*f+this.n34*h;b.w=this.n41*e+this.n42*c+this.n43*f+this.n44*h;return b},rotateAxis:function(b){var e=b.x,c=b.y,f=b.z;b.x=e*this.n11+c*this.n12+f*this.n13;b.y=e*this.n21+c*this.n22+f*this.n23;b.z=e*this.n31+
- c*this.n32+f*this.n33;b.normalize();return b},crossVector:function(b){var e=new THREE.Vector4;e.x=this.n11*b.x+this.n12*b.y+this.n13*b.z+this.n14*b.w;e.y=this.n21*b.x+this.n22*b.y+this.n23*b.z+this.n24*b.w;e.z=this.n31*b.x+this.n32*b.y+this.n33*b.z+this.n34*b.w;e.w=b.w?this.n41*b.x+this.n42*b.y+this.n43*b.z+this.n44*b.w:1;return e},multiply:function(b,e){var c=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,p=b.n23,v=b.n24,w=b.n31,u=b.n32,x=b.n33,t=b.n34,z=b.n41,y=b.n42,A=b.n43,E=b.n44,F=e.n11,D=e.n12,
- G=e.n13,K=e.n14,N=e.n21,L=e.n22,B=e.n23,M=e.n24,U=e.n31,I=e.n32,S=e.n33,Q=e.n34,Y=e.n41,W=e.n42,o=e.n43,$=e.n44;this.n11=c*F+f*N+h*U+k*Y;this.n12=c*D+f*L+h*I+k*W;this.n13=c*G+f*B+h*S+k*o;this.n14=c*K+f*M+h*Q+k*$;this.n21=m*F+n*N+p*U+v*Y;this.n22=m*D+n*L+p*I+v*W;this.n23=m*G+n*B+p*S+v*o;this.n24=m*K+n*M+p*Q+v*$;this.n31=w*F+u*N+x*U+t*Y;this.n32=w*D+u*L+x*I+t*W;this.n33=w*G+u*B+x*S+t*o;this.n34=w*K+u*M+x*Q+t*$;this.n41=z*F+y*N+A*U+E*Y;this.n42=z*D+y*L+A*I+E*W;this.n43=z*G+y*B+A*S+E*o;this.n44=z*K+y*
- M+A*Q+E*$;return this},multiplyToArray:function(b,e,c){this.multiply(b,e);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},multiplySelf:function(b){this.multiply(this,b);return this},multiplyScalar:function(b){this.n11*=b;this.n12*=b;this.n13*=b;this.n14*=b;this.n21*=b;this.n22*=b;this.n23*=b;this.n24*=b;this.n31*=
- b;this.n32*=b;this.n33*=b;this.n34*=b;this.n41*=b;this.n42*=b;this.n43*=b;this.n44*=b;return this},determinant:function(){var b=this.n11,e=this.n12,c=this.n13,f=this.n14,h=this.n21,k=this.n22,m=this.n23,n=this.n24,p=this.n31,v=this.n32,w=this.n33,u=this.n34,x=this.n41,t=this.n42,z=this.n43,y=this.n44;return f*m*v*x-c*n*v*x-f*k*w*x+e*n*w*x+c*k*u*x-e*m*u*x-f*m*p*t+c*n*p*t+f*h*w*t-b*n*w*t-c*h*u*t+b*m*u*t+f*k*p*z-e*n*p*z-f*h*v*z+b*n*v*z+e*h*u*z-b*k*u*z-c*k*p*y+e*m*p*y+c*h*v*y-b*m*v*y-e*h*w*y+b*k*w*y},
- transpose:function(){var b;b=this.n21;this.n21=this.n12;this.n12=b;b=this.n31;this.n31=this.n13;this.n13=b;b=this.n32;this.n32=this.n23;this.n23=b;b=this.n41;this.n41=this.n14;this.n14=b;b=this.n42;this.n42=this.n24;this.n24=b;b=this.n43;this.n43=this.n34;this.n43=b;return this},clone:function(){var b=new THREE.Matrix4;b.n11=this.n11;b.n12=this.n12;b.n13=this.n13;b.n14=this.n14;b.n21=this.n21;b.n22=this.n22;b.n23=this.n23;b.n24=this.n24;b.n31=this.n31;b.n32=this.n32;b.n33=this.n33;b.n34=this.n34;
- b.n41=this.n41;b.n42=this.n42;b.n43=this.n43;b.n44=this.n44;return b},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(b){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 b},flattenToArrayOffset:function(b,e){b[e]=this.n11;b[e+1]=this.n21;b[e+2]=this.n31;b[e+3]=this.n41;b[e+4]=this.n12;b[e+5]=this.n22;b[e+6]=this.n32;b[e+7]=this.n42;b[e+8]=this.n13;b[e+9]=this.n23;b[e+10]=this.n33;b[e+11]=this.n43;b[e+12]=this.n14;b[e+13]=this.n24;b[e+14]=this.n34;
- b[e+15]=this.n44;return b},setTranslation:function(b,e,c){this.set(1,0,0,b,0,1,0,e,0,0,1,c,0,0,0,1);return this},setScale:function(b,e,c){this.set(b,0,0,0,0,e,0,0,0,0,c,0,0,0,0,1);return this},setRotationX:function(b){var e=Math.cos(b),b=Math.sin(b);this.set(1,0,0,0,0,e,-b,0,0,b,e,0,0,0,0,1);return this},setRotationY:function(b){var e=Math.cos(b),b=Math.sin(b);this.set(e,0,b,0,0,1,0,0,-b,0,e,0,0,0,0,1);return this},setRotationZ:function(b){var e=Math.cos(b),b=Math.sin(b);this.set(e,-b,0,0,b,e,0,0,
- 0,0,1,0,0,0,0,1);return this},setRotationAxis:function(b,e){var c=Math.cos(e),f=Math.sin(e),h=1-c,k=b.x,m=b.y,n=b.z,p=h*k,v=h*m;this.set(p*k+c,p*m-f*n,p*n+f*m,0,p*m+f*n,v*m+c,v*n-f*k,0,p*n-f*m,v*n+f*k,h*n*n+c,0,0,0,0,1);return this},setPosition:function(b){this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},getPosition:function(){if(!this.position)this.position=new THREE.Vector3;this.position.set(this.n14,this.n24,this.n34);return this.position},getColumnX:function(){if(!this.columnX)this.columnX=
- new THREE.Vector3;this.columnX.set(this.n11,this.n21,this.n31);return this.columnX},getColumnY:function(){if(!this.columnY)this.columnY=new THREE.Vector3;this.columnY.set(this.n12,this.n22,this.n32);return this.columnY},getColumnZ:function(){if(!this.columnZ)this.columnZ=new THREE.Vector3;this.columnZ.set(this.n13,this.n23,this.n33);return this.columnZ},setRotationFromEuler:function(b,e){var c=b.x,f=b.y,h=b.z,k=Math.cos(c),c=Math.sin(c),m=Math.cos(f),f=Math.sin(f),n=Math.cos(h),h=Math.sin(h);switch(e){case "YXZ":var p=
- m*n,v=m*h,w=f*n,u=f*h;this.n11=p+u*c;this.n12=w*c-v;this.n13=k*f;this.n21=k*h;this.n22=k*n;this.n23=-c;this.n31=v*c-w;this.n32=u+p*c;this.n33=k*m;break;case "ZXY":p=m*n;v=m*h;w=f*n;u=f*h;this.n11=p-u*c;this.n12=-k*h;this.n13=w+v*c;this.n21=v+w*c;this.n22=k*n;this.n23=u-p*c;this.n31=-k*f;this.n32=c;this.n33=k*m;break;case "ZYX":p=k*n;v=k*h;w=c*n;u=c*h;this.n11=m*n;this.n12=w*f-v;this.n13=p*f+u;this.n21=m*h;this.n22=u*f+p;this.n23=v*f-w;this.n31=-f;this.n32=c*m;this.n33=k*m;break;case "YZX":p=k*m;v=
- k*f;w=c*m;u=c*f;this.n11=m*n;this.n12=u-p*h;this.n13=w*h+v;this.n21=h;this.n22=k*n;this.n23=-c*n;this.n31=-f*n;this.n32=v*h+w;this.n33=p-u*h;break;case "XZY":p=k*m;v=k*f;w=c*m;u=c*f;this.n11=m*n;this.n12=-h;this.n13=f*n;this.n21=p*h+u;this.n22=k*n;this.n23=v*h-w;this.n31=w*h-v;this.n32=c*n;this.n33=u*h+p;break;default:p=k*n,v=k*h,w=c*n,u=c*h,this.n11=m*n,this.n12=-m*h,this.n13=f,this.n21=v+w*f,this.n22=p-u*f,this.n23=-c*m,this.n31=u-p*f,this.n32=w+v*f,this.n33=k*m}return this},setRotationFromQuaternion:function(b){var e=
- b.x,c=b.y,f=b.z,h=b.w,k=e+e,m=c+c,n=f+f,b=e*k,p=e*m;e*=n;var v=c*m;c*=n;f*=n;k*=h;m*=h;h*=n;this.n11=1-(v+f);this.n12=p-h;this.n13=e+m;this.n21=p+h;this.n22=1-(b+f);this.n23=c-k;this.n31=e-m;this.n32=c+k;this.n33=1-(b+v);return this},scale:function(b){var e=b.x,c=b.y,b=b.z;this.n11*=e;this.n12*=c;this.n13*=b;this.n21*=e;this.n22*=c;this.n23*=b;this.n31*=e;this.n32*=c;this.n33*=b;this.n41*=e;this.n42*=c;this.n43*=b;return this},compose:function(b,e,c){var f=THREE.Matrix4.__m1,h=THREE.Matrix4.__m2;
- f.identity();f.setRotationFromQuaternion(e);h.setScale(c.x,c.y,c.z);this.multiply(f,h);this.n14=b.x;this.n24=b.y;this.n34=b.z;return this},decompose:function(b,e,c){var f=THREE.Matrix4.__v1,h=THREE.Matrix4.__v2,k=THREE.Matrix4.__v3;f.set(this.n11,this.n21,this.n31);h.set(this.n12,this.n22,this.n32);k.set(this.n13,this.n23,this.n33);b=b instanceof THREE.Vector3?b:new THREE.Vector3;e=e instanceof THREE.Quaternion?e:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=f.length();
- c.y=h.length();c.z=k.length();b.x=this.n14;b.y=this.n24;b.z=this.n34;f=THREE.Matrix4.__m1;f.copy(this);f.n11/=c.x;f.n21/=c.x;f.n31/=c.x;f.n12/=c.y;f.n22/=c.y;f.n32/=c.y;f.n13/=c.z;f.n23/=c.z;f.n33/=c.z;e.setFromRotationMatrix(f);return[b,e,c]},extractPosition:function(b){this.n14=b.n14;this.n24=b.n24;this.n34=b.n34},extractRotation:function(b,e){var c=1/e.x,f=1/e.y,h=1/e.z;this.n11=b.n11*c;this.n21=b.n21*c;this.n31=b.n31*c;this.n12=b.n12*f;this.n22=b.n22*f;this.n32=b.n32*f;this.n13=b.n13*h;this.n23=
- b.n23*h;this.n33=b.n33*h}};
- THREE.Matrix4.makeInvert=function(b,e){var c=b.n11,f=b.n12,h=b.n13,k=b.n14,m=b.n21,n=b.n22,p=b.n23,v=b.n24,w=b.n31,u=b.n32,x=b.n33,t=b.n34,z=b.n41,y=b.n42,A=b.n43,E=b.n44;e===void 0&&(e=new THREE.Matrix4);e.n11=p*t*y-v*x*y+v*u*A-n*t*A-p*u*E+n*x*E;e.n12=k*x*y-h*t*y-k*u*A+f*t*A+h*u*E-f*x*E;e.n13=h*v*y-k*p*y+k*n*A-f*v*A-h*n*E+f*p*E;e.n14=k*p*u-h*v*u-k*n*x+f*v*x+h*n*t-f*p*t;e.n21=v*x*z-p*t*z-v*w*A+m*t*A+p*w*E-m*x*E;e.n22=h*t*z-k*x*z+k*w*A-c*t*A-h*w*E+c*x*E;e.n23=k*p*z-h*v*z-k*m*A+c*v*A+h*m*E-c*p*E;e.n24=
- h*v*w-k*p*w+k*m*x-c*v*x-h*m*t+c*p*t;e.n31=n*t*z-v*u*z+v*w*y-m*t*y-n*w*E+m*u*E;e.n32=k*u*z-f*t*z-k*w*y+c*t*y+f*w*E-c*u*E;e.n33=h*v*z-k*n*z+k*m*y-c*v*y-f*m*E+c*n*E;e.n34=k*n*w-f*v*w-k*m*u+c*v*u+f*m*t-c*n*t;e.n41=p*u*z-n*x*z-p*w*y+m*x*y+n*w*A-m*u*A;e.n42=f*x*z-h*u*z+h*w*y-c*x*y-f*w*A+c*u*A;e.n43=h*n*z-f*p*z-h*m*y+c*p*y+f*m*A-c*n*A;e.n44=f*p*w-h*n*w+h*m*u-c*p*u-f*m*x+c*n*x;e.multiplyScalar(1/b.determinant());return e};
- THREE.Matrix4.makeInvert3x3=function(b){var e=b.m33,c=e.m,f=b.n33*b.n22-b.n32*b.n23,h=-b.n33*b.n21+b.n31*b.n23,k=b.n32*b.n21-b.n31*b.n22,m=-b.n33*b.n12+b.n32*b.n13,n=b.n33*b.n11-b.n31*b.n13,p=-b.n32*b.n11+b.n31*b.n12,v=b.n23*b.n12-b.n22*b.n13,w=-b.n23*b.n11+b.n21*b.n13,u=b.n22*b.n11-b.n21*b.n12,b=b.n11*f+b.n21*m+b.n31*v;b==0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");b=1/b;c[0]=b*f;c[1]=b*h;c[2]=b*k;c[3]=b*m;c[4]=b*n;c[5]=b*p;c[6]=b*v;c[7]=b*w;c[8]=b*u;return e};
- THREE.Matrix4.makeFrustum=function(b,e,c,f,h,k){var m;m=new THREE.Matrix4;m.n11=2*h/(e-b);m.n12=0;m.n13=(e+b)/(e-b);m.n14=0;m.n21=0;m.n22=2*h/(f-c);m.n23=(f+c)/(f-c);m.n24=0;m.n31=0;m.n32=0;m.n33=-(k+h)/(k-h);m.n34=-2*k*h/(k-h);m.n41=0;m.n42=0;m.n43=-1;m.n44=0;return m};THREE.Matrix4.makePerspective=function(b,e,c,f){var h,b=c*Math.tan(b*Math.PI/360);h=-b;return THREE.Matrix4.makeFrustum(h*e,b*e,h,b,c,f)};
- THREE.Matrix4.makeOrtho=function(b,e,c,f,h,k){var m,n,p,v;m=new THREE.Matrix4;n=e-b;p=c-f;v=k-h;m.n11=2/n;m.n12=0;m.n13=0;m.n14=-((e+b)/n);m.n21=0;m.n22=2/p;m.n23=0;m.n24=-((c+f)/p);m.n31=0;m.n32=0;m.n33=-2/v;m.n34=-((k+h)/v);m.n41=0;m.n42=0;m.n43=0;m.n44=1;return m};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
- THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
- !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
- THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(b,e){this.matrix.rotateAxis(e);this.position.addSelf(e.multiplyScalar(b))},translateX:function(b){this.translate(b,this._vector.set(1,0,0))},translateY:function(b){this.translate(b,this._vector.set(0,1,0))},translateZ:function(b){this.translate(b,this._vector.set(0,0,1))},lookAt:function(b){this.matrix.lookAt(b,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(b){if(this.children.indexOf(b)===
- -1){b.parent!==void 0&&b.parent.remove(b);b.parent=this;this.children.push(b);for(var e=this;e.parent!==void 0;)e=e.parent;e!==void 0&&e instanceof THREE.Scene&&e.addChildRecurse(b)}},remove:function(b){var e=this,c=this.children.indexOf(b);if(c!==-1){b.parent=void 0;for(this.children.splice(c,1);e.parent!==void 0;)e=e.parent;e!==void 0&&e instanceof THREE.Scene&&e.removeChildRecurse(b)}},getChildByName:function(b,e){var c,f,h;c=0;for(f=this.children.length;c<f;c++){h=this.children[c];if(h.name===
- b)return h;if(e&&(h=h.getChildByName(b,e),h!==void 0))return h}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);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(b,e,c){this.matrixAutoUpdate&&
- this.updateMatrix();if(this.matrixWorldNeedsUpdate||e)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale),this.matrixWorldNeedsUpdate=!1,e=!0;for(var b=0,f=this.children.length;b<f;b++)this.children[b].update(this.matrixWorld,e,c)},addChild:function(b){console.warn("DEPRECATED: Object3D.addChild() is now Object3D.add().");this.add(b)},removeChild:function(b){console.warn("DEPRECATED: Object3D.removeChild() is now Object3D.remove().");
- this.remove(b)}};THREE.Object3DCount=0;
- THREE.Projector=function(){function b(){var b=p[n]=p[n]||new THREE.RenderableVertex;n++;return b}function e(b,c){return c.z-b.z}function c(b,c){var e=0,f=1,k=b.z+b.w,h=c.z+c.w,m=-b.z+b.w,n=-c.z+c.w;return k>=0&&h>=0&&m>=0&&n>=0?!0:k<0&&h<0||m<0&&n<0?!1:(k<0?e=Math.max(e,k/(k-h)):h<0&&(f=Math.min(f,k/(k-h))),m<0?e=Math.max(e,m/(m-n)):n<0&&(f=Math.min(f,m/(m-n))),f<e?!1:(b.lerpSelf(c,e),c.lerpSelf(b,1-f),!0))}var f,h,k=[],m,n,p=[],v,w,u=[],x,t=[],z,y,A=[],E,F,D=[],G=[],K=[],N=new THREE.Vector3,L=new THREE.Vector4,
- B=new THREE.Matrix4,M=new THREE.Matrix4,U=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],I=new THREE.Vector4,S=new THREE.Vector4;this.projectVector=function(b,c){THREE.Matrix4.makeInvert(c.matrixWorld,c.matrixWorldInverse);B.multiply(c.projectionMatrix,c.matrixWorldInverse);B.multiplyVector3(b);return b};this.unprojectVector=function(b,c){B.multiply(c.matrixWorld,THREE.Matrix4.makeInvert(c.projectionMatrix));B.multiplyVector3(b);return b};
- this.pickingRay=function(b,c){var e;b.z=-1;e=new THREE.Vector3(b.x,b.y,1);this.unprojectVector(b,c);this.unprojectVector(e,c);e.subSelf(b).normalize();return new THREE.Ray(b,e)};this.projectObjects=function(b,c,m){var o,n;h=G.length=0;o=b.objects;b=0;for(c=o.length;b<c;b++){n=o[b];var p;if(!(p=!n.visible))if(p=n instanceof THREE.Mesh)if(p=n.frustumCulled){a:{p=void 0;for(var t=n.matrixWorld,v=-n.geometry.boundingSphere.radius*Math.max(n.scale.x,Math.max(n.scale.y,n.scale.z)),u=0;u<6;u++)if(p=U[u].x*
- t.n14+U[u].y*t.n24+U[u].z*t.n34+U[u].w,p<=v){p=!1;break a}p=!0}p=!p}if(!p)p=k[h]=k[h]||new THREE.RenderableObject,h++,f=p,N.copy(n.position),B.multiplyVector3(N),f.object=n,f.z=N.z,G.push(f)}m&&G.sort(e);return G};this.projectScene=function(f,k,h){var o=k.near,G=k.far,N,ha,fa,oa,ca,ja,la,da,X,V,aa,ia,ra,ma,ga,na,qa;F=y=x=w=K.length=0;k.matrixAutoUpdate&&k.update(void 0,!0);f.update(void 0,!1,k);THREE.Matrix4.makeInvert(k.matrixWorld,k.matrixWorldInverse);B.multiply(k.projectionMatrix,k.matrixWorldInverse);
- U[0].set(B.n41-B.n11,B.n42-B.n12,B.n43-B.n13,B.n44-B.n14);U[1].set(B.n41+B.n11,B.n42+B.n12,B.n43+B.n13,B.n44+B.n14);U[2].set(B.n41+B.n21,B.n42+B.n22,B.n43+B.n23,B.n44+B.n24);U[3].set(B.n41-B.n21,B.n42-B.n22,B.n43-B.n23,B.n44-B.n24);U[4].set(B.n41-B.n31,B.n42-B.n32,B.n43-B.n33,B.n44-B.n34);U[5].set(B.n41+B.n31,B.n42+B.n32,B.n43+B.n33,B.n44+B.n34);for(N=0;N<6;N++)X=U[N],X.divideScalar(Math.sqrt(X.x*X.x+X.y*X.y+X.z*X.z));X=this.projectObjects(f,k,!0);f=0;for(N=X.length;f<N;f++)if(V=X[f].object,V.visible)if(aa=
- V.matrixWorld,ia=V.matrixRotationWorld,ra=V.materials,ma=V.overdraw,n=0,V instanceof THREE.Mesh){ga=V.geometry;oa=ga.vertices;na=ga.faces;ga=ga.faceVertexUvs;ha=0;for(fa=oa.length;ha<fa;ha++)m=b(),m.positionWorld.copy(oa[ha].position),aa.multiplyVector3(m.positionWorld),m.positionScreen.copy(m.positionWorld),B.multiplyVector4(m.positionScreen),m.positionScreen.x/=m.positionScreen.w,m.positionScreen.y/=m.positionScreen.w,m.visible=m.positionScreen.z>o&&m.positionScreen.z<G;oa=0;for(ha=na.length;oa<
- ha;oa++){fa=na[oa];if(fa instanceof THREE.Face3)if(ca=p[fa.a],ja=p[fa.b],la=p[fa.c],ca.visible&&ja.visible&&la.visible&&(V.doubleSided||V.flipSided!=(la.positionScreen.x-ca.positionScreen.x)*(ja.positionScreen.y-ca.positionScreen.y)-(la.positionScreen.y-ca.positionScreen.y)*(ja.positionScreen.x-ca.positionScreen.x)<0))da=u[w]=u[w]||new THREE.RenderableFace3,w++,v=da,v.v1.copy(ca),v.v2.copy(ja),v.v3.copy(la);else continue;else if(fa instanceof THREE.Face4)if(ca=p[fa.a],ja=p[fa.b],la=p[fa.c],da=p[fa.d],
- ca.visible&&ja.visible&&la.visible&&da.visible&&(V.doubleSided||V.flipSided!=((da.positionScreen.x-ca.positionScreen.x)*(ja.positionScreen.y-ca.positionScreen.y)-(da.positionScreen.y-ca.positionScreen.y)*(ja.positionScreen.x-ca.positionScreen.x)<0||(ja.positionScreen.x-la.positionScreen.x)*(da.positionScreen.y-la.positionScreen.y)-(ja.positionScreen.y-la.positionScreen.y)*(da.positionScreen.x-la.positionScreen.x)<0)))qa=t[x]=t[x]||new THREE.RenderableFace4,x++,v=qa,v.v1.copy(ca),v.v2.copy(ja),v.v3.copy(la),
- v.v4.copy(da);else continue;v.normalWorld.copy(fa.normal);ia.multiplyVector3(v.normalWorld);v.centroidWorld.copy(fa.centroid);aa.multiplyVector3(v.centroidWorld);v.centroidScreen.copy(v.centroidWorld);B.multiplyVector3(v.centroidScreen);la=fa.vertexNormals;ca=0;for(ja=la.length;ca<ja;ca++)da=v.vertexNormalsWorld[ca],da.copy(la[ca]),ia.multiplyVector3(da);ca=0;for(ja=ga.length;ca<ja;ca++)if(qa=ga[ca][oa]){la=0;for(da=qa.length;la<da;la++)v.uvs[ca][la]=qa[la]}v.meshMaterials=ra;v.faceMaterials=fa.materials;
- v.overdraw=ma;v.z=v.centroidScreen.z;K.push(v)}}else if(V instanceof THREE.Line){M.multiply(B,aa);oa=V.geometry.vertices;ca=b();ca.positionScreen.copy(oa[0].position);M.multiplyVector4(ca.positionScreen);ha=1;for(fa=oa.length;ha<fa;ha++)if(ca=b(),ca.positionScreen.copy(oa[ha].position),M.multiplyVector4(ca.positionScreen),ja=p[n-2],I.copy(ca.positionScreen),S.copy(ja.positionScreen),c(I,S))I.multiplyScalar(1/I.w),S.multiplyScalar(1/S.w),aa=A[y]=A[y]||new THREE.RenderableLine,y++,z=aa,z.v1.positionScreen.copy(I),
- z.v2.positionScreen.copy(S),z.z=Math.max(I.z,S.z),z.materials=V.materials,K.push(z)}else if(V instanceof THREE.Particle&&(L.set(V.matrixWorld.n14,V.matrixWorld.n24,V.matrixWorld.n34,1),B.multiplyVector4(L),L.z/=L.w,L.z>0&&L.z<1))aa=D[F]=D[F]||new THREE.RenderableParticle,F++,E=aa,E.x=L.x/L.w,E.y=L.y/L.w,E.z=L.z,E.rotation=V.rotation.z,E.scale.x=V.scale.x*Math.abs(E.x-(L.x+k.projectionMatrix.n11)/(L.w+k.projectionMatrix.n14)),E.scale.y=V.scale.y*Math.abs(E.y-(L.y+k.projectionMatrix.n22)/(L.w+k.projectionMatrix.n24)),
- E.materials=V.materials,K.push(E);h&&K.sort(e);return K}};THREE.Quaternion=function(b,e,c,f){this.set(b||0,e||0,c||0,f!==void 0?f:1)};
- THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(b,e,c,f){this.x=b;this.y=e;this.z=c;this.w=f;return this},copy:function(b){this.x=b.x;this.y=b.y;this.z=b.z;this.w=b.w;return this},setFromEuler:function(b){var e=Math.PI/360,c=b.x*e,f=b.y*e,h=b.z*e,b=Math.cos(f),f=Math.sin(f),e=Math.cos(-h),h=Math.sin(-h),k=Math.cos(c),c=Math.sin(c),m=b*e,n=f*h;this.w=m*k-n*c;this.x=m*c+n*k;this.y=f*e*k+b*h*c;this.z=b*h*k-f*e*c;return this},setFromAxisAngle:function(b,e){var c=e/2,f=Math.sin(c);
- this.x=b.x*f;this.y=b.y*f;this.z=b.z*f;this.w=Math.cos(c);return this},setFromRotationMatrix:function(b){var e=Math.pow(b.determinant(),1/3);this.w=Math.sqrt(Math.max(0,e+b.n11+b.n22+b.n33))/2;this.x=Math.sqrt(Math.max(0,e+b.n11-b.n22-b.n33))/2;this.y=Math.sqrt(Math.max(0,e-b.n11+b.n22-b.n33))/2;this.z=Math.sqrt(Math.max(0,e-b.n11-b.n22+b.n33))/2;this.x=b.n32-b.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=b.n13-b.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=b.n21-b.n12<0?-Math.abs(this.z):Math.abs(this.z);
- this.normalize();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 b=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);b==0?this.w=this.z=this.y=this.x=0:(b=1/b,this.x*=b,this.y*=b,this.z*=b,this.w*=b);return this},multiplySelf:function(b){var e=
- this.x,c=this.y,f=this.z,h=this.w,k=b.x,m=b.y,n=b.z,b=b.w;this.x=e*b+h*k+c*n-f*m;this.y=c*b+h*m+f*k-e*n;this.z=f*b+h*n+e*m-c*k;this.w=h*b-e*k-c*m-f*n;return this},multiply:function(b,e){this.x=b.x*e.w+b.y*e.z-b.z*e.y+b.w*e.x;this.y=-b.x*e.z+b.y*e.w+b.z*e.x+b.w*e.y;this.z=b.x*e.y-b.y*e.x+b.z*e.w+b.w*e.z;this.w=-b.x*e.x-b.y*e.y-b.z*e.z+b.w*e.w;return this},multiplyVector3:function(b,e){e||(e=b);var c=b.x,f=b.y,h=b.z,k=this.x,m=this.y,n=this.z,p=this.w,v=p*c+m*h-n*f,w=p*f+n*c-k*h,u=p*h+k*f-m*c,c=-k*
- c-m*f-n*h;e.x=v*p+c*-k+w*-n-u*-m;e.y=w*p+c*-m+u*-k-v*-n;e.z=u*p+c*-n+v*-m-w*-k;return e}};THREE.Quaternion.slerp=function(b,e,c,f){var h=b.w*e.w+b.x*e.x+b.y*e.y+b.z*e.z;if(Math.abs(h)>=1)return c.w=b.w,c.x=b.x,c.y=b.y,c.z=b.z,c;var k=Math.acos(h),m=Math.sqrt(1-h*h);if(Math.abs(m)<0.001)return c.w=0.5*(b.w+e.w),c.x=0.5*(b.x+e.x),c.y=0.5*(b.y+e.y),c.z=0.5*(b.z+e.z),c;h=Math.sin((1-f)*k)/m;f=Math.sin(f*k)/m;c.w=b.w*h+e.w*f;c.x=b.x*h+e.x*f;c.y=b.y*h+e.y*f;c.z=b.z*h+e.z*f;return c};
- THREE.Vertex=function(b){this.position=b||new THREE.Vector3};THREE.Face3=function(b,e,c,f,h,k){this.a=b;this.b=e;this.c=c;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=h instanceof THREE.Color?h:new THREE.Color;this.vertexColors=h instanceof Array?h:[];this.vertexTangents=[];this.materials=k instanceof Array?k:[k];this.centroid=new THREE.Vector3};
- THREE.Face4=function(b,e,c,f,h,k,m){this.a=b;this.b=e;this.c=c;this.d=f;this.normal=h instanceof THREE.Vector3?h:new THREE.Vector3;this.vertexNormals=h instanceof Array?h:[];this.color=k instanceof THREE.Color?k:new THREE.Color;this.vertexColors=k instanceof Array?k:[];this.vertexTangents=[];this.materials=m instanceof Array?m:[m];this.centroid=new THREE.Vector3};THREE.UV=function(b,e){this.u=b||0;this.v=e||0};
- THREE.UV.prototype={constructor:THREE.UV,set:function(b,e){this.u=b;this.v=e;return this},copy:function(b){this.u=b.u;this.v=b.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
- THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(b){var e=new THREE.Matrix4;e.extractRotation(b,new THREE.Vector3(1,1,1));for(var c=0,f=this.vertices.length;c<f;c++)b.multiplyVector3(this.vertices[c].position);c=0;for(f=this.faces.length;c<f;c++){var h=this.faces[c];e.multiplyVector3(h.normal);for(var k=0,m=h.vertexNormals.length;k<m;k++)e.multiplyVector3(h.vertexNormals[k]);b.multiplyVector3(h.centroid)}},computeCentroids:function(){var b,e,c;b=0;for(e=this.faces.length;b<
- e;b++)c=this.faces[b],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(b){var e,
- c,f,h,k,m,n=new THREE.Vector3,p=new THREE.Vector3;f=0;for(h=this.faces.length;f<h;f++){k=this.faces[f];if(b&&k.vertexNormals.length){n.set(0,0,0);e=0;for(c=k.vertexNormals.length;e<c;e++)n.addSelf(k.vertexNormals[e]);n.divideScalar(3)}else e=this.vertices[k.a],c=this.vertices[k.b],m=this.vertices[k.c],n.sub(m.position,c.position),p.sub(e.position,c.position),n.crossSelf(p);n.isZero()||n.normalize();k.normal.copy(n)}},computeVertexNormals:function(){var b,e,c,f;if(this.__tmpVertices==void 0){f=this.__tmpVertices=
- Array(this.vertices.length);b=0;for(e=this.vertices.length;b<e;b++)f[b]=new THREE.Vector3;b=0;for(e=this.faces.length;b<e;b++)if(c=this.faces[b],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{f=this.__tmpVertices;b=0;for(e=this.vertices.length;b<e;b++)f[b].set(0,0,0)}b=0;for(e=this.faces.length;b<e;b++)c=this.faces[b],c instanceof
- THREE.Face3?(f[c.a].addSelf(c.normal),f[c.b].addSelf(c.normal),f[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(f[c.a].addSelf(c.normal),f[c.b].addSelf(c.normal),f[c.c].addSelf(c.normal),f[c.d].addSelf(c.normal));b=0;for(e=this.vertices.length;b<e;b++)f[b].normalize();b=0;for(e=this.faces.length;b<e;b++)c=this.faces[b],c instanceof THREE.Face3?(c.vertexNormals[0].copy(f[c.a]),c.vertexNormals[1].copy(f[c.b]),c.vertexNormals[2].copy(f[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(f[c.a]),
- c.vertexNormals[1].copy(f[c.b]),c.vertexNormals[2].copy(f[c.c]),c.vertexNormals[3].copy(f[c.d]))},computeTangents:function(){function b(b,c,e,f,k,h,o){n=b.vertices[c].position;p=b.vertices[e].position;v=b.vertices[f].position;w=m[k];u=m[h];x=m[o];t=p.x-n.x;z=v.x-n.x;y=p.y-n.y;A=v.y-n.y;E=p.z-n.z;F=v.z-n.z;D=u.u-w.u;G=x.u-w.u;K=u.v-w.v;N=x.v-w.v;L=1/(D*N-G*K);I.set((N*t-K*z)*L,(N*y-K*A)*L,(N*E-K*F)*L);S.set((D*z-G*t)*L,(D*A-G*y)*L,(D*F-G*E)*L);M[c].addSelf(I);M[e].addSelf(I);M[f].addSelf(I);U[c].addSelf(S);
- U[e].addSelf(S);U[f].addSelf(S)}var e,c,f,h,k,m,n,p,v,w,u,x,t,z,y,A,E,F,D,G,K,N,L,B,M=[],U=[],I=new THREE.Vector3,S=new THREE.Vector3,Q=new THREE.Vector3,Y=new THREE.Vector3,W=new THREE.Vector3;e=0;for(c=this.vertices.length;e<c;e++)M[e]=new THREE.Vector3,U[e]=new THREE.Vector3;e=0;for(c=this.faces.length;e<c;e++)k=this.faces[e],m=this.faceVertexUvs[0][e],k instanceof THREE.Face3?b(this,k.a,k.b,k.c,0,1,2):k instanceof THREE.Face4&&(b(this,k.a,k.b,k.c,0,1,2),b(this,k.a,k.b,k.d,0,1,3));var o=["a","b",
- "c","d"];e=0;for(c=this.faces.length;e<c;e++){k=this.faces[e];for(f=0;f<k.vertexNormals.length;f++)W.copy(k.vertexNormals[f]),h=k[o[f]],B=M[h],Q.copy(B),Q.subSelf(W.multiplyScalar(W.dot(B))).normalize(),Y.cross(k.vertexNormals[f],B),h=Y.dot(U[h]),h=h<0?-1:1,k.vertexTangents[f]=new THREE.Vector4(Q.x,Q.y,Q.z,h)}this.hasTangents=!0},computeBoundingBox:function(){var b;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 e=1,c=this.vertices.length;e<c;e++){b=this.vertices[e];if(b.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=b.position.x;else if(b.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=b.position.x;if(b.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=b.position.y;else if(b.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=b.position.y;if(b.position.z<this.boundingBox.z[0])this.boundingBox.z[0]=
- b.position.z;else if(b.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=b.position.z}}},computeBoundingSphere:function(){for(var b=0,e=0,c=this.vertices.length;e<c;e++)b=Math.max(b,this.vertices[e].position.length());this.boundingSphere={radius:b}},mergeVertices:function(){var b={},e=[],c=[],f,h=Math.pow(10,4),k,m;k=0;for(m=this.vertices.length;k<m;k++)f=this.vertices[k].position,f=[Math.round(f.x*h),Math.round(f.y*h),Math.round(f.z*h)].join("_"),b[f]===void 0?(b[f]=k,e.push(this.vertices[k]),
- c[k]=e.length-1):c[k]=c[b[f]];k=0;for(m=this.faces.length;k<m;k++){b=this.faces[k];if(b instanceof THREE.Face3)b.a=c[b.a],b.b=c[b.b],b.c=c[b.c];if(b instanceof THREE.Face4)b.a=c[b.a],b.b=c[b.b],b.c=c[b.c],b.d=c[b.d]}this.vertices=e}};THREE.GeometryCount=0;
- THREE.Spline=function(b){function e(b,c,e,f,k,h,m){b=(e-b)*0.5;f=(f-c)*0.5;return(2*(c-e)+b+f)*m+(-3*(c-e)-2*b-f)*h+b*k+c}this.points=b;var c=[],f={x:0,y:0,z:0},h,k,m,n,p,v,w,u,x;this.initFromArray=function(b){this.points=[];for(var c=0;c<b.length;c++)this.points[c]={x:b[c][0],y:b[c][1],z:b[c][2]}};this.getPoint=function(b){h=(this.points.length-1)*b;k=Math.floor(h);m=h-k;c[0]=k==0?k:k-1;c[1]=k;c[2]=k>this.points.length-2?k:k+1;c[3]=k>this.points.length-3?k:k+2;v=this.points[c[0]];w=this.points[c[1]];
- u=this.points[c[2]];x=this.points[c[3]];n=m*m;p=m*n;f.x=e(v.x,w.x,u.x,x.x,m,n,p);f.y=e(v.y,w.y,u.y,x.y,m,n,p);f.z=e(v.z,w.z,u.z,x.z,m,n,p);return f};this.getControlPointsArray=function(){var b,c,e=this.points.length,f=[];for(b=0;b<e;b++)c=this.points[b],f[b]=[c.x,c.y,c.z];return f};this.getLength=function(b){var c,e,f=c=c=0,k=new THREE.Vector3,h=new THREE.Vector3,m=[],n=0;m[0]=0;b||(b=100);e=this.points.length*b;k.copy(this.points[0]);for(b=1;b<e;b++)c=b/e,position=this.getPoint(c),h.copy(position),
- n+=h.distanceTo(k),k.copy(position),c*=this.points.length-1,c=Math.floor(c),c!=f&&(m[c]=n,f=c);m[m.length]=n;return{chunks:m,total:n}};this.reparametrizeByArcLength=function(b){var c,e,f,k,h,m,n=[],p=new THREE.Vector3,v=this.getLength();n.push(p.copy(this.points[0]).clone());for(c=1;c<this.points.length;c++){e=v.chunks[c]-v.chunks[c-1];m=Math.ceil(b*e/v.total);k=(c-1)/(this.points.length-1);h=c/(this.points.length-1);for(e=1;e<m-1;e++)f=k+e*(1/m)*(h-k),position=this.getPoint(f),n.push(p.copy(position).clone());
- n.push(p.copy(this.points[c]).clone())}this.points=n}};THREE.Edge=function(b,e,c,f){this.vertices=[b,e];this.vertexIndices=[c,f];this.faces=[];this.faceIndices=[]};THREE.Camera=function(){if(arguments.length)return console.warn("DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera()."),new THREE.PerspectiveCamera(arguments[0],arguments[1],arguments[2],arguments[3]);THREE.Object3D.call(this);this.projectionMatrix=new THREE.Matrix4;this.matrixWorldInverse=new THREE.Matrix4};
- THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.lookAt=function(b){this.matrix.lookAt(this.position,b,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};THREE.OrthographicCamera=function(b,e,c,f,h,k){THREE.Camera.call(this);this.left=b;this.right=e;this.top=c;this.bottom=f;this.near=h!==void 0?h:0.1;this.far=k!==void 0?k:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;
- THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(b,e,c,f){THREE.Camera.call(this);this.fov=b!==void 0?b:50;this.aspect=e!==void 0?e:1;this.near=c!==void 0?c:0.1;this.far=f!==void 0?f:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;
- THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;THREE.PerspectiveCamera.prototype.setLens=function(b,e){this.fov=2*Math.atan((e!==void 0?e:43.25)/(b*2));this.fov*=180/Math.PI;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype.setViewOffset=function(b,e,c,f,h,k){this.fullWidth=b;this.fullHeight=e;this.x=c;this.y=f;this.width=h;this.height=k;this.updateProjectionMatrix()};
- THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var b=this.fullWidth/this.fullHeight,e=Math.tan(this.fov*Math.PI/360)*this.near,c=-e,f=b*c,b=Math.abs(b*e-f),c=Math.abs(e-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(f+this.x*b/this.fullWidth,f+(this.x+this.width)*b/this.fullWidth,e-(this.y+this.height)*c/this.fullHeight,e-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
- this.far)};THREE.Light=function(b){THREE.Object3D.call(this);this.color=new THREE.Color(b)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(b){THREE.Light.call(this,b)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight;
- THREE.DirectionalLight=function(b,e,c){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.intensity=e!==void 0?e:1;this.distance=c!==void 0?c:0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(b,e,c){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,0,0);this.intensity=e!==void 0?e:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;
- THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(b,e,c,f){THREE.Light.call(this,b);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=e!==void 0?e:1;this.distance=c!==void 0?c:0;this.castShadow=f!==void 0?f:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
- THREE.Material=function(b){this.name="";this.id=THREE.MaterialCount++;b=b||{};this.opacity=b.opacity!==void 0?b.opacity:1;this.transparent=b.transparent!==void 0?b.transparent:!1;this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.depthTest=b.depthTest!==void 0?b.depthTest:!0;this.depthWrite=b.depthWrite!==void 0?b.depthWrite:!0;this.polygonOffset=b.polygonOffset!==void 0?b.polygonOffset:!1;this.polygonOffsetFactor=b.polygonOffsetFactor!==void 0?b.polygonOffsetFactor:0;this.polygonOffsetUnits=
- b.polygonOffsetUnits!==void 0?b.polygonOffsetUnits:0;this.alphaTest=b.alphaTest!==void 0?b.alphaTest:0};THREE.MaterialCount=0;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.AdditiveAlphaBlending=4;
- THREE.LineBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.linewidth=b.linewidth!==void 0?b.linewidth:1;this.linecap=b.linecap!==void 0?b.linecap:"round";this.linejoin=b.linejoin!==void 0?b.linejoin:"round";this.vertexColors=b.vertexColors?b.vertexColors:!1;this.fog=b.fog!==void 0?b.fog:!0};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
- THREE.MeshBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.fog=b.fog!==void 0?b.fog:
- !0;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:
- !1};THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
- THREE.MeshLambertMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.fog=b.fog!==void 0?
- b.fog:!0;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?
- b.morphTargets:!1};THREE.MeshLambertMaterial.prototype=new THREE.Material;THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial;
- THREE.MeshPhongMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.ambient=b.ambient!==void 0?new THREE.Color(b.ambient):new THREE.Color(328965);this.specular=b.specular!==void 0?new THREE.Color(b.specular):new THREE.Color(1118481);this.shininess=b.shininess!==void 0?b.shininess:30;this.map=b.map!==void 0?b.map:null;this.lightMap=b.lightMap!==void 0?b.lightMap:null;this.envMap=b.envMap!==void 0?b.envMap:null;
- this.combine=b.combine!==void 0?b.combine:THREE.MultiplyOperation;this.reflectivity=b.reflectivity!==void 0?b.reflectivity:1;this.refractionRatio=b.refractionRatio!==void 0?b.refractionRatio:0.98;this.fog=b.fog!==void 0?b.fog:!0;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.wireframeLinecap=b.wireframeLinecap!==void 0?b.wireframeLinecap:"round";this.wireframeLinejoin=
- b.wireframeLinejoin!==void 0?b.wireframeLinejoin:"round";this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.MeshPhongMaterial.prototype=new THREE.Material;THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial;
- THREE.MeshDepthMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1};THREE.MeshDepthMaterial.prototype=new THREE.Material;THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;
- THREE.MeshNormalMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.shading=b.shading?b.shading:THREE.FlatShading;this.wireframe=b.wireframe?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth?b.wireframeLinewidth:1};THREE.MeshNormalMaterial.prototype=new THREE.Material;THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshFaceMaterial=function(){};
- THREE.MeshShaderMaterial=function(b){console.warn("DEPRECATED: MeshShaderMaterial() is now ShaderMaterial().");return new THREE.ShaderMaterial(b)};
- THREE.ParticleBasicMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map!==void 0?b.map:null;this.size=b.size!==void 0?b.size:1;this.sizeAttenuation=b.sizeAttenuation!==void 0?b.sizeAttenuation:!0;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.fog=b.fog!==void 0?b.fog:!0};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
- THREE.ParticleCanvasMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.program=b.program!==void 0?b.program:function(){}};THREE.ParticleCanvasMaterial.prototype=new THREE.Material;THREE.ParticleCanvasMaterial.prototype.constructor=THREE.ParticleCanvasMaterial;THREE.ParticleDOMMaterial=function(b){THREE.Material.call(this);this.domElement=b};
- THREE.ShaderMaterial=function(b){THREE.Material.call(this,b);b=b||{};this.fragmentShader=b.fragmentShader!==void 0?b.fragmentShader:"void main() {}";this.vertexShader=b.vertexShader!==void 0?b.vertexShader:"void main() {}";this.uniforms=b.uniforms!==void 0?b.uniforms:{};this.attributes=b.attributes;this.shading=b.shading!==void 0?b.shading:THREE.SmoothShading;this.wireframe=b.wireframe!==void 0?b.wireframe:!1;this.wireframeLinewidth=b.wireframeLinewidth!==void 0?b.wireframeLinewidth:1;this.fog=b.fog!==
- void 0?b.fog:!1;this.lights=b.lights!==void 0?b.lights:!1;this.vertexColors=b.vertexColors!==void 0?b.vertexColors:!1;this.skinning=b.skinning!==void 0?b.skinning:!1;this.morphTargets=b.morphTargets!==void 0?b.morphTargets:!1};THREE.ShaderMaterial.prototype=new THREE.Material;THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;
- THREE.Texture=function(b,e,c,f,h,k){this.id=THREE.TextureCount++;this.image=b;this.mapping=e!==void 0?e:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=f!==void 0?f:THREE.ClampToEdgeWrapping;this.magFilter=h!==void 0?h:THREE.LinearFilter;this.minFilter=k!==void 0?k:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1};
- THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var b=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
- THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};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.DataTexture=function(b,e,c,f,h,k,m,n,p){THREE.Texture.call(this,null,h,k,m,n,p);this.image={data:b,width:e,height:c};this.format=f!==void 0?f:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
- THREE.DataTexture.prototype.clone=function(){var b=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);b.offset.copy(this.offset);b.repeat.copy(this.repeat);return b};THREE.Particle=function(b){THREE.Object3D.call(this);this.materials=b instanceof Array?b:[b]};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;
- THREE.ParticleSystem=function(b,e){THREE.Object3D.call(this);this.geometry=b;this.materials=e instanceof Array?e:[e];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(b,e,c){THREE.Object3D.call(this);this.geometry=b;this.materials=e instanceof Array?e:[e];this.type=c!=void 0?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;
- THREE.Line.prototype.constructor=THREE.Line;
- THREE.Mesh=function(b,e){THREE.Object3D.call(this);this.geometry=b;this.materials=e&&e.length?e:[e];this.overdraw=!1;if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=b.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var c=0;c<this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[c].name]=
- c}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(b){if(this.morphTargetDictionary[b]!==void 0)return this.morphTargetDictionary[b];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+b+" does not exist. Returning 0.");return 0};
- THREE.Bone=function(b){THREE.Object3D.call(this);this.skin=b;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(b,e,c){this.matrixAutoUpdate&&(e|=this.updateMatrix());if(e||this.matrixWorldNeedsUpdate)b?this.skinMatrix.multiply(b,this.matrix):this.skinMatrix.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0;var f,h=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(f=0;f<h;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.skinMatrix,e,c):b.update(this.matrixWorld,!0,c)}else for(f=0;f<h;f++)this.children[f].update(this.skinMatrix,
- e,c)};THREE.Bone.prototype.addChild=function(b){if(this.children.indexOf(b)===-1&&(b.parent!==void 0&&b.parent.removeChild(b),b.parent=this,this.children.push(b),!(b instanceof THREE.Bone)))this.hasNoneBoneChildren=!0};
- THREE.SkinnedMesh=function(b,e){THREE.Mesh.call(this,b,e);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,f,h,k,m,n;if(this.geometry.bones!==void 0){for(c=0;c<this.geometry.bones.length;c++)h=this.geometry.bones[c],k=h.pos,m=h.rotq,n=h.scl,f=this.addBone(),f.name=h.name,f.position.set(k[0],k[1],k[2]),f.quaternion.set(m[0],m[1],m[2],m[3]),f.useQuaternion=!0,n!==void 0?f.scale.set(n[0],n[1],n[2]):f.scale.set(1,1,1);for(c=0;c<this.bones.length;c++)h=this.geometry.bones[c],
- f=this.bones[c],h.parent===-1?this.addChild(f):this.bones[h.parent].addChild(f);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(b,e,c){if(this.visible){this.matrixAutoUpdate&&(e|=this.updateMatrix());if(e||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0;var f,h=this.children.length;for(f=0;f<h;f++)b=this.children[f],b instanceof THREE.Bone?b.update(this.identityMatrix,!1,c):b.update(this.matrixWorld,e,c);c=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(e=0;e<c;e++)ba[e].skinMatrix.flattenToArrayOffset(bm,
- e*16)}};THREE.SkinnedMesh.prototype.addBone=function(b){b===void 0&&(b=new THREE.Bone(this));this.bones.push(b);return b};
- THREE.SkinnedMesh.prototype.pose=function(){this.update(void 0,!0);for(var b,e=[],c=0;c<this.bones.length;c++)b=this.bones[c],e.push(THREE.Matrix4.makeInvert(b.skinMatrix)),b.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16);if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var f;for(b=0;b<this.geometry.skinIndices.length;b++){var c=this.geometry.vertices[b].position,h=this.geometry.skinIndices[b].x,k=this.geometry.skinIndices[b].y;f=new THREE.Vector3(c.x,
- c.y,c.z);this.geometry.skinVerticesA.push(e[h].multiplyVector3(f));f=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(e[k].multiplyVector3(f));this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y!==1&&(c=(1-(this.geometry.skinWeights[b].x+this.geometry.skinWeights[b].y))*0.5,this.geometry.skinWeights[b].x+=c,this.geometry.skinWeights[b].y+=c)}}};THREE.Ribbon=function(b,e){THREE.Object3D.call(this);this.geometry=b;this.materials=e instanceof Array?e:[e]};
- THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;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.addLevel=function(b,e){e===void 0&&(e=0);for(var e=Math.abs(e),c=0;c<this.LODs.length;c++)if(e<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:e,object3D:b});this.add(b)};
- THREE.LOD.prototype.update=function(b,e,c){this.matrixAutoUpdate&&(e|=this.updateMatrix());if(e||this.matrixWorldNeedsUpdate)b?this.matrixWorld.multiply(b,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0;if(this.LODs.length>1){b=c.matrixWorldInverse;b=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(var f=1;f<this.LODs.length;f++)if(b>=this.LODs[f].visibleAtDistance)this.LODs[f-1].object3D.visible=!1,
- this.LODs[f].object3D.visible=!0;else break;for(;f<this.LODs.length;f++)this.LODs[f].object3D.visible=!1}for(b=0;b<this.children.length;b++)this.children[b].update(this.matrixWorld,e,c)};
- THREE.Sprite=function(b){THREE.Object3D.call(this);this.color=b.color!==void 0?new THREE.Color(b.color):new THREE.Color(16777215);this.map=b.map instanceof THREE.Texture?b.map:THREE.ImageUtils.loadTexture(b.map);this.blending=b.blending!==void 0?b.blending:THREE.NormalBlending;this.useScreenCoordinates=b.useScreenCoordinates!==void 0?b.useScreenCoordinates:!0;this.mergeWith3D=b.mergeWith3D!==void 0?b.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=b.affectedByDistance!==void 0?b.affectedByDistance:
- !this.useScreenCoordinates;this.scaleByViewport=b.scaleByViewport!==void 0?b.scaleByViewport:!this.affectedByDistance;this.alignment=b.alignment instanceof THREE.Vector2?b.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.supr=THREE.Object3D.prototype;
- THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);
- THREE.SpriteAlignment.topRight=new THREE.Vector2(-1,-1);THREE.SpriteAlignment.centerLeft=new THREE.Vector2(1,0);THREE.SpriteAlignment.center=new THREE.Vector2(0,0);THREE.SpriteAlignment.centerRight=new THREE.Vector2(-1,0);THREE.SpriteAlignment.bottomLeft=new THREE.Vector2(1,1);THREE.SpriteAlignment.bottomCenter=new THREE.Vector2(0,1);THREE.SpriteAlignment.bottomRight=new THREE.Vector2(-1,1);
- THREE.Scene=function(){THREE.Object3D.call(this);this.fog=null;this.matrixAutoUpdate=!1;this.collisions=this.overrideMaterial=null;this.objects=[];this.lights=[];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.add=function(b){this.supr.add.call(this,b);this.addChildRecurse(b)};
- THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1){this.objects.push(b);this.__objectsAdded.push(b);var e=this.__objectsRemoved.indexOf(b);e!==-1&&this.__objectsRemoved.splice(e,1)}for(e=0;e<b.children.length;e++)this.addChildRecurse(b.children[e])};THREE.Scene.prototype.remove=function(b){this.supr.remove.call(this,b);this.removeChildRecurse(b)};
- THREE.Scene.prototype.removeChildRecurse=function(b){if(b instanceof THREE.Light){var e=this.lights.indexOf(b);e!==-1&&this.lights.splice(e,1)}else b instanceof THREE.Camera||(e=this.objects.indexOf(b),e!==-1&&(this.objects.splice(e,1),this.__objectsRemoved.push(b),e=this.__objectsAdded.indexOf(b),e!==-1&&this.__objectsAdded.splice(e,1)));for(e=0;e<b.children.length;e++)this.removeChildRecurse(b.children[e])};
- THREE.Scene.prototype.addChild=function(b){console.warn("DEPRECATED: Scene.addChild() is now Scene.add().");this.add(b)};THREE.Scene.prototype.addObject=function(b){console.warn("DEPRECATED: Scene.addObject() is now Scene.add().");this.add(b)};THREE.Scene.prototype.addLight=function(b){console.warn("DEPRECATED: Scene.addLight() is now Scene.add().");this.add(b)};THREE.Scene.prototype.removeChild=function(b){console.warn("DEPRECATED: Scene.removeChild() is now Scene.remove().");this.remove(b)};
- THREE.Scene.prototype.removeObject=function(b){console.warn("DEPRECATED: Scene.removeObject() is now Scene.remove().");this.remove(b)};THREE.Scene.prototype.removeLight=function(b){console.warn("DEPRECATED: Scene.removeLight() is now Scene.remove().");this.remove(b)};THREE.Fog=function(b,e,c){this.color=new THREE.Color(b);this.near=e!==void 0?e:1;this.far=c!==void 0?c:1E3};THREE.FogExp2=function(b,e){this.color=new THREE.Color(b);this.density=e!==void 0?e:2.5E-4};
- THREE.DOMRenderer=function(){THREE.Renderer.call(this);var b=null,e=new THREE.Projector,c,f,h,k;this.domElement=document.createElement("div");this.setSize=function(b,e){c=b;f=e;h=c/2;k=f/2};this.render=function(c,f){var p,v,w,u,x,t,z,y;b=e.projectScene(c,f);p=0;for(v=b.length;p<v;p++)if(x=b[p],x instanceof THREE.RenderableParticle){z=x.x*h+h;y=x.y*k+k;w=0;for(u=x.material.length;w<u;w++)if(t=x.material[w],t instanceof THREE.ParticleDOMMaterial)t=t.domElement,t.style.left=z+"px",t.style.top=y+"px"}}};
- THREE.CanvasRenderer=function(b){function e(b){if(A!=b)t.globalAlpha=A=b}function c(b){if(E!=b){switch(b){case THREE.NormalBlending:t.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:t.globalCompositeOperation="lighter";break;case THREE.SubtractiveBlending:t.globalCompositeOperation="darker"}E=b}}function f(b){if(F!=b)t.strokeStyle=F=b}function h(b){if(D!=b)t.fillStyle=D=b}var k=this,m=null,n=new THREE.Projector,b=b||{},p=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
- v,w,u,x,t=p.getContext("2d"),z=new THREE.Color(0),y=0,A=1,E=0,F=null,D=null,G=null,K=null,N=null,L,B,M,U,I=new THREE.RenderableVertex,S=new THREE.RenderableVertex,Q,Y,W,o,$,T,ha,fa,oa,ca,ja,la,da=new THREE.Color(0),X=new THREE.Color(0),V=new THREE.Color(0),aa=new THREE.Color(0),ia=new THREE.Color(0),ra=[],ma,ga,na,qa,xa,Ca,Fa,Ea,Da,Ga,ya=new THREE.Rectangle,H=new THREE.Rectangle,Z=new THREE.Rectangle,ea=!1,ka=new THREE.Color,O=new THREE.Color,ua=new THREE.Color,wa=new THREE.Color,pa=new THREE.Vector3,
- za,Ha,Aa,sa,Ia,R,b=16;za=document.createElement("canvas");za.width=za.height=2;Ha=za.getContext("2d");Ha.fillStyle="rgba(0,0,0,1)";Ha.fillRect(0,0,2,2);Aa=Ha.getImageData(0,0,2,2);sa=Aa.data;Ia=document.createElement("canvas");Ia.width=Ia.height=b;R=Ia.getContext("2d");R.translate(-b/2,-b/2);R.scale(b,b);b--;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setSize=function(b,c){v=b;w=c;u=Math.floor(v/2);x=Math.floor(w/2);p.width=v;
- p.height=w;ya.set(-u,-x,u,x);H.set(-u,-x,u,x);A=1;E=0;N=K=G=D=F=null};this.setClearColor=function(b,c){z.copy(b);y=c;H.set(-u,-x,u,x)};this.setClearColorHex=function(b,c){z.setHex(b);y=c;H.set(-u,-x,u,x)};this.clear=function(){t.setTransform(1,0,0,-1,u,x);H.isEmpty()||(H.minSelf(ya),H.inflate(2),y<1&&t.clearRect(Math.floor(H.getX()),Math.floor(H.getY()),Math.floor(H.getWidth()),Math.floor(H.getHeight())),y>0&&(c(THREE.NormalBlending),e(1),h("rgba("+Math.floor(z.r*255)+","+Math.floor(z.g*255)+","+
- Math.floor(z.b*255)+","+y+")"),t.fillRect(Math.floor(H.getX()),Math.floor(H.getY()),Math.floor(H.getWidth()),Math.floor(H.getHeight()))),H.empty())};this.render=function(b,p){function v(b){var c,e,f,k=b.lights;O.setRGB(0,0,0);ua.setRGB(0,0,0);wa.setRGB(0,0,0);b=0;for(c=k.length;b<c;b++)e=k[b],f=e.color,e instanceof THREE.AmbientLight?(O.r+=f.r,O.g+=f.g,O.b+=f.b):e instanceof THREE.DirectionalLight?(ua.r+=f.r,ua.g+=f.g,ua.b+=f.b):e instanceof THREE.PointLight&&(wa.r+=f.r,wa.g+=f.g,wa.b+=f.b)}function w(b,
- c,e,f){var k,h,m,o,n=b.lights,b=0;for(k=n.length;b<k;b++)h=n[b],m=h.color,h instanceof THREE.DirectionalLight?(o=e.dot(h.position),o<=0||(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)):h instanceof THREE.PointLight&&(o=e.dot(pa.sub(h.position,c).normalize()),o<=0||(o*=h.distance==0?1:1-Math.min(c.distanceTo(h.position)/h.distance,1),o!=0&&(o*=h.intensity,f.r+=m.r*o,f.g+=m.g*o,f.b+=m.b*o)))}function y(b,k,m){e(m.opacity);c(m.blending);var o,n,p,v,w,va;if(m instanceof THREE.ParticleBasicMaterial){if(m.map)v=
- m.map.image,w=v.width>>1,va=v.height>>1,m=k.scale.x*u,p=k.scale.y*x,o=m*w,n=p*va,Z.set(b.x-o,b.y-n,b.x+o,b.y+n),ya.intersects(Z)&&(t.save(),t.translate(b.x,b.y),t.rotate(-k.rotation),t.scale(m,-p),t.translate(-w,-va),t.drawImage(v,0,0),t.restore())}else m instanceof THREE.ParticleCanvasMaterial&&(o=k.scale.x*u,n=k.scale.y*x,Z.set(b.x-o,b.y-n,b.x+o,b.y+n),ya.intersects(Z)&&(f(m.color.getContextStyle()),h(m.color.getContextStyle()),t.save(),t.translate(b.x,b.y),t.rotate(-k.rotation),t.scale(o,n),m.program(t),
- t.restore()))}function A(b,k,h,m){e(m.opacity);c(m.blending);t.beginPath();t.moveTo(b.positionScreen.x,b.positionScreen.y);t.lineTo(k.positionScreen.x,k.positionScreen.y);t.closePath();if(m instanceof THREE.LineBasicMaterial){b=m.linewidth;if(G!=b)t.lineWidth=G=b;b=m.linecap;if(K!=b)t.lineCap=K=b;b=m.linejoin;if(N!=b)t.lineJoin=N=b;f(m.color.getContextStyle());t.stroke();Z.inflate(m.linewidth*2)}}function z(b,f,h,m,n,v,t,u,x){k.info.render.vertices+=3;k.info.render.faces++;e(u.opacity);c(u.blending);
- Q=b.positionScreen.x;Y=b.positionScreen.y;W=f.positionScreen.x;o=f.positionScreen.y;$=h.positionScreen.x;T=h.positionScreen.y;E(Q,Y,W,o,$,T);if(u instanceof THREE.MeshBasicMaterial)if(u.map)u.map.mapping instanceof THREE.UVMapping&&(qa=t.uvs[0],ab(Q,Y,W,o,$,T,qa[m].u,qa[m].v,qa[n].u,qa[n].v,qa[v].u,qa[v].v,u.map));else if(u.envMap){if(u.envMap.mapping instanceof THREE.SphericalReflectionMapping)b=p.matrixWorldInverse,pa.copy(t.vertexNormalsWorld[m]),xa=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,Ca=
- -(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,pa.copy(t.vertexNormalsWorld[n]),Fa=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,Ea=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,pa.copy(t.vertexNormalsWorld[v]),Da=(pa.x*b.n11+pa.y*b.n12+pa.z*b.n13)*0.5+0.5,Ga=-(pa.x*b.n21+pa.y*b.n22+pa.z*b.n23)*0.5+0.5,ab(Q,Y,W,o,$,T,xa,Ca,Fa,Ea,Da,Ga,u.envMap)}else u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):Oa(u.color);else if(u instanceof THREE.MeshLambertMaterial)u.map&&!u.wireframe&&
- (u.map.mapping instanceof THREE.UVMapping&&(qa=t.uvs[0],ab(Q,Y,W,o,$,T,qa[m].u,qa[m].v,qa[n].u,qa[n].v,qa[v].u,qa[v].v,u.map)),c(THREE.SubtractiveBlending)),ea?!u.wireframe&&u.shading==THREE.SmoothShading&&t.vertexNormalsWorld.length==3?(X.r=V.r=aa.r=O.r,X.g=V.g=aa.g=O.g,X.b=V.b=aa.b=O.b,w(x,t.v1.positionWorld,t.vertexNormalsWorld[0],X),w(x,t.v2.positionWorld,t.vertexNormalsWorld[1],V),w(x,t.v3.positionWorld,t.vertexNormalsWorld[2],aa),X.r=Math.max(0,Math.min(u.color.r*X.r,1)),X.g=Math.max(0,Math.min(u.color.g*
- X.g,1)),X.b=Math.max(0,Math.min(u.color.b*X.b,1)),V.r=Math.max(0,Math.min(u.color.r*V.r,1)),V.g=Math.max(0,Math.min(u.color.g*V.g,1)),V.b=Math.max(0,Math.min(u.color.b*V.b,1)),aa.r=Math.max(0,Math.min(u.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(u.color.g*aa.g,1)),aa.b=Math.max(0,Math.min(u.color.b*aa.b,1)),ia.r=(V.r+aa.r)*0.5,ia.g=(V.g+aa.g)*0.5,ia.b=(V.b+aa.b)*0.5,na=Ya(X,V,aa,ia),Va(Q,Y,W,o,$,T,0,0,1,0,0,1,na)):(ka.r=O.r,ka.g=O.g,ka.b=O.b,w(x,t.centroidWorld,t.normalWorld,ka),da.r=Math.max(0,Math.min(u.color.r*
- ka.r,1)),da.g=Math.max(0,Math.min(u.color.g*ka.g,1)),da.b=Math.max(0,Math.min(u.color.b*ka.b,1)),u.wireframe?Na(da,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):Oa(da)):u.wireframe?Na(u.color,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):Oa(u.color);else if(u instanceof THREE.MeshDepthMaterial)ma=p.near,ga=p.far,X.r=X.g=X.b=1-Ra(b.positionScreen.z,ma,ga),V.r=V.g=V.b=1-Ra(f.positionScreen.z,ma,ga),aa.r=aa.g=aa.b=1-Ra(h.positionScreen.z,ma,ga),ia.r=(V.r+aa.r)*0.5,ia.g=
- (V.g+aa.g)*0.5,ia.b=(V.b+aa.b)*0.5,na=Ya(X,V,aa,ia),Va(Q,Y,W,o,$,T,0,0,1,0,0,1,na);else if(u instanceof THREE.MeshNormalMaterial)da.r=Wa(t.normalWorld.x),da.g=Wa(t.normalWorld.y),da.b=Wa(t.normalWorld.z),u.wireframe?Na(da,u.wireframeLinewidth,u.wireframeLinecap,u.wireframeLinejoin):Oa(da)}function F(b,f,h,m,n,v,u,t,x){k.info.render.vertices+=4;k.info.render.faces++;e(t.opacity);c(t.blending);if(t.map||t.envMap)z(b,f,m,0,1,3,u,t,x),z(n,h,v,1,2,3,u,t,x);else if(Q=b.positionScreen.x,Y=b.positionScreen.y,
- W=f.positionScreen.x,o=f.positionScreen.y,$=h.positionScreen.x,T=h.positionScreen.y,ha=m.positionScreen.x,fa=m.positionScreen.y,oa=n.positionScreen.x,ca=n.positionScreen.y,ja=v.positionScreen.x,la=v.positionScreen.y,t instanceof THREE.MeshBasicMaterial)D(Q,Y,W,o,$,T,ha,fa),t.wireframe?Na(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Oa(t.color);else if(t instanceof THREE.MeshLambertMaterial)ea?!t.wireframe&&t.shading==THREE.SmoothShading&&u.vertexNormalsWorld.length==4?(X.r=
- V.r=aa.r=ia.r=O.r,X.g=V.g=aa.g=ia.g=O.g,X.b=V.b=aa.b=ia.b=O.b,w(x,u.v1.positionWorld,u.vertexNormalsWorld[0],X),w(x,u.v2.positionWorld,u.vertexNormalsWorld[1],V),w(x,u.v4.positionWorld,u.vertexNormalsWorld[3],aa),w(x,u.v3.positionWorld,u.vertexNormalsWorld[2],ia),X.r=Math.max(0,Math.min(t.color.r*X.r,1)),X.g=Math.max(0,Math.min(t.color.g*X.g,1)),X.b=Math.max(0,Math.min(t.color.b*X.b,1)),V.r=Math.max(0,Math.min(t.color.r*V.r,1)),V.g=Math.max(0,Math.min(t.color.g*V.g,1)),V.b=Math.max(0,Math.min(t.color.b*
- V.b,1)),aa.r=Math.max(0,Math.min(t.color.r*aa.r,1)),aa.g=Math.max(0,Math.min(t.color.g*aa.g,1)),aa.b=Math.max(0,Math.min(t.color.b*aa.b,1)),ia.r=Math.max(0,Math.min(t.color.r*ia.r,1)),ia.g=Math.max(0,Math.min(t.color.g*ia.g,1)),ia.b=Math.max(0,Math.min(t.color.b*ia.b,1)),na=Ya(X,V,aa,ia),E(Q,Y,W,o,ha,fa),Va(Q,Y,W,o,ha,fa,0,0,1,0,0,1,na),E(oa,ca,$,T,ja,la),Va(oa,ca,$,T,ja,la,1,0,1,1,0,1,na)):(ka.r=O.r,ka.g=O.g,ka.b=O.b,w(x,u.centroidWorld,u.normalWorld,ka),da.r=Math.max(0,Math.min(t.color.r*ka.r,1)),
- da.g=Math.max(0,Math.min(t.color.g*ka.g,1)),da.b=Math.max(0,Math.min(t.color.b*ka.b,1)),D(Q,Y,W,o,$,T,ha,fa),t.wireframe?Na(da,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Oa(da)):(D(Q,Y,W,o,$,T,ha,fa),t.wireframe?Na(t.color,t.wireframeLinewidth,t.wireframeLinecap,t.wireframeLinejoin):Oa(t.color));else if(t instanceof THREE.MeshNormalMaterial)da.r=Wa(u.normalWorld.x),da.g=Wa(u.normalWorld.y),da.b=Wa(u.normalWorld.z),D(Q,Y,W,o,$,T,ha,fa),t.wireframe?Na(da,t.wireframeLinewidth,t.wireframeLinecap,
- t.wireframeLinejoin):Oa(da);else if(t instanceof THREE.MeshDepthMaterial)ma=p.near,ga=p.far,X.r=X.g=X.b=1-Ra(b.positionScreen.z,ma,ga),V.r=V.g=V.b=1-Ra(f.positionScreen.z,ma,ga),aa.r=aa.g=aa.b=1-Ra(m.positionScreen.z,ma,ga),ia.r=ia.g=ia.b=1-Ra(h.positionScreen.z,ma,ga),na=Ya(X,V,aa,ia),E(Q,Y,W,o,ha,fa),Va(Q,Y,W,o,ha,fa,0,0,1,0,0,1,na),E(oa,ca,$,T,ja,la),Va(oa,ca,$,T,ja,la,1,0,1,1,0,1,na)}function E(b,c,e,f,k,h){t.beginPath();t.moveTo(b,c);t.lineTo(e,f);t.lineTo(k,h);t.lineTo(b,c);t.closePath()}function D(b,
- c,e,f,k,h,m,o){t.beginPath();t.moveTo(b,c);t.lineTo(e,f);t.lineTo(k,h);t.lineTo(m,o);t.lineTo(b,c);t.closePath()}function Na(b,c,e,k){if(G!=c)t.lineWidth=G=c;if(K!=e)t.lineCap=K=e;if(N!=k)t.lineJoin=N=k;f(b.getContextStyle());t.stroke();Z.inflate(c*2)}function Oa(b){h(b.getContextStyle());t.fill()}function ab(b,c,e,f,k,m,o,n,p,u,v,w,va){if(va.image.width!=0){if(va.needsUpdate==!0||ra[va.id]==void 0){var x=va.wrapS==THREE.RepeatWrapping,H=va.wrapT==THREE.RepeatWrapping;ra[va.id]=t.createPattern(va.image,
- x&&H?"repeat":x&&!H?"repeat-x":!x&&H?"repeat-y":"no-repeat");va.needsUpdate=!1}h(ra[va.id]);var x=va.offset.x/va.repeat.x,H=va.offset.y/va.repeat.y,y=(va.image.width-1)*va.repeat.x,va=(va.image.height-1)*va.repeat.y,o=(o+x)*y,n=(n+H)*va,p=(p+x)*y,u=(u+H)*va,v=(v+x)*y,w=(w+H)*va;e-=b;f-=c;k-=b;m-=c;p-=o;u-=n;v-=o;w-=n;x=1/(p*w-v*u);va=(w*e-u*k)*x;u=(w*f-u*m)*x;e=(p*k-v*e)*x;f=(p*m-v*f)*x;b=b-va*o-e*n;c=c-u*o-f*n;t.save();t.transform(va,u,e,f,b,c);t.fill();t.restore()}}function Va(b,c,e,f,k,h,m,o,n,
- p,u,v,va){var w,x;w=va.width-1;x=va.height-1;m*=w;o*=x;n*=w;p*=x;u*=w;v*=x;e-=b;f-=c;k-=b;h-=c;n-=m;p-=o;u-=m;v-=o;x=1/(n*v-u*p);w=(v*e-p*k)*x;p=(v*f-p*h)*x;e=(n*k-u*e)*x;f=(n*h-u*f)*x;b=b-w*m-e*o;c=c-p*m-f*o;t.save();t.transform(w,p,e,f,b,c);t.clip();t.drawImage(va,0,0);t.restore()}function Ya(b,c,e,f){var k=~~(b.r*255),h=~~(b.g*255),b=~~(b.b*255),m=~~(c.r*255),o=~~(c.g*255),c=~~(c.b*255),n=~~(e.r*255),p=~~(e.g*255),e=~~(e.b*255),t=~~(f.r*255),u=~~(f.g*255),f=~~(f.b*255);sa[0]=k<0?0:k>255?255:k;
- sa[1]=h<0?0:h>255?255:h;sa[2]=b<0?0:b>255?255:b;sa[4]=m<0?0:m>255?255:m;sa[5]=o<0?0:o>255?255:o;sa[6]=c<0?0:c>255?255:c;sa[8]=n<0?0:n>255?255:n;sa[9]=p<0?0:p>255?255:p;sa[10]=e<0?0:e>255?255:e;sa[12]=t<0?0:t>255?255:t;sa[13]=u<0?0:u>255?255:u;sa[14]=f<0?0:f>255?255:f;Ha.putImageData(Aa,0,0);R.drawImage(za,0,0);return Ia}function Ra(b,c,e){b=(b-c)/(e-c);return b*b*(3-2*b)}function Wa(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}function Pa(b,c){var e=c.x-b.x,f=c.y-b.y,k=e*e+f*f;k!=0&&(k=1/Math.sqrt(k),e*=k,
- f*=k,c.x+=e,c.y+=f,b.x-=e,b.y-=f)}var Za,bb,ta,Ja,Qa,Xa,$a,Ba;this.autoClear?this.clear():t.setTransform(1,0,0,-1,u,x);k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,p,this.sortElements);(ea=b.lights.length>0)&&v(b);Za=0;for(bb=m.length;Za<bb;Za++){ta=m[Za];Z.empty();if(ta instanceof THREE.RenderableParticle){L=ta;L.x*=u;L.y*=x;Ja=0;for(Qa=ta.materials.length;Ja<Qa;)Ba=ta.materials[Ja++],Ba.opacity!=0&&y(L,ta,Ba,b)}else if(ta instanceof THREE.RenderableLine){if(L=ta.v1,B=ta.v2,
- L.positionScreen.x*=u,L.positionScreen.y*=x,B.positionScreen.x*=u,B.positionScreen.y*=x,Z.addPoint(L.positionScreen.x,L.positionScreen.y),Z.addPoint(B.positionScreen.x,B.positionScreen.y),ya.intersects(Z)){Ja=0;for(Qa=ta.materials.length;Ja<Qa;)Ba=ta.materials[Ja++],Ba.opacity!=0&&A(L,B,ta,Ba,b)}}else if(ta instanceof THREE.RenderableFace3){if(L=ta.v1,B=ta.v2,M=ta.v3,L.positionScreen.x*=u,L.positionScreen.y*=x,B.positionScreen.x*=u,B.positionScreen.y*=x,M.positionScreen.x*=u,M.positionScreen.y*=x,
- ta.overdraw&&(Pa(L.positionScreen,B.positionScreen),Pa(B.positionScreen,M.positionScreen),Pa(M.positionScreen,L.positionScreen)),Z.add3Points(L.positionScreen.x,L.positionScreen.y,B.positionScreen.x,B.positionScreen.y,M.positionScreen.x,M.positionScreen.y),ya.intersects(Z)){Ja=0;for(Qa=ta.meshMaterials.length;Ja<Qa;)if(Ba=ta.meshMaterials[Ja++],Ba instanceof THREE.MeshFaceMaterial){Xa=0;for($a=ta.faceMaterials.length;Xa<$a;)(Ba=ta.faceMaterials[Xa++])&&Ba.opacity!=0&&z(L,B,M,0,1,2,ta,Ba,b)}else Ba.opacity!=
- 0&&z(L,B,M,0,1,2,ta,Ba,b)}}else if(ta instanceof THREE.RenderableFace4&&(L=ta.v1,B=ta.v2,M=ta.v3,U=ta.v4,L.positionScreen.x*=u,L.positionScreen.y*=x,B.positionScreen.x*=u,B.positionScreen.y*=x,M.positionScreen.x*=u,M.positionScreen.y*=x,U.positionScreen.x*=u,U.positionScreen.y*=x,I.positionScreen.copy(B.positionScreen),S.positionScreen.copy(U.positionScreen),ta.overdraw&&(Pa(L.positionScreen,B.positionScreen),Pa(B.positionScreen,U.positionScreen),Pa(U.positionScreen,L.positionScreen),Pa(M.positionScreen,
- I.positionScreen),Pa(M.positionScreen,S.positionScreen)),Z.addPoint(L.positionScreen.x,L.positionScreen.y),Z.addPoint(B.positionScreen.x,B.positionScreen.y),Z.addPoint(M.positionScreen.x,M.positionScreen.y),Z.addPoint(U.positionScreen.x,U.positionScreen.y),ya.intersects(Z))){Ja=0;for(Qa=ta.meshMaterials.length;Ja<Qa;)if(Ba=ta.meshMaterials[Ja++],Ba instanceof THREE.MeshFaceMaterial){Xa=0;for($a=ta.faceMaterials.length;Xa<$a;)(Ba=ta.faceMaterials[Xa++])&&Ba.opacity!=0&&F(L,B,M,U,I,S,ta,Ba,b)}else Ba.opacity!=
- 0&&F(L,B,M,U,I,S,ta,Ba,b)}H.addRectangle(Z)}t.setTransform(1,0,0,1,0,0)}};
- THREE.SVGRenderer=function(){function b(b,c,e){var f,k,h,m;f=0;for(k=b.lights.length;f<k;f++)h=b.lights[f],h instanceof THREE.DirectionalLight?(m=c.normalWorld.dot(h.position)*h.intensity,m>0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m)):h instanceof THREE.PointLight&&(U.sub(h.position,c.centroidWorld),U.normalize(),m=c.normalWorld.dot(U)*h.intensity,m>0&&(e.r+=h.color.r*m,e.g+=h.color.g*m,e.b+=h.color.b*m))}function e(c,e,m,o,n,t){k.info.render.vertices+=3;k.info.render.faces++;Q=f(Y++);
- Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+"z");n instanceof THREE.MeshBasicMaterial?G.copy(n.color):n instanceof THREE.MeshLambertMaterial?D?(K.r=N.r,K.g=N.g,K.b=N.b,b(t,o,K),G.r=Math.max(0,Math.min(n.color.r*K.r,1)),G.g=Math.max(0,Math.min(n.color.g*K.g,1)),G.b=Math.max(0,Math.min(n.color.b*K.b,1))):G.copy(n.color):n instanceof THREE.MeshDepthMaterial?(M=1-n.__2near/(n.__farPlusNear-
- o.z*n.__farMinusNear),G.setRGB(M,M,M)):n instanceof THREE.MeshNormalMaterial&&G.setRGB(h(o.normalWorld.x),h(o.normalWorld.y),h(o.normalWorld.z));n.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+n.wireframeLinewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframeLinecap+"; stroke-linejoin: "+n.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+"; fill-opacity: "+n.opacity);p.appendChild(Q)}function c(c,e,m,o,n,t,u){k.info.render.vertices+=
- 4;k.info.render.faces++;Q=f(Y++);Q.setAttribute("d","M "+c.positionScreen.x+" "+c.positionScreen.y+" L "+e.positionScreen.x+" "+e.positionScreen.y+" L "+m.positionScreen.x+","+m.positionScreen.y+" L "+o.positionScreen.x+","+o.positionScreen.y+"z");t instanceof THREE.MeshBasicMaterial?G.copy(t.color):t instanceof THREE.MeshLambertMaterial?D?(K.r=N.r,K.g=N.g,K.b=N.b,b(u,n,K),G.r=Math.max(0,Math.min(t.color.r*K.r,1)),G.g=Math.max(0,Math.min(t.color.g*K.g,1)),G.b=Math.max(0,Math.min(t.color.b*K.b,1))):
- G.copy(t.color):t instanceof THREE.MeshDepthMaterial?(M=1-t.__2near/(t.__farPlusNear-n.z*t.__farMinusNear),G.setRGB(M,M,M)):t instanceof THREE.MeshNormalMaterial&&G.setRGB(h(n.normalWorld.x),h(n.normalWorld.y),h(n.normalWorld.z));t.wireframe?Q.setAttribute("style","fill: none; stroke: "+G.getContextStyle()+"; stroke-width: "+t.wireframeLinewidth+"; stroke-opacity: "+t.opacity+"; stroke-linecap: "+t.wireframeLinecap+"; stroke-linejoin: "+t.wireframeLinejoin):Q.setAttribute("style","fill: "+G.getContextStyle()+
- "; fill-opacity: "+t.opacity);p.appendChild(Q)}function f(b){I[b]==null&&(I[b]=document.createElementNS("http://www.w3.org/2000/svg","path"),o==0&&I[b].setAttribute("shape-rendering","crispEdges"));return I[b]}function h(b){b=(b+1)*0.5;return b<0?0:b>1?1:b}var k=this,m=null,n=new THREE.Projector,p=document.createElementNS("http://www.w3.org/2000/svg","svg"),v,w,u,x,t,z,y,A,E=new THREE.Rectangle,F=new THREE.Rectangle,D=!1,G=new THREE.Color(16777215),K=new THREE.Color(16777215),N=new THREE.Color(0),
- L=new THREE.Color(0),B=new THREE.Color(0),M,U=new THREE.Vector3,I=[],S=[],Q,Y,W,o=1;this.domElement=p;this.sortElements=this.sortObjects=this.autoClear=!0;this.info={render:{vertices:0,faces:0}};this.setQuality=function(b){switch(b){case "high":o=1;break;case "low":o=0}};this.setSize=function(b,c){v=b;w=c;u=v/2;x=w/2;p.setAttribute("viewBox",-u+" "+-x+" "+v+" "+w);p.setAttribute("width",v);p.setAttribute("height",w);E.set(-u,-x,u,x)};this.clear=function(){for(;p.childNodes.length>0;)p.removeChild(p.childNodes[0])};
- this.render=function(b,f){var h,v,w,G,I,M,K,X;this.autoClear&&this.clear();k.info.render.vertices=0;k.info.render.faces=0;m=n.projectScene(b,f,this.sortElements);W=Y=0;if(D=b.lights.length>0){K=b.lights;N.setRGB(0,0,0);L.setRGB(0,0,0);B.setRGB(0,0,0);h=0;for(v=K.length;h<v;h++)w=K[h],G=w.color,w instanceof THREE.AmbientLight?(N.r+=G.r,N.g+=G.g,N.b+=G.b):w instanceof THREE.DirectionalLight?(L.r+=G.r,L.g+=G.g,L.b+=G.b):w instanceof THREE.PointLight&&(B.r+=G.r,B.g+=G.g,B.b+=G.b)}h=0;for(v=m.length;h<
- v;h++)if(K=m[h],F.empty(),K instanceof THREE.RenderableParticle){t=K;t.x*=u;t.y*=-x;w=0;for(G=K.materials.length;w<G;)w++}else if(K instanceof THREE.RenderableLine){if(t=K.v1,z=K.v2,t.positionScreen.x*=u,t.positionScreen.y*=-x,z.positionScreen.x*=u,z.positionScreen.y*=-x,F.addPoint(t.positionScreen.x,t.positionScreen.y),F.addPoint(z.positionScreen.x,z.positionScreen.y),E.intersects(F)){w=0;for(G=K.materials.length;w<G;)if((X=K.materials[w++])&&X.opacity!=0){I=t;M=z;var V=W++;S[V]==null&&(S[V]=document.createElementNS("http://www.w3.org/2000/svg",
- "line"),o==0&&S[V].setAttribute("shape-rendering","crispEdges"));Q=S[V];Q.setAttribute("x1",I.positionScreen.x);Q.setAttribute("y1",I.positionScreen.y);Q.setAttribute("x2",M.positionScreen.x);Q.setAttribute("y2",M.positionScreen.y);X instanceof THREE.LineBasicMaterial&&(Q.setAttribute("style","fill: none; stroke: "+X.color.getContextStyle()+"; stroke-width: "+X.linewidth+"; stroke-opacity: "+X.opacity+"; stroke-linecap: "+X.linecap+"; stroke-linejoin: "+X.linejoin),p.appendChild(Q))}}}else if(K instanceof
- THREE.RenderableFace3){if(t=K.v1,z=K.v2,y=K.v3,t.positionScreen.x*=u,t.positionScreen.y*=-x,z.positionScreen.x*=u,z.positionScreen.y*=-x,y.positionScreen.x*=u,y.positionScreen.y*=-x,F.addPoint(t.positionScreen.x,t.positionScreen.y),F.addPoint(z.positionScreen.x,z.positionScreen.y),F.addPoint(y.positionScreen.x,y.positionScreen.y),E.intersects(F)){w=0;for(G=K.meshMaterials.length;w<G;)if(X=K.meshMaterials[w++],X instanceof THREE.MeshFaceMaterial){I=0;for(M=K.faceMaterials.length;I<M;)(X=K.faceMaterials[I++])&&
- X.opacity!=0&&e(t,z,y,K,X,b)}else X&&X.opacity!=0&&e(t,z,y,K,X,b)}}else if(K instanceof THREE.RenderableFace4&&(t=K.v1,z=K.v2,y=K.v3,A=K.v4,t.positionScreen.x*=u,t.positionScreen.y*=-x,z.positionScreen.x*=u,z.positionScreen.y*=-x,y.positionScreen.x*=u,y.positionScreen.y*=-x,A.positionScreen.x*=u,A.positionScreen.y*=-x,F.addPoint(t.positionScreen.x,t.positionScreen.y),F.addPoint(z.positionScreen.x,z.positionScreen.y),F.addPoint(y.positionScreen.x,y.positionScreen.y),F.addPoint(A.positionScreen.x,A.positionScreen.y),
- E.intersects(F))){w=0;for(G=K.meshMaterials.length;w<G;)if(X=K.meshMaterials[w++],X instanceof THREE.MeshFaceMaterial){I=0;for(M=K.faceMaterials.length;I<M;)(X=K.faceMaterials[I++])&&X.opacity!=0&&c(t,z,y,A,K,X,b)}else X&&X.opacity!=0&&c(t,z,y,A,K,X,b)}}};
- 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_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform vec4 offsetRepeat;\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\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#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}\n#endif\n}",
- lights_phong_pars_vertex:"#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif",lights_phong_vertex:"#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 );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif",
- lights_pars_fragment:"uniform 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 ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",lights_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\n#if MAX_POINT_LIGHTS > 0\nvec3 pointDiffuse = vec3( 0.0 );\nvec3 pointSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nvec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );\nfloat pointDistance = vPointLight[ i ].w;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec3 dirDiffuse = vec3( 0.0 );\nvec3 dirSpecular = vec3( 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 + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\ndirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;\n}\n#endif\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\ntotalDiffuse += dirDiffuse;\ntotalSpecular += dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalDiffuse += pointDiffuse;\ntotalSpecular += pointSpecular;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;",
- 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",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",
- shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec4 shadowColor = vec4( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec4( vec3( ( 1.0 - shadowDarkness * shadow ) ), 1.0 );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec4( vec3( shadowDarkness ), 1.0 );\n#endif\n}\n}\ngl_FragColor = gl_FragColor * shadowColor;\n#endif",
- shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif"};
- THREE.UniformsUtils={merge:function(b){var e,c,f,h={};for(e=0;e<b.length;e++)for(c in f=this.clone(b[e]),f)h[c]=f[c];return h},clone:function(b){var e,c,f,h={};for(e in b)for(c in h[e]={},b[e])f=b[e][c],h[e][c]=f instanceof THREE.Color||f instanceof THREE.Vector2||f instanceof THREE.Vector3||f instanceof THREE.Vector4||f instanceof THREE.Matrix4||f instanceof THREE.Texture?f.clone():f instanceof Array?f.slice():f;return h}};
- THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},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},morphTargetInfluences:{type:"f",value:0}},fog:{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)}},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)}},shadowmap:{shadowMap:{type:"tv",value:6,texture:[]},shadowMatrix:{type:"m4v",value:[]},shadowBias:{type:"f",value:0.0039},shadowDarkness:{type:"f",value:0.2}}};
- THREE.ShaderLib={sprite:{vertexShader:"uniform int useScreenCoordinates;\nuniform int affectedByDistance;\nuniform vec3 screenPosition;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 alignment;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position + alignment;\nvec2 rotatedPosition;\nrotatedPosition.x = ( cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y ) * scale.x;\nrotatedPosition.y = ( sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y ) * scale.y;\nvec4 finalPosition;\nif( useScreenCoordinates != 0 ) {\nfinalPosition = vec4( screenPosition.xy + rotatedPosition, screenPosition.z, 1.0 );\n} else {\nfinalPosition = projectionMatrix * modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition * ( affectedByDistance == 1 ? 1.0 : finalPosition.z );\n}\ngl_Position = finalPosition;\n}",fragmentShader:"#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\n}"},
- depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},vertexShader:"void main() {\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",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}"},normal:{uniforms:{opacity:{type:"f",value:1}},
- vertexShader:"varying vec3 vNormal;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvNormal = normalize( normalMatrix * normal );\ngl_Position = projectionMatrix * mvPosition;\n}",fragmentShader:"uniform float opacity;\nvarying vec3 vNormal;\nvoid main() {\ngl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n}"},basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.shadowmap]),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,THREE.ShaderChunk.shadowmap_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,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),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,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphatest_fragment,
- THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap]),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,THREE.ShaderChunk.shadowmap_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,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),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,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphatest_fragment,
- "gl_FragColor = gl_FragColor * vec4( vLightWeighting, 1.0 );",THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{ambient:{type:"c",value:new THREE.Color(328965)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",
- value:30}}]),vertexShader:["varying vec3 vViewPosition;\nvarying vec3 vNormal;",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_phong_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.shadowmap_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 = -mvPosition.xyz;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = transformedNormal;",THREE.ShaderChunk.lights_phong_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform vec3 ambient;\nuniform vec3 specular;\nuniform float shininess;",
- 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,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3 ( 1.0 ), opacity );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.lights_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,
- THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_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;",
- THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,
- "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
- THREE.WebGLRenderer=function(b){function e(b,c,e){var f,k,h,m=b.vertices,n=m.length,p=b.colors,t=p.length,u=b.__vertexArray,v=b.__colorArray,w=b.__sortArray,x=b.__dirtyVertices,H=b.__dirtyColors,y=b.__webglCustomAttributes,A,z;if(y)for(A in y)y[A].offset=0;if(e.sortParticles){Ca.multiplySelf(e.matrixWorld);for(f=0;f<n;f++)k=m[f].position,Da.copy(k),Ca.multiplyVector3(Da),w[f]=[Da.z,f];w.sort(function(b,c){return c[0]-b[0]});for(f=0;f<n;f++)k=m[w[f][1]].position,h=f*3,u[h]=k.x,u[h+1]=k.y,u[h+2]=k.z;
- for(f=0;f<t;f++)h=f*3,color=p[w[f][1]],v[h]=color.r,v[h+1]=color.g,v[h+2]=color.b;if(y)for(A in y){f=y[A];p=f.value.length;for(h=0;h<p;h++){index=w[h][1];t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[index]}else{if(f.boundTo===void 0||f.boundTo==="vertices")z=f.value[index];f.size===2?(f.array[t]=z.x,f.array[t+1]=z.y):f.size===3?f.type==="c"?(f.array[t]=z.r,f.array[t+1]=z.g,f.array[t+2]=z.b):(f.array[t]=z.x,f.array[t+1]=z.y,f.array[t+2]=z.z):(f.array[t]=
- z.x,f.array[t+1]=z.y,f.array[t+2]=z.z,f.array[t+3]=z.w)}f.offset+=f.size}}}else{if(x)for(f=0;f<n;f++)k=m[f].position,h=f*3,u[h]=k.x,u[h+1]=k.y,u[h+2]=k.z;if(H)for(f=0;f<t;f++)color=p[f],h=f*3,v[h]=color.r,v[h+1]=color.g,v[h+2]=color.b;if(y)for(A in y)if(f=y[A],f.__original.needsUpdate){p=f.value.length;for(h=0;h<p;h++){t=f.offset;if(f.size===1){if(f.boundTo===void 0||f.boundTo==="vertices")f.array[t]=f.value[h]}else{if(f.boundTo===void 0||f.boundTo==="vertices")z=f.value[h];f.size===2?(f.array[t]=
- z.x,f.array[t+1]=z.y):f.size===3?f.type==="c"?(f.array[t]=z.r,f.array[t+1]=z.g,f.array[t+2]=z.b):(f.array[t]=z.x,f.array[t+1]=z.y,f.array[t+2]=z.z):(f.array[t]=z.x,f.array[t+1]=z.y,f.array[t+2]=z.z,f.array[t+3]=z.w)}f.offset+=f.size}}}if(x||e.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,u,c);if(H||e.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,b.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,v,c);if(y)for(A in y)if(f=y[A],f.__original.needsUpdate||e.sortParticles)o.bindBuffer(o.ARRAY_BUFFER,
- f.buffer),o.bufferData(o.ARRAY_BUFFER,f.array,c)}function c(b,c,e,f,k){f.program||W.initMaterial(f,c,e,k);if(f.morphTargets&&!k.__webglMorphTargetInfluences){k.__webglMorphTargetInfluences=new Float32Array(W.maxMorphTargets);for(var h=0,m=W.maxMorphTargets;h<m;h++)k.__webglMorphTargetInfluences[h]=0}var n=!1,h=f.program,m=h.uniforms,t=f.uniforms;h!=T&&(o.useProgram(h),T=h,n=!0);if(f.id!=fa)fa=f.id,n=!0;if(n){o.uniformMatrix4fv(m.projectionMatrix,!1,Fa);if(e&&f.fog)if(t.fogColor.value=e.color,e instanceof
- THREE.Fog)t.fogNear.value=e.near,t.fogFar.value=e.far;else if(e instanceof THREE.FogExp2)t.fogDensity.value=e.density;if(f instanceof THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f.lights){for(var p,u,v=0,w=0,x=0,H,y,A,z=Ga,ea=z.directional.colors,Z=z.directional.positions,E=z.point.colors,F=z.point.positions,D=z.point.distances,G=0,ka=0,e=p=A=0,n=c.length;e<n;e++)if(p=c[e],u=p.color,H=p.position,y=p.intensity,A=p.distance,p instanceof THREE.AmbientLight)v+=u.r,w+=u.g,x+=u.b;else if(p instanceof
- THREE.DirectionalLight)A=G*3,ea[A]=u.r*y,ea[A+1]=u.g*y,ea[A+2]=u.b*y,Z[A]=H.x,Z[A+1]=H.y,Z[A+2]=H.z,G+=1;else if(p instanceof THREE.SpotLight)A=G*3,ea[A]=u.r*y,ea[A+1]=u.g*y,ea[A+2]=u.b*y,u=1/H.length(),Z[A]=H.x*u,Z[A+1]=H.y*u,Z[A+2]=H.z*u,G+=1;else if(p instanceof THREE.PointLight)p=ka*3,E[p]=u.r*y,E[p+1]=u.g*y,E[p+2]=u.b*y,F[p]=H.x,F[p+1]=H.y,F[p+2]=H.z,D[ka]=A,ka+=1;e=G*3;for(n=ea.length;e<n;e++)ea[e]=0;e=ka*3;for(n=E.length;e<n;e++)E[e]=0;z.point.length=ka;z.directional.length=G;z.ambient[0]=
- v;z.ambient[1]=w;z.ambient[2]=x;c=Ga;t.enableLighting.value=c.directional.length+c.point.length;t.ambientLightColor.value=c.ambient;t.directionalLightColor.value=c.directional.colors;t.directionalLightDirection.value=c.directional.positions;t.pointLightColor.value=c.point.colors;t.pointLightPosition.value=c.point.positions;t.pointLightDistance.value=c.point.distances}if(f instanceof THREE.MeshBasicMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.MeshPhongMaterial)t.diffuse.value=
- f.color,t.opacity.value=f.opacity,(t.map.texture=f.map)&&t.offsetRepeat.value.set(f.map.offset.x,f.map.offset.y,f.map.repeat.x,f.map.repeat.y),t.lightMap.texture=f.lightMap,t.envMap.texture=f.envMap,t.reflectivity.value=f.reflectivity,t.refractionRatio.value=f.refractionRatio,t.combine.value=f.combine,t.useRefract.value=f.envMap&&f.envMap.mapping instanceof THREE.CubeRefractionMapping;if(f instanceof THREE.LineBasicMaterial)t.diffuse.value=f.color,t.opacity.value=f.opacity;else if(f instanceof THREE.ParticleBasicMaterial)t.psColor.value=
- f.color,t.opacity.value=f.opacity,t.size.value=f.size,t.scale.value=ya.height/2,t.map.texture=f.map;else if(f instanceof THREE.MeshPhongMaterial)t.ambient.value=f.ambient,t.specular.value=f.specular,t.shininess.value=f.shininess;else if(f instanceof THREE.MeshDepthMaterial)t.mNear.value=b.near,t.mFar.value=b.far,t.opacity.value=f.opacity;else if(f instanceof THREE.MeshNormalMaterial)t.opacity.value=f.opacity;if(k.receiveShadow&&!f._shadowPass&&t.shadowMatrix){for(c=0;c<pa.length;c++)t.shadowMatrix.value[c]=
- pa[c],t.shadowMap.texture[c]=W.shadowMap[c];t.shadowDarkness.value=W.shadowMapDarkness;t.shadowBias.value=W.shadowMapBias}c=f.uniformsList;t=0;for(e=c.length;t<e;t++)if(w=h.uniforms[c[t][1]])if(v=c[t][0],x=v.type,n=v.value,x=="i")o.uniform1i(w,n);else if(x=="f")o.uniform1f(w,n);else if(x=="v2")o.uniform2f(w,n.x,n.y);else if(x=="v3")o.uniform3f(w,n.x,n.y,n.z);else if(x=="v4")o.uniform4f(w,n.x,n.y,n.z,n.w);else if(x=="c")o.uniform3f(w,n.r,n.g,n.b);else if(x=="fv1")o.uniform1fv(w,n);else if(x=="fv")o.uniform3fv(w,
- n);else if(x=="v3v"){if(!v._array)v._array=new Float32Array(3*n.length);x=0;for(H=n.length;x<H;x++)z=x*3,v._array[z]=n[x].x,v._array[z+1]=n[x].y,v._array[z+2]=n[x].z;o.uniform3fv(w,v._array)}else if(x=="m4"){if(!v._array)v._array=new Float32Array(16);n.flattenToArray(v._array);o.uniformMatrix4fv(w,!1,v._array)}else if(x=="m4v"){if(!v._array)v._array=new Float32Array(16*n.length);x=0;for(H=n.length;x<H;x++)n[x].flattenToArrayOffset(v._array,x*16);o.uniformMatrix4fv(w,!1,v._array)}else if(x=="t"){if(o.uniform1i(w,
- n),w=v.texture)if(w.image instanceof Array&&w.image.length==6){if(v=w,v.image.length==6)if(v.needsUpdate){if(!v.image.__webglTextureCube)v.image.__webglTextureCube=o.createTexture();o.activeTexture(o.TEXTURE0+n);o.bindTexture(o.TEXTURE_CUBE_MAP,v.image.__webglTextureCube);for(n=0;n<6;n++)o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,v.image[n]);B(o.TEXTURE_CUBE_MAP,v,v.image[0]);v.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+n),o.bindTexture(o.TEXTURE_CUBE_MAP,v.image.__webglTextureCube)}else w instanceof
- THREE.WebGLRenderTargetCube?(v=w,o.activeTexture(o.TEXTURE0+n),o.bindTexture(o.TEXTURE_CUBE_MAP,v.__webglTexture)):M(w,n)}else if(x=="tv"){if(!v._array){v._array=[];x=0;for(H=v.texture.length;x<H;x++)v._array[x]=n+x}o.uniform1iv(w,v._array);x=0;for(H=v.texture.length;x<H;x++)(w=v.texture[x])&&M(w,v._array[x])}(f instanceof THREE.ShaderMaterial||f instanceof THREE.MeshPhongMaterial||f.envMap)&&m.cameraPosition!==null&&o.uniform3f(m.cameraPosition,b.position.x,b.position.y,b.position.z);(f instanceof
- THREE.MeshPhongMaterial||f instanceof THREE.MeshLambertMaterial||f instanceof THREE.ShaderMaterial||f.skinning)&&m.viewMatrix!==null&&o.uniformMatrix4fv(m.viewMatrix,!1,Ea);f.skinning&&(o.uniformMatrix4fv(m.cameraInverseMatrix,!1,Ea),o.uniformMatrix4fv(m.boneGlobalMatrices,!1,k.boneMatrices))}o.uniformMatrix4fv(m.modelViewMatrix,!1,k._modelViewMatrixArray);m.normalMatrix&&o.uniformMatrix3fv(m.normalMatrix,!1,k._normalMatrixArray);(f instanceof THREE.ShaderMaterial||f.envMap||f.skinning||k.receiveShadow)&&
- m.objectMatrix!==null&&o.uniformMatrix4fv(m.objectMatrix,!1,k._objectMatrixArray);return h}function f(b,e,f,k,h,m){if(k.opacity!=0){var n,f=c(b,e,f,k,m),b=f.attributes,e=!1,f=h.id*16777215+f.id*2+(k.wireframe?1:0);f!=oa&&(oa=f,e=!0);if(!k.morphTargets&&b.position>=0)e&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(b.position,3,o.FLOAT,!1,0,0));else if(m.morphTargetBase){f=k.program.attributes;m.morphTargetBase!==-1?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[m.morphTargetBase]),
- o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0)):f.position>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer),o.vertexAttribPointer(f.position,3,o.FLOAT,!1,0,0));if(m.morphTargetForcedOrder.length)for(var t=0,p=m.morphTargetForcedOrder,v=m.morphTargetInfluences;t<k.numSupportedMorphTargets&&t<p.length;)o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[p[t]]),o.vertexAttribPointer(f["morphTarget"+t],3,o.FLOAT,!1,0,0),m.__webglMorphTargetInfluences[t]=v[p[t]],t++;else{var p=[],u=-1,
- w=0,v=m.morphTargetInfluences,x,H=v.length,t=0;for(m.morphTargetBase!==-1&&(p[m.morphTargetBase]=!0);t<k.numSupportedMorphTargets;){for(x=0;x<H;x++)!p[x]&&v[x]>u&&(w=x,u=v[w]);o.bindBuffer(o.ARRAY_BUFFER,h.__webglMorphTargetsBuffers[w]);o.vertexAttribPointer(f["morphTarget"+t],3,o.FLOAT,!1,0,0);m.__webglMorphTargetInfluences[t]=u;p[w]=1;u=-1;t++}}k.program.uniforms.morphTargetInfluences!==null&&o.uniform1fv(k.program.uniforms.morphTargetInfluences,m.__webglMorphTargetInfluences)}if(e){if(h.__webglCustomAttributes)for(n in h.__webglCustomAttributes)b[n]>=
- 0&&(f=h.__webglCustomAttributes[n],o.bindBuffer(o.ARRAY_BUFFER,f.buffer),o.vertexAttribPointer(b[n],f.size,o.FLOAT,!1,0,0));b.color>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer),o.vertexAttribPointer(b.color,3,o.FLOAT,!1,0,0));b.normal>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglNormalBuffer),o.vertexAttribPointer(b.normal,3,o.FLOAT,!1,0,0));b.tangent>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglTangentBuffer),o.vertexAttribPointer(b.tangent,4,o.FLOAT,!1,0,0));b.uv>=0&&(h.__webglUVBuffer?(o.bindBuffer(o.ARRAY_BUFFER,
- h.__webglUVBuffer),o.vertexAttribPointer(b.uv,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv)):o.disableVertexAttribArray(b.uv));b.uv2>=0&&(h.__webglUV2Buffer?(o.bindBuffer(o.ARRAY_BUFFER,h.__webglUV2Buffer),o.vertexAttribPointer(b.uv2,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(b.uv2)):o.disableVertexAttribArray(b.uv2));k.skinning&&b.skinVertexA>=0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0&&(o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexABuffer),o.vertexAttribPointer(b.skinVertexA,4,
- o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinVertexBBuffer),o.vertexAttribPointer(b.skinVertexB,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinIndicesBuffer),o.vertexAttribPointer(b.skinIndex,4,o.FLOAT,!1,0,0),o.bindBuffer(o.ARRAY_BUFFER,h.__webglSkinWeightsBuffer),o.vertexAttribPointer(b.skinWeight,4,o.FLOAT,!1,0,0))}m instanceof THREE.Mesh?(k.wireframe?(o.lineWidth(k.wireframeLinewidth),e&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglLineBuffer),o.drawElements(o.LINES,h.__webglLineCount,
- o.UNSIGNED_SHORT,0)):(e&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h.__webglFaceBuffer),o.drawElements(o.TRIANGLES,h.__webglFaceCount,o.UNSIGNED_SHORT,0)),W.info.render.calls++,W.info.render.vertices+=h.__webglFaceCount,W.info.render.faces+=h.__webglFaceCount/3):m instanceof THREE.Line?(m=m.type==THREE.LineStrip?o.LINE_STRIP:o.LINES,o.lineWidth(k.linewidth),o.drawArrays(m,0,h.__webglLineCount),W.info.render.calls++):m instanceof THREE.ParticleSystem?(o.drawArrays(o.POINTS,0,h.__webglParticleCount),W.info.render.calls++):
- m instanceof THREE.Ribbon&&(o.drawArrays(o.TRIANGLE_STRIP,0,h.__webglVertexCount),W.info.render.calls++)}}function h(b,c,e){if(!b.__webglVertexBuffer)b.__webglVertexBuffer=o.createBuffer();if(!b.__webglNormalBuffer)b.__webglNormalBuffer=o.createBuffer();b.hasPos&&(o.bindBuffer(o.ARRAY_BUFFER,b.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,b.positionArray,o.DYNAMIC_DRAW),o.enableVertexAttribArray(c.attributes.position),o.vertexAttribPointer(c.attributes.position,3,o.FLOAT,!1,0,0));if(b.hasNormal){o.bindBuffer(o.ARRAY_BUFFER,
- b.__webglNormalBuffer);if(e==THREE.FlatShading){var f,k,h,m,n,t,p,v,u,w,x=b.count*3;for(w=0;w<x;w+=9)e=b.normalArray,f=e[w],k=e[w+1],h=e[w+2],m=e[w+3],t=e[w+4],v=e[w+5],n=e[w+6],p=e[w+7],u=e[w+8],f=(f+m+n)/3,k=(k+t+p)/3,h=(h+v+u)/3,e[w]=f,e[w+1]=k,e[w+2]=h,e[w+3]=f,e[w+4]=k,e[w+5]=h,e[w+6]=f,e[w+7]=k,e[w+8]=h}o.bufferData(o.ARRAY_BUFFER,b.normalArray,o.DYNAMIC_DRAW);o.enableVertexAttribArray(c.attributes.normal);o.vertexAttribPointer(c.attributes.normal,3,o.FLOAT,!1,0,0)}o.drawArrays(o.TRIANGLES,
- 0,b.count);b.count=0}function k(b){if(ja!=b.doubleSided)b.doubleSided?o.disable(o.CULL_FACE):o.enable(o.CULL_FACE),ja=b.doubleSided;if(la!=b.flipSided)b.flipSided?o.frontFace(o.CW):o.frontFace(o.CCW),la=b.flipSided}function m(b){X!=b&&(b?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),X=b)}function n(b){V!=b&&(o.depthMask(b),V=b)}function p(b,c,e){aa!=b&&(b?o.enable(o.POLYGON_OFFSET_FILL):o.disable(o.POLYGON_OFFSET_FILL),aa=b);if(b&&(ia!=c||ra!=e))o.polygonOffset(c,e),ia=c,ra=e}function v(b){xa[0].set(b.n41-
- b.n11,b.n42-b.n12,b.n43-b.n13,b.n44-b.n14);xa[1].set(b.n41+b.n11,b.n42+b.n12,b.n43+b.n13,b.n44+b.n14);xa[2].set(b.n41+b.n21,b.n42+b.n22,b.n43+b.n23,b.n44+b.n24);xa[3].set(b.n41-b.n21,b.n42-b.n22,b.n43-b.n23,b.n44-b.n24);xa[4].set(b.n41-b.n31,b.n42-b.n32,b.n43-b.n33,b.n44-b.n34);xa[5].set(b.n41+b.n31,b.n42+b.n32,b.n43+b.n33,b.n44+b.n34);for(var c,b=0;b<6;b++)c=xa[b],c.divideScalar(Math.sqrt(c.x*c.x+c.y*c.y+c.z*c.z))}function w(b){for(var c=b.matrixWorld,e=-b.geometry.boundingSphere.radius*Math.max(b.scale.x,
- Math.max(b.scale.y,b.scale.z)),f=0;f<6;f++)if(b=xa[f].x*c.n14+xa[f].y*c.n24+xa[f].z*c.n34+xa[f].w,b<=e)return!1;return!0}function u(b,c){b.list[b.count]=c;b.count+=1}function x(b){var c,e,f=b.object,k=b.opaque,h=b.transparent;h.count=0;b=k.count=0;for(c=f.materials.length;b<c;b++)e=f.materials[b],e.transparent?u(h,e):u(k,e)}function t(b){var c,e,f,k,h=b.object,m=b.buffer,n=b.opaque,o=b.transparent;o.count=0;b=n.count=0;for(f=h.materials.length;b<f;b++)if(c=h.materials[b],c instanceof THREE.MeshFaceMaterial){c=
- 0;for(e=m.materials.length;c<e;c++)(k=m.materials[c])&&(k.transparent?u(o,k):u(n,k))}else(k=c)&&(k.transparent?u(o,k):u(n,k))}function z(b,c){return c.z-b.z}function y(b){var e,n,t,p=0,u,x,H,y,A=b.lights;wa||(wa=new THREE.PerspectiveCamera(W.shadowCameraFov,W.shadowMapWidth/W.shadowMapHeight,W.shadowCameraNear,W.shadowCameraFar));e=0;for(n=A.length;e<n;e++)if(t=A[e],t instanceof THREE.SpotLight&&t.castShadow){fa=-1;W.shadowMap[p]||(W.shadowMap[p]=new THREE.WebGLRenderTarget(W.shadowMapWidth,W.shadowMapHeight,
- {minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));pa[p]||(pa[p]=new THREE.Matrix4);u=W.shadowMap[p];x=pa[p];wa.position.copy(t.position);wa.lookAt(t.target.position);wa.update(void 0,!0);b.update(void 0,!1,wa);THREE.Matrix4.makeInvert(wa.matrixWorld,wa.matrixWorldInverse);x.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);x.multiplySelf(wa.projectionMatrix);x.multiplySelf(wa.matrixWorldInverse);wa.matrixWorldInverse.flattenToArray(Ea);wa.projectionMatrix.flattenToArray(Fa);
- Ca.multiply(wa.projectionMatrix,wa.matrixWorldInverse);v(Ca);W.initWebGLObjects(b);U(u);o.clearColor(1,1,1,1);W.clear();o.clearColor(ka.r,ka.g,ka.b,O);x=b.__webglObjects.length;t=b.__webglObjectsImmediate.length;for(u=0;u<x;u++)H=b.__webglObjects[u],y=H.object,y.visible&&y.castShadow?!(y instanceof THREE.Mesh)||!y.frustumCulled||w(y)?(y.matrixWorld.flattenToArray(y._objectMatrixArray),E(y,wa,!1),H.render=!0):H.render=!1:H.render=!1;m(!0);L(THREE.NormalBlending);for(u=0;u<x;u++)if(H=b.__webglObjects[u],
- H.render)y=H.object,buffer=H.buffer,k(y),H=y.customDepthMaterial?y.customDepthMaterial:y.geometry.morphTargets.length?Aa:Ha,f(wa,A,null,H,buffer,y);for(u=0;u<t;u++)H=b.__webglObjectsImmediate[u],y=H.object,y.visible&&y.castShadow&&(y.matrixAutoUpdate&&y.matrixWorld.flattenToArray(y._objectMatrixArray),oa=-1,E(y,wa,!1),k(y),program=c(wa,A,null,Ha,y),y.immediateRenderCallback?y.immediateRenderCallback(program,o,xa):y.render(function(b){h(b,program,Ha.shading)}));p++}}function A(b,c){var e,f,k;e=R.attributes;
- var h=R.uniforms,m=qa/na,n,t=[],p=na*0.5,u=qa*0.5,v=!0;o.useProgram(R.program);T=R.program;oa=X=da=-1;Ka||(o.enableVertexAttribArray(R.attributes.position),o.enableVertexAttribArray(R.attributes.uv),Ka=!0);o.disable(o.CULL_FACE);o.enable(o.BLEND);o.depthMask(!0);o.bindBuffer(o.ARRAY_BUFFER,R.vertexBuffer);o.vertexAttribPointer(e.position,2,o.FLOAT,!1,16,0);o.vertexAttribPointer(e.uv,2,o.FLOAT,!1,16,8);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,R.elementBuffer);o.uniformMatrix4fv(h.projectionMatrix,!1,Fa);
- o.activeTexture(o.TEXTURE0);o.uniform1i(h.map,0);e=0;for(f=b.__webglSprites.length;e<f;e++)if(k=b.__webglSprites[e],k.visible&&k.opacity!=0)k.useScreenCoordinates?k.z=-k.position.z:(k._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,k.matrixWorld,k._modelViewMatrixArray),k.z=-k._modelViewMatrix.n34);b.__webglSprites.sort(z);e=0;for(f=b.__webglSprites.length;e<f;e++)k=b.__webglSprites[e],k.visible&&k.opacity!=0&&k.map&&k.map.image&&k.map.image.width&&(k.useScreenCoordinates?(o.uniform1i(h.useScreenCoordinates,
- 1),o.uniform3f(h.screenPosition,(k.position.x-p)/p,(u-k.position.y)/u,Math.max(0,Math.min(1,k.position.z)))):(o.uniform1i(h.useScreenCoordinates,0),o.uniform1i(h.affectedByDistance,k.affectedByDistance?1:0),o.uniformMatrix4fv(h.modelViewMatrix,!1,k._modelViewMatrixArray)),n=k.map.image.width/(k.scaleByViewport?qa:1),t[0]=n*m*k.scale.x,t[1]=n*k.scale.y,o.uniform2f(h.uvScale,k.uvScale.x,k.uvScale.y),o.uniform2f(h.uvOffset,k.uvOffset.x,k.uvOffset.y),o.uniform2f(h.alignment,k.alignment.x,k.alignment.y),
- o.uniform1f(h.opacity,k.opacity),o.uniform3f(h.color,k.color.r,k.color.g,k.color.b),o.uniform1f(h.rotation,k.rotation),o.uniform2fv(h.scale,t),k.mergeWith3D&&!v?(o.enable(o.DEPTH_TEST),v=!0):!k.mergeWith3D&&v&&(o.disable(o.DEPTH_TEST),v=!1),L(k.blending),M(k.map,0),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0));o.enable(o.CULL_FACE);o.enable(o.DEPTH_TEST);o.depthMask(V)}function E(b,c,e){b._modelViewMatrix.multiplyToArray(c.matrixWorldInverse,b.matrixWorld,b._modelViewMatrixArray);e&&THREE.Matrix4.makeInvert3x3(b._modelViewMatrix).transposeIntoArray(b._normalMatrixArray)}
- function F(b){var c,e,f,k;k=b.__materials;b=0;for(e=k.length;b<e;b++)if(f=k[b],f.attributes)for(c in f.attributes)if(f.attributes[c].needsUpdate)return!0;return!1}function D(b){var c,e,f,k;k=b.__materials;b=0;for(e=k.length;b<e;b++)if(f=k[b],f.attributes)for(c in f.attributes)f.attributes[c].needsUpdate=!1}function G(b,c){var e;for(e=b.length-1;e>=0;e--)b[e].object==c&&b.splice(e,1)}function K(b){function c(b){var k=[];e=0;for(f=b.length;e<f;e++)b[e]==void 0?k.push("undefined"):k.push(b[e].id);return k.join("_")}
- var e,f,k,h,m,n,o,t,p={},u=b.morphTargets!==void 0?b.morphTargets.length:0;b.geometryGroups={};k=0;for(h=b.faces.length;k<h;k++)m=b.faces[k],n=m.materials,o=c(n),p[o]==void 0&&(p[o]={hash:o,counter:0}),t=p[o].hash+"_"+p[o].counter,b.geometryGroups[t]==void 0&&(b.geometryGroups[t]={faces:[],materials:n,vertices:0,numMorphTargets:u}),m=m instanceof THREE.Face3?3:4,b.geometryGroups[t].vertices+m>65535&&(p[o].counter+=1,t=p[o].hash+"_"+p[o].counter,b.geometryGroups[t]==void 0&&(b.geometryGroups[t]={faces:[],
- materials:n,vertices:0,numMorphTargets:u})),b.geometryGroups[t].faces.push(k),b.geometryGroups[t].vertices+=m;b.geometryGroupsList=[];for(var v in b.geometryGroups)b.geometryGroups[v].id=ca++,b.geometryGroupsList.push(b.geometryGroups[v])}function N(b,c,e){b.push({buffer:c,object:e,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function L(b){if(b!=da){switch(b){case THREE.AdditiveBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE);break;case THREE.SubtractiveBlending:o.blendEquation(o.FUNC_ADD);
- o.blendFunc(o.ZERO,o.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:o.blendEquation(o.FUNC_ADD);o.blendFunc(o.ZERO,o.SRC_COLOR);break;default:o.blendEquationSeparate(o.FUNC_ADD,o.FUNC_ADD),o.blendFuncSeparate(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA,o.ONE,o.ONE_MINUS_SRC_ALPHA)}da=b}}function B(b,c,e){(e.width&e.width-1)==0&&(e.height&e.height-1)==0?(o.texParameteri(b,o.TEXTURE_WRAP_S,Y(c.wrapS)),o.texParameteri(b,o.TEXTURE_WRAP_T,Y(c.wrapT)),o.texParameteri(b,o.TEXTURE_MAG_FILTER,Y(c.magFilter)),
- o.texParameteri(b,o.TEXTURE_MIN_FILTER,Y(c.minFilter)),o.generateMipmap(b)):(o.texParameteri(b,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(b,o.TEXTURE_MAG_FILTER,Q(c.magFilter)),o.texParameteri(b,o.TEXTURE_MIN_FILTER,Q(c.minFilter)))}function M(b,c){if(b.needsUpdate){if(!b.__webglInit)b.__webglInit=!0,b.__webglTexture=o.createTexture(),W.info.memory.textures++;o.activeTexture(o.TEXTURE0+c);o.bindTexture(o.TEXTURE_2D,b.__webglTexture);b instanceof
- THREE.DataTexture?o.texImage2D(o.TEXTURE_2D,0,Y(b.format),b.image.width,b.image.height,0,Y(b.format),o.UNSIGNED_BYTE,b.image.data):o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,b.image);B(o.TEXTURE_2D,b,b.image);b.needsUpdate=!1}else o.activeTexture(o.TEXTURE0+c),o.bindTexture(o.TEXTURE_2D,b.__webglTexture)}function U(b){var c=b instanceof THREE.WebGLRenderTargetCube;if(b&&!b.__webglFramebuffer){if(b.depthBuffer===void 0)b.depthBuffer=!0;if(b.stencilBuffer===void 0)b.stencilBuffer=!0;
- b.__webglRenderbuffer=o.createRenderbuffer();b.__webglTexture=o.createTexture();if(c){o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture);B(o.TEXTURE_CUBE_MAP,b,b);b.__webglFramebuffer=[];for(var e=0;e<6;e++)b.__webglFramebuffer[e]=o.createFramebuffer(),o.texImage2D(o.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,Y(b.format),b.width,b.height,0,Y(b.format),Y(b.type),null)}else b.__webglFramebuffer=o.createFramebuffer(),o.bindTexture(o.TEXTURE_2D,b.__webglTexture),B(o.TEXTURE_2D,b,b),o.texImage2D(o.TEXTURE_2D,0,Y(b.format),
- b.width,b.height,0,Y(b.format),Y(b.type),null);o.bindRenderbuffer(o.RENDERBUFFER,b.__webglRenderbuffer);if(c)for(e=0;e<6;++e)o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer[e]),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+e,b.__webglTexture,0);else o.bindFramebuffer(o.FRAMEBUFFER,b.__webglFramebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,b.__webglTexture,0);b.depthBuffer&&!b.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,
- o.DEPTH_COMPONENT16,b.width,b.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,b.__webglRenderbuffer)):b.depthBuffer&&b.stencilBuffer?(o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,b.width,b.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,b.__webglRenderbuffer)):o.renderbufferStorage(o.RENDERBUFFER,o.RGBA4,b.width,b.height);c?o.bindTexture(o.TEXTURE_CUBE_MAP,null):o.bindTexture(o.TEXTURE_2D,null);o.bindRenderbuffer(o.RENDERBUFFER,
- null);o.bindFramebuffer(o.FRAMEBUFFER,null)}var f,k;b?(c=c?b.__webglFramebuffer[b.activeCubeFace]:b.__webglFramebuffer,e=b.width,b=b.height,k=f=0):(c=null,e=na,b=qa,f=ma,k=ga);c!=ha&&(o.bindFramebuffer(o.FRAMEBUFFER,c),o.viewport(f,k,e,b),ha=c)}function I(b){b instanceof THREE.WebGLRenderTargetCube?(o.bindTexture(o.TEXTURE_CUBE_MAP,b.__webglTexture),o.generateMipmap(o.TEXTURE_CUBE_MAP),o.bindTexture(o.TEXTURE_CUBE_MAP,null)):(o.bindTexture(o.TEXTURE_2D,b.__webglTexture),o.generateMipmap(o.TEXTURE_2D),
- o.bindTexture(o.TEXTURE_2D,null))}function S(b,c){var e;b=="fragment"?e=o.createShader(o.FRAGMENT_SHADER):b=="vertex"&&(e=o.createShader(o.VERTEX_SHADER));o.shaderSource(e,c);o.compileShader(e);if(!o.getShaderParameter(e,o.COMPILE_STATUS))return console.error(o.getShaderInfoLog(e)),console.error(c),null;return e}function Q(b){switch(b){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return o.NEAREST;default:return o.LINEAR}}function Y(b){switch(b){case THREE.RepeatWrapping:return o.REPEAT;
- case THREE.ClampToEdgeWrapping:return o.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return o.MIRRORED_REPEAT;case THREE.NearestFilter:return o.NEAREST;case THREE.NearestMipMapNearestFilter:return o.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return o.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return o.LINEAR;case THREE.LinearMipMapNearestFilter:return o.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return o.LINEAR_MIPMAP_LINEAR;case THREE.ByteType:return o.BYTE;
- case THREE.UnsignedByteType:return o.UNSIGNED_BYTE;case THREE.ShortType:return o.SHORT;case THREE.UnsignedShortType:return o.UNSIGNED_SHORT;case THREE.IntType:return o.INT;case THREE.UnsignedShortType:return o.UNSIGNED_INT;case THREE.FloatType:return o.FLOAT;case THREE.AlphaFormat:return o.ALPHA;case THREE.RGBFormat:return o.RGB;case THREE.RGBAFormat:return o.RGBA;case THREE.LuminanceFormat:return o.LUMINANCE;case THREE.LuminanceAlphaFormat:return o.LUMINANCE_ALPHA}return 0}var W=this,o,$=[],T=null,
- ha=null,fa=-1,oa=null,ca=0,ja=null,la=null,da=null,X=null,V=null,aa=null,ia=null,ra=null,ma=0,ga=0,na=0,qa=0,xa=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ca=new THREE.Matrix4,Fa=new Float32Array(16),Ea=new Float32Array(16),Da=new THREE.Vector4,Ga={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}},b=b||{},ya=b.canvas!==void 0?b.canvas:document.createElement("canvas"),
- H=b.stencil!==void 0?b.stencil:!0,Z=b.preserveDrawingBuffer!==void 0?b.preserveDrawingBuffer:!1,ea=b.antialias!==void 0?b.antialias:!1,ka=b.clearColor!==void 0?new THREE.Color(b.clearColor):new THREE.Color(0),O=b.clearAlpha!==void 0?b.clearAlpha:0,ua=b.maxLights!==void 0?b.maxLights:4;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0}};this.maxMorphTargets=8;this.domElement=ya;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=
- !0;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMap=[];this.shadowMapEnabled=!1;this.shadowMapSoft=!0;var wa,pa=[],b=THREE.ShaderLib.depthRGBA,za=THREE.UniformsUtils.clone(b.uniforms),Ha=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,uniforms:za}),Aa=new THREE.ShaderMaterial({fragmentShader:b.fragmentShader,vertexShader:b.vertexShader,
- uniforms:za,morphTargets:!0});Ha._shadowPass=!0;Aa._shadowPass=!0;try{if(!(o=ya.getContext("experimental-webgl",{antialias:ea,stencil:H,preserveDrawingBuffer:Z})))throw"Error creating WebGL context.";console.log(navigator.userAgent+" | "+o.getParameter(o.VERSION)+" | "+o.getParameter(o.VENDOR)+" | "+o.getParameter(o.RENDERER)+" | "+o.getParameter(o.SHADING_LANGUAGE_VERSION))}catch(sa){console.error(sa)}o.clearColor(0,0,0,1);o.clearDepth(1);o.clearStencil(0);o.enable(o.DEPTH_TEST);o.depthFunc(o.LEQUAL);
- o.frontFace(o.CCW);o.cullFace(o.BACK);o.enable(o.CULL_FACE);o.enable(o.BLEND);o.blendEquation(o.FUNC_ADD);o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA);o.clearColor(ka.r,ka.g,ka.b,O);this.context=o;var Ia=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0,R={};R.vertices=new Float32Array(16);R.faces=new Uint16Array(6);H=0;R.vertices[H++]=-1;R.vertices[H++]=-1;R.vertices[H++]=0;R.vertices[H++]=1;R.vertices[H++]=1;R.vertices[H++]=-1;R.vertices[H++]=1;R.vertices[H++]=1;R.vertices[H++]=1;R.vertices[H++]=
- 1;R.vertices[H++]=1;R.vertices[H++]=0;R.vertices[H++]=-1;R.vertices[H++]=1;R.vertices[H++]=0;H=R.vertices[H++]=0;R.faces[H++]=0;R.faces[H++]=1;R.faces[H++]=2;R.faces[H++]=0;R.faces[H++]=2;R.faces[H++]=3;R.vertexBuffer=o.createBuffer();R.elementBuffer=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,R.vertexBuffer);o.bufferData(o.ARRAY_BUFFER,R.vertices,o.STATIC_DRAW);o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,R.elementBuffer);o.bufferData(o.ELEMENT_ARRAY_BUFFER,R.faces,o.STATIC_DRAW);R.program=o.createProgram();
- o.attachShader(R.program,S("fragment",THREE.ShaderLib.sprite.fragmentShader));o.attachShader(R.program,S("vertex",THREE.ShaderLib.sprite.vertexShader));o.linkProgram(R.program);R.attributes={};R.uniforms={};R.attributes.position=o.getAttribLocation(R.program,"position");R.attributes.uv=o.getAttribLocation(R.program,"uv");R.uniforms.uvOffset=o.getUniformLocation(R.program,"uvOffset");R.uniforms.uvScale=o.getUniformLocation(R.program,"uvScale");R.uniforms.rotation=o.getUniformLocation(R.program,"rotation");
- R.uniforms.scale=o.getUniformLocation(R.program,"scale");R.uniforms.alignment=o.getUniformLocation(R.program,"alignment");R.uniforms.color=o.getUniformLocation(R.program,"color");R.uniforms.map=o.getUniformLocation(R.program,"map");R.uniforms.opacity=o.getUniformLocation(R.program,"opacity");R.uniforms.useScreenCoordinates=o.getUniformLocation(R.program,"useScreenCoordinates");R.uniforms.affectedByDistance=o.getUniformLocation(R.program,"affectedByDistance");R.uniforms.screenPosition=o.getUniformLocation(R.program,
- "screenPosition");R.uniforms.modelViewMatrix=o.getUniformLocation(R.program,"modelViewMatrix");R.uniforms.projectionMatrix=o.getUniformLocation(R.program,"projectionMatrix");var Ka=!1;this.setSize=function(b,c){ya.width=b;ya.height=c;this.setViewport(0,0,ya.width,ya.height)};this.setViewport=function(b,c,e,f){ma=b;ga=c;na=e;qa=f;o.viewport(ma,ga,na,qa)};this.setScissor=function(b,c,e,f){o.scissor(b,c,e,f)};this.enableScissorTest=function(b){b?o.enable(o.SCISSOR_TEST):o.disable(o.SCISSOR_TEST)};this.setClearColorHex=
- function(b,c){ka.setHex(b);O=c;o.clearColor(ka.r,ka.g,ka.b,O)};this.setClearColor=function(b,c){ka.copy(b);O=c;o.clearColor(ka.r,ka.g,ka.b,O)};this.getClearColor=function(){return ka};this.getClearAlpha=function(){return O};this.clear=function(b,c,e){var f=0;if(b==void 0||b)f|=o.COLOR_BUFFER_BIT;if(c==void 0||c)f|=o.DEPTH_BUFFER_BIT;if(e==void 0||e)f|=o.STENCIL_BUFFER_BIT;o.clear(f)};this.getContext=function(){return o};this.deallocateObject=function(b){if(b.__webglInit)if(b.__webglInit=!1,delete b._modelViewMatrix,
- delete b._normalMatrixArray,delete b._modelViewMatrixArray,delete b._objectMatrixArray,b instanceof THREE.Mesh)for(g in b.geometry.geometryGroups){var c=b.geometry.geometryGroups[g];o.deleteBuffer(c.__webglVertexBuffer);o.deleteBuffer(c.__webglNormalBuffer);o.deleteBuffer(c.__webglTangentBuffer);o.deleteBuffer(c.__webglColorBuffer);o.deleteBuffer(c.__webglUVBuffer);o.deleteBuffer(c.__webglUV2Buffer);o.deleteBuffer(c.__webglSkinVertexABuffer);o.deleteBuffer(c.__webglSkinVertexBBuffer);o.deleteBuffer(c.__webglSkinIndicesBuffer);
- o.deleteBuffer(c.__webglSkinWeightsBuffer);o.deleteBuffer(c.__webglFaceBuffer);o.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var e=0,f=c.numMorphTargets;e<f;e++)o.deleteBuffer(c.__webglMorphTargetsBuffers[e]);W.info.memory.geometries--}else if(b instanceof THREE.Ribbon)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),W.info.memory.geometries--;else if(b instanceof THREE.Line)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),
- W.info.memory.geometries--;else if(b instanceof THREE.ParticleSystem)b=b.geometry,o.deleteBuffer(b.__webglVertexBuffer),o.deleteBuffer(b.__webglColorBuffer),W.info.memory.geometries--};this.deallocateTexture=function(b){if(b.__webglInit)b.__webglInit=!1,o.deleteTexture(b.__webglTexture),W.info.memory.textures--};this.initMaterial=function(b,c,e,f){var k,h,m,n;b instanceof THREE.MeshDepthMaterial?n="depth":b instanceof THREE.MeshNormalMaterial?n="normal":b instanceof THREE.MeshBasicMaterial?n="basic":
- b instanceof THREE.MeshLambertMaterial?n="lambert":b instanceof THREE.MeshPhongMaterial?n="phong":b instanceof THREE.LineBasicMaterial?n="basic":b instanceof THREE.ParticleBasicMaterial&&(n="particle_basic");if(n){var t=THREE.ShaderLib[n];b.uniforms=THREE.UniformsUtils.clone(t.uniforms);b.vertexShader=t.vertexShader;b.fragmentShader=t.fragmentShader}var p,u,v;p=v=t=0;for(u=c.length;p<u;p++)m=c[p],m instanceof THREE.SpotLight&&v++,m instanceof THREE.DirectionalLight&&v++,m instanceof THREE.PointLight&&
- t++;t+v<=ua?p=v:(p=Math.ceil(ua*v/(t+v)),t=ua-p);m={directional:p,point:t};t=v=0;for(p=c.length;t<p;t++)u=c[t],u instanceof THREE.SpotLight&&u.castShadow&&v++;var w=50;if(f!==void 0&&f instanceof THREE.SkinnedMesh)w=f.bones.length;var x;a:{p=b.fragmentShader;u=b.vertexShader;var t=b.uniforms,c=b.attributes,e={map:!!b.map,envMap:!!b.envMap,lightMap:!!b.lightMap,vertexColors:b.vertexColors,fog:e,useFog:b.fog,sizeAttenuation:b.sizeAttenuation,skinning:b.skinning,morphTargets:b.morphTargets,maxMorphTargets:this.maxMorphTargets,
- maxDirLights:m.directional,maxPointLights:m.point,maxBones:w,shadowMapEnabled:this.shadowMapEnabled&&f.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:v,alphaTest:b.alphaTest},H,f=[];n?f.push(n):(f.push(p),f.push(u));for(H in e)f.push(H),f.push(e[H]);n=f.join();H=0;for(f=$.length;H<f;H++)if($[H].code==n){x=$[H].program;break a}H=o.createProgram();f=[Ia?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,
- "#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapSoft?"#define SHADOWMAP_SOFT":"",e.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");
- m=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.vertexColors?"#define USE_COLOR":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",
- e.shadowMapSoft?"#define SHADOWMAP_SOFT":"",e.shadowMapSoft?"#define SHADOWMAP_WIDTH "+e.shadowMapWidth.toFixed(1):"",e.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+e.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");o.attachShader(H,S("fragment",m+p));o.attachShader(H,S("vertex",f+u));o.linkProgram(H);o.getProgramParameter(H,o.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+o.getProgramParameter(H,o.VALIDATE_STATUS)+", gl error ["+
- o.getError()+"]");H.uniforms={};H.attributes={};var y,f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(y in t)f.push(y);y=f;f=0;for(t=y.length;f<t;f++)p=y[f],H.uniforms[p]=o.getUniformLocation(H,p);f=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(y=0;y<e.maxMorphTargets;y++)f.push("morphTarget"+y);for(x in c)f.push(x);
- x=f;y=0;for(c=x.length;y<c;y++)e=x[y],H.attributes[e]=o.getAttribLocation(H,e);H.id=$.length;$.push({program:H,code:n});W.info.memory.programs=$.length;x=H}b.program=x;x=b.program.attributes;x.position>=0&&o.enableVertexAttribArray(x.position);x.color>=0&&o.enableVertexAttribArray(x.color);x.normal>=0&&o.enableVertexAttribArray(x.normal);x.tangent>=0&&o.enableVertexAttribArray(x.tangent);b.skinning&&x.skinVertexA>=0&&x.skinVertexB>=0&&x.skinIndex>=0&&x.skinWeight>=0&&(o.enableVertexAttribArray(x.skinVertexA),
- o.enableVertexAttribArray(x.skinVertexB),o.enableVertexAttribArray(x.skinIndex),o.enableVertexAttribArray(x.skinWeight));if(b.attributes)for(h in b.attributes)x[h]!==void 0&&x[h]>=0&&o.enableVertexAttribArray(x[h]);if(b.morphTargets)for(h=b.numSupportedMorphTargets=0;h<this.maxMorphTargets;h++)y="morphTarget"+h,x[y]>=0&&(o.enableVertexAttribArray(x[y]),b.numSupportedMorphTargets++);b.uniformsList=[];for(k in b.uniforms)b.uniformsList.push([b.uniforms[k],k])};this.clearTarget=function(b,c,e,f){U(b);
- this.clear(c,e,f)};this.render=function(b,e,u,H){var ea,Z,F,D,G,ka,B,ma,K=b.lights,ga=b.fog;fa=-1;this.shadowMapEnabled&&y(b,e);W.info.render.calls=0;W.info.render.vertices=0;W.info.render.faces=0;if(e.matrixAutoUpdate){for(G=e;G.parent;)G=G.parent;G.update(void 0,!0)}b.update(void 0,!1,e);THREE.Matrix4.makeInvert(e.matrixWorld,e.matrixWorldInverse);e.matrixWorldInverse.flattenToArray(Ea);e.projectionMatrix.flattenToArray(Fa);Ca.multiply(e.projectionMatrix,e.matrixWorldInverse);v(Ca);this.initWebGLObjects(b);
- U(u);(this.autoClear||H)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);G=b.__webglObjects.length;for(H=0;H<G;H++)if(ea=b.__webglObjects[H],B=ea.object,B.visible)if(!(B instanceof THREE.Mesh)||!B.frustumCulled||w(B)){if(B.matrixWorld.flattenToArray(B._objectMatrixArray),E(B,e,!0),t(ea),ea.render=!0,this.sortObjects)ea.object.renderDepth?ea.z=ea.object.renderDepth:(Da.copy(B.position),Ca.multiplyVector3(Da),ea.z=Da.z)}else ea.render=!1;else ea.render=!1;this.sortObjects&&
- b.__webglObjects.sort(z);ka=b.__webglObjectsImmediate.length;for(H=0;H<ka;H++)ea=b.__webglObjectsImmediate[H],B=ea.object,B.visible&&(B.matrixAutoUpdate&&B.matrixWorld.flattenToArray(B._objectMatrixArray),E(B,e,!0),x(ea));if(b.overrideMaterial){m(b.overrideMaterial.depthTest);L(b.overrideMaterial.blending);for(H=0;H<G;H++)if(ea=b.__webglObjects[H],ea.render)B=ea.object,ma=ea.buffer,k(B),f(e,K,ga,b.overrideMaterial,ma,B);for(H=0;H<ka;H++)ea=b.__webglObjectsImmediate[H],B=ea.object,B.visible&&(oa=-1,
- k(B),Z=c(e,K,ga,b.overrideMaterial,B),B.immediateRenderCallback?B.immediateRenderCallback(Z,o,xa):B.render(function(c){h(c,Z,b.overrideMaterial.shading)}))}else{L(THREE.NormalBlending);for(H=G-1;H>=0;H--)if(ea=b.__webglObjects[H],ea.render){B=ea.object;ma=ea.buffer;F=ea.opaque;k(B);for(ea=0;ea<F.count;ea++)D=F.list[ea],m(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),f(e,K,ga,D,ma,B)}for(H=0;H<ka;H++)if(ea=b.__webglObjectsImmediate[H],B=ea.object,B.visible){oa=
- -1;F=ea.opaque;k(B);for(ea=0;ea<F.count;ea++)D=F.list[ea],m(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),Z=c(e,K,ga,D,B),B.immediateRenderCallback?B.immediateRenderCallback(Z,o,xa):B.render(function(b){h(b,Z,D.shading)})}for(H=0;H<G;H++)if(ea=b.__webglObjects[H],ea.render){B=ea.object;ma=ea.buffer;F=ea.transparent;k(B);for(ea=0;ea<F.count;ea++)D=F.list[ea],L(D.blending),m(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),
- f(e,K,ga,D,ma,B)}for(H=0;H<ka;H++)if(ea=b.__webglObjectsImmediate[H],B=ea.object,B.visible){oa=-1;F=ea.transparent;k(B);for(ea=0;ea<F.count;ea++)D=F.list[ea],L(D.blending),m(D.depthTest),n(D.depthWrite),p(D.polygonOffset,D.polygonOffsetFactor,D.polygonOffsetUnits),Z=c(e,K,ga,D,B),B.immediateRenderCallback?B.immediateRenderCallback(Z,o,xa):B.render(function(b){h(b,Z,D.shading)})}}b.__webglSprites.length&&A(b,e);u&&u.minFilter!==THREE.NearestFilter&&u.minFilter!==THREE.LinearFilter&&I(u)};this.initWebGLObjects=
- function(b){if(!b.__webglObjects)b.__webglObjects=[],b.__webglObjectsImmediate=[],b.__webglSprites=[];for(;b.__objectsAdded.length;){var c=b.__objectsAdded[0],f=b,k=void 0,h=void 0,m=void 0;if(!c.__webglInit)if(c.__webglInit=!0,c._modelViewMatrix=new THREE.Matrix4,c._normalMatrixArray=new Float32Array(9),c._modelViewMatrixArray=new Float32Array(16),c._objectMatrixArray=new Float32Array(16),c.matrixWorld.flattenToArray(c._objectMatrixArray),c instanceof THREE.Mesh)for(k in h=c.geometry,h.geometryGroups==
- void 0&&K(h),h.geometryGroups){if(m=h.geometryGroups[k],!m.__webglVertexBuffer){var n=m;n.__webglVertexBuffer=o.createBuffer();n.__webglNormalBuffer=o.createBuffer();n.__webglTangentBuffer=o.createBuffer();n.__webglColorBuffer=o.createBuffer();n.__webglUVBuffer=o.createBuffer();n.__webglUV2Buffer=o.createBuffer();n.__webglSkinVertexABuffer=o.createBuffer();n.__webglSkinVertexBBuffer=o.createBuffer();n.__webglSkinIndicesBuffer=o.createBuffer();n.__webglSkinWeightsBuffer=o.createBuffer();n.__webglFaceBuffer=
- o.createBuffer();n.__webglLineBuffer=o.createBuffer();if(n.numMorphTargets){var t=void 0,p=void 0;n.__webglMorphTargetsBuffers=[];t=0;for(p=n.numMorphTargets;t<p;t++)n.__webglMorphTargetsBuffers.push(o.createBuffer())}W.info.memory.geometries++;for(var n=c,u=void 0,v=void 0,w=void 0,x=w=void 0,H=void 0,y=void 0,A=y=t=0,z=w=v=void 0,w=p=z=v=u=void 0,x=n.geometry,H=x.faces,z=m.faces,u=0,v=z.length;u<v;u++)w=z[u],w=H[w],w instanceof THREE.Face3?(t+=3,y+=1,A+=3):w instanceof THREE.Face4&&(t+=4,y+=2,A+=
- 4);for(var u=m,v=n,ea=z=H=void 0,Z=void 0,ea=void 0,w=[],H=0,z=v.materials.length;H<z;H++)if(ea=v.materials[H],ea instanceof THREE.MeshFaceMaterial){ea=0;for(l=u.materials.length;ea<l;ea++)(Z=u.materials[ea])&&w.push(Z)}else(Z=ea)&&w.push(Z);u=w;m.__materials=u;a:{H=v=void 0;z=u.length;for(v=0;v<z;v++)if(H=u[v],H.map||H.lightMap||H instanceof THREE.ShaderMaterial){v=!0;break a}v=!1}a:{z=H=void 0;w=u.length;for(H=0;H<w;H++)if(z=u[H],!(z instanceof THREE.MeshBasicMaterial&&!z.envMap||z instanceof THREE.MeshDepthMaterial)){z=
- z&&z.shading!=void 0&&z.shading==THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading;break a}z=!1}a:{w=H=void 0;ea=u.length;for(H=0;H<ea;H++)if(w=u[H],w.vertexColors){w=w.vertexColors;break a}w=!1}m.__vertexArray=new Float32Array(t*3);if(z)m.__normalArray=new Float32Array(t*3);if(x.hasTangents)m.__tangentArray=new Float32Array(t*4);if(w)m.__colorArray=new Float32Array(t*3);if(v){if(x.faceUvs.length>0||x.faceVertexUvs.length>0)m.__uvArray=new Float32Array(t*2);if(x.faceUvs.length>1||x.faceVertexUvs.length>
- 1)m.__uv2Array=new Float32Array(t*2)}if(n.geometry.skinWeights.length&&n.geometry.skinIndices.length)m.__skinVertexAArray=new Float32Array(t*4),m.__skinVertexBArray=new Float32Array(t*4),m.__skinIndexArray=new Float32Array(t*4),m.__skinWeightArray=new Float32Array(t*4);m.__faceArray=new Uint16Array(y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0));m.__lineArray=new Uint16Array(A*2);if(m.numMorphTargets){m.__morphTargetsArrays=[];x=0;for(H=m.numMorphTargets;x<H;x++)m.__morphTargetsArrays.push(new Float32Array(t*
- 3))}m.__needsSmoothNormals=z==THREE.SmoothShading;m.__uvType=v;m.__vertexColorType=w;m.__normalType=z;m.__webglFaceCount=y*3+(n.geometry.edgeFaces?n.geometry.edgeFaces.length*6:0);m.__webglLineCount=A*2;x=0;for(H=u.length;x<H;x++)if(v=u[x],v.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes={};for(a in v.attributes){w=v.attributes[a];z={};for(p in w)z[p]=w[p];if(!z.__webglInitialized||z.createUniqueBuffers)z.__webglInitialized=!0,y=1,z.type==="v2"?y=2:z.type==="v3"?y=3:z.type===
- "v4"?y=4:z.type==="c"&&(y=3),z.size=y,z.array=new Float32Array(t*y),z.buffer=o.createBuffer(),z.buffer.belongsToAttribute=a,w.needsUpdate=!0,z.__original=w;m.__webglCustomAttributes[a]=z}}m.__inittedArrays=!0;h.__dirtyVertices=!0;h.__dirtyMorphTargets=!0;h.__dirtyElements=!0;h.__dirtyUvs=!0;h.__dirtyNormals=!0;h.__dirtyTangents=!0;h.__dirtyColors=!0}}else if(c instanceof THREE.Ribbon){if(h=c.geometry,!h.__webglVertexBuffer)m=h,m.__webglVertexBuffer=o.createBuffer(),m.__webglColorBuffer=o.createBuffer(),
- W.info.memory.geometries++,m=h,n=m.vertices.length,m.__vertexArray=new Float32Array(n*3),m.__colorArray=new Float32Array(n*3),m.__webglVertexCount=n,h.__dirtyVertices=!0,h.__dirtyColors=!0}else if(c instanceof THREE.Line){if(h=c.geometry,!h.__webglVertexBuffer)m=h,m.__webglVertexBuffer=o.createBuffer(),m.__webglColorBuffer=o.createBuffer(),W.info.memory.geometries++,m=h,n=m.vertices.length,m.__vertexArray=new Float32Array(n*3),m.__colorArray=new Float32Array(n*3),m.__webglLineCount=n,h.__dirtyVertices=
- !0,h.__dirtyColors=!0}else if(c instanceof THREE.ParticleSystem&&(h=c.geometry,!h.__webglVertexBuffer)){m=h;m.__webglVertexBuffer=o.createBuffer();m.__webglColorBuffer=o.createBuffer();W.info.geometries++;m=h;n=c;t=m.vertices.length;m.__vertexArray=new Float32Array(t*3);m.__colorArray=new Float32Array(t*3);m.__sortArray=[];m.__webglParticleCount=t;m.__materials=n.materials;A=y=p=void 0;p=0;for(y=n.materials.length;p<y;p++)if(A=n.materials[p],A.attributes){if(m.__webglCustomAttributes===void 0)m.__webglCustomAttributes=
- {};for(a in A.attributes){originalAttribute=A.attributes[a];attribute={};for(property in originalAttribute)attribute[property]=originalAttribute[property];if(!attribute.__webglInitialized||attribute.createUniqueBuffers)attribute.__webglInitialized=!0,size=1,attribute.type==="v2"?size=2:attribute.type==="v3"?size=3:attribute.type==="v4"?size=4:attribute.type==="c"&&(size=3),attribute.size=size,attribute.array=new Float32Array(t*size),attribute.buffer=o.createBuffer(),attribute.buffer.belongsToAttribute=
- a,originalAttribute.needsUpdate=!0,attribute.__original=originalAttribute;m.__webglCustomAttributes[a]=attribute}}h.__dirtyVertices=!0;h.__dirtyColors=!0}if(!c.__webglActive){if(c instanceof THREE.Mesh)for(k in h=c.geometry,h.geometryGroups)m=h.geometryGroups[k],N(f.__webglObjects,m,c);else c instanceof THREE.Ribbon||c instanceof THREE.Line||c instanceof THREE.ParticleSystem?(h=c.geometry,N(f.__webglObjects,h,c)):THREE.MarchingCubes!==void 0&&c instanceof THREE.MarchingCubes||c.immediateRenderCallback?
- f.__webglObjectsImmediate.push({object:c,opaque:{list:[],count:0},transparent:{list:[],count:0}}):c instanceof THREE.Sprite&&f.__webglSprites.push(c);c.__webglActive=!0}b.__objectsAdded.splice(0,1)}for(;b.__objectsRemoved.length;){c=b.__objectsRemoved[0];f=b;if(c instanceof THREE.Mesh||c instanceof THREE.ParticleSystem||c instanceof THREE.Ribbon||c instanceof THREE.Line)G(f.__webglObjects,c);else if(c instanceof THREE.Sprite){f=f.__webglSprites;k=c;h=void 0;for(h=f.length-1;h>=0;h--)f[h]==k&&f.splice(h,
- 1)}else(c instanceof THREE.MarchingCubes||c.immediateRenderCallback)&&G(f.__webglObjectsImmediate,c);c.__webglActive=!1;b.__objectsRemoved.splice(0,1)}c=0;for(f=b.__webglObjects.length;c<f;c++)if(h=b.__webglObjects[c].object,p=m=k=void 0,h instanceof THREE.Mesh){k=h.geometry;n=0;for(t=k.geometryGroupsList.length;n<t;n++)if(m=k.geometryGroupsList[n],p=F(m),k.__dirtyVertices||k.__dirtyMorphTargets||k.__dirtyElements||k.__dirtyUvs||k.__dirtyNormals||k.__dirtyColors||k.__dirtyTangents||p)if(p=m,y=o.DYNAMIC_DRAW,
- A=!k.dynamic,p.__inittedArrays){var E=u=x=void 0,B=void 0,ka=E=void 0,ma=void 0,L=void 0,ga=void 0,I=Z=ea=w=z=H=v=void 0,M=void 0,ua=void 0,J=B=ga=B=L=ma=void 0,C=void 0,O=C=J=ma=void 0,Q=void 0,X=O=C=J=E=E=ka=ga=B=O=C=J=Q=O=C=J=Q=O=C=J=void 0,na=0,V=0,wa=0,S=0,qa=0,U=0,R=0,Y=0,T=0,P=0,aa=0,O=J=0,O=void 0,pa=p.__vertexArray,xa=p.__uvArray,oa=p.__uv2Array,za=p.__normalArray,$=p.__tangentArray,fa=p.__colorArray,ca=p.__skinVertexAArray,ia=p.__skinVertexBArray,da=p.__skinIndexArray,ha=p.__skinWeightArray,
- la=p.__morphTargetsArrays,ja=p.__webglCustomAttributes,C=void 0,ra=p.__faceArray,Aa=p.__lineArray,Ha=p.__needsSmoothNormals,H=p.__vertexColorType,v=p.__uvType,z=p.__normalType,sa=h.geometry,Ca=sa.__dirtyVertices,Fa=sa.__dirtyElements,Ea=sa.__dirtyUvs,Da=sa.__dirtyNormals,ya=sa.__dirtyTangents,Ia=sa.__dirtyColors,Ga=sa.__dirtyMorphTargets,Ka=sa.vertices,cb=p.faces,fb=sa.faces,db=sa.faceVertexUvs[0],eb=sa.faceVertexUvs[1],Sa=sa.skinVerticesA,Ta=sa.skinVerticesB,Ua=sa.skinIndices,Ma=sa.skinWeights,La=
- sa.morphTargets;if(ja)for(X in ja)ja[X].offset=0,ja[X].offsetSrc=0;x=0;for(u=cb.length;x<u;x++)if(E=cb[x],B=fb[E],db&&(w=db[E]),eb&&(ea=eb[E]),E=B.vertexNormals,ka=B.normal,ma=B.vertexColors,L=B.color,ga=B.vertexTangents,B instanceof THREE.Face3){if(Ca)Z=Ka[B.a].position,I=Ka[B.b].position,M=Ka[B.c].position,pa[V]=Z.x,pa[V+1]=Z.y,pa[V+2]=Z.z,pa[V+3]=I.x,pa[V+4]=I.y,pa[V+5]=I.z,pa[V+6]=M.x,pa[V+7]=M.y,pa[V+8]=M.z,V+=9;if(ja)for(X in ja)if(C=ja[X],C.__original.needsUpdate)J=C.offset,O=C.offsetSrc,C.size===
- 1?(C.boundTo===void 0||C.boundTo==="vertices"?(C.array[J]=C.value[B.a],C.array[J+1]=C.value[B.b],C.array[J+2]=C.value[B.c]):C.boundTo==="faces"?(O=C.value[O],C.array[J]=O,C.array[J+1]=O,C.array[J+2]=O,C.offsetSrc++):C.boundTo==="faceVertices"&&(C.array[J]=C.value[O],C.array[J+1]=C.value[O+1],C.array[J+2]=C.value[O+2],C.offsetSrc+=3),C.offset+=3):(C.boundTo===void 0||C.boundTo==="vertices"?(Z=C.value[B.a],I=C.value[B.b],M=C.value[B.c]):C.boundTo==="faces"?(M=I=Z=O=C.value[O],C.offsetSrc++):C.boundTo===
- "faceVertices"&&(Z=C.value[O],I=C.value[O+1],M=C.value[O+2],C.offsetSrc+=3),C.size===2?(C.array[J]=Z.x,C.array[J+1]=Z.y,C.array[J+2]=I.x,C.array[J+3]=I.y,C.array[J+4]=M.x,C.array[J+5]=M.y,C.offset+=6):C.size===3?(C.type==="c"?(C.array[J]=Z.r,C.array[J+1]=Z.g,C.array[J+2]=Z.b,C.array[J+3]=I.r,C.array[J+4]=I.g,C.array[J+5]=I.b,C.array[J+6]=M.r,C.array[J+7]=M.g,C.array[J+8]=M.b):(C.array[J]=Z.x,C.array[J+1]=Z.y,C.array[J+2]=Z.z,C.array[J+3]=I.x,C.array[J+4]=I.y,C.array[J+5]=I.z,C.array[J+6]=M.x,C.array[J+
- 7]=M.y,C.array[J+8]=M.z),C.offset+=9):(C.array[J]=Z.x,C.array[J+1]=Z.y,C.array[J+2]=Z.z,C.array[J+3]=Z.w,C.array[J+4]=I.x,C.array[J+5]=I.y,C.array[J+6]=I.z,C.array[J+7]=I.w,C.array[J+8]=M.x,C.array[J+9]=M.y,C.array[J+10]=M.z,C.array[J+11]=M.w,C.offset+=12));if(Ga){J=0;for(C=La.length;J<C;J++)Z=La[J].vertices[B.a].position,I=La[J].vertices[B.b].position,M=La[J].vertices[B.c].position,O=la[J],O[aa]=Z.x,O[aa+1]=Z.y,O[aa+2]=Z.z,O[aa+3]=I.x,O[aa+4]=I.y,O[aa+5]=I.z,O[aa+6]=M.x,O[aa+7]=M.y,O[aa+8]=M.z;aa+=
- 9}if(Ma.length)J=Ma[B.a],C=Ma[B.b],O=Ma[B.c],ha[P]=J.x,ha[P+1]=J.y,ha[P+2]=J.z,ha[P+3]=J.w,ha[P+4]=C.x,ha[P+5]=C.y,ha[P+6]=C.z,ha[P+7]=C.w,ha[P+8]=O.x,ha[P+9]=O.y,ha[P+10]=O.z,ha[P+11]=O.w,J=Ua[B.a],C=Ua[B.b],O=Ua[B.c],da[P]=J.x,da[P+1]=J.y,da[P+2]=J.z,da[P+3]=J.w,da[P+4]=C.x,da[P+5]=C.y,da[P+6]=C.z,da[P+7]=C.w,da[P+8]=O.x,da[P+9]=O.y,da[P+10]=O.z,da[P+11]=O.w,J=Sa[B.a],C=Sa[B.b],O=Sa[B.c],ca[P]=J.x,ca[P+1]=J.y,ca[P+2]=J.z,ca[P+3]=1,ca[P+4]=C.x,ca[P+5]=C.y,ca[P+6]=C.z,ca[P+7]=1,ca[P+8]=O.x,ca[P+9]=
- O.y,ca[P+10]=O.z,ca[P+11]=1,J=Ta[B.a],C=Ta[B.b],O=Ta[B.c],ia[P]=J.x,ia[P+1]=J.y,ia[P+2]=J.z,ia[P+3]=1,ia[P+4]=C.x,ia[P+5]=C.y,ia[P+6]=C.z,ia[P+7]=1,ia[P+8]=O.x,ia[P+9]=O.y,ia[P+10]=O.z,ia[P+11]=1,P+=12;if(Ia&&H)ma.length==3&&H==THREE.VertexColors?(B=ma[0],J=ma[1],C=ma[2]):C=J=B=L,fa[T]=B.r,fa[T+1]=B.g,fa[T+2]=B.b,fa[T+3]=J.r,fa[T+4]=J.g,fa[T+5]=J.b,fa[T+6]=C.r,fa[T+7]=C.g,fa[T+8]=C.b,T+=9;if(ya&&sa.hasTangents)ma=ga[0],L=ga[1],B=ga[2],$[R]=ma.x,$[R+1]=ma.y,$[R+2]=ma.z,$[R+3]=ma.w,$[R+4]=L.x,$[R+5]=
- L.y,$[R+6]=L.z,$[R+7]=L.w,$[R+8]=B.x,$[R+9]=B.y,$[R+10]=B.z,$[R+11]=B.w,R+=12;if(Da&&z)if(E.length==3&&Ha)for(ga=0;ga<3;ga++)ka=E[ga],za[U]=ka.x,za[U+1]=ka.y,za[U+2]=ka.z,U+=3;else for(ga=0;ga<3;ga++)za[U]=ka.x,za[U+1]=ka.y,za[U+2]=ka.z,U+=3;if(Ea&&w!==void 0&&v)for(ga=0;ga<3;ga++)E=w[ga],xa[wa]=E.u,xa[wa+1]=E.v,wa+=2;if(Ea&&ea!==void 0&&v)for(ga=0;ga<3;ga++)E=ea[ga],oa[S]=E.u,oa[S+1]=E.v,S+=2;Fa&&(ra[qa]=na,ra[qa+1]=na+1,ra[qa+2]=na+2,qa+=3,Aa[Y]=na,Aa[Y+1]=na+1,Aa[Y+2]=na,Aa[Y+3]=na+2,Aa[Y+4]=na+
- 1,Aa[Y+5]=na+2,Y+=6,na+=3)}else if(B instanceof THREE.Face4){if(Ca)Z=Ka[B.a].position,I=Ka[B.b].position,M=Ka[B.c].position,ua=Ka[B.d].position,pa[V]=Z.x,pa[V+1]=Z.y,pa[V+2]=Z.z,pa[V+3]=I.x,pa[V+4]=I.y,pa[V+5]=I.z,pa[V+6]=M.x,pa[V+7]=M.y,pa[V+8]=M.z,pa[V+9]=ua.x,pa[V+10]=ua.y,pa[V+11]=ua.z,V+=12;if(ja)for(X in ja)if(C=ja[X],C.__original.needsUpdate)J=C.offset,O=C.offsetSrc,C.size===1?(C.boundTo===void 0||C.boundTo==="vertices"?(C.array[J]=C.value[B.a],C.array[J+1]=C.value[B.b],C.array[J+2]=C.value[B.c],
- C.array[J+3]=C.value[B.d]):C.boundTo==="faces"?(O=C.value[O],C.array[J]=O,C.array[J+1]=O,C.array[J+2]=O,C.array[J+3]=O,C.offsetSrc++):C.boundTo==="faceVertices"&&(C.array[J]=C.value[O],C.array[J+1]=C.value[O+1],C.array[J+2]=C.value[O+2],C.array[J+3]=C.value[O+3],C.offsetSrc+=4),C.offset+=4):(C.boundTo===void 0||C.boundTo==="vertices"?(Z=C.value[B.a],I=C.value[B.b],M=C.value[B.c],ua=C.value[B.d]):C.boundTo==="faces"?(ua=M=I=Z=O=C.value[O],C.offsetSrc++):C.boundTo==="faceVertices"&&(Z=C.value[O],I=
- C.value[O+1],M=C.value[O+2],ua=C.value[O+3],C.offsetSrc+=4),C.size===2?(C.array[J]=Z.x,C.array[J+1]=Z.y,C.array[J+2]=I.x,C.array[J+3]=I.y,C.array[J+4]=M.x,C.array[J+5]=M.y,C.array[J+6]=ua.x,C.array[J+7]=ua.y,C.offset+=8):C.size===3?(C.type==="c"?(C.array[J]=Z.r,C.array[J+1]=Z.g,C.array[J+2]=Z.b,C.array[J+3]=I.r,C.array[J+4]=I.g,C.array[J+5]=I.b,C.array[J+6]=M.r,C.array[J+7]=M.g,C.array[J+8]=M.b,C.array[J+9]=ua.r,C.array[J+10]=ua.g,C.array[J+11]=ua.b):(C.array[J]=Z.x,C.array[J+1]=Z.y,C.array[J+2]=
- Z.z,C.array[J+3]=I.x,C.array[J+4]=I.y,C.array[J+5]=I.z,C.array[J+6]=M.x,C.array[J+7]=M.y,C.array[J+8]=M.z,C.array[J+9]=ua.x,C.array[J+10]=ua.y,C.array[J+11]=ua.z),C.offset+=12):(C.array[J]=Z.x,C.array[J+1]=Z.y,C.array[J+2]=Z.z,C.array[J+3]=Z.w,C.array[J+4]=I.x,C.array[J+5]=I.y,C.array[J+6]=I.z,C.array[J+7]=I.w,C.array[J+8]=M.x,C.array[J+9]=M.y,C.array[J+10]=M.z,C.array[J+11]=M.w,C.array[J+12]=ua.x,C.array[J+13]=ua.y,C.array[J+14]=ua.z,C.array[J+15]=ua.w,C.offset+=16));if(Ga){J=0;for(C=La.length;J<
- C;J++)Z=La[J].vertices[B.a].position,I=La[J].vertices[B.b].position,M=La[J].vertices[B.c].position,ua=La[J].vertices[B.d].position,O=la[J],O[aa]=Z.x,O[aa+1]=Z.y,O[aa+2]=Z.z,O[aa+3]=I.x,O[aa+4]=I.y,O[aa+5]=I.z,O[aa+6]=M.x,O[aa+7]=M.y,O[aa+8]=M.z,O[aa+9]=ua.x,O[aa+10]=ua.y,O[aa+11]=ua.z;aa+=12}if(Ma.length)J=Ma[B.a],C=Ma[B.b],O=Ma[B.c],Q=Ma[B.d],ha[P]=J.x,ha[P+1]=J.y,ha[P+2]=J.z,ha[P+3]=J.w,ha[P+4]=C.x,ha[P+5]=C.y,ha[P+6]=C.z,ha[P+7]=C.w,ha[P+8]=O.x,ha[P+9]=O.y,ha[P+10]=O.z,ha[P+11]=O.w,ha[P+12]=Q.x,
- ha[P+13]=Q.y,ha[P+14]=Q.z,ha[P+15]=Q.w,J=Ua[B.a],C=Ua[B.b],O=Ua[B.c],Q=Ua[B.d],da[P]=J.x,da[P+1]=J.y,da[P+2]=J.z,da[P+3]=J.w,da[P+4]=C.x,da[P+5]=C.y,da[P+6]=C.z,da[P+7]=C.w,da[P+8]=O.x,da[P+9]=O.y,da[P+10]=O.z,da[P+11]=O.w,da[P+12]=Q.x,da[P+13]=Q.y,da[P+14]=Q.z,da[P+15]=Q.w,J=Sa[B.a],C=Sa[B.b],O=Sa[B.c],Q=Sa[B.d],ca[P]=J.x,ca[P+1]=J.y,ca[P+2]=J.z,ca[P+3]=1,ca[P+4]=C.x,ca[P+5]=C.y,ca[P+6]=C.z,ca[P+7]=1,ca[P+8]=O.x,ca[P+9]=O.y,ca[P+10]=O.z,ca[P+11]=1,ca[P+12]=Q.x,ca[P+13]=Q.y,ca[P+14]=Q.z,ca[P+15]=
- 1,J=Ta[B.a],C=Ta[B.b],O=Ta[B.c],B=Ta[B.d],ia[P]=J.x,ia[P+1]=J.y,ia[P+2]=J.z,ia[P+3]=1,ia[P+4]=C.x,ia[P+5]=C.y,ia[P+6]=C.z,ia[P+7]=1,ia[P+8]=O.x,ia[P+9]=O.y,ia[P+10]=O.z,ia[P+11]=1,ia[P+12]=B.x,ia[P+13]=B.y,ia[P+14]=B.z,ia[P+15]=1,P+=16;if(Ia&&H)ma.length==4&&H==THREE.VertexColors?(B=ma[0],J=ma[1],C=ma[2],ma=ma[3]):ma=C=J=B=L,fa[T]=B.r,fa[T+1]=B.g,fa[T+2]=B.b,fa[T+3]=J.r,fa[T+4]=J.g,fa[T+5]=J.b,fa[T+6]=C.r,fa[T+7]=C.g,fa[T+8]=C.b,fa[T+9]=ma.r,fa[T+10]=ma.g,fa[T+11]=ma.b,T+=12;if(ya&&sa.hasTangents)ma=
- ga[0],L=ga[1],B=ga[2],ga=ga[3],$[R]=ma.x,$[R+1]=ma.y,$[R+2]=ma.z,$[R+3]=ma.w,$[R+4]=L.x,$[R+5]=L.y,$[R+6]=L.z,$[R+7]=L.w,$[R+8]=B.x,$[R+9]=B.y,$[R+10]=B.z,$[R+11]=B.w,$[R+12]=ga.x,$[R+13]=ga.y,$[R+14]=ga.z,$[R+15]=ga.w,R+=16;if(Da&&z)if(E.length==4&&Ha)for(ga=0;ga<4;ga++)ka=E[ga],za[U]=ka.x,za[U+1]=ka.y,za[U+2]=ka.z,U+=3;else for(ga=0;ga<4;ga++)za[U]=ka.x,za[U+1]=ka.y,za[U+2]=ka.z,U+=3;if(Ea&&w!==void 0&&v)for(ga=0;ga<4;ga++)E=w[ga],xa[wa]=E.u,xa[wa+1]=E.v,wa+=2;if(Ea&&ea!==void 0&&v)for(ga=0;ga<
- 4;ga++)E=ea[ga],oa[S]=E.u,oa[S+1]=E.v,S+=2;Fa&&(ra[qa]=na,ra[qa+1]=na+1,ra[qa+2]=na+3,ra[qa+3]=na+1,ra[qa+4]=na+2,ra[qa+5]=na+3,qa+=6,Aa[Y]=na,Aa[Y+1]=na+1,Aa[Y+2]=na,Aa[Y+3]=na+3,Aa[Y+4]=na+1,Aa[Y+5]=na+2,Aa[Y+6]=na+2,Aa[Y+7]=na+3,Y+=8,na+=4)}Ca&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglVertexBuffer),o.bufferData(o.ARRAY_BUFFER,pa,y));if(ja)for(X in ja)C=ja[X],C.__original.needsUpdate&&(o.bindBuffer(o.ARRAY_BUFFER,C.buffer),o.bufferData(o.ARRAY_BUFFER,C.array,y));if(Ga){J=0;for(C=La.length;J<C;J++)o.bindBuffer(o.ARRAY_BUFFER,
- p.__webglMorphTargetsBuffers[J]),o.bufferData(o.ARRAY_BUFFER,la[J],y)}Ia&&T>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglColorBuffer),o.bufferData(o.ARRAY_BUFFER,fa,y));Da&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglNormalBuffer),o.bufferData(o.ARRAY_BUFFER,za,y));ya&&sa.hasTangents&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglTangentBuffer),o.bufferData(o.ARRAY_BUFFER,$,y));Ea&&wa>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUVBuffer),o.bufferData(o.ARRAY_BUFFER,xa,y));Ea&&S>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglUV2Buffer),
- o.bufferData(o.ARRAY_BUFFER,oa,y));Fa&&(o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglFaceBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,ra,y),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p.__webglLineBuffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,Aa,y));P>0&&(o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinVertexABuffer),o.bufferData(o.ARRAY_BUFFER,ca,y),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinVertexBBuffer),o.bufferData(o.ARRAY_BUFFER,ia,y),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinIndicesBuffer),o.bufferData(o.ARRAY_BUFFER,
- da,y),o.bindBuffer(o.ARRAY_BUFFER,p.__webglSkinWeightsBuffer),o.bufferData(o.ARRAY_BUFFER,ha,y));A&&(delete p.__inittedArrays,delete p.__colorArray,delete p.__normalArray,delete p.__tangentArray,delete p.__uvArray,delete p.__uv2Array,delete p.__faceArray,delete p.__vertexArray,delete p.__lineArray,delete p.__skinVertexAArray,delete p.__skinVertexBArray,delete p.__skinIndexArray,delete p.__skinWeightArray)}k.__dirtyVertices=!1;k.__dirtyMorphTargets=!1;k.__dirtyElements=!1;k.__dirtyUvs=!1;k.__dirtyNormals=
- !1;k.__dirtyTangents=!1;k.__dirtyColors=!1;D(m)}else if(h instanceof THREE.Ribbon){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=o.DYNAMIC_DRAW;n=x=A=A=void 0;u=h.vertices;t=h.colors;v=u.length;p=t.length;H=h.__vertexArray;y=h.__colorArray;z=h.__dirtyColors;if(h.__dirtyVertices){for(A=0;A<v;A++)x=u[A].position,n=A*3,H[n]=x.x,H[n+1]=x.y,H[n+2]=x.z;o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer);o.bufferData(o.ARRAY_BUFFER,H,m)}if(z){for(A=0;A<p;A++)color=t[A],n=A*3,y[n]=color.r,y[n+
- 1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,y,m)}}k.__dirtyVertices=!1;k.__dirtyColors=!1}else if(h instanceof THREE.Line){k=h.geometry;if(k.__dirtyVertices||k.__dirtyColors){h=k;m=o.DYNAMIC_DRAW;n=x=A=A=void 0;u=h.vertices;t=h.colors;v=u.length;p=t.length;H=h.__vertexArray;y=h.__colorArray;z=h.__dirtyColors;if(h.__dirtyVertices){for(A=0;A<v;A++)x=u[A].position,n=A*3,H[n]=x.x,H[n+1]=x.y,H[n+2]=x.z;o.bindBuffer(o.ARRAY_BUFFER,h.__webglVertexBuffer);
- o.bufferData(o.ARRAY_BUFFER,H,m)}if(z){for(A=0;A<p;A++)color=t[A],n=A*3,y[n]=color.r,y[n+1]=color.g,y[n+2]=color.b;o.bindBuffer(o.ARRAY_BUFFER,h.__webglColorBuffer);o.bufferData(o.ARRAY_BUFFER,y,m)}}k.__dirtyVertices=!1;k.__dirtyColors=!1}else if(h instanceof THREE.ParticleSystem)k=h.geometry,p=F(k),(k.__dirtyVertices||k.__dirtyColors||h.sortParticles||p)&&e(k,o.DYNAMIC_DRAW,h),k.__dirtyVertices=!1,k.__dirtyColors=!1,D(k)};this.setFaceCulling=function(b,c){b?(!c||c=="ccw"?o.frontFace(o.CCW):o.frontFace(o.CW),
- b=="back"?o.cullFace(o.BACK):b=="front"?o.cullFace(o.FRONT):o.cullFace(o.FRONT_AND_BACK),o.enable(o.CULL_FACE)):o.disable(o.CULL_FACE)};this.supportsVertexTextures=function(){return Ia}};
- THREE.WebGLRenderTarget=function(b,e,c){this.width=b;this.height=e;c=c||{};this.wrapS=c.wrapS!==void 0?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=c.wrapT!==void 0?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=c.magFilter!==void 0?c.magFilter:THREE.LinearFilter;this.minFilter=c.minFilter!==void 0?c.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=c.format!==void 0?c.format:THREE.RGBAFormat;this.type=c.type!==void 0?c.type:
- THREE.UnsignedByteType;this.depthBuffer=c.depthBuffer!==void 0?c.depthBuffer:!0;this.stencilBuffer=c.stencilBuffer!==void 0?c.stencilBuffer:!0};
- THREE.WebGLRenderTarget.prototype.clone=function(){var b=new THREE.WebGLRenderTarget(this.width,this.height);b.wrapS=this.wrapS;b.wrapT=this.wrapT;b.magFilter=this.magFilter;b.minFilter=this.minFilter;b.offset.copy(this.offset);b.repeat.copy(this.repeat);b.format=this.format;b.type=this.type;b.depthBuffer=this.depthBuffer;b.stencilBuffer=this.stencilBuffer;return b};THREE.WebGLRenderTargetCube=function(b,e,c){THREE.WebGLRenderTarget.call(this,b,e,c);this.activeCubeFace=0};
- THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=!0};THREE.RenderableVertex.prototype.copy=function(b){this.positionWorld.copy(b.positionWorld);this.positionScreen.copy(b.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};
- THREE.ColorUtils={adjustHSV:function(b,e,c,f){var h=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(b,h);h.h=THREE.ColorUtils.clamp(h.h+e,0,1);h.s=THREE.ColorUtils.clamp(h.s+c,0,1);h.v=THREE.ColorUtils.clamp(h.v+f,0,1);b.setHSV(h.h,h.s,h.v)},rgbToHsv:function(b,e){var c=b.r,f=b.g,h=b.b,k=Math.max(Math.max(c,f),h),m=Math.min(Math.min(c,f),h);if(m==k)m=c=0;else{var n=k-m,m=n/k,c=c==k?(f-h)/n:f==k?2+(h-c)/n:4+(c-f)/n;c/=6;c<0&&(c+=1);c>1&&(c-=1)}e===void 0&&(e={h:0,s:0,v:0});e.h=c;e.s=m;e.v=k;return e},
- clamp:function(b,e,c){return b<e?e:b>c?c:b}};THREE.ColorUtils.__hsv={h:0,s:0,v:0};
- THREE.GeometryUtils={merge:function(b,e){var c,f,h=b.vertices.length,k=e instanceof THREE.Mesh?e.geometry:e,m=b.vertices,n=k.vertices,p=b.faces,v=k.faces,w=b.faceVertexUvs[0],k=k.faceVertexUvs[0];if(e instanceof THREE.Mesh)e.matrixAutoUpdate&&e.updateMatrix(),c=e.matrix,f=new THREE.Matrix4,f.extractRotation(c,e.scale);for(var u=0,x=n.length;u<x;u++){var t=new THREE.Vertex(n[u].position.clone());c&&c.multiplyVector3(t.position);m.push(t)}u=0;for(x=v.length;u<x;u++){var t=v[u],z,y,A=t.vertexNormals,
- E=t.vertexColors;t instanceof THREE.Face3?z=new THREE.Face3(t.a+h,t.b+h,t.c+h):t instanceof THREE.Face4&&(z=new THREE.Face4(t.a+h,t.b+h,t.c+h,t.d+h));z.normal.copy(t.normal);f&&f.multiplyVector3(z.normal);m=0;for(n=A.length;m<n;m++)y=A[m].clone(),f&&f.multiplyVector3(y),z.vertexNormals.push(y);z.color.copy(t.color);m=0;for(n=E.length;m<n;m++)y=E[m],z.vertexColors.push(y.clone());z.materials=t.materials.slice();z.centroid.copy(t.centroid);c&&c.multiplyVector3(z.centroid);p.push(z)}u=0;for(x=k.length;u<
- x;u++){c=k[u];f=[];m=0;for(n=c.length;m<n;m++)f.push(new THREE.UV(c[m].u,c[m].v));w.push(f)}},clone:function(b){var e=new THREE.Geometry,c,f=b.vertices,h=b.faces,k=b.faceVertexUvs[0],b=0;for(c=f.length;b<c;b++){var m=new THREE.Vertex(f[b].position.clone());e.vertices.push(m)}b=0;for(c=h.length;b<c;b++){var n=h[b],p,v,w=n.vertexNormals,u=n.vertexColors;n instanceof THREE.Face3?p=new THREE.Face3(n.a,n.b,n.c):n instanceof THREE.Face4&&(p=new THREE.Face4(n.a,n.b,n.c,n.d));p.normal.copy(n.normal);f=0;
- for(m=w.length;f<m;f++)v=w[f],p.vertexNormals.push(v.clone());p.color.copy(n.color);f=0;for(m=u.length;f<m;f++)v=u[f],p.vertexColors.push(v.clone());p.materials=n.materials.slice();p.centroid.copy(n.centroid);e.faces.push(p)}b=0;for(c=k.length;b<c;b++){h=k[b];p=[];f=0;for(m=h.length;f<m;f++)p.push(new THREE.UV(h[f].u,h[f].v));e.faceVertexUvs[0].push(p)}return e},randomPointInTriangle:function(b,e,c){var f,h,k,m=new THREE.Vector3,n=THREE.GeometryUtils.__v1;f=THREE.GeometryUtils.random();h=THREE.GeometryUtils.random();
- f+h>1&&(f=1-f,h=1-h);k=1-f-h;m.copy(b);m.multiplyScalar(f);n.copy(e);n.multiplyScalar(h);m.addSelf(n);n.copy(c);n.multiplyScalar(k);m.addSelf(n);return m},randomPointInFace:function(b,e,c){var f,h,k;if(b instanceof THREE.Face3)return f=e.vertices[b.a].position,h=e.vertices[b.b].position,k=e.vertices[b.c].position,THREE.GeometryUtils.randomPointInTriangle(f,h,k);else if(b instanceof THREE.Face4){f=e.vertices[b.a].position;h=e.vertices[b.b].position;k=e.vertices[b.c].position;var e=e.vertices[b.d].position,
- m;c?b._area1&&b._area2?(c=b._area1,m=b._area2):(c=THREE.GeometryUtils.triangleArea(f,h,e),m=THREE.GeometryUtils.triangleArea(h,k,e),b._area1=c,b._area2=m):(c=THREE.GeometryUtils.triangleArea(f,h,e),m=THREE.GeometryUtils.triangleArea(h,k,e));return THREE.GeometryUtils.random()*(c+m)<c?THREE.GeometryUtils.randomPointInTriangle(f,h,e):THREE.GeometryUtils.randomPointInTriangle(h,k,e)}},randomPointsInGeometry:function(b,e){function c(b){function c(e,f){if(f<e)return e;var k=e+Math.floor((f-e)/2);return v[k]>
- b?c(e,k-1):v[k]<b?c(k+1,f):k}return c(0,v.length-1)}var f,h,k=b.faces,m=b.vertices,n=k.length,p=0,v=[],w,u,x,t;for(h=0;h<n;h++){f=k[h];if(f instanceof THREE.Face3)w=m[f.a].position,u=m[f.b].position,x=m[f.c].position,f._area=THREE.GeometryUtils.triangleArea(w,u,x);else if(f instanceof THREE.Face4)w=m[f.a].position,u=m[f.b].position,x=m[f.c].position,t=m[f.d].position,f._area1=THREE.GeometryUtils.triangleArea(w,u,t),f._area2=THREE.GeometryUtils.triangleArea(u,x,t),f._area=f._area1+f._area2;p+=f._area;
- v[h]=p}f=[];m={};for(h=0;h<e;h++)n=THREE.GeometryUtils.random()*p,n=c(n),f[h]=THREE.GeometryUtils.randomPointInFace(k[n],b,!0),m[n]?m[n]+=1:m[n]=1;return f},triangleArea:function(b,e,c){var f,h=THREE.GeometryUtils.__v1;h.sub(b,e);f=h.length();h.sub(b,c);b=h.length();h.sub(e,c);c=h.length();e=0.5*(f+b+c);return Math.sqrt(e*(e-f)*(e-b)*(e-c))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},center:function(b){b.computeBoundingBox();var e=new THREE.Matrix4;e.setTranslation(-0.5*
- (b.boundingBox.x[1]+b.boundingBox.x[0]),-0.5*(b.boundingBox.y[1]+b.boundingBox.y[0]),-0.5*(b.boundingBox.z[1]+b.boundingBox.z[0]));b.applyMatrix(e);b.computeBoundingBox()}};THREE.GeometryUtils.random=THREE.GeometryUtils.random16;THREE.GeometryUtils.__v1=new THREE.Vector3;
- THREE.ImageUtils={loadTexture:function(b,e,c){var f=new Image,h=new THREE.Texture(f,e);f.onload=function(){h.needsUpdate=!0;c&&c(this)};f.crossOrigin="";f.src=b;return h},loadTextureCube:function(b,e,c){var f,h=[],k=new THREE.Texture(h,e),e=h.loadCount=0;for(f=b.length;e<f;++e)h[e]=new Image,h[e].onload=function(){h.loadCount+=1;if(h.loadCount==6)k.needsUpdate=!0;c&&c(this)},h[e].crossOrigin="",h[e].src=b[e];return k},getNormalMap:function(b,e){var c=function(b){var c=Math.sqrt(b[0]*b[0]+b[1]*b[1]+
- b[2]*b[2]);return[b[0]/c,b[1]/c,b[2]/c]};e|=1;var f=b.width,h=b.height,k=document.createElement("canvas");k.width=f;k.height=h;var m=k.getContext("2d");m.drawImage(b,0,0);for(var n=m.getImageData(0,0,f,h).data,p=m.createImageData(f,h),v=p.data,w=0;w<f;w++)for(var u=1;u<h;u++){var x=u-1<0?h-1:u-1,t=(u+1)%h,z=w-1<0?f-1:w-1,y=(w+1)%f,A=[],E=[0,0,n[(u*f+w)*4]/255*e];A.push([-1,0,n[(u*f+z)*4]/255*e]);A.push([-1,-1,n[(x*f+z)*4]/255*e]);A.push([0,-1,n[(x*f+w)*4]/255*e]);A.push([1,-1,n[(x*f+y)*4]/255*e]);
- A.push([1,0,n[(u*f+y)*4]/255*e]);A.push([1,1,n[(t*f+y)*4]/255*e]);A.push([0,1,n[(t*f+w)*4]/255*e]);A.push([-1,1,n[(t*f+z)*4]/255*e]);x=[];z=A.length;for(t=0;t<z;t++){var y=A[t],F=A[(t+1)%z],y=[y[0]-E[0],y[1]-E[1],y[2]-E[2]],F=[F[0]-E[0],F[1]-E[1],F[2]-E[2]];x.push(c([y[1]*F[2]-y[2]*F[1],y[2]*F[0]-y[0]*F[2],y[0]*F[1]-y[1]*F[0]]))}A=[0,0,0];for(t=0;t<x.length;t++)A[0]+=x[t][0],A[1]+=x[t][1],A[2]+=x[t][2];A[0]/=x.length;A[1]/=x.length;A[2]/=x.length;E=(u*f+w)*4;v[E]=(A[0]+1)/2*255|0;v[E+1]=(A[1]+0.5)*
- 255|0;v[E+2]=A[2]*255|0;v[E+3]=255}m.putImageData(p,0,0);return k}};THREE.SceneUtils={showHierarchy:function(b,e){THREE.SceneUtils.traverseHierarchy(b,function(b){b.visible=e})},traverseHierarchy:function(b,e){var c,f,h=b.children.length;for(f=0;f<h;f++)c=b.children[f],e(c),THREE.SceneUtils.traverseHierarchy(c,e)}};
- if(THREE.WebGLRenderer)THREE.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:THREE.UniformsUtils.merge([THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{enableAO:{type:"i",value:0},enableDiffuse:{type:"i",value:0},enableSpecular:{type:"i",value:0},enableReflection:{type:"i",value:0},tDiffuse:{type:"t",value:0,texture:null},tCube:{type:"t",value:1,texture:null},tNormal:{type:"t",value:2,texture:null},tSpecular:{type:"t",value:3,texture:null},tAO:{type:"t",value:4,texture:null},tDisplacement:{type:"t",value:5,texture:null},uNormalScale:{type:"f",
- value:1},uDisplacementBias:{type:"f",value:0},uDisplacementScale:{type:"f",value:1},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},uOpacity:{type:"f",value:1},uReflectivity:{type:"f",value:0.5},uOffset:{type:"v2",value:new THREE.Vector2(0,0)},uRepeat:{type:"v2",value:new THREE.Vector2(1,1)}}]),fragmentShader:["uniform vec3 uAmbientColor;\nuniform vec3 uDiffuseColor;\nuniform vec3 uSpecularColor;\nuniform float uShininess;\nuniform float uOpacity;\nuniform bool enableDiffuse;\nuniform bool enableSpecular;\nuniform bool enableAO;\nuniform bool enableReflection;\nuniform sampler2D tDiffuse;\nuniform sampler2D tNormal;\nuniform sampler2D tSpecular;\nuniform sampler2D tAO;\nuniform samplerCube tCube;\nuniform float uNormalScale;\nuniform float uReflectivity;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\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 ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;",
- THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3( 1.0 ), uOpacity );\nvec3 specularTex = vec3( 1.0 );\nvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\nnormalTex.xy *= uNormalScale;\nnormalTex = normalize( normalTex );\nif( enableDiffuse )\ngl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );\nif( enableAO )\ngl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;\nif( enableSpecular )\nspecularTex = texture2D( tSpecular, vUv ).xyz;\nmat3 tsb = mat3( vTangent, vBinormal, vNormal );\nvec3 finalNormal = tsb * normalTex;\nvec3 normal = normalize( finalNormal );\nvec3 viewPosition = normalize( vViewPosition );\n#if MAX_POINT_LIGHTS > 0\nvec3 pointDiffuse = vec3( 0.0 );\nvec3 pointSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nvec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );\nfloat pointDistance = vPointLight[ i ].w;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = specularTex.r * pow( pointDotNormalHalf, uShininess );\npointDiffuse += pointDistance * pointLightColor[ i ] * uDiffuseColor * pointDiffuseWeight;\npointSpecular += pointDistance * pointLightColor[ i ] * uSpecularColor * pointSpecularWeight * pointDiffuseWeight;\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec3 dirDiffuse = vec3( 0.0 );\nvec3 dirSpecular = vec3( 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 + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = specularTex.r * pow( dirDotNormalHalf, uShininess );\ndirDiffuse += directionalLightColor[ i ] * uDiffuseColor * dirDiffuseWeight;\ndirSpecular += directionalLightColor[ i ] * uSpecularColor * dirSpecularWeight * dirDiffuseWeight;\n}\n#endif\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\ntotalDiffuse += dirDiffuse;\ntotalSpecular += dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalDiffuse += pointDiffuse;\ntotalSpecular += pointSpecular;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * uAmbientColor) + totalSpecular;\nif ( enableReflection ) {\nvec3 wPos = cameraPosition - vViewPosition;\nvec3 vReflect = reflect( normalize( wPos ), normal );\nvec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, uReflectivity );\n}",
- THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\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;\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;",
- THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalize( normalMatrix * normal );\nvTangent = normalize( normalMatrix * tangent.xyz );\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvBinormal = normalize( vBinormal );\nvUv = uv * uRepeat + uOffset;\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 );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\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",
- THREE.ShaderChunk.shadowmap_vertex,"}"].join("\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}"}}};
- THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(b){return this.getPoint(this.getUtoTmapping(b))};THREE.Curve.prototype.getPoints=function(b){b||(b=5);var e,c=[];for(e=0;e<=b;e++)c.push(this.getPoint(e/b));return c};THREE.Curve.prototype.getSpacedPoints=function(b){b||(b=5);var e,c=[];for(e=0;e<=b;e++)c.push(this.getPointAt(e/b));return c};
- THREE.Curve.prototype.getLength=function(){var b=this.getLengths();return b[b.length-1]};THREE.Curve.prototype.getLengths=function(b){b||(b=200);if(this.cacheArcLengths&&this.cacheArcLengths.length==b+1)return this.cacheArcLengths;var e=[],c,f=this.getPoint(0),h,k=0;e.push(0);for(h=1;h<=b;h++)c=this.getPoint(h/b),k+=c.distanceTo(f),e.push(k),f=c;return this.cacheArcLengths=e};
- THREE.Curve.prototype.getUtoTmapping=function(b,e){var c=this.getLengths(),f=0,h=c.length,k;k=e?e:b*c[h-1];time=Date.now();for(var m=0,n=h-1,p;m<=n;)if(f=Math.floor(m+(n-m)/2),p=c[f]-k,p<0)m=f+1;else if(p>0)n=f-1;else{n=f;break}f=n;if(c[f]==k)return f/(h-1);m=c[f];return c=(f+(k-m)/(c[f+1]-m))/(h-1)};THREE.Curve.prototype.getNormalVector=function(b){b=this.getTangent(b);return new THREE.Vector2(-b.y,b.x)};
- THREE.Curve.prototype.getTangent=function(b){var e=b-1.0E-4;b+=1.0E-4;e<0&&(e=0);b>1&&(b=1);var e=this.getPoint(e),b=this.getPoint(b),c=new THREE.Vector2;c.sub(b,e);return c.unit()};THREE.LineCurve=function(b,e){b instanceof THREE.Vector2?(this.v1=b,this.v2=e):THREE.LineCurve.oldConstructor.apply(this,arguments)};THREE.LineCurve.oldConstructor=function(b,e,c,f){this.constructor(new THREE.Vector2(b,e),new THREE.Vector2(c,f))};THREE.LineCurve.prototype=new THREE.Curve;
- THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(b){var e=new THREE.Vector2;e.sub(this.v2,this.v1);e.multiplyScalar(b).addSelf(this.v1);return e};THREE.LineCurve.prototype.getPointAt=function(b){return this.getPoint(b)};THREE.LineCurve.prototype.getTangent=function(){var b=new THREE.Vector2;b.sub(this.v2,this.v1);b.normalize();return b};
- THREE.QuadraticBezierCurve=function(b,e,c){if(!(e instanceof THREE.Vector2))var f=Array.prototype.slice.call(arguments),b=new THREE.Vector2(f[0],f[1]),e=new THREE.Vector2(f[2],f[3]),c=new THREE.Vector2(f[4],f[5]);this.v0=b;this.v1=e;this.v2=c};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
- THREE.QuadraticBezierCurve.prototype.getPoint=function(b){var e;e=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);b=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(e,b)};THREE.QuadraticBezierCurve.prototype.getTangent=function(b){var e;e=THREE.Curve.Utils.tangentQuadraticBezier(b,this.v0.x,this.v1.x,this.v2.x);b=THREE.Curve.Utils.tangentQuadraticBezier(b,this.v0.y,this.v1.y,this.v2.y);e=new THREE.Vector2(e,b);e.normalize();return e};
- THREE.CubicBezierCurve=function(b,e,c,f){if(!(e instanceof THREE.Vector2))var h=Array.prototype.slice.call(arguments),b=new THREE.Vector2(h[0],h[1]),e=new THREE.Vector2(h[2],h[3]),c=new THREE.Vector2(h[4],h[5]),f=new THREE.Vector2(h[6],h[7]);this.v0=b;this.v1=e;this.v2=c;this.v3=f};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;
- THREE.CubicBezierCurve.prototype.getPoint=function(b){var e;e=THREE.Shape.Utils.b3(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b=THREE.Shape.Utils.b3(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(e,b)};THREE.CubicBezierCurve.prototype.getTangent=function(b){var e;e=THREE.Curve.Utils.tangentCubicBezier(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b=THREE.Curve.Utils.tangentCubicBezier(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);e=new THREE.Vector2(e,b);e.normalize();return e};
- THREE.SplineCurve=function(b){this.points=b};THREE.SplineCurve.prototype=new THREE.Curve;THREE.SplineCurve.prototype.constructor=THREE.SplineCurve;
- THREE.SplineCurve.prototype.getPoint=function(b){var e=new THREE.Vector2,c=[],f=this.points,h;h=(f.length-1)*b;b=Math.floor(h);h-=b;c[0]=b==0?b:b-1;c[1]=b;c[2]=b>f.length-2?b:b+1;c[3]=b>f.length-3?b:b+2;e.x=THREE.Curve.Utils.interpolate(f[c[0]].x,f[c[1]].x,f[c[2]].x,f[c[3]].x,h);e.y=THREE.Curve.Utils.interpolate(f[c[0]].y,f[c[1]].y,f[c[2]].y,f[c[3]].y,h);return e};THREE.ArcCurve=function(b,e,c,f,h,k){this.aX=b;this.aY=e;this.aRadius=c;this.aStartAngle=f;this.aEndAngle=h;this.aClockwise=k};
- THREE.ArcCurve.prototype=new THREE.Curve;THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.ArcCurve.prototype.getPoint=function(b){var e=this.aEndAngle-this.aStartAngle;this.aClockwise||(b=1-b);b=this.aStartAngle+b*e;return new THREE.Vector2(this.aX+this.aRadius*Math.cos(b),this.aY+this.aRadius*Math.sin(b))};
- THREE.Curve.Utils={tangentQuadraticBezier:function(b,e,c,f){return 2*(1-b)*(c-e)+2*b*(f-c)},tangentCubicBezier:function(b,e,c,f,h){return-3*e*(1-b)*(1-b)+3*c*(1-b)*(1-b)-6*b*c*(1-b)+6*b*f*(1-b)-3*b*b*f+3*b*b*h},tangentSpline:function(b){return 6*b*b-6*b+(3*b*b-4*b+1)+(-6*b*b+6*b)+(3*b*b-2*b)},interpolate:function(b,e,c,f,h){var b=(c-b)*0.5,f=(f-e)*0.5,k=h*h;return(2*e-2*c+b+f)*h*k+(-3*e+3*c-2*b-f)*k+b*h+e}};
- THREE.Curve.create=function(b,e){b.prototype=new THREE.Curve;b.prototype.constructor=b;b.prototype.getPoint=e;return b};THREE.LineCurve3=THREE.Curve.create(function(b,e){this.v1=b;this.v2=e},function(b){var e=new THREE.Vector3;e.sub(v2,v1);e.multiplyScalar(b);e.addSelf(this.v1);return e});
- THREE.QuadraticBezierCurve3=THREE.Curve.create(function(b,e,c){this.v0=b;this.v1=e;this.v2=c},function(b){var e,c;e=THREE.Shape.Utils.b2(b,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(b,this.v0.y,this.v1.y,this.v2.y);b=THREE.Shape.Utils.b2(b,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(e,c,b)});
- THREE.CubicBezierCurve3=THREE.Curve.create(function(b,e,c,f){this.v0=b;this.v1=e;this.v2=c;this.v3=f},function(b){var e,c;e=THREE.Shape.Utils.b3(b,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(b,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=THREE.Shape.Utils.b3(b,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(e,c,b)});
- THREE.SplineCurve3=THREE.Curve.create(function(b){this.points=b},function(b){var e=new THREE.Vector3,c=[],f=this.points,h;h=(f.length-1)*b;b=Math.floor(h);h-=b;c[0]=b==0?b:b-1;c[1]=b;c[2]=b>f.length-2?b:b+1;c[3]=b>f.length-3?b:b+2;e.x=THREE.Curve.Utils.interpolate(f[c[0]].x,f[c[1]].x,f[c[2]].x,f[c[3]].x,h);e.y=THREE.Curve.Utils.interpolate(f[c[0]].y,f[c[1]].y,f[c[2]].y,f[c[3]].y,h);e.z=THREE.Curve.Utils.interpolate(f[c[0]].z,f[c[1]].z,f[c[2]].z,f[c[3]].z,h);return e});
- THREE.CurvePath=function(){this.curves=[];this.bends=[]};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(b){this.curves.push(b)};THREE.CurvePath.prototype.checkConnection=function(){};THREE.CurvePath.prototype.closePath=function(){};
- THREE.CurvePath.prototype.getPoint=function(b){for(var e=b*this.getLength(),c=this.getCurveLengths(),b=0;b<c.length;){if(c[b]>=e)return e=c[b]-e,b=this.curves[b],e=1-e/b.getLength(),b.getPointAt(e);b++}return null};THREE.CurvePath.prototype.getLength=function(){var b=this.getCurveLengths();return b[b.length-1]};
- THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var b=[],e=0,c,f=this.curves.length;for(c=0;c<f;c++)e+=this.curves[c].getLength(),b.push(e);return this.cacheLengths=b};
- THREE.CurvePath.prototype.getBoundingBox=function(){var b=this.getPoints(),e,c,f,h;e=c=Number.NEGATIVE_INFINITY;f=h=Number.POSITIVE_INFINITY;var k,m,n,p;p=new THREE.Vector2;m=0;for(n=b.length;m<n;m++){k=b[m];if(k.x>e)e=k.x;else if(k.x<f)f=k.x;if(k.y>c)c=k.y;else if(k.y<c)h=k.y;p.addSelf(k.x,k.y)}return{minX:f,minY:h,maxX:e,maxY:c,centroid:p.divideScalar(n)}};THREE.CurvePath.prototype.createPointsGeometry=function(b){return this.createGeometry(this.getPoints(b,!0))};
- THREE.CurvePath.prototype.createSpacedPointsGeometry=function(b){return this.createGeometry(this.getSpacedPoints(b,!0))};THREE.CurvePath.prototype.createGeometry=function(b){for(var e=new THREE.Geometry,c=0;c<b.length;c++)e.vertices.push(new THREE.Vertex(new THREE.Vector3(b[c].x,b[c].y,0)));return e};THREE.CurvePath.prototype.addWrapPath=function(b){this.bends.push(b)};
- THREE.CurvePath.prototype.getTransformedPoints=function(b,e){var c=this.getPoints(b),f,h;if(!e)e=this.bends;f=0;for(h=e.length;f<h;f++)c=this.getWrapPoints(c,e[f]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(b,e){var c=this.getSpacedPoints(b),f,h;if(!e)e=this.bends;f=0;for(h=e.length;f<h;f++)c=this.getWrapPoints(c,e[f]);return c};
- THREE.CurvePath.prototype.getWrapPoints=function(b,e){var c=this.getBoundingBox(),f,h,k,m,n,p;f=0;for(h=b.length;f<h;f++)k=b[f],m=k.x,n=k.y,p=m/c.maxX,p=e.getUtoTmapping(p,m),m=e.getPoint(p),n=e.getNormalVector(p).multiplyScalar(n),k.x=m.x+n.x,k.y=m.y+n.y;return b};THREE.Path=function(b){THREE.CurvePath.call(this);this.actions=[];b&&this.fromPoints(b)};THREE.Path.prototype=new THREE.CurvePath;THREE.Path.prototype.constructor=THREE.Path;
- THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc"};THREE.Path.prototype.fromPoints=function(b){this.moveTo(b[0].x,b[0].y);var e,c=b.length;for(e=1;e<c;e++)this.lineTo(b[e].x,b[e].y)};THREE.Path.prototype.moveTo=function(){var b=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:b})};
- THREE.Path.prototype.lineTo=function(b,e){var c=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args;this.curves.push(new THREE.LineCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(b,e)));this.actions.push({action:THREE.PathActions.LINE_TO,args:c})};
- THREE.Path.prototype.quadraticCurveTo=function(b,e,c,f){var h=Array.prototype.slice.call(arguments),k=this.actions[this.actions.length-1].args;this.curves.push(new THREE.QuadraticBezierCurve(new THREE.Vector2(k[k.length-2],k[k.length-1]),new THREE.Vector2(b,e),new THREE.Vector2(c,f)));this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:h})};
- THREE.Path.prototype.bezierCurveTo=function(b,e,c,f,h,k){var m=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args;this.curves.push(new THREE.CubicBezierCurve(new THREE.Vector2(n[n.length-2],n[n.length-1]),new THREE.Vector2(b,e),new THREE.Vector2(c,f),new THREE.Vector2(h,k)));this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:m})};
- THREE.Path.prototype.splineThru=function(b){var e=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,b);this.curves.push(new THREE.SplineCurve(c));this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:e})};
- THREE.Path.prototype.arc=function(b,e,c,f,h,k){var m=Array.prototype.slice.call(arguments);this.curves.push(new THREE.ArcCurve(b,e,c,f,h,k));this.actions.push({action:THREE.PathActions.ARC,args:m})};THREE.Path.prototype.getSpacedPoints=function(b){b||(b=40);for(var e=[],c=0;c<b;c++)e.push(this.getPoint(c/b));return e};
- THREE.Path.prototype.getPoints=function(b,e){var b=b||12,c=[],f,h,k,m,n,p,v,w,u,x,t,z,y;f=0;for(h=this.actions.length;f<h;f++)switch(k=this.actions[f],m=k.action,k=k.args,m){case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(k[0],k[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:n=k[2];p=k[3];u=k[0];x=k[1];c.length>0?(m=c[c.length-1],t=m.x,z=m.y):(m=this.actions[f-1].args,t=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)y=m/b,k=THREE.Shape.Utils.b2(y,t,u,n),y=THREE.Shape.Utils.b2(y,z,x,
- p),c.push(new THREE.Vector2(k,y));break;case THREE.PathActions.BEZIER_CURVE_TO:n=k[4];p=k[5];u=k[0];x=k[1];v=k[2];w=k[3];c.length>0?(m=c[c.length-1],t=m.x,z=m.y):(m=this.actions[f-1].args,t=m[m.length-2],z=m[m.length-1]);for(m=1;m<=b;m++)y=m/b,k=THREE.Shape.Utils.b3(y,t,u,v,n),y=THREE.Shape.Utils.b3(y,z,x,w,p),c.push(new THREE.Vector2(k,y));break;case THREE.PathActions.CSPLINE_THRU:m=this.actions[f-1].args;m=[new THREE.Vector2(m[m.length-2],m[m.length-1])];y=b*k[0].length;m=m.concat(k[0]);k=new THREE.SplineCurve(m);
- for(m=1;m<=y;m++)c.push(k.getPointAt(m/y));break;case THREE.PathActions.ARC:m=this.actions[f-1].args;n=k[0];p=k[1];v=k[2];u=k[3];y=k[4];x=!!k[5];w=m[m.length-2];t=m[m.length-1];m.length==0&&(w=t=0);z=y-u;var A=b*2;for(m=1;m<=A;m++)y=m/A,x||(y=1-y),y=u+y*z,k=w+n+v*Math.cos(y),y=t+p+v*Math.sin(y),c.push(new THREE.Vector2(k,y))}e&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(b,e){this.getBoundingBox();return this.getWrapPoints(this.getPoints(e),b)};
- THREE.Path.prototype.nltransform=function(b,e,c,f,h,k){var m=this.getPoints(),n,p,v,w,u;n=0;for(p=m.length;n<p;n++)v=m[n],w=v.x,u=v.y,v.x=b*w+e*u+c,v.y=f*u+h*w+k;return m};
- THREE.Path.prototype.debug=function(b){var e=this.getBoundingBox();b||(b=document.createElement("canvas"),b.setAttribute("width",e.maxX+100),b.setAttribute("height",e.maxY+100),document.body.appendChild(b));e=b.getContext("2d");e.fillStyle="white";e.fillRect(0,0,b.width,b.height);e.strokeStyle="black";e.beginPath();var c,f,h,b=0;for(c=this.actions.length;b<c;b++)f=this.actions[b],h=f.args,f=f.action,f!=THREE.PathActions.CSPLINE_THRU&&e[f].apply(e,h);e.stroke();e.closePath();e.strokeStyle="red";f=
- this.getPoints();b=0;for(c=f.length;b<c;b++)h=f[b],e.beginPath(),e.arc(h.x,h.y,1.5,0,Math.PI*2,!1),e.stroke(),e.closePath()};
- THREE.Path.prototype.toShapes=function(){var b,e,c,f,h=[],k=new THREE.Path;b=0;for(e=this.actions.length;b<e;b++)c=this.actions[b],f=c.args,c=c.action,c==THREE.PathActions.MOVE_TO&&k.actions.length!=0&&(h.push(k),k=new THREE.Path),k[c].apply(k,f);k.actions.length!=0&&h.push(k);if(h.length==0)return[];var m,k=[];if(THREE.Shape.Utils.isClockWise(h[0].getPoints())){b=0;for(e=h.length;b<e;b++)f=h[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(m&&k.push(m),m=new THREE.Shape,m.actions=f.actions,m.curves=
- f.curves):m.holes.push(f);k.push(m)}else{m=new THREE.Shape;b=0;for(e=h.length;b<e;b++)f=h[b],THREE.Shape.Utils.isClockWise(f.getPoints())?(m.actions=f.actions,m.curves=f.curves,k.push(m),m=new THREE.Shape):m.holes.push(f)}return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=new THREE.Path;THREE.Shape.prototype.constructor=THREE.Path;THREE.Shape.prototype.extrude=function(b){return new THREE.ExtrudeGeometry(this,b)};
- THREE.Shape.prototype.getPointsHoles=function(b){var e,c=this.holes.length,f=[];for(e=0;e<c;e++)f[e]=this.holes[e].getTransformedPoints(b,this.bends);return f};THREE.Shape.prototype.getSpacedPointsHoles=function(b){var e,c=this.holes.length,f=[];for(e=0;e<c;e++)f[e]=this.holes[e].getTransformedSpacedPoints(b,this.bends);return f};THREE.Shape.prototype.extractAllPoints=function(b){return{shape:this.getTransformedPoints(b),holes:this.getPointsHoles(b)}};
- THREE.Shape.prototype.extractAllSpacedPoints=function(b){return{shape:this.getTransformedSpacedPoints(b),holes:this.getSpacedPointsHoles(b)}};
- THREE.Shape.Utils={removeHoles:function(b,e){var c=b.concat(),f=c.concat(),h,k,m,n,p,v,w,u,x,t,z=[];for(p=0;p<e.length;p++){v=e[p];Array.prototype.push.apply(f,v);k=Number.POSITIVE_INFINITY;for(h=0;h<v.length;h++){x=v[h];t=[];for(u=0;u<c.length;u++)w=c[u],w=x.distanceToSquared(w),t.push(w),w<k&&(k=w,m=h,n=u)}h=n-1>=0?n-1:c.length-1;k=m-1>=0?m-1:v.length-1;var y=[v[m],c[n],c[h]];u=THREE.FontUtils.Triangulate.area(y);var A=[v[m],v[k],c[n]];x=THREE.FontUtils.Triangulate.area(A);t=n;w=m;n+=1;m+=-1;n<
- 0&&(n+=c.length);n%=c.length;m<0&&(m+=v.length);m%=v.length;h=n-1>=0?n-1:c.length-1;k=m-1>=0?m-1:v.length-1;y=[v[m],c[n],c[h]];y=THREE.FontUtils.Triangulate.area(y);A=[v[m],v[k],c[n]];A=THREE.FontUtils.Triangulate.area(A);u+x>y+A&&(n=t,m=w,n<0&&(n+=c.length),n%=c.length,m<0&&(m+=v.length),m%=v.length,h=n-1>=0?n-1:c.length-1,k=m-1>=0?m-1:v.length-1);u=c.slice(0,n);x=c.slice(n);t=v.slice(m);w=v.slice(0,m);k=[v[m],v[k],c[n]];z.push([v[m],c[n],c[h]]);z.push(k);c=u.concat(t).concat(w).concat(x)}return{shape:c,
- isolatedPts:z,allpoints:f}},triangulateShape:function(b,e){var c=THREE.Shape.Utils.removeHoles(b,e),f=c.allpoints,h=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,!1),k,m,n,p,v={};k=0;for(m=f.length;k<m;k++)p=f[k].x+":"+f[k].y,v[p]!==void 0&&console.log("Duplicate point",p),v[p]=k;k=0;for(m=c.length;k<m;k++){n=c[k];for(f=0;f<3;f++)p=n[f].x+":"+n[f].y,p=v[p],p!==void 0&&(n[f]=p)}k=0;for(m=h.length;k<m;k++){n=h[k];for(f=0;f<3;f++)p=n[f].x+":"+n[f].y,p=v[p],p!==void 0&&(n[f]=p)}return c.concat(h)},
- isClockWise:function(b){return THREE.FontUtils.Triangulate.area(b)<0},b2p0:function(b,e){var c=1-b;return c*c*e},b2p1:function(b,e){return 2*(1-b)*b*e},b2p2:function(b,e){return b*b*e},b2:function(b,e,c,f){return this.b2p0(b,e)+this.b2p1(b,c)+this.b2p2(b,f)},b3p0:function(b,e){var c=1-b;return c*c*c*e},b3p1:function(b,e){var c=1-b;return 3*c*c*b*e},b3p2:function(b,e){return 3*(1-b)*b*b*e},b3p3:function(b,e){return b*b*b*e},b3:function(b,e,c,f,h){return this.b3p0(b,e)+this.b3p1(b,c)+this.b3p2(b,f)+
- this.b3p3(b,h)}};THREE.TextPath=function(b,e){THREE.Path.call(this);this.parameters=e||{};this.set(b)};THREE.TextPath.prototype.set=function(b,e){this.text=b;var e=e||this.parameters,c=e.curveSegments!==void 0?e.curveSegments:4,f=e.font!==void 0?e.font:"helvetiker",h=e.weight!==void 0?e.weight:"normal",k=e.style!==void 0?e.style:"normal";THREE.FontUtils.size=e.size!==void 0?e.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=f;THREE.FontUtils.weight=h;THREE.FontUtils.style=k};
- THREE.TextPath.prototype.toShapes=function(){for(var b=THREE.FontUtils.drawText(this.text).paths,e=[],c=0,f=b.length;c<f;c++)Array.prototype.push.apply(e,b[c].toShapes());return e};
- THREE.AnimationHandler=function(){var b=[],e={},c={update:function(c){for(var e=0;e<b.length;e++)b[e].update(c)},addToUpdate:function(c){b.indexOf(c)===-1&&b.push(c)},removeFromUpdate:function(c){c=b.indexOf(c);c!==-1&&b.splice(c,1)},add:function(b){e[b.name]!==void 0&&console.log("THREE.AnimationHandler.add: Warning! "+b.name+" already exists in library. Overwriting.");e[b.name]=b;if(b.initialized!==!0){for(var c=0;c<b.hierarchy.length;c++){for(var f=0;f<b.hierarchy[c].keys.length;f++){if(b.hierarchy[c].keys[f].time<
- 0)b.hierarchy[c].keys[f].time=0;if(b.hierarchy[c].keys[f].rot!==void 0&&!(b.hierarchy[c].keys[f].rot instanceof THREE.Quaternion)){var n=b.hierarchy[c].keys[f].rot;b.hierarchy[c].keys[f].rot=new THREE.Quaternion(n[0],n[1],n[2],n[3])}}if(b.hierarchy[c].keys[0].morphTargets!==void 0){n={};for(f=0;f<b.hierarchy[c].keys.length;f++)for(var p=0;p<b.hierarchy[c].keys[f].morphTargets.length;p++){var v=b.hierarchy[c].keys[f].morphTargets[p];n[v]=-1}b.hierarchy[c].usedMorphTargets=n;for(f=0;f<b.hierarchy[c].keys.length;f++){var w=
- {};for(v in n){for(p=0;p<b.hierarchy[c].keys[f].morphTargets.length;p++)if(b.hierarchy[c].keys[f].morphTargets[p]===v){w[v]=b.hierarchy[c].keys[f].morphTargetsInfluences[p];break}p===b.hierarchy[c].keys[f].morphTargets.length&&(w[v]=0)}b.hierarchy[c].keys[f].morphTargetsInfluences=w}}for(f=1;f<b.hierarchy[c].keys.length;f++)b.hierarchy[c].keys[f].time===b.hierarchy[c].keys[f-1].time&&(b.hierarchy[c].keys.splice(f,1),f--);for(f=1;f<b.hierarchy[c].keys.length;f++)b.hierarchy[c].keys[f].index=f}f=parseInt(b.length*
- b.fps,10);b.JIT={};b.JIT.hierarchy=[];for(c=0;c<b.hierarchy.length;c++)b.JIT.hierarchy.push(Array(f));b.initialized=!0}},get:function(b){if(typeof b==="string")return e[b]?e[b]:(console.log("THREE.AnimationHandler.get: Couldn't find animation "+b),null)},parse:function(b){var c=[];if(b instanceof THREE.SkinnedMesh)for(var e=0;e<b.bones.length;e++)c.push(b.bones[e]);else f(b,c);return c}},f=function(b,c){c.push(b);for(var e=0;e<b.children.length;e++)f(b.children[e],c)};c.LINEAR=0;c.CATMULLROM=1;c.CATMULLROM_FORWARD=
- 2;return c}();THREE.Animation=function(b,e,c,f){this.root=b;this.data=THREE.AnimationHandler.get(e);this.hierarchy=THREE.AnimationHandler.parse(b);this.currentTime=0;this.timeScale=1;this.isPlaying=!1;this.loop=this.isPaused=!0;this.interpolationType=c!==void 0?c:THREE.AnimationHandler.LINEAR;this.JITCompile=f!==void 0?f:!0;this.points=[];this.target=new THREE.Vector3};
- THREE.Animation.prototype.play=function(b,e){if(!this.isPlaying){this.isPlaying=!0;this.loop=b!==void 0?b:!0;this.currentTime=e!==void 0?e:0;var c,f=this.hierarchy.length,h;for(c=0;c<f;c++){h=this.hierarchy[c];if(this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD)h.useQuaternion=!0;h.matrixAutoUpdate=!0;if(h.animationCache===void 0)h.animationCache={},h.animationCache.prevKey={pos:0,rot:0,scl:0},h.animationCache.nextKey={pos:0,rot:0,scl:0},h.animationCache.originalMatrix=h instanceof
- THREE.Bone?h.skinMatrix:h.matrix;var k=h.animationCache.prevKey;h=h.animationCache.nextKey;k.pos=this.data.hierarchy[c].keys[0];k.rot=this.data.hierarchy[c].keys[0];k.scl=this.data.hierarchy[c].keys[0];h.pos=this.getNextKeyWith("pos",c,1);h.rot=this.getNextKeyWith("rot",c,1);h.scl=this.getNextKeyWith("scl",c,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.isPaused=this.isPlaying=!1;THREE.AnimationHandler.removeFromUpdate(this);for(var b=0;b<this.hierarchy.length;b++)if(this.hierarchy[b].animationCache!==void 0)this.hierarchy[b]instanceof THREE.Bone?this.hierarchy[b].skinMatrix=this.hierarchy[b].animationCache.originalMatrix:this.hierarchy[b].matrix=this.hierarchy[b].animationCache.originalMatrix,delete this.hierarchy[b].animationCache};
- THREE.Animation.prototype.update=function(b){if(this.isPlaying){var e=["pos","rot","scl"],c,f,h,k,m,n,p,v,w=this.data.JIT.hierarchy,u,x;this.currentTime+=b*this.timeScale;x=this.currentTime;u=this.currentTime%=this.data.length;v=parseInt(Math.min(u*this.data.fps,this.data.length*this.data.fps),10);for(var t=0,z=this.hierarchy.length;t<z;t++)if(b=this.hierarchy[t],p=b.animationCache,this.JITCompile&&w[t][v]!==void 0)b instanceof THREE.Bone?(b.skinMatrix=w[t][v],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=
- !1):(b.matrix=w[t][v],b.matrixAutoUpdate=!1,b.matrixWorldNeedsUpdate=!0);else{if(this.JITCompile)b instanceof THREE.Bone?b.skinMatrix=b.animationCache.originalMatrix:b.matrix=b.animationCache.originalMatrix;for(var y=0;y<3;y++){c=e[y];m=p.prevKey[c];n=p.nextKey[c];if(n.time<=x){if(u<x)if(this.loop){m=this.data.hierarchy[t].keys[0];for(n=this.getNextKeyWith(c,t,1);n.time<u;)m=n,n=this.getNextKeyWith(c,t,n.index+1)}else{this.stop();return}else{do m=n,n=this.getNextKeyWith(c,t,n.index+1);while(n.time<
- u)}p.prevKey[c]=m;p.nextKey[c]=n}b.matrixAutoUpdate=!0;b.matrixWorldNeedsUpdate=!0;f=(u-m.time)/(n.time-m.time);h=m[c];k=n[c];if(f<0||f>1)console.log("THREE.Animation.update: Warning! Scale out of bounds:"+f+" on bone "+t),f=f<0?0:1;if(c==="pos")if(c=b.position,this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=h[0]+(k[0]-h[0])*f,c.y=h[1]+(k[1]-h[1])*f,c.z=h[2]+(k[2]-h[2])*f;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)if(this.points[0]=
- this.getPrevKeyWith("pos",t,m.index-1).pos,this.points[1]=h,this.points[2]=k,this.points[3]=this.getNextKeyWith("pos",t,n.index+1).pos,f=f*0.33+0.33,h=this.interpolateCatmullRom(this.points,f),c.x=h[0],c.y=h[1],c.z=h[2],this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)f=this.interpolateCatmullRom(this.points,f*1.01),this.target.set(f[0],f[1],f[2]),this.target.subSelf(c),this.target.y=0,this.target.normalize(),f=Math.atan2(this.target.x,this.target.z),b.rotation.set(0,f,0)}else if(c===
- "rot")THREE.Quaternion.slerp(h,k,b.quaternion,f);else if(c==="scl")c=b.scale,c.x=h[0]+(k[0]-h[0])*f,c.y=h[1]+(k[1]-h[1])*f,c.z=h[2]+(k[2]-h[2])*f}}if(this.JITCompile&&w[0][v]===void 0){this.hierarchy[0].update(void 0,!0);for(t=0;t<this.hierarchy.length;t++)w[t][v]=this.hierarchy[t]instanceof THREE.Bone?this.hierarchy[t].skinMatrix.clone():this.hierarchy[t].matrix.clone()}}};
- THREE.Animation.prototype.interpolateCatmullRom=function(b,e){var c=[],f=[],h,k,m,n,p,v;h=(b.length-1)*e;k=Math.floor(h);h-=k;c[0]=k==0?k:k-1;c[1]=k;c[2]=k>b.length-2?k:k+1;c[3]=k>b.length-3?k:k+2;k=b[c[0]];n=b[c[1]];p=b[c[2]];v=b[c[3]];c=h*h;m=h*c;f[0]=this.interpolate(k[0],n[0],p[0],v[0],h,c,m);f[1]=this.interpolate(k[1],n[1],p[1],v[1],h,c,m);f[2]=this.interpolate(k[2],n[2],p[2],v[2],h,c,m);return f};
- THREE.Animation.prototype.interpolate=function(b,e,c,f,h,k,m){b=(c-b)*0.5;f=(f-e)*0.5;return(2*(e-c)+b+f)*m+(-3*(e-c)-2*b-f)*k+b*h+e};THREE.Animation.prototype.getNextKeyWith=function(b,e,c){var f=this.data.hierarchy[e].keys;for(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c=c<f.length-1?c:f.length-1:c%=f.length;c<f.length;c++)if(f[c][b]!==void 0)return f[c];return this.data.hierarchy[e].keys[0]};
- THREE.Animation.prototype.getPrevKeyWith=function(b,e,c){for(var f=this.data.hierarchy[e].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c>0?c:0:c>=0?c:c+f.length;c>=0;c--)if(f[c][b]!==void 0)return f[c];return this.data.hierarchy[e].keys[f.length-1]};
- THREE.CubeCamera=function(b,e,c,f){this.cameraPX=new THREE.PerspectiveCamera(90,1,b,e);this.cameraNX=new THREE.PerspectiveCamera(90,1,b,e);this.cameraPY=new THREE.PerspectiveCamera(90,1,b,e);this.cameraNY=new THREE.PerspectiveCamera(90,1,b,e);this.cameraPZ=new THREE.PerspectiveCamera(90,1,b,e);this.cameraNZ=new THREE.PerspectiveCamera(90,1,b,e);this.cameraPXTarget=new THREE.Vector3(0,0,0);this.cameraNXTarget=new THREE.Vector3(0,0,0);this.cameraPYTarget=new THREE.Vector3(0,0,0);this.cameraNYTarget=
- new THREE.Vector3(0,0,0);this.cameraPZTarget=new THREE.Vector3(0,0,0);this.cameraNZTarget=new THREE.Vector3(0,0,0);this.height=c;this.position=new THREE.Vector3(0,c,0);this.cameraPX.position=this.position;this.cameraNX.position=this.position;this.cameraPY.position=this.position;this.cameraNY.position=this.position;this.cameraPZ.position=this.position;this.cameraNZ.position=this.position;this.cameraPY.up.set(0,0,1);this.cameraPZ.up.set(0,-1,0);this.cameraNZ.up.set(0,-1,0);this.renderTarget=new THREE.WebGLRenderTargetCube(f,
- f,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updatePosition=function(b){this.position.x=b.x;this.position.z=b.z;this.cameraPXTarget.add(this.position,new THREE.Vector3(-1,0,0));this.cameraNXTarget.add(this.position,new THREE.Vector3(1,0,0));this.cameraPYTarget.add(this.position,new THREE.Vector3(0,1,0));this.cameraNYTarget.add(this.position,new THREE.Vector3(0,-1,0));this.cameraPZTarget.add(this.position,new THREE.Vector3(0,0,1));this.cameraNZTarget.add(this.position,
- new THREE.Vector3(0,0,-1));this.cameraPX.lookAt(this.cameraPXTarget);this.cameraNX.lookAt(this.cameraNXTarget);this.cameraPY.lookAt(this.cameraPYTarget);this.cameraNY.lookAt(this.cameraNYTarget);this.cameraPZ.lookAt(this.cameraPZTarget);this.cameraNZ.lookAt(this.cameraNZTarget)};this.updateCubeMap=function(b,c){var e=this.renderTarget;b.setFaceCulling("back","cw");c.scale.y=-1;c.position.y=2*this.height;c.updateMatrix();e.activeCubeFace=0;b.render(c,this.cameraPX,e);e.activeCubeFace=1;b.render(c,
- this.cameraNX,e);c.scale.y=1;c.position.y=0;c.updateMatrix();c.scale.x=-1;c.updateMatrix();e.activeCubeFace=2;b.render(c,this.cameraPY,e);c.scale.x=1;c.updateMatrix();b.setFaceCulling("back","ccw");e.activeCubeFace=3;b.render(c,this.cameraNY,e);c.scale.x=-1;c.updateMatrix();b.setFaceCulling("back","cw");e.activeCubeFace=4;b.render(c,this.cameraPZ,e);e.activeCubeFace=5;b.render(c,this.cameraNZ,e);c.scale.x=1;c.updateMatrix();b.setFaceCulling("back","ccw")}};THREE.FirstPersonCamera=function(){console.warn("DEPRECATED: FirstPersonCamera() is FirstPersonControls().")};
- THREE.PathCamera=function(){console.warn("DEPRECATED: PathCamera() is PathControls().")};THREE.FlyCamera=function(){console.warn("DEPRECATED: FlyCamera() is FlyControls().")};THREE.RollCamera=function(){console.warn("DEPRECATED: RollCamera() is RollControls().")};THREE.TrackballCamera=function(){console.warn("DEPRECATED: TrackballCamera() is TrackballControls().")};
- THREE.CombinedCamera=function(b,e,c,f,h,k,m){THREE.Camera.call(this);this.cameraO=new THREE.OrthographicCamera(b/-2,b/2,e/2,e/-2,k,m);this.cameraP=new THREE.PerspectiveCamera(c,b/e,f,h);this.toPerspective()};THREE.CombinedCamera.prototype=new THREE.Camera;THREE.CombinedCamera.prototype.constructor=THREE.CoolCamera;THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near;this.far=this.cameraP.far;this.projectionMatrix=this.cameraP.projectionMatrix};
- THREE.CombinedCamera.prototype.toOrthographic=function(){this.near=this.cameraO.near;this.far=this.cameraO.far;this.projectionMatrix=this.cameraO.projectionMatrix};THREE.CombinedCamera.prototype.setFov=function(b){this.cameraP.fov=b;this.cameraP.updateProjectionMatrix();this.toPerspective()};THREE.CombinedCamera.prototype.setLens=function(b,e){e||(e=43.25);var c=2*Math.atan(e/(b*2));c*=180/Math.PI;this.setFov(c);return c};
- THREE.FirstPersonControls=function(b,e){function c(b,c){return function(){c.apply(b,arguments)}}this.object=b;this.target=new THREE.Vector3(0,0,0);this.domElement=e!==void 0?e:document;this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=!1;this.lookVertical=!0;this.autoForward=!1;this.activeLook=!0;this.heightSpeed=!1;this.heightCoef=1;this.heightMin=0;this.constrainVertical=!1;this.verticalMin=0;this.verticalMax=Math.PI;this.lastUpdate=(new Date).getTime();this.theta=this.phi=this.lon=this.lat=
- this.mouseY=this.mouseX=this.autoSpeedFactor=this.tdiff=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=!1;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));this.onMouseDown=function(b){this.domElement!==document&&this.domElement.focus();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.domElement===document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=
- b.pageY-this.domElement.offsetTop-this.viewHalfY)};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;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0;break;case 81:this.freeze=!this.freeze}};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;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}};this.update=function(){var b=(new Date).getTime();this.tdiff=(b-this.lastUpdate)/1E3;this.lastUpdate=b;if(!this.freeze){this.autoSpeedFactor=this.heightSpeed?this.tdiff*((this.object.position.y<this.heightMin?this.heightMin:this.object.position.y>this.heightMax?this.heightMax:this.object.position.y)-this.heightMin)*this.heightCoef:0;var c=this.tdiff*this.movementSpeed;(this.moveForward||this.autoForward&&
- !this.moveBackward)&&this.object.translateZ(-(c+this.autoSpeedFactor));this.moveBackward&&this.object.translateZ(c);this.moveLeft&&this.object.translateX(-c);this.moveRight&&this.object.translateX(c);this.moveUp&&this.object.translateY(c);this.moveDown&&this.object.translateY(-c);c=this.tdiff*this.lookSpeed;this.activeLook||(c=0);this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c);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;var b=this.target,e=this.object.position;b.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=e.y+100*Math.cos(this.phi);b.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta)}b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon+=this.mouseX*c;this.lookVertical&&(this.lat-=this.mouseY*c*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;if(this.constrainVertical)this.phi=(this.phi-0)*(this.verticalMax-
- this.verticalMin)/(Math.PI-0)+this.verticalMin;b=this.target;e=this.object.position;b.x=e.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=e.y+100*Math.cos(this.phi);b.z=e.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(b)};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.PathControls=function(b,e){function c(b){if((b*=2)<1)return 0.5*b*b;return-0.5*(--b*(b-2)-1)}function f(b,c){return function(){c.apply(b,arguments)}}function h(b,c,e,f){var k={name:e,fps:0.6,length:f,hierarchy:[]},h,m=c.getControlPointsArray(),n=c.getLength(),A=m.length,E=0;h=A-1;c={parent:-1,keys:[]};c.keys[0]={time:0,pos:m[0],rot:[0,0,0,1],scl:[1,1,1]};c.keys[h]={time:f,pos:m[h],rot:[0,0,0,1],scl:[1,1,1]};for(h=1;h<A-1;h++)E=f*n.chunks[h]/n.total,c.keys[h]={time:E,pos:m[h]};k.hierarchy[0]=
- c;THREE.AnimationHandler.add(k);return new THREE.Animation(b,e,THREE.AnimationHandler.CATMULLROM_FORWARD,!1)}function k(b,c){var e,f,k=new THREE.Geometry;for(e=0;e<b.points.length*c;e++)f=e/(b.points.length*c),f=b.getPoint(f),k.vertices[e]=new THREE.Vertex(new THREE.Vector3(f.x,f.y,f.z));return k}this.object=b;this.domElement=e!==void 0?e:document;this.id="PathControls"+THREE.PathControlsIdCounter++;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.005;this.lookHorizontal=this.lookVertical=!0;this.verticalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.horizontalAngleMap={srcRange:[0,2*Math.PI],dstRange:[0,2*Math.PI]};this.target=new THREE.Object3D;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX=0;this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=
- this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2,this.domElement.setAttribute("tabindex",-1));var m=Math.PI*2,n=Math.PI/180;this.update=function(){var b,e;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)*n;this.theta=this.lon*n;b=this.phi%m;this.phi=b>=0?b:b+m;b=this.verticalAngleMap.srcRange;
- e=this.verticalAngleMap.dstRange;var f=e[1]-e[0];this.phi=c(((this.phi-b[0])*(e[1]-e[0])/(b[1]-b[0])+e[0]-e[0])/f)*f+e[0];b=this.horizontalAngleMap.srcRange;e=this.horizontalAngleMap.dstRange;f=e[1]-e[0];this.theta=c(((this.theta-b[0])*(e[1]-e[0])/(b[1]-b[0])+e[0]-e[0])/f)*f+e[0];b=this.target.position;b.x=100*Math.sin(this.phi)*Math.cos(this.theta);b.y=100*Math.cos(this.phi);b.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(b){this.domElement===
- document?(this.mouseX=b.pageX-this.viewHalfX,this.mouseY=b.pageY-this.viewHalfY):(this.mouseX=b.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=b.pageY-this.domElement.offsetTop-this.viewHalfY)};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var b=new THREE.MeshLambertMaterial({color:30719}),c=new THREE.MeshLambertMaterial({color:65280}),
- e=new THREE.CubeGeometry(10,10,20),m=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(e,b);b=new THREE.Mesh(m,c);b.position.set(0,10,0);this.animation=h(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(b)}else this.animation=h(this.animationParent,this.spline,this.id,this.duration),this.animationParent.add(this.target),this.animationParent.add(this.object);if(this.createDebugPath){var b=
- this.debugPath,c=this.spline,e=k(c,10),m=k(c,10),n=new THREE.LineBasicMaterial({color:16711680,linewidth:3});lineObj=new THREE.Line(e,n);particleObj=new THREE.ParticleSystem(m,new THREE.ParticleBasicMaterial({color:16755200,size:3}));lineObj.scale.set(1,1,1);b.add(lineObj);particleObj.scale.set(1,1,1);b.add(particleObj);m=new THREE.SphereGeometry(1,16,8);n=new THREE.MeshBasicMaterial({color:65280});for(i=0;i<c.points.length;i++)e=new THREE.Mesh(m,n),e.position.copy(c.points[i]),b.add(e)}this.domElement.addEventListener("mousemove",
- f(this,this.onMouseMove),!1)}};THREE.PathControlsIdCounter=0;
- THREE.FlyControls=function(b,e){function c(b,c){return function(){c.apply(b,arguments)}}this.object=b;this.domElement=e!==void 0?e:document;e&&this.domElement.setAttribute("tabindex",-1);this.movementSpeed=1;this.rollSpeed=0.005;this.autoForward=this.dragToLook=!1;this.object.useQuaternion=!0;this.tmpQuaternion=new THREE.Quaternion;this.mouseStatus=0;this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0};this.moveVector=new THREE.Vector3(0,
- 0,0);this.rotationVector=new THREE.Vector3(0,0,0);this.lastUpdate=-1;this.tdiff=0;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.keydown=function(b){if(!b.altKey){switch(b.keyCode){case 16:this.movementSpeedMultiplier=0.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=
- 1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector();this.updateRotationVector()}};this.keyup=function(b){switch(b.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=
- 0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector();this.updateRotationVector()};this.mousedown=function(b){this.domElement!==document&&this.domElement.focus();b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus++;else switch(b.button){case 0:this.object.moveForward=
- !0;break;case 2:this.object.moveBackward=!0}};this.mousemove=function(b){if(!this.dragToLook||this.mouseStatus>0){var c=this.getContainerDimensions(),e=c.size[0]/2,m=c.size[1]/2;this.moveState.yawLeft=-(b.pageX-c.offset[0]-e)/e;this.moveState.pitchDown=(b.pageY-c.offset[1]-m)/m;this.updateRotationVector()}};this.mouseup=function(b){b.preventDefault();b.stopPropagation();if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else switch(b.button){case 0:this.moveForward=
- !1;break;case 2:this.moveBackward=!1}this.updateRotationVector()};this.update=function(){var b=(new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.tdiff=(b-this.lastUpdate)/1E3;this.lastUpdate=b;var b=this.tdiff*this.movementSpeed,c=this.tdiff*this.rollSpeed;this.object.translateX(this.moveVector.x*b);this.object.translateY(this.moveVector.y*b);this.object.translateZ(this.moveVector.z*b);this.tmpQuaternion.set(this.rotationVector.x*c,this.rotationVector.y*c,this.rotationVector.z*c,
- 1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion);this.object.matrixWorldNeedsUpdate=!0};this.updateMovementVector=function(){var b=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-b+this.moveState.back};
- this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,
- 0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),!1);this.domElement.addEventListener("mousedown",c(this,this.mousedown),!1);this.domElement.addEventListener("mouseup",c(this,this.mouseup),!1);this.domElement.addEventListener("keydown",c(this,this.keydown),!1);this.domElement.addEventListener("keyup",c(this,this.keyup),!1);this.updateMovementVector();this.updateRotationVector()};
- THREE.RollControls=function(b,e){this.object=b;this.domElement=e!==void 0?e:document;this.mouseLook=!0;this.autoForward=!1;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=!1;this.forward=new THREE.Vector3(0,0,1);this.roll=0;this.lastUpdate=-1;this.delta=0;var c=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Matrix4,m=!1,n=1,p=0,v=0,w=0,u=0,x=0,t=window.innerWidth/2,z=window.innerHeight/2;this.update=function(){var b=
- (new Date).getTime();if(this.lastUpdate==-1)this.lastUpdate=b;this.delta=(b-this.lastUpdate)/1E3;this.lastUpdate=b;this.mouseLook&&(b=this.delta*this.lookSpeed,this.rotateHorizontally(b*u),this.rotateVertically(b*x));b=this.delta*this.movementSpeed;this.object.translateZ(-b*(p>0||this.autoForward&&!(p<0)?1:p));this.object.translateX(b*v);this.object.translateY(b*w);m&&(this.roll+=this.rollSpeed*this.delta*n);if(this.forward.y>this.constrainVertical[1])this.forward.y=this.constrainVertical[1],this.forward.normalize();
- else if(this.forward.y<this.constrainVertical[0])this.forward.y=this.constrainVertical[0],this.forward.normalize();h.copy(this.forward);f.set(0,1,0);c.cross(f,h).normalize();f.cross(h,c).normalize();this.object.matrix.n11=c.x;this.object.matrix.n12=f.x;this.object.matrix.n13=h.x;this.object.matrix.n21=c.y;this.object.matrix.n22=f.y;this.object.matrix.n23=h.y;this.object.matrix.n31=c.z;this.object.matrix.n32=f.z;this.object.matrix.n33=h.z;k.identity();k.n11=Math.cos(this.roll);k.n12=-Math.sin(this.roll);
- k.n21=Math.sin(this.roll);k.n22=Math.cos(this.roll);this.object.matrix.multiplySelf(k);this.object.matrixWorldNeedsUpdate=!0;this.object.matrix.n14=this.object.position.x;this.object.matrix.n24=this.object.position.y;this.object.matrix.n34=this.object.position.z};this.translateX=function(b){this.object.position.x+=this.object.matrix.n11*b;this.object.position.y+=this.object.matrix.n21*b;this.object.position.z+=this.object.matrix.n31*b};this.translateY=function(b){this.object.position.x+=this.object.matrix.n12*
- b;this.object.position.y+=this.object.matrix.n22*b;this.object.position.z+=this.object.matrix.n32*b};this.translateZ=function(b){this.object.position.x-=this.object.matrix.n13*b;this.object.position.y-=this.object.matrix.n23*b;this.object.position.z-=this.object.matrix.n33*b};this.rotateHorizontally=function(b){c.set(this.object.matrix.n11,this.object.matrix.n21,this.object.matrix.n31);c.multiplyScalar(b);this.forward.subSelf(c);this.forward.normalize()};this.rotateVertically=function(b){f.set(this.object.matrix.n12,
- this.object.matrix.n22,this.object.matrix.n32);f.multiplyScalar(b);this.forward.addSelf(f);this.forward.normalize()};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(b){u=(b.clientX-t)/window.innerWidth;x=(b.clientY-z)/window.innerHeight},!1);this.domElement.addEventListener("mousedown",function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:p=1;break;case 2:p=-1}},!1);this.domElement.addEventListener("mouseup",
- function(b){b.preventDefault();b.stopPropagation();switch(b.button){case 0:p=0;break;case 2:p=0}},!1);this.domElement.addEventListener("keydown",function(b){switch(b.keyCode){case 38:case 87:p=1;break;case 37:case 65:v=-1;break;case 40:case 83:p=-1;break;case 39:case 68:v=1;break;case 81:m=!0;n=1;break;case 69:m=!0;n=-1;break;case 82:w=1;break;case 70:w=-1}},!1);this.domElement.addEventListener("keyup",function(b){switch(b.keyCode){case 38:case 87:p=0;break;case 37:case 65:v=0;break;case 40:case 83:p=
- 0;break;case 39:case 68:v=0;break;case 81:m=!1;break;case 69:m=!1;break;case 82:w=0;break;case 70:w=0}},!1)};
- THREE.TrackballControls=function(b,e){var c=this,f={NONE:-1,ROTATE:0,ZOOM:1,PAN:2};this.object=b;this.domElement=e!==void 0?e:document;this.enabled=!0;this.screen={width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0};this.radius=(this.screen.width+this.screen.height)/4;this.rotateSpeed=1;this.zoomSpeed=1.2;this.panSpeed=0.3;this.staticMoving=this.noPan=this.noZoom=!1;this.dynamicDampingFactor=0.2;this.minDistance=0;this.maxDistance=Infinity;this.keys=[65,83,68];this.target=
- new THREE.Vector3(0,0,0);var h=!1,k=f.NONE,m=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,v=new THREE.Vector2,w=new THREE.Vector2,u=new THREE.Vector2,x=new THREE.Vector2;this.handleEvent=function(b){if(typeof this[b.type]=="function")this[b.type](b)};this.getMouseOnScreen=function(b,e){return new THREE.Vector2((b-c.screen.offsetLeft)/c.radius*0.5,(e-c.screen.offsetTop)/c.radius*0.5)};this.getMouseProjectionOnBall=function(b,e){var f=new THREE.Vector3((b-c.screen.width*0.5-c.screen.offsetLeft)/
- c.radius,(c.screen.height*0.5+c.screen.offsetTop-e)/c.radius,0),k=f.length();k>1?f.normalize():f.z=Math.sqrt(1-k*k);m.copy(c.object.position).subSelf(c.target);k=c.object.up.clone().setLength(f.y);k.addSelf(c.object.up.clone().crossSelf(m).setLength(f.x));k.addSelf(m.setLength(f.z));return k};this.rotateCamera=function(){var b=Math.acos(n.dot(p)/n.length()/p.length());if(b){var e=(new THREE.Vector3).cross(n,p).normalize(),f=new THREE.Quaternion;b*=c.rotateSpeed;f.setFromAxisAngle(e,-b);f.multiplyVector3(m);
- f.multiplyVector3(c.object.up);f.multiplyVector3(p);c.staticMoving?n=p:(f.setFromAxisAngle(e,b*(c.dynamicDampingFactor-1)),f.multiplyVector3(n))}};this.zoomCamera=function(){var b=1+(w.y-v.y)*c.zoomSpeed;b!==1&&b>0&&(m.multiplyScalar(b),c.staticMoving?v=w:v.y+=(w.y-v.y)*this.dynamicDampingFactor)};this.panCamera=function(){var b=x.clone().subSelf(u);if(b.lengthSq()){b.multiplyScalar(m.length()*c.panSpeed);var e=m.clone().crossSelf(c.object.up).setLength(b.x);e.addSelf(c.object.up.clone().setLength(b.y));
- c.object.position.addSelf(e);c.target.addSelf(e);c.staticMoving?u=x:u.addSelf(b.sub(x,u).multiplyScalar(c.dynamicDampingFactor))}};this.checkDistances=function(){if(!c.noZoom||!c.noPan)c.object.position.lengthSq()>c.maxDistance*c.maxDistance&&c.object.position.setLength(c.maxDistance),m.lengthSq()<c.minDistance*c.minDistance&&c.object.position.add(c.target,m.setLength(c.minDistance))};this.update=function(){m.copy(c.object.position).subSelf(this.target);c.rotateCamera();c.noZoom||c.zoomCamera();c.noPan||
- c.panCamera();c.object.position.add(c.target,m);c.checkDistances();c.object.lookAt(c.target)};this.domElement.addEventListener("contextmenu",function(b){b.preventDefault()},!1);this.domElement.addEventListener("mousemove",function(b){c.enabled&&(h&&(n=p=c.getMouseProjectionOnBall(b.clientX,b.clientY),v=w=c.getMouseOnScreen(b.clientX,b.clientY),u=x=c.getMouseOnScreen(b.clientX,b.clientY),h=!1),k!==f.NONE&&(k===f.ROTATE?p=c.getMouseProjectionOnBall(b.clientX,b.clientY):k===f.ZOOM&&!c.noZoom?w=c.getMouseOnScreen(b.clientX,
- b.clientY):k===f.PAN&&!c.noPan&&(x=c.getMouseOnScreen(b.clientX,b.clientY))))},!1);this.domElement.addEventListener("mousedown",function(b){if(c.enabled&&(b.preventDefault(),b.stopPropagation(),k===f.NONE))k=b.button,k===f.ROTATE?n=p=c.getMouseProjectionOnBall(b.clientX,b.clientY):k===f.ZOOM&&!c.noZoom?v=w=c.getMouseOnScreen(b.clientX,b.clientY):this.noPan||(u=x=c.getMouseOnScreen(b.clientX,b.clientY))},!1);this.domElement.addEventListener("mouseup",function(b){if(c.enabled)b.preventDefault(),b.stopPropagation(),
- k=f.NONE},!1);window.addEventListener("keydown",function(b){if(c.enabled&&k===f.NONE){if(b.keyCode===c.keys[f.ROTATE])k=f.ROTATE;else if(b.keyCode===c.keys[f.ZOOM]&&!c.noZoom)k=f.ZOOM;else if(b.keyCode===c.keys[f.PAN]&&!c.noPan)k=f.PAN;k!==f.NONE&&(h=!0)}},!1);window.addEventListener("keyup",function(){if(c.enabled&&k!==f.NONE)k=f.NONE},!1)};
- THREE.CubeGeometry=function(b,e,c,f,h,k,m,n){function p(b,c,e,m,n,t,p,u){var w,x,z=f||1,U=h||1,I=n/2,S=t/2,Q=v.vertices.length;if(b=="x"&&c=="y"||b=="y"&&c=="x")w="z";else if(b=="x"&&c=="z"||b=="z"&&c=="x")w="y",U=k||1;else if(b=="z"&&c=="y"||b=="y"&&c=="z")w="x",z=k||1;var Y=z+1,W=U+1;n/=z;var o=t/U;for(x=0;x<W;x++)for(t=0;t<Y;t++){var $=new THREE.Vector3;$[b]=(t*n-I)*e;$[c]=(x*o-S)*m;$[w]=p;v.vertices.push(new THREE.Vertex($))}for(x=0;x<U;x++)for(t=0;t<z;t++)v.faces.push(new THREE.Face4(t+Y*x+Q,
- t+Y*(x+1)+Q,t+1+Y*(x+1)+Q,t+1+Y*x+Q,null,null,u)),v.faceVertexUvs[0].push([new THREE.UV(t/z,x/U),new THREE.UV(t/z,(x+1)/U),new THREE.UV((t+1)/z,(x+1)/U),new THREE.UV((t+1)/z,x/U)])}THREE.Geometry.call(this);var v=this,w=b/2,u=e/2,x=c/2;if(m!==void 0)if(m instanceof Array)this.materials=m;else{this.materials=[];for(var t=0;t<6;t++)this.materials.push([m])}else this.materials=[];this.sides={px:!0,nx:!0,py:!0,ny:!0,pz:!0,nz:!0};if(n!=void 0)for(var z in n)this.sides[z]!=void 0&&(this.sides[z]=n[z]);
- this.sides.px&&p("z","y",-1,-1,c,e,w,this.materials[0]);this.sides.nx&&p("z","y",1,-1,c,e,-w,this.materials[1]);this.sides.py&&p("x","z",1,1,b,c,u,this.materials[2]);this.sides.ny&&p("x","z",1,-1,b,c,-u,this.materials[3]);this.sides.pz&&p("x","y",1,-1,b,e,x,this.materials[4]);this.sides.nz&&p("x","y",-1,-1,b,e,-x,this.materials[5]);this.mergeVertices();this.computeCentroids();this.computeFaceNormals()};THREE.CubeGeometry.prototype=new THREE.Geometry;THREE.CubeGeometry.prototype.constructor=THREE.CubeGeometry;
- THREE.CylinderGeometry=function(b,e,c,f,h,k){THREE.Geometry.call(this);var b=b!=null?b:20,e=e!=null?e:20,c=c||100,m=c/2,f=f||8,h=h||1,n,p,v=[],w=[];for(p=0;p<=h;p++){var u=[],x=[],t=p/h,z=t*(e-b)+b;for(n=0;n<=f;n++){var y=n/f;this.vertices.push(new THREE.Vertex(new THREE.Vector3(z*Math.sin(y*Math.PI*2),-t*c+m,z*Math.cos(y*Math.PI*2))));u.push(this.vertices.length-1);x.push(new THREE.UV(y,t))}v.push(u);w.push(x)}for(p=0;p<h;p++)for(n=0;n<f;n++){var c=v[p][n],u=v[p+1][n],x=v[p+1][n+1],t=v[p][n+1],z=
- this.vertices[c].position.clone().setY(0).normalize(),y=this.vertices[u].position.clone().setY(0).normalize(),A=this.vertices[x].position.clone().setY(0).normalize(),E=this.vertices[t].position.clone().setY(0).normalize(),F=w[p][n].clone(),D=w[p+1][n].clone(),G=w[p+1][n+1].clone(),K=w[p][n+1].clone();this.faces.push(new THREE.Face4(c,u,x,t,[z,y,A,E]));this.faceVertexUvs[0].push([F,D,G,K])}if(!k&&b>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,m,0)));for(n=0;n<f;n++)c=v[0][n],u=v[0][n+
- 1],x=this.vertices.length-1,z=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),A=new THREE.Vector3(0,1,0),F=w[0][n].clone(),D=w[0][n+1].clone(),G=new THREE.UV(D.u,0),this.faces.push(new THREE.Face3(c,u,x,[z,y,A])),this.faceVertexUvs[0].push([F,D,G])}if(!k&&e>0){this.vertices.push(new THREE.Vertex(new THREE.Vector3(0,-m,0)));for(n=0;n<f;n++)c=v[p][n+1],u=v[p][n],x=this.vertices.length-1,z=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),A=new THREE.Vector3(0,-1,0),F=w[p][n+1].clone(),D=w[p][n].clone(),
- G=new THREE.UV(D.u,1),this.faces.push(new THREE.Face3(c,u,x,[z,y,A])),this.faceVertexUvs[0].push([F,D,G])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=new THREE.Geometry;THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;
- THREE.ExtrudeGeometry=function(b,e){if(typeof b!="undefined"){THREE.Geometry.call(this);var b=b instanceof Array?b:[b],c,f=b.length,h;this.shapebb=b[f-1].getBoundingBox();for(c=0;c<f;c++)h=b[c],this.addShape(h,e);this.computeCentroids();this.computeFaceNormals()}};THREE.ExtrudeGeometry.prototype=new THREE.Geometry;THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;
- THREE.ExtrudeGeometry.prototype.addShape=function(b,e){function c(b,c,e){c||console.log("die");return c.clone().multiplyScalar(e).addSelf(b)}function f(b,c,e){var f=THREE.ExtrudeGeometry.__v1,k=THREE.ExtrudeGeometry.__v2,m=THREE.ExtrudeGeometry.__v3,h=THREE.ExtrudeGeometry.__v4,n=THREE.ExtrudeGeometry.__v5,o=THREE.ExtrudeGeometry.__v6;f.set(b.x-c.x,b.y-c.y);k.set(b.x-e.x,b.y-e.y);f=f.normalize();k=k.normalize();m.set(-f.y,f.x);h.set(k.y,-k.x);n.copy(b).addSelf(m);o.copy(b).addSelf(h);if(n.equals(o))return h.clone();
- n.copy(c).addSelf(m);o.copy(e).addSelf(h);m=f.dot(h);h=o.subSelf(n).dot(h);m==0&&(console.log("Either infinite or no solutions!"),h==0?console.log("Its finite solutions."):console.log("Too bad, no solutions."));h/=m;if(h<0)return c=Math.atan2(c.y-b.y,c.x-b.x),b=Math.atan2(e.y-b.y,e.x-b.x),c>b&&(b+=Math.PI*2),anglec=(c+b)/2,new THREE.Vector2(-Math.cos(anglec),-Math.sin(anglec));return f.multiplyScalar(h).addSelf(n).subSelf(b).clone()}function h(b){for(I=b.length;--I>=0;){ja=I;la=I-1;la<0&&(la=b.length-
- 1);for(var c=0,e=t+w*2,c=0;c<e;c++){var f=$*c,k=$*(c+1),h=da+ja+f,m=da+ja+k,o=h,f=da+la+f,k=da+la+k,u=m;o+=U;f+=U;k+=U;u+=U;M.faces.push(new THREE.Face4(o,f,k,u,null,null,G));G&&(o=c/e,f=(c+1)/e,k=n+p*2,h=(M.vertices[h].position.z+p)/k,m=(M.vertices[m].position.z+p)/k,M.faceVertexUvs[0].push([new THREE.UV(h,o),new THREE.UV(m,o),new THREE.UV(m,f),new THREE.UV(h,f)]))}}}function k(b,c,e){M.vertices.push(new THREE.Vertex(new THREE.Vector3(b,c,e)))}function m(b,c,e){b+=U;c+=U;e+=U;M.faces.push(new THREE.Face3(b,
- c,e,null,null,D));if(D){var f=K.maxY,k=K.maxX,h=M.vertices[c].position.x,c=M.vertices[c].position.y,m=M.vertices[e].position.x,e=M.vertices[e].position.y;M.faceVertexUvs[0].push([new THREE.UV(M.vertices[b].position.x/k,M.vertices[b].position.y/f),new THREE.UV(h/k,c/f),new THREE.UV(m/k,e/f)])}}var n=e.amount!==void 0?e.amount:100,p=e.bevelThickness!==void 0?e.bevelThickness:6,v=e.bevelSize!==void 0?e.bevelSize:p-2,w=e.bevelSegments!==void 0?e.bevelSegments:3,u=e.bevelEnabled!==void 0?e.bevelEnabled:
- !0,x=e.curveSegments!==void 0?e.curveSegments:12,t=e.steps!==void 0?e.steps:1,z=e.bendPath,y=e.extrudePath,A,E=!1,F=e.useSpacedPoints!==void 0?e.useSpacedPoints:!1,D=e.material,G=e.extrudeMaterial,K=this.shapebb;if(y)A=y.getPoints(x),t=A.length,E=!0,u=!1;u||(v=p=w=0);var N,L,B,M=this,U=this.vertices.length;z&&b.addWrapPath(z);x=F?b.extractAllSpacedPoints(x):b.extractAllPoints(x);z=x.shape;x=x.holes;if(y=!THREE.Shape.Utils.isClockWise(z)){z=z.reverse();L=0;for(B=x.length;L<B;L++)N=x[L],THREE.Shape.Utils.isClockWise(N)&&
- (x[L]=N.reverse());y=!1}y=THREE.Shape.Utils.triangulateShape(z,x);F=z;L=0;for(B=x.length;L<B;L++)N=x[L],z=z.concat(N);var I,S,Q,Y,W,o,$=z.length,T=y.length,ha=[];I=0;S=F.length;ja=S-1;for(la=I+1;I<S;I++,ja++,la++)ja==S&&(ja=0),la==S&&(la=0),ha[I]=f(F[I],F[ja],F[la]);var fa=[],oa,ca=ha.concat();L=0;for(B=x.length;L<B;L++){N=x[L];oa=[];I=0;S=N.length;ja=S-1;for(la=I+1;I<S;I++,ja++,la++)ja==S&&(ja=0),la==S&&(la=0),oa[I]=f(N[I],N[ja],N[la]);fa.push(oa);ca=ca.concat(oa)}for(Q=0;Q<w;Q++){Y=Q/w;W=p*(1-Y);
- Y=v*Math.sin(Y*Math.PI/2);I=0;for(S=F.length;I<S;I++)o=c(F[I],ha[I],Y),k(o.x,o.y,-W);L=0;for(B=x.length;L<B;L++){N=x[L];oa=fa[L];I=0;for(S=N.length;I<S;I++)o=c(N[I],oa[I],Y),k(o.x,o.y,-W)}}Y=v;for(I=0;I<$;I++)o=u?c(z[I],ca[I],Y):z[I],E?k(o.x,o.y+A[0].y,A[0].x):k(o.x,o.y,0);for(Q=1;Q<=t;Q++)for(I=0;I<$;I++)o=u?c(z[I],ca[I],Y):z[I],E?k(o.x,o.y+A[Q-1].y,A[Q-1].x):k(o.x,o.y,n/t*Q);for(Q=w-1;Q>=0;Q--){Y=Q/w;W=p*(1-Y);Y=v*Math.sin(Y*Math.PI/2);I=0;for(S=F.length;I<S;I++)o=c(F[I],ha[I],Y),k(o.x,o.y,n+W);
- L=0;for(B=x.length;L<B;L++){N=x[L];oa=fa[L];I=0;for(S=N.length;I<S;I++)o=c(N[I],oa[I],Y),E?k(o.x,o.y+A[t-1].y,A[t-1].x+W):k(o.x,o.y,n+W)}}if(u){u=$*0;for(I=0;I<T;I++)v=y[I],m(v[2]+u,v[1]+u,v[0]+u);u=$*(t+w*2);for(I=0;I<T;I++)v=y[I],m(v[0]+u,v[1]+u,v[2]+u)}else{for(I=0;I<T;I++)v=y[I],m(v[2],v[1],v[0]);for(I=0;I<T;I++)v=y[I],m(v[0]+$*t,v[1]+$*t,v[2]+$*t)}var ja,la,da=0;h(F);da+=F.length;L=0;for(B=x.length;L<B;L++)N=x[L],h(N),da+=N.length};THREE.ExtrudeGeometry.__v1=new THREE.Vector2;
- THREE.ExtrudeGeometry.__v2=new THREE.Vector2;THREE.ExtrudeGeometry.__v3=new THREE.Vector2;THREE.ExtrudeGeometry.__v4=new THREE.Vector2;THREE.ExtrudeGeometry.__v5=new THREE.Vector2;THREE.ExtrudeGeometry.__v6=new THREE.Vector2;
- THREE.IcosahedronGeometry=function(b){function e(b,c,e){var f=Math.sqrt(b*b+c*c+e*e);return h.vertices.push(new THREE.Vertex(new THREE.Vector3(b/f,c/f,e/f)))-1}function c(b,c,e,f){f.faces.push(new THREE.Face3(b,c,e))}function f(b,c){var f=h.vertices[b].position,k=h.vertices[c].position;return e((f.x+k.x)/2,(f.y+k.y)/2,(f.z+k.z)/2)}var h=this,k=new THREE.Geometry;this.subdivisions=b||0;THREE.Geometry.call(this);b=(1+Math.sqrt(5))/2;e(-1,b,0);e(1,b,0);e(-1,-b,0);e(1,-b,0);e(0,-1,b);e(0,1,b);e(0,-1,
- -b);e(0,1,-b);e(b,0,-1);e(b,0,1);e(-b,0,-1);e(-b,0,1);c(0,11,5,k);c(0,5,1,k);c(0,1,7,k);c(0,7,10,k);c(0,10,11,k);c(1,5,9,k);c(5,11,4,k);c(11,10,2,k);c(10,7,6,k);c(7,1,8,k);c(3,9,4,k);c(3,4,2,k);c(3,2,6,k);c(3,6,8,k);c(3,8,9,k);c(4,9,5,k);c(2,4,11,k);c(6,2,10,k);c(8,6,7,k);c(9,8,1,k);for(var m=0;m<this.subdivisions;m++){var b=new THREE.Geometry,n;for(n in k.faces){var p=f(k.faces[n].a,k.faces[n].b),v=f(k.faces[n].b,k.faces[n].c),w=f(k.faces[n].c,k.faces[n].a);c(k.faces[n].a,p,w,b);c(k.faces[n].b,v,
- p,b);c(k.faces[n].c,w,v,b);c(p,v,w,b)}k.faces=b.faces}h.faces=k.faces;this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.IcosahedronGeometry.prototype=new THREE.Geometry;THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry;
- THREE.LatheGeometry=function(b,e,c){THREE.Geometry.call(this);this.steps=e||12;this.angle=c||2*Math.PI;for(var e=this.angle/this.steps,c=[],f=[],h=[],k=[],m=(new THREE.Matrix4).setRotationZ(e),n=0;n<b.length;n++)this.vertices.push(new THREE.Vertex(b[n])),c[n]=b[n].clone(),f[n]=this.vertices.length-1;for(var p=0;p<=this.angle+0.001;p+=e){for(n=0;n<c.length;n++)p<this.angle?(c[n]=m.multiplyVector3(c[n].clone()),this.vertices.push(new THREE.Vertex(c[n])),h[n]=this.vertices.length-1):h=k;p==0&&(k=f);
- for(n=0;n<f.length-1;n++)this.faces.push(new THREE.Face4(h[n],h[n+1],f[n+1],f[n])),this.faceVertexUvs[0].push([new THREE.UV(1-p/this.angle,n/b.length),new THREE.UV(1-p/this.angle,(n+1)/b.length),new THREE.UV(1-(p-e)/this.angle,(n+1)/b.length),new THREE.UV(1-(p-e)/this.angle,n/b.length)]);f=h;h=[]}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=new THREE.Geometry;THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry;
- THREE.OctahedronGeometry=function(b,e){function c(c){var e=c.clone().normalize(),e=new THREE.Vertex(e.clone().multiplyScalar(b));e.index=m.vertices.push(e)-1;e.uv=new THREE.UV(Math.atan2(c.z,-c.x)/2/Math.PI+0.5,Math.atan2(-c.y,Math.sqrt(c.x*c.x+c.z*c.z))/Math.PI+0.5);return e}function f(b,c,e,n){n<1?(n=new THREE.Face3(b.index,c.index,e.index,[b.position,c.position,e.position]),n.centroid.addSelf(b.position).addSelf(c.position).addSelf(e.position).divideScalar(3),n.normal=n.centroid.clone().normalize(),
- m.faces.push(n),n=Math.atan2(n.centroid.z,-n.centroid.x),m.faceVertexUvs[0].push([k(b.uv,b.position,n),k(c.uv,c.position,n),k(e.uv,e.position,n)])):(n-=1,f(b,h(b,c),h(b,e),n),f(h(b,c),c,h(c,e),n),f(h(b,e),h(c,e),e,n),f(h(b,c),h(c,e),h(b,e),n))}function h(b,e){n[b.index]||(n[b.index]=[]);n[e.index]||(n[e.index]=[]);var f=n[b.index][e.index];f===void 0&&(n[b.index][e.index]=n[e.index][b.index]=f=c((new THREE.Vector3).add(b.position,e.position).divideScalar(2)));return f}function k(b,c,e){e<0&&b.u===
- 1&&(b=new THREE.UV(b.u-1,b.v));c.x===0&&c.z===0&&(b=new THREE.UV(e/2/Math.PI+0.5,b.v));return b}THREE.Geometry.call(this);var e=isFinite(e)?e:3,m=this;c(new THREE.Vector3(1,0,0));c(new THREE.Vector3(-1,0,0));c(new THREE.Vector3(0,1,0));c(new THREE.Vector3(0,-1,0));c(new THREE.Vector3(0,0,1));c(new THREE.Vector3(0,0,-1));var n=[],p=this.vertices;f(p[0],p[2],p[4],e);f(p[0],p[4],p[3],e);f(p[0],p[3],p[5],e);f(p[0],p[5],p[2],e);f(p[1],p[2],p[5],e);f(p[1],p[5],p[3],e);f(p[1],p[3],p[4],e);f(p[1],p[4],p[2],
- e);this.boundingSphere={radius:b}};THREE.OctahedronGeometry.prototype=new THREE.Geometry;THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry;
- THREE.PlaneGeometry=function(b,e,c,f){THREE.Geometry.call(this);var h,k=b/2,m=e/2,c=c||1,f=f||1,n=c+1,p=f+1;b/=c;var v=e/f;for(h=0;h<p;h++)for(e=0;e<n;e++)this.vertices.push(new THREE.Vertex(new THREE.Vector3(e*b-k,-(h*v-m),0)));for(h=0;h<f;h++)for(e=0;e<c;e++)this.faces.push(new THREE.Face4(e+n*h,e+n*(h+1),e+1+n*(h+1),e+1+n*h)),this.faceVertexUvs[0].push([new THREE.UV(e/c,h/f),new THREE.UV(e/c,(h+1)/f),new THREE.UV((e+1)/c,(h+1)/f),new THREE.UV((e+1)/c,h/f)]);this.computeCentroids();this.computeFaceNormals()};
- THREE.PlaneGeometry.prototype=new THREE.Geometry;THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
- THREE.SphereGeometry=function(b,e,c){THREE.Geometry.call(this);for(var b=b||50,f,h=Math.PI,k=Math.max(3,e||8),m=Math.max(2,c||6),e=[],c=0;c<m+1;c++){f=c/m;var n=b*Math.cos(f*h),p=b*Math.sin(f*h),v=[],w=0;for(f=0;f<k;f++){var u=2*f/k,x=p*Math.sin(u*h),u=p*Math.cos(u*h);(c==0||c==m)&&f>0||(w=this.vertices.push(new THREE.Vertex(new THREE.Vector3(u,n,x)))-1);v.push(w)}e.push(v)}for(var t,z,y,h=e.length,c=0;c<h;c++)if(k=e[c].length,c>0)for(f=0;f<k;f++){v=f==k-1;m=e[c][v?0:f+1];n=e[c][v?k-1:f];p=e[c-1][v?
- k-1:f];v=e[c-1][v?0:f+1];x=c/(h-1);t=(c-1)/(h-1);z=(f+1)/k;var u=f/k,w=new THREE.UV(1-z,x),x=new THREE.UV(1-u,x),u=new THREE.UV(1-u,t),A=new THREE.UV(1-z,t);c<e.length-1&&(t=this.vertices[m].position.clone(),z=this.vertices[n].position.clone(),y=this.vertices[p].position.clone(),t.normalize(),z.normalize(),y.normalize(),this.faces.push(new THREE.Face3(m,n,p,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(y.x,y.y,y.z)])),this.faceVertexUvs[0].push([w,x,u]));c>1&&(t=
- this.vertices[m].position.clone(),z=this.vertices[p].position.clone(),y=this.vertices[v].position.clone(),t.normalize(),z.normalize(),y.normalize(),this.faces.push(new THREE.Face3(m,p,v,[new THREE.Vector3(t.x,t.y,t.z),new THREE.Vector3(z.x,z.y,z.z),new THREE.Vector3(y.x,y.y,y.z)])),this.faceVertexUvs[0].push([w,u,A]))}this.computeCentroids();this.computeFaceNormals();this.computeVertexNormals();this.boundingSphere={radius:b}};THREE.SphereGeometry.prototype=new THREE.Geometry;
- THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;
- THREE.TextGeometry=function(b,e){var c=(new THREE.TextPath(b,e)).toShapes();e.amount=e.height!==void 0?e.height:50;if(e.bevelThickness===void 0)e.bevelThickness=10;if(e.bevelSize===void 0)e.bevelSize=8;if(e.bevelEnabled===void 0)e.bevelEnabled=!1;if(e.bend){var f=c[c.length-1].getBoundingBox().maxX;e.bendPath=new THREE.QuadraticBezierCurve(new THREE.Vector2(0,0),new THREE.Vector2(f/2,120),new THREE.Vector2(f,0))}THREE.ExtrudeGeometry.call(this,c,e)};THREE.TextGeometry.prototype=new THREE.ExtrudeGeometry;
- THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
- THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){return this.faces[this.face][this.weight][this.style]},getTextShapes:function(b,e){return(new TextPath(b,e)).toShapes()},loadFace:function(b){var e=b.familyName.toLowerCase();this.faces[e]=this.faces[e]||{};this.faces[e][b.cssFontWeight]=this.faces[e][b.cssFontWeight]||{};this.faces[e][b.cssFontWeight][b.cssFontStyle]=b;return this.faces[e][b.cssFontWeight][b.cssFontStyle]=b},drawText:function(b){for(var e=
- this.getFace(),c=this.size/e.resolution,f=0,h=String(b).split(""),k=h.length,m=[],b=0;b<k;b++){var n=new THREE.Path,n=this.extractGlyphPoints(h[b],e,c,f,n);f+=n.offset;m.push(n.path)}return{paths:m,offset:f/2}},extractGlyphPoints:function(b,e,c,f,h){var k=[],m,n,p,v,w,u,x,t,z,y,A=e.glyphs[b]||e.glyphs[ctxt.options.fallbackCharacter];if(A){if(A.o){e=A._cachedOutline||(A._cachedOutline=A.o.split(" "));p=e.length;for(b=0;b<p;)switch(n=e[b++],n){case "m":n=e[b++]*c+f;v=e[b++]*c;k.push(new THREE.Vector2(n,
- v));h.moveTo(n,v);break;case "l":n=e[b++]*c+f;v=e[b++]*c;k.push(new THREE.Vector2(n,v));h.lineTo(n,v);break;case "q":n=e[b++]*c+f;v=e[b++]*c;x=e[b++]*c+f;t=e[b++]*c;h.quadraticCurveTo(x,t,n,v);if(m=k[k.length-1]){w=m.x;u=m.y;m=1;for(divisions=this.divisions;m<=divisions;m++){var E=m/divisions,F=THREE.Shape.Utils.b2(E,w,x,n),E=THREE.Shape.Utils.b2(E,u,t,v);k.push(new THREE.Vector2(F,E))}}break;case "b":if(n=e[b++]*c+f,v=e[b++]*c,x=e[b++]*c+f,t=e[b++]*-c,z=e[b++]*c+f,y=e[b++]*-c,h.bezierCurveTo(n,v,
- x,t,z,y),m=k[k.length-1]){w=m.x;u=m.y;m=1;for(divisions=this.divisions;m<=divisions;m++)E=m/divisions,F=THREE.Shape.Utils.b3(E,w,x,z,n),E=THREE.Shape.Utils.b3(E,u,t,y,v),k.push(new THREE.Vector2(F,E))}}}return{offset:A.ha*c,points:k,path:h}}}};
- (function(b){var e=function(b){for(var e=b.length,h=0,k=e-1,m=0;m<e;k=m++)h+=b[k].x*b[m].y-b[m].x*b[k].y;return h*0.5};b.Triangulate=function(b,f){var h=b.length;if(h<3)return null;var k=[],m=[],n=[],p,v,w;if(e(b)>0)for(v=0;v<h;v++)m[v]=v;else for(v=0;v<h;v++)m[v]=h-1-v;var u=2*h;for(v=h-1;h>2;){if(u--<=0){console.log("Warning, unable to triangulate polygon!");if(f)return n;return k}p=v;h<=p&&(p=0);v=p+1;h<=v&&(v=0);w=v+1;h<=w&&(w=0);var x;a:{x=b;var t=p,z=v,y=w,A=h,E=m,F=void 0,D=void 0,G=void 0,
- K=void 0,N=void 0,L=void 0,B=void 0,M=void 0,U=void 0,D=x[E[t]].x,G=x[E[t]].y,K=x[E[z]].x,N=x[E[z]].y,L=x[E[y]].x,B=x[E[y]].y;if(1.0E-10>(K-D)*(B-G)-(N-G)*(L-D))x=!1;else{for(F=0;F<A;F++)if(!(F==t||F==z||F==y)){var M=x[E[F]].x,U=x[E[F]].y,I=void 0,S=void 0,Q=void 0,Y=void 0,W=void 0,o=void 0,$=void 0,T=void 0,ha=void 0,fa=void 0,oa=void 0,ca=void 0,I=Q=W=void 0,I=L-K,S=B-N,Q=D-L,Y=G-B,W=K-D,o=N-G,$=M-D,T=U-G,ha=M-K,fa=U-N,oa=M-L,ca=U-B,I=I*fa-S*ha,W=W*T-o*$,Q=Q*ca-Y*oa;if(I>=0&&Q>=0&&W>=0){x=!1;break a}}x=
- !0}}if(x){k.push([b[m[p]],b[m[v]],b[m[w]]]);n.push([m[p],m[v],m[w]]);p=v;for(w=v+1;w<h;p++,w++)m[p]=m[w];h--;u=2*h}}if(f)return n;return k};b.Triangulate.area=e;return b})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};
- THREE.TorusGeometry=function(b,e,c,f,h){THREE.Geometry.call(this);this.radius=b||100;this.tube=e||40;this.segmentsR=c||8;this.segmentsT=f||6;this.arc=h||Math.PI*2;h=new THREE.Vector3;b=[];e=[];for(c=0;c<=this.segmentsR;c++)for(f=0;f<=this.segmentsT;f++){var k=f/this.segmentsT*this.arc,m=c/this.segmentsR*Math.PI*2;h.x=this.radius*Math.cos(k);h.y=this.radius*Math.sin(k);var n=new THREE.Vector3;n.x=(this.radius+this.tube*Math.cos(m))*Math.cos(k);n.y=(this.radius+this.tube*Math.cos(m))*Math.sin(k);n.z=
- this.tube*Math.sin(m);this.vertices.push(new THREE.Vertex(n));b.push(new THREE.UV(f/this.segmentsT,1-c/this.segmentsR));e.push(n.clone().subSelf(h).normalize())}for(c=1;c<=this.segmentsR;c++)for(f=1;f<=this.segmentsT;f++){var h=(this.segmentsT+1)*c+f-1,k=(this.segmentsT+1)*(c-1)+f-1,m=(this.segmentsT+1)*(c-1)+f,n=(this.segmentsT+1)*c+f,p=new THREE.Face4(h,k,m,n,[e[h],e[k],e[m],e[n]]);p.normal.addSelf(e[h]);p.normal.addSelf(e[k]);p.normal.addSelf(e[m]);p.normal.addSelf(e[n]);p.normal.normalize();this.faces.push(p);
- this.faceVertexUvs[0].push([b[h].clone(),b[k].clone(),b[m].clone(),b[n].clone()])}this.computeCentroids()};THREE.TorusGeometry.prototype=new THREE.Geometry;THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;
- THREE.TorusKnotGeometry=function(b,e,c,f,h,k,m){function n(b,c,e,f,k,h){c=e/f*b;e=Math.cos(c);return new THREE.Vector3(k*(2+e)*0.5*Math.cos(b),k*(2+e)*Math.sin(b)*0.5,h*k*Math.sin(c)*0.5)}THREE.Geometry.call(this);this.radius=b||200;this.tube=e||40;this.segmentsR=c||64;this.segmentsT=f||8;this.p=h||2;this.q=k||3;this.heightScale=m||1;this.grid=Array(this.segmentsR);c=new THREE.Vector3;f=new THREE.Vector3;k=new THREE.Vector3;for(b=0;b<this.segmentsR;++b){this.grid[b]=Array(this.segmentsT);for(e=0;e<
- this.segmentsT;++e){var p=b/this.segmentsR*2*this.p*Math.PI,m=e/this.segmentsT*2*Math.PI,h=n(p,m,this.q,this.p,this.radius,this.heightScale),p=n(p+0.01,m,this.q,this.p,this.radius,this.heightScale);c.x=p.x-h.x;c.y=p.y-h.y;c.z=p.z-h.z;f.x=p.x+h.x;f.y=p.y+h.y;f.z=p.z+h.z;k.cross(c,f);f.cross(k,c);k.normalize();f.normalize();p=-this.tube*Math.cos(m);m=this.tube*Math.sin(m);h.x+=p*f.x+m*k.x;h.y+=p*f.y+m*k.y;h.z+=p*f.z+m*k.z;this.grid[b][e]=this.vertices.push(new THREE.Vertex(new THREE.Vector3(h.x,h.y,
- h.z)))-1}}for(b=0;b<this.segmentsR;++b)for(e=0;e<this.segmentsT;++e){var f=(b+1)%this.segmentsR,k=(e+1)%this.segmentsT,h=this.grid[b][e],c=this.grid[f][e],f=this.grid[f][k],k=this.grid[b][k],m=new THREE.UV(b/this.segmentsR,e/this.segmentsT),p=new THREE.UV((b+1)/this.segmentsR,e/this.segmentsT),v=new THREE.UV((b+1)/this.segmentsR,(e+1)/this.segmentsT),w=new THREE.UV(b/this.segmentsR,(e+1)/this.segmentsT);this.faces.push(new THREE.Face4(h,c,f,k));this.faceVertexUvs[0].push([m,p,v,w])}this.computeCentroids();
- this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=new THREE.Geometry;THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;THREE.SubdivisionModifier=function(b){this.subdivisions=b===void 0?1:b;this.useOldVertexColors=!1;this.supportUVs=!0};THREE.SubdivisionModifier.prototype.constructor=THREE.SubdivisionModifier;THREE.SubdivisionModifier.prototype.modify=function(b){for(var e=this.subdivisions;e-- >0;)this.smooth(b)};
- THREE.SubdivisionModifier.prototype.smooth=function(b){function e(b,c,e,f,n,t){var p=new THREE.Face4(b,c,e,f,null,n.color,n.material);if(m.useOldVertexColors){p.vertexColors=[];for(var o,v,w,x=0;x<4;x++){w=t[x];o=new THREE.Color;o.setRGB(0,0,0);for(var y=0;y<w.length;y++)v=n.vertexColors[w[y]-1],o.r+=v.r,o.g+=v.g,o.b+=v.b;o.r/=w.length;o.g/=w.length;o.b/=w.length;p.vertexColors[x]=o}}h.push(p);(!m.supportUVs||u.length!=0)&&k.push([u[b],u[c],u[e],u[f]])}function c(b,c){return Math.min(b,c)+"_"+Math.max(b,
- c)}var f=[],h=[],k=[],m=this,n=b.vertices,f=b.faces,p=n.concat(),v=[],w={},u=[],x,t,z,y,A,E=b.faceVertexUvs[0];x=0;for(t=E.length;x<t;x++){z=0;for(y=E[x].length;z<y;z++)A=f[x]["abcd".charAt(z)],u[A]||(u[A]=E[x][z])}var F;x=0;for(t=f.length;x<t;x++)if(A=f[x],v.push(A.centroid),p.push(new THREE.Vertex(A.centroid)),m.supportUVs&&u.length!=0){F=new THREE.UV;if(A instanceof THREE.Face3)F.u=u[A.a].u+u[A.b].u+u[A.c].u,F.v=u[A.a].v+u[A.b].v+u[A.c].v,F.u/=3,F.v/=3;else if(A instanceof THREE.Face4)F.u=u[A.a].u+
- u[A.b].u+u[A.c].u+u[A.d].u,F.v=u[A.a].v+u[A.b].v+u[A.c].v+u[A.d].v,F.u/=4,F.v/=4;u.push(F)}y=function(b){function e(b,c,f){b[c]===void 0&&(b[c]=[]);b[c].push(f)}var f,k,h,m,n={};f=0;for(k=b.faces.length;f<k;f++)h=b.faces[f],h instanceof THREE.Face3?(m=c(h.a,h.b),e(n,m,f),m=c(h.b,h.c),e(n,m,f),m=c(h.c,h.a),e(n,m,f)):h instanceof THREE.Face4&&(m=c(h.a,h.b),e(n,m,f),m=c(h.b,h.c),e(n,m,f),m=c(h.c,h.d),e(n,m,f),m=c(h.d,h.a),e(n,m,f));return n}(b);var D,G,K=0,E=n.length,N;for(x in y)if(A=y[x],F=A[0],D=
- A[1],N=x.split("_"),t=N[0],N=N[1],G=new THREE.Vector3,A.length!=2?(G.addSelf(n[t].position),G.addSelf(n[N].position),G.multiplyScalar(0.5)):(G.addSelf(v[F]),G.addSelf(v[D]),G.addSelf(n[t].position),G.addSelf(n[N].position),G.multiplyScalar(0.25)),w[x]=E+f.length+K,p.push(new THREE.Vertex(G)),K++,m.supportUVs&&u.length!=0)F=new THREE.UV,F.u=u[t].u+u[N].u,F.v=u[t].v+u[N].v,F.u/=2,F.v/=2,u.push(F);x=0;for(t=v.length;x<t;x++)A=f[x],F=E+x,A instanceof THREE.Face3?(D=c(A.a,A.b),N=c(A.b,A.c),K=c(A.c,A.a),
- e(F,w[D],A.b,w[N],A,["123","12","2","23"]),e(F,w[N],A.c,w[K],A,["123","23","3","31"]),e(F,w[K],A.a,w[D],A,["123","31","1","12"])):A instanceof THREE.Face4?(D=c(A.a,A.b),N=c(A.b,A.c),K=c(A.c,A.d),G=c(A.d,A.a),e(F,w[D],A.b,w[N],A,["1234","12","2","23"]),e(F,w[N],A.c,w[K],A,["1234","23","3","34"]),e(F,w[K],A.d,w[G],A,["1234","34","4","41"]),e(F,w[G],A.a,w[D],A,["1234","41","1","12"])):console.log("face should be a face!",A);var f=p,L={},B={},p=function(b,c){L[b]===void 0&&(L[b]=[]);L[b].push(c)},w=function(b,
- c){B[b]===void 0&&(B[b]={});B[b][c]=null};for(x in y)A=y[x],N=x.split("_"),t=N[0],N=N[1],p(t,[t,N]),p(N,[t,N]),F=A[0],D=A[1],w(t,F),D?w(t,D):w(t,F),w(N,F),D?w(N,D):w(N,F);p=new THREE.Vector3;w=new THREE.Vector3;x=0;for(t=n.length;x<t;x++)if(L[x]!==void 0){p.set(0,0,0);w.set(0,0,0);y=new THREE.Vector3(0,0,0);E=0;for(z in B[x])p.addSelf(v[z]),E++;p.divideScalar(E);E=L[x].length;for(z=0;z<E;z++)A=L[x][z],A=n[A[0]].position.clone().addSelf(n[A[1]].position).divideScalar(2),w.addSelf(A);w.divideScalar(E);
- y.addSelf(n[x].position);y.multiplyScalar(E-3);y.addSelf(p);y.addSelf(w.multiplyScalar(2));y.divideScalar(E);f[x].position=y}b.vertices=f;b.faces=h;b.faceVertexUvs[0]=k;delete b.__tmpVertices;b.computeCentroids();b.computeFaceNormals();b.computeVertexNormals()};THREE.Loader=function(b){this.statusDomElement=(this.showStatus=b)?THREE.Loader.prototype.addStatusElement():null;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
- THREE.Loader.prototype={constructor:THREE.Loader,addStatusElement:function(){var b=document.createElement("div");b.style.position="absolute";b.style.right="0px";b.style.top="0px";b.style.fontSize="0.8em";b.style.textAlign="left";b.style.background="rgba(0,0,0,0.25)";b.style.color="#fff";b.style.width="120px";b.style.padding="0.5em 0.5em 0.5em 0.5em";b.style.zIndex=1E3;b.innerHTML="Loading ...";return b},updateProgress:function(b){var e="Loaded ";e+=b.total?(100*b.loaded/b.total).toFixed(0)+"%":(b.loaded/
- 1E3).toFixed(2)+" KB";this.statusDomElement.innerHTML=e},extractUrlbase:function(b){b=b.split("/");b.pop();return b.length<1?"":b.join("/")+"/"},init_materials:function(b,e,c){b.materials=[];for(var f=0;f<e.length;++f)b.materials[f]=[THREE.Loader.prototype.createMaterial(e[f],c)]},hasNormals:function(b){var e,c,f=b.materials.length;for(c=0;c<f;c++)if(e=b.materials[c][0],e instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(b,e){function c(b){b=Math.log(b)/Math.LN2;return Math.floor(b)==
- b}function f(b,e){var f=new Image;f.onload=function(){if(!c(this.width)||!c(this.height)){var e=Math.pow(2,Math.round(Math.log(this.width)/Math.LN2)),f=Math.pow(2,Math.round(Math.log(this.height)/Math.LN2));b.image.width=e;b.image.height=f;b.image.getContext("2d").drawImage(this,0,0,e,f)}else b.image=this;b.needsUpdate=!0};f.src=e}function h(b,c,k,h,m,n){var p=document.createElement("canvas");b[c]=new THREE.Texture(p);b[c].sourceFile=k;if(h){b[c].repeat.set(h[0],h[1]);if(h[0]!=1)b[c].wrapS=THREE.RepeatWrapping;
- if(h[1]!=1)b[c].wrapT=THREE.RepeatWrapping}m&&b[c].offset.set(m[0],m[1]);if(n){h={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(h[n[0]]!==void 0)b[c].wrapS=h[n[0]];if(h[n[1]]!==void 0)b[c].wrapT=h[n[1]]}f(b[c],e+"/"+k)}function k(b){return(b[0]*255<<16)+(b[1]*255<<8)+b[2]*255}var m,n,p;n="MeshLambertMaterial";m={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,wireframe:b.wireframe};b.shading&&(b.shading=="Phong"?n="MeshPhongMaterial":b.shading=="Basic"&&(n="MeshBasicMaterial"));
- if(b.blending)if(b.blending=="Additive")m.blending=THREE.AdditiveBlending;else if(b.blending=="Subtractive")m.blending=THREE.SubtractiveBlending;else if(b.blending=="Multiply")m.blending=THREE.MultiplyBlending;if(b.transparent!==void 0||b.opacity<1)m.transparent=b.transparent;if(b.depthTest!==void 0)m.depthTest=b.depthTest;if(b.vertexColors!==void 0)if(b.vertexColors=="face")m.vertexColors=THREE.FaceColors;else if(b.vertexColors)m.vertexColors=THREE.VertexColors;if(b.colorDiffuse)m.color=k(b.colorDiffuse);
- else if(b.DbgColor)m.color=b.DbgColor;if(b.colorSpecular)m.specular=k(b.colorSpecular);if(b.colorAmbient)m.ambient=k(b.colorAmbient);if(b.transparency)m.opacity=b.transparency;if(b.specularCoef)m.shininess=b.specularCoef;b.mapDiffuse&&e&&h(m,"map",b.mapDiffuse,b.mapDiffuseRepeat,b.mapDiffuseOffset,b.mapDiffuseWrap);b.mapLight&&e&&h(m,"lightMap",b.mapLight,b.mapLightRepeat,b.mapLightOffset,b.mapLightWrap);b.mapNormal&&e&&h(m,"normalMap",b.mapNormal,b.mapNormalRepeat,b.mapNormalOffset,b.mapNormalWrap);
- b.mapSpecular&&e&&h(m,"specularMap",b.mapSpecular,b.mapSpecularRepeat,b.mapSpecularOffset,b.mapSpecularWrap);if(b.mapNormal){var v=THREE.ShaderUtils.lib.normal,w=THREE.UniformsUtils.clone(v.uniforms),u=m.color;n=m.specular;p=m.ambient;var x=m.shininess;w.tNormal.texture=m.normalMap;if(b.mapNormalFactor)w.uNormalScale.value=b.mapNormalFactor;if(m.map)w.tDiffuse.texture=m.map,w.enableDiffuse.value=!0;if(m.specularMap)w.tSpecular.texture=m.specularMap,w.enableSpecular.value=!0;if(m.lightMap)w.tAO.texture=
- m.lightMap,w.enableAO.value=!0;w.uDiffuseColor.value.setHex(u);w.uSpecularColor.value.setHex(n);w.uAmbientColor.value.setHex(p);w.uShininess.value=x;if(m.opacity)w.uOpacity.value=m.opacity;m=new THREE.ShaderMaterial({fragmentShader:v.fragmentShader,vertexShader:v.vertexShader,uniforms:w,lights:!0,fog:!0})}else m=new THREE[n](m);return m}};THREE.BinaryLoader=function(b){THREE.Loader.call(this,b)};THREE.BinaryLoader.prototype=new THREE.Loader;THREE.BinaryLoader.prototype.constructor=THREE.BinaryLoader;
- THREE.BinaryLoader.prototype.supr=THREE.Loader.prototype;
- THREE.BinaryLoader.prototype.load=function(b){var e=b.model,c=b.callback,f=b.texture_path?b.texture_path:THREE.Loader.prototype.extractUrlbase(e),h=b.bin_path?b.bin_path:THREE.Loader.prototype.extractUrlbase(e),b=(new Date).getTime(),e=new Worker(e),k=this.showProgress?THREE.Loader.prototype.updateProgress:null;e.onmessage=function(b){THREE.BinaryLoader.prototype.loadAjaxBuffers(b.data.buffers,b.data.materials,c,h,f,k)};e.onerror=function(b){alert("worker.onerror: "+b.message+"\n"+b.data);b.preventDefault()};
- e.postMessage(b)};
- THREE.BinaryLoader.prototype.loadAjaxBuffers=function(b,e,c,f,h,k){var m=new XMLHttpRequest,n=f+"/"+b,p=0;m.onreadystatechange=function(){m.readyState==4?m.status==200||m.status==0?THREE.BinaryLoader.prototype.createBinModel(m.responseText,c,h,e):alert("Couldn't load ["+n+"] ["+m.status+"]"):m.readyState==3?k&&(p==0&&(p=m.getResponseHeader("Content-Length")),k({total:p,loaded:m.responseText.length})):m.readyState==2&&(p=m.getResponseHeader("Content-Length"))};m.open("GET",n,!0);m.overrideMimeType("text/plain; charset=x-user-defined");
- m.setRequestHeader("Content-Type","text/plain");m.send(null)};
- THREE.BinaryLoader.prototype.createBinModel=function(b,e,c,f){var h=function(c){function e(b,c){var f=w(b,c),h=w(b,c+1),k=w(b,c+2),m=w(b,c+3),n=(m<<1&255|k>>7)-127;f|=(k&127)<<16|h<<8;if(f==0&&n==-127)return 0;return(1-2*(m>>7))*(1+f*Math.pow(2,-23))*Math.pow(2,n)}function h(b,c){var e=w(b,c),f=w(b,c+1),k=w(b,c+2);return(w(b,c+3)<<24)+(k<<16)+(f<<8)+e}function p(b,c){var e=w(b,c);return(w(b,c+1)<<8)+e}function v(b,c){var e=w(b,c);return e>127?e-256:e}function w(b,c){return b.charCodeAt(c)&255}function u(c){var e,
- f,k;e=h(b,c);f=h(b,c+N);k=h(b,c+L);c=p(b,c+B);E.faces.push(new THREE.Face3(e,f,k,null,null,E.materials[c]))}function x(c){var e,f,k,m,o,t;e=h(b,c);f=h(b,c+N);k=h(b,c+L);m=p(b,c+B);o=h(b,c+M);t=h(b,c+U);c=h(b,c+I);m=E.materials[m];var u=G[t*3],v=G[t*3+1];t=G[t*3+2];var w=G[c*3],x=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face3(e,f,k,[new THREE.Vector3(G[o*3],G[o*3+1],G[o*3+2]),new THREE.Vector3(u,v,t),new THREE.Vector3(w,x,c)],null,m))}function t(c){var e,f,k,m;e=h(b,c);f=h(b,c+S);k=h(b,c+Q);m=h(b,
- c+Y);c=p(b,c+W);E.faces.push(new THREE.Face4(e,f,k,m,null,null,E.materials[c]))}function z(c){var e,f,k,m,t,u,v,w;e=h(b,c);f=h(b,c+S);k=h(b,c+Q);m=h(b,c+Y);t=p(b,c+W);u=h(b,c+o);v=h(b,c+$);w=h(b,c+T);c=h(b,c+ha);t=E.materials[t];var x=G[v*3],y=G[v*3+1];v=G[v*3+2];var H=G[w*3],A=G[w*3+1];w=G[w*3+2];var z=G[c*3],B=G[c*3+1],c=G[c*3+2];E.faces.push(new THREE.Face4(e,f,k,m,[new THREE.Vector3(G[u*3],G[u*3+1],G[u*3+2]),new THREE.Vector3(x,y,v),new THREE.Vector3(H,A,w),new THREE.Vector3(z,B,c)],null,t))}
- function y(c){var e,f,k,m;e=h(b,c);f=h(b,c+fa);k=h(b,c+oa);c=K[e*2];m=K[e*2+1];e=K[f*2];var o=E.faceVertexUvs[0];f=K[f*2+1];var p=K[k*2];k=K[k*2+1];var t=[];t.push(new THREE.UV(c,m));t.push(new THREE.UV(e,f));t.push(new THREE.UV(p,k));o.push(t)}function A(c){var e,f,k,m,o,p;e=h(b,c);f=h(b,c+ca);k=h(b,c+ja);m=h(b,c+la);c=K[e*2];o=K[e*2+1];e=K[f*2];p=K[f*2+1];f=K[k*2];var t=E.faceVertexUvs[0];k=K[k*2+1];var u=K[m*2];m=K[m*2+1];var v=[];v.push(new THREE.UV(c,o));v.push(new THREE.UV(e,p));v.push(new THREE.UV(f,
- k));v.push(new THREE.UV(u,m));t.push(v)}var E=this,F=0,D,G=[],K=[],N,L,B,M,U,I,S,Q,Y,W,o,$,T,ha,fa,oa,ca,ja,la,da,X,V,aa,ia,ra;THREE.Geometry.call(this);THREE.Loader.prototype.init_materials(E,f,c);D={signature:b.substr(F,8),header_bytes:w(b,F+8),vertex_coordinate_bytes:w(b,F+9),normal_coordinate_bytes:w(b,F+10),uv_coordinate_bytes:w(b,F+11),vertex_index_bytes:w(b,F+12),normal_index_bytes:w(b,F+13),uv_index_bytes:w(b,F+14),material_index_bytes:w(b,F+15),nvertices:h(b,F+16),nnormals:h(b,F+16+4),nuvs:h(b,
- F+16+8),ntri_flat:h(b,F+16+12),ntri_smooth:h(b,F+16+16),ntri_flat_uv:h(b,F+16+20),ntri_smooth_uv:h(b,F+16+24),nquad_flat:h(b,F+16+28),nquad_smooth:h(b,F+16+32),nquad_flat_uv:h(b,F+16+36),nquad_smooth_uv:h(b,F+16+40)};F+=D.header_bytes;N=D.vertex_index_bytes;L=D.vertex_index_bytes*2;B=D.vertex_index_bytes*3;M=D.vertex_index_bytes*3+D.material_index_bytes;U=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes;I=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*2;S=D.vertex_index_bytes;
- Q=D.vertex_index_bytes*2;Y=D.vertex_index_bytes*3;W=D.vertex_index_bytes*4;o=D.vertex_index_bytes*4+D.material_index_bytes;$=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes;T=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*2;ha=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*3;fa=D.uv_index_bytes;oa=D.uv_index_bytes*2;ca=D.uv_index_bytes;ja=D.uv_index_bytes*2;la=D.uv_index_bytes*3;c=D.vertex_index_bytes*3+D.material_index_bytes;ra=D.vertex_index_bytes*
- 4+D.material_index_bytes;da=D.ntri_flat*c;X=D.ntri_smooth*(c+D.normal_index_bytes*3);V=D.ntri_flat_uv*(c+D.uv_index_bytes*3);aa=D.ntri_smooth_uv*(c+D.normal_index_bytes*3+D.uv_index_bytes*3);ia=D.nquad_flat*ra;c=D.nquad_smooth*(ra+D.normal_index_bytes*4);ra=D.nquad_flat_uv*(ra+D.uv_index_bytes*4);F+=function(c){for(var f,k,h,n=D.vertex_coordinate_bytes*3,o=c+D.nvertices*n;c<o;c+=n)f=e(b,c),k=e(b,c+D.vertex_coordinate_bytes),h=e(b,c+D.vertex_coordinate_bytes*2),E.vertices.push(new THREE.Vertex(new THREE.Vector3(f,
- k,h)));return D.nvertices*n}(F);F+=function(c){for(var e,f,k,h=D.normal_coordinate_bytes*3,m=c+D.nnormals*h;c<m;c+=h)e=v(b,c),f=v(b,c+D.normal_coordinate_bytes),k=v(b,c+D.normal_coordinate_bytes*2),G.push(e/127,f/127,k/127);return D.nnormals*h}(F);F+=function(c){for(var f,k,h=D.uv_coordinate_bytes*2,n=c+D.nuvs*h;c<n;c+=h)f=e(b,c),k=e(b,c+D.uv_coordinate_bytes),K.push(f,k);return D.nuvs*h}(F);da=F+da;X=da+X;V=X+V;aa=V+aa;ia=aa+ia;c=ia+c;ra=c+ra;(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,
- f=e+D.uv_index_bytes*3,k=b+D.ntri_flat_uv*f;for(c=b;c<k;c+=f)u(c),y(c+e);return k-b})(X);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=e+D.uv_index_bytes*3,k=b+D.ntri_smooth_uv*f;for(c=b;c<k;c+=f)x(c),y(c+e);return k-b})(V);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=e+D.uv_index_bytes*4,k=b+D.nquad_flat_uv*f;for(c=b;c<k;c+=f)t(c),A(c+e);return k-b})(c);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*
- 4,f=e+D.uv_index_bytes*4,k=b+D.nquad_smooth_uv*f;for(c=b;c<k;c+=f)z(c),A(c+e);return k-b})(ra);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes,f=b+D.ntri_flat*e;for(c=b;c<f;c+=e)u(c);return f-b})(F);(function(b){var c,e=D.vertex_index_bytes*3+D.material_index_bytes+D.normal_index_bytes*3,f=b+D.ntri_smooth*e;for(c=b;c<f;c+=e)x(c);return f-b})(da);(function(b){var c,e=D.vertex_index_bytes*4+D.material_index_bytes,f=b+D.nquad_flat*e;for(c=b;c<f;c+=e)t(c);return f-b})(aa);(function(b){var c,
- e=D.vertex_index_bytes*4+D.material_index_bytes+D.normal_index_bytes*4,f=b+D.nquad_smooth*e;for(c=b;c<f;c+=e)z(c);return f-b})(ia);this.computeCentroids();this.computeFaceNormals();THREE.Loader.prototype.hasNormals(this)&&this.computeTangents()};h.prototype=new THREE.Geometry;h.prototype.constructor=h;e(new h(c))};
- THREE.ColladaLoader=function(){function b(b,f,h){X=b;f=f||ia;h!==void 0&&(b=h.split("/"),b.pop(),Ea=b.length<1?"":b.join("/")+"/");ma=e("//dae:library_images/dae:image",m,"image");xa=e("//dae:library_materials/dae:material",B,"material");Ca=e("//dae:library_effects/dae:effect",Q,"effect");qa=e("//dae:library_geometries/dae:geometry",A,"geometry");na=e("//dae:library_controllers/dae:controller",n,"controller");ga=e("//dae:library_animations/dae:animation",W,"animation");Fa=e(".//dae:library_visual_scenes/dae:visual_scene",
- w,"visual_scene");Da=[];Ga=[];(b=X.evaluate(".//dae:scene/dae:instance_visual_scene",X,ha,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())?(b=b.getAttribute("url").replace(/^#/,""),aa=Fa[b]):aa=null;V=new THREE.Object3D;for(b=0;b<aa.nodes.length;b++)V.add(k(aa.nodes[b]));c();for(var o in ga);o={scene:V,morphs:Da,skins:Ga,dae:{images:ma,materials:xa,effects:Ca,geometries:qa,controllers:na,animations:ga,visualScenes:Fa,scene:aa}};f&&f(o);return o}function e(b,c,e){for(var b=X.evaluate(b,
- X,ha,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),f={},k=b.iterateNext(),h=0;k;){k=(new c).parse(k);if(k.id.length==0)k.id=e+h++;f[k.id]=k;k=b.iterateNext()}return f}function c(){var b=1E6,c=-b,e=0,f;for(f in ga)for(var k=ga[f],h=0;h<k.sampler.length;h++){var m=k.sampler[h];m.create();b=Math.min(b,m.startTime);c=Math.max(c,m.endTime);e=Math.max(e,m.input.length)}return{start:b,end:c,frames:e}}function f(b,c,e,k){b.world=b.world||new THREE.Matrix4;b.world.copy(b.matrix);if(b.channels&&b.channels.length){var h=
- b.channels[0].sampler.output[e];h instanceof THREE.Matrix4&&b.world.copy(h)}k&&b.world.multiply(k,b.world);c.push(b);for(k=0;k<b.nodes.length;k++)f(b.nodes[k],c,e,b.world)}function h(b,e,k){var h=na[e.url];if(!h||!h.skin)console.log("ColladaLoader: Could not find skin controller.");else if(!e.skeleton||!e.skeleton.length)console.log("ColladaLoader: Could not find the skeleton for the skin. ");else{var m=c(),e=aa.getChildById(e.skeleton[0],!0)||aa.getChildBySid(e.skeleton[0],!0),n,o,p,t,u=new THREE.Vector3,
- v;for(n=0;n<b.vertices.length;n++)h.skin.bindShapeMatrix.multiplyVector3(b.vertices[n].position);for(k=0;k<m.frames;k++){var w=[],x=[];for(n=0;n<b.vertices.length;n++)x.push(new THREE.Vertex(new THREE.Vector3));f(e,w,k);n=w;o=h.skin;for(t=0;t<n.length;t++)if(p=n[t],v=-1,p.type=="JOINT"){for(var y=0;y<o.joints.length;y++)if(p.sid==o.joints[y]){v=y;break}if(v>=0){y=o.invBindMatrices[v];p.invBindMatrix=y;p.skinningMatrix=new THREE.Matrix4;p.skinningMatrix.multiply(p.world,y);p.weights=[];for(y=0;y<o.weights.length;y++)for(var A=
- 0;A<o.weights[y].length;A++){var z=o.weights[y][A];z.joint==v&&p.weights.push(z)}}else throw"ColladaLoader: Could not find joint '"+p.sid+"'.";}for(n=0;n<w.length;n++)if(w[n].type=="JOINT")for(o=0;o<w[n].weights.length;o++)p=w[n].weights[o],t=p.index,p=p.weight,v=b.vertices[t],t=x[t],u.x=v.position.x,u.y=v.position.y,u.z=v.position.z,w[n].skinningMatrix.multiplyVector3(u),t.position.x+=u.x*p,t.position.y+=u.y*p,t.position.z+=u.z*p;b.morphTargets.push({name:"target_"+k,vertices:x})}}}function k(b){var c=
- new THREE.Object3D,e,f,m;c.name=b.id||"";c.matrixAutoUpdate=!1;c.matrix=b.matrix;for(m=0;m<b.controllers.length;m++){var n=na[b.controllers[m].url];switch(n.type){case "skin":if(qa[n.skin.source]){var o=new y;o.url=n.skin.source;o.instance_material=b.controllers[m].instance_material;b.geometries.push(o);e=b.controllers[m]}else if(na[n.skin.source]&&(f=n=na[n.skin.source],n.morph&&qa[n.morph.source]))o=new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o);
- break;case "morph":if(qa[n.morph.source])o=new y,o.url=n.morph.source,o.instance_material=b.controllers[m].instance_material,b.geometries.push(o),f=b.controllers[m];console.log("ColladaLoader: Morph-controller partially supported.")}}for(m=0;m<b.geometries.length;m++){var n=b.geometries[m],o=n.instance_material,n=qa[n.url],p={},u=0,v;if(n&&n.mesh&&n.mesh.primitives){if(c.name.length==0)c.name=n.id;if(o)for(j=0;j<o.length;j++){v=o[j];var w=Ca[xa[v.target].instance_effect.url].shader;w.material.opacity=
- !w.material.opacity?1:w.material.opacity;v=p[v.symbol]=w.material;u++}o=v||new THREE.MeshLambertMaterial({color:14540253,shading:THREE.FlatShading});n=n.mesh.geometry3js;if(u>1){o=new THREE.MeshFaceMaterial;for(j=0;j<n.faces.length;j++)u=n.faces[j],u.materials=[p[u.daeMaterial]]}if(e!==void 0)h(n,e),o.morphTargets=!0,o=new THREE.SkinnedMesh(n,o),o.skeleton=e.skeleton,o.skinController=na[e.url],o.skinInstanceController=e,o.name="skin_"+Ga.length,Ga.push(o);else if(f!==void 0){p=n;u=f instanceof t?
- na[f.url]:f;if(!u||!u.morph)console.log("could not find morph controller!");else{u=u.morph;for(w=0;w<u.targets.length;w++){var x=qa[u.targets[w]];if(x.mesh&&x.mesh.primitives&&x.mesh.primitives.length)x=x.mesh.primitives[0].geometry,x.vertices.length===p.vertices.length&&p.morphTargets.push({name:"target_1",vertices:x.vertices})}p.morphTargets.push({name:"target_Z",vertices:p.vertices})}o.morphTargets=!0;o=new THREE.Mesh(n,o);o.name="morph_"+Da.length;Da.push(o)}else o=new THREE.Mesh(n,o);c.add(o)}}for(m=
- 0;m<b.nodes.length;m++)c.add(k(b.nodes[m],b));return c}function m(){this.init_from=this.id=""}function n(){this.type=this.name=this.id="";this.morph=this.skin=null}function p(){this.weights=this.targets=this.source=this.method=null}function v(){this.source="";this.bindShapeMatrix=null;this.invBindMatrices=[];this.joints=[];this.weights=[]}function w(){this.name=this.id="";this.nodes=[];this.scene=new THREE.Object3D}function u(){this.sid=this.name=this.id="";this.nodes=[];this.controllers=[];this.transforms=
- [];this.geometries=[];this.channels=[];this.matrix=new THREE.Matrix4}function x(){this.type=this.sid="";this.data=[];this.matrix=new THREE.Matrix4}function t(){this.url="";this.skeleton=[];this.instance_material=[]}function z(){this.target=this.symbol=""}function y(){this.url="";this.instance_material=[]}function A(){this.id="";this.mesh=null}function E(b){this.geometry=b.id;this.primitives=[];this.geometry3js=this.vertices=null}function F(){}function D(){this.material="";this.count=0;this.inputs=
- [];this.vcount=null;this.p=[];this.geometry=new THREE.Geometry}function G(){this.source="";this.stride=this.count=0;this.params=[]}function K(){this.input={}}function N(){this.semantic="";this.offset=0;this.source="";this.set=0}function L(b){this.id=b;this.type=null}function B(){this.name=this.id="";this.instance_effect=null}function M(){this.color=new THREE.Color(0);this.color.setRGB(Math.random(),Math.random(),Math.random());this.color.a=1;this.texcoord=this.texture=null}function U(b,c){this.type=
- b;this.effect=c;this.material=null}function I(b){this.effect=b;this.format=this.init_from=null}function S(b){this.effect=b;this.mipfilter=this.magfilter=this.minfilter=this.wrap_t=this.wrap_s=this.source=null}function Q(){this.name=this.id="";this.sampler=this.surface=this.shader=null}function Y(){this.url=""}function W(){this.name=this.id="";this.source={};this.sampler=[];this.channel=[]}function o(b){this.animation=b;this.target=this.source="";this.member=this.arrIndices=this.arrSyntax=this.dotSyntax=
- this.sid=null}function $(b){this.id="";this.animation=b;this.inputs=[];this.endTime=this.startTime=this.interpolation=this.output=this.input=null;this.duration=0}function T(b){var c=b.getAttribute("id");if(ra[c]!=void 0)return ra[c];ra[c]=(new L(c)).parse(b);return ra[c]}function ha(b){if(b=="dae")return"http://www.collada.org/2005/11/COLLADASchema";return null}function fa(b){for(var b=ca(b),c=[],e=0;e<b.length;e++)c.push(parseFloat(b[e]));return c}function oa(b){for(var b=ca(b),c=[],e=0;e<b.length;e++)c.push(parseInt(b[e],
- 10));return c}function ca(b){return b.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s+/)}function ja(b,c,e){return b.hasAttribute(c)?parseInt(b.getAttribute(c),10):e}function la(b,c){if(b===void 0){for(var e="0.";e.length<c+2;)e+="0";return e}c=c||2;e=b.toString().split(".");for(e[1]=e.length>1?e[1].substr(0,c):"0";e[1].length<c;)e[1]+="0";return e.join(".")}function da(b,c){var e="";e+=la(b.x,c)+",";e+=la(b.y,c)+",";e+=la(b.z,c);return e}var X=null,V=null,aa,ia=null,ra={},ma={},ga={},na={},qa={},
- xa={},Ca={},Fa,Ea,Da,Ga,ya=THREE.SmoothShading;m.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="init_from")this.init_from=e.textContent}return this};n.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.type="none";for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "skin":this.skin=(new v).parse(e);this.type=e.nodeName;break;case "morph":this.morph=
- (new p).parse(e),this.type=e.nodeName}}return this};p.prototype.parse=function(b){var c={},e=[],f;this.method=b.getAttribute("method");this.source=b.getAttribute("source").replace(/^#/,"");for(f=0;f<b.childNodes.length;f++){var k=b.childNodes[f];if(k.nodeType==1)switch(k.nodeName){case "source":k=(new L).parse(k);c[k.id]=k;break;case "targets":e=this.parseInputs(k);break;default:console.log(k.nodeName)}}for(f=0;f<e.length;f++)switch(b=e[f],k=c[b.source],b.semantic){case "MORPH_TARGET":this.targets=
- k.read();break;case "MORPH_WEIGHT":this.weights=k.read()}return this};p.prototype.parseInputs=function(b){for(var c=[],e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":c.push((new N).parse(f))}}return c};v.prototype.parse=function(b){var c={},e,f;this.source=b.getAttribute("source").replace(/^#/,"");this.invBindMatrices=[];this.joints=[];this.weights=[];for(var k=0;k<b.childNodes.length;k++){var h=b.childNodes[k];if(h.nodeType==1)switch(h.nodeName){case "bind_shape_matrix":h=
- fa(h.textContent);this.bindShapeMatrix=new THREE.Matrix4;this.bindShapeMatrix.set(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]);break;case "source":h=(new L).parse(h);c[h.id]=h;break;case "joints":e=h;break;case "vertex_weights":f=h;break;default:console.log(h.nodeName)}}this.parseJoints(e,c);this.parseWeights(f,c);return this};v.prototype.parseJoints=function(b,c){for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "input":var f=
- (new N).parse(f),k=c[f.source];if(f.semantic=="JOINT")this.joints=k.read();else if(f.semantic=="INV_BIND_MATRIX")this.invBindMatrices=k.read()}}};v.prototype.parseWeights=function(b,c){for(var e,f,k=[],h=0;h<b.childNodes.length;h++){var m=b.childNodes[h];if(m.nodeType==1)switch(m.nodeName){case "input":k.push((new N).parse(m));break;case "v":e=oa(m.textContent);break;case "vcount":f=oa(m.textContent)}}for(h=m=0;h<f.length;h++){for(var n=f[h],o=[],p=0;p<n;p++){for(var t={},u=0;u<k.length;u++){var v=
- k[u],w=e[m+v.offset];switch(v.semantic){case "JOINT":t.joint=w;break;case "WEIGHT":t.weight=c[v.source].data[w]}}o.push(t);m+=k.length}for(p=0;p<o.length;p++)o[p].index=h;this.weights.push(o)}};w.prototype.getChildById=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};w.prototype.getChildBySid=function(b,c){for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};w.prototype.parse=function(b){this.id=
- b.getAttribute("id");this.name=b.getAttribute("name");this.nodes=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "node":this.nodes.push((new u).parse(e))}}return this};u.prototype.getChannelForTransform=function(b){for(var c=0;c<this.channels.length;c++){var e=this.channels[c],f=e.target.split("/");f.shift();var k=f.shift(),h=k.indexOf(".")>=0,m=k.indexOf("(")>=0,n;if(h)f=k.split("."),k=f.shift(),f.shift();else if(m){n=k.split("(");k=n.shift();
- for(f=0;f<n.length;f++)n[f]=parseInt(n[f].replace(/\)/,""))}if(k==b)return e.info={sid:k,dotSyntax:h,arrSyntax:m,arrIndices:n},e}return null};u.prototype.getChildById=function(b,c){if(this.id==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildById(b,c);if(f)return f}return null};u.prototype.getChildBySid=function(b,c){if(this.sid==b)return this;if(c)for(var e=0;e<this.nodes.length;e++){var f=this.nodes[e].getChildBySid(b,c);if(f)return f}return null};u.prototype.getTransformBySid=
- function(b){for(var c=0;c<this.transforms.length;c++)if(this.transforms[c].sid==b)return this.transforms[c];return null};u.prototype.parse=function(b){var c;this.id=b.getAttribute("id");this.sid=b.getAttribute("sid");this.name=b.getAttribute("name");this.type=b.getAttribute("type");this.type=this.type=="JOINT"?this.type:"NODE";this.nodes=[];this.transforms=[];this.geometries=[];this.controllers=[];this.matrix=new THREE.Matrix4;for(var e=0;e<b.childNodes.length;e++)if(c=b.childNodes[e],c.nodeType==
- 1)switch(c.nodeName){case "node":this.nodes.push((new u).parse(c));break;case "instance_camera":break;case "instance_controller":this.controllers.push((new t).parse(c));break;case "instance_geometry":this.geometries.push((new y).parse(c));break;case "instance_light":break;case "instance_node":c=c.getAttribute("url").replace(/^#/,"");(c=X.evaluate(".//dae:library_nodes//dae:node[@id='"+c+"']",X,ha,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null).iterateNext())&&this.nodes.push((new u).parse(c));break;
- case "rotate":case "translate":case "scale":case "matrix":case "lookat":case "skew":this.transforms.push((new x).parse(c));break;case "extra":break;default:console.log(c.nodeName)}b=[];e=1E6;c=-1E6;for(var f in ga)for(var k=ga[f],h=0;h<k.channel.length;h++){var m=k.channel[h],n=k.sampler[h];f=m.target.split("/")[0];if(f==this.id)n.create(),m.sampler=n,e=Math.min(e,n.startTime),c=Math.max(c,n.endTime),b.push(m)}if(b.length)this.startTime=e,this.endTime=c;if((this.channels=b)&&this.channels.length){f=
- 1E7;for(i=0;i<this.channels.length;i++){b=this.channels[i].sampler;for(e=0;e<b.input.length-1;e++)f=Math.min(f,b.input[e+1]-b.input[e])}e=[];for(b=this.startTime;b<this.endTime;b+=f){c=b;for(var k={},o=h=void 0,h=0;h<this.channels.length;h++)o=this.channels[h],k[o.sid]=o;m=new THREE.Matrix4;for(h=0;h<this.transforms.length;h++)if(n=this.transforms[h],o=k[n.sid],o!==void 0){for(var p=o.sampler,v,o=0;o<p.input.length-1;o++)if(p.input[o+1]>c){v=p.output[o];break}m=v!==void 0?v instanceof THREE.Matrix4?
- m.multiply(m,v):m.multiply(m,n.matrix):m.multiply(m,n.matrix)}else m=m.multiply(m,n.matrix);c=m;e.push({time:b,pos:[c.n14,c.n24,c.n34],rotq:[0,0,0,1],scl:[1,1,1]})}this.keys=e}this.updateMatrix();return this};u.prototype.updateMatrix=function(){this.matrix.identity();for(var b=0;b<this.transforms.length;b++)this.matrix.multiply(this.matrix,this.transforms[b].matrix)};x.prototype.parse=function(b){this.sid=b.getAttribute("sid");this.type=b.nodeName;this.data=fa(b.textContent);this.updateMatrix();return this};
- x.prototype.updateMatrix=function(){var b=0;this.matrix.identity();switch(this.type){case "matrix":this.matrix.set(this.data[0],this.data[1],this.data[2],this.data[3],this.data[4],this.data[5],this.data[6],this.data[7],this.data[8],this.data[9],this.data[10],this.data[11],this.data[12],this.data[13],this.data[14],this.data[15]);break;case "translate":this.matrix.setTranslation(this.data[0],this.data[1],this.data[2]);break;case "rotate":b=this.data[3]*(Math.PI/180);this.matrix.setRotationAxis(new THREE.Vector3(this.data[0],
- this.data[1],this.data[2]),b);break;case "scale":this.matrix.setScale(this.data[0],this.data[1],this.data[2])}return this.matrix};t.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.skeleton=[];this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "skeleton":this.skeleton.push(e.textContent.replace(/^#/,""));break;case "bind_material":if(e=X.evaluate(".//dae:instance_material",e,ha,XPathResult.ORDERED_NODE_ITERATOR_TYPE,
- null))for(var f=e.iterateNext();f;)this.instance_material.push((new z).parse(f)),f=e.iterateNext()}}return this};z.prototype.parse=function(b){this.symbol=b.getAttribute("symbol");this.target=b.getAttribute("target").replace(/^#/,"");return this};y.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");this.instance_material=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1&&e.nodeName=="bind_material"){if(b=X.evaluate(".//dae:instance_material",
- e,ha,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null))for(c=b.iterateNext();c;)this.instance_material.push((new z).parse(c)),c=b.iterateNext();break}}return this};A.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "mesh":this.mesh=(new E(this)).parse(e)}}return this};E.prototype.parse=function(b){function c(b,e){var f=da(b.position);k[f]===void 0&&(k[f]={v:b,index:e});return k[f]}this.primitives=[];var e;for(e=
- 0;e<b.childNodes.length;e++){var f=b.childNodes[e];switch(f.nodeName){case "source":T(f);break;case "vertices":this.vertices=(new K).parse(f);break;case "triangles":this.primitives.push((new D).parse(f));break;case "polygons":console.warn("polygon holes not yet supported!");case "polylist":this.primitives.push((new F).parse(f))}}var k={};this.geometry3js=new THREE.Geometry;f=ra[this.vertices.input.POSITION.source].data;for(b=e=0;e<f.length;e+=3,b++){var h=new THREE.Vertex(new THREE.Vector3(f[e],f[e+
- 1],f[e+2]));c(h,b);this.geometry3js.vertices.push(h)}for(e=0;e<this.primitives.length;e++)primitive=this.primitives[e],primitive.setVertices(this.vertices),this.handlePrimitive(primitive,this.geometry3js,k);this.geometry3js.computeCentroids();this.geometry3js.computeFaceNormals();this.geometry3js.computeVertexNormals();this.geometry3js.computeBoundingBox();return this};E.prototype.handlePrimitive=function(b,c,e){var f=0,k,h,m=b.p,n=b.inputs,o,p,t,u=0,v=3,w=[];for(k=0;k<n.length;k++)switch(o=n[k],
- o.semantic){case "TEXCOORD":w.push(o.set)}for(;f<m.length;){var x=[],y=[],A={},z=[];b.vcount&&(v=b.vcount[u++]);for(k=0;k<v;k++)for(h=0;h<n.length;h++)switch(o=n[h],source=ra[o.source],p=m[f+k*n.length+o.offset],numParams=source.accessor.params.length,t=p*numParams,o.semantic){case "VERTEX":o=da(c.vertices[p].position);x.push(e[o].index);break;case "NORMAL":y.push(new THREE.Vector3(source.data[t],source.data[t+1],source.data[t+2]));break;case "TEXCOORD":A[o.set]===void 0&&(A[o.set]=[]);A[o.set].push(new THREE.UV(source.data[t],
- source.data[t+1]));break;case "COLOR":z.push((new THREE.Color).setRGB(source.data[t],source.data[t+1],source.data[t+2]))}var B;v==3?B=new THREE.Face3(x[0],x[1],x[2],[y[0],y[1],y[2]],z.length?z:new THREE.Color):v==4&&(B=new THREE.Face4(x[0],x[1],x[2],x[3],[y[0],y[1],y[2],y[3]],z.length?z:new THREE.Color));B.daeMaterial=b.material;c.faces.push(B);for(h=0;h<w.length;h++)k=A[w[h]],c.faceVertexUvs[h].push([k[0],k[1],k[2]]);f+=n.length*v}};F.prototype=new D;F.prototype.constructor=F;D.prototype.setVertices=
- function(b){for(var c=0;c<this.inputs.length;c++)if(this.inputs[c].source==b.id)this.inputs[c].source=b.input.POSITION.source};D.prototype.parse=function(b){this.inputs=[];this.material=b.getAttribute("material");this.count=ja(b,"count",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "input":this.inputs.push((new N).parse(b.childNodes[c]));break;case "vcount":this.vcount=oa(e.textContent);break;case "p":this.p=oa(e.textContent)}}return this};G.prototype.parse=
- function(b){this.params=[];this.source=b.getAttribute("source");this.count=ja(b,"count",0);this.stride=ja(b,"stride",0);for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeName=="param"){var f={};f.name=e.getAttribute("name");f.type=e.getAttribute("type");this.params.push(f)}}return this};K.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++)b.childNodes[c].nodeName=="input"&&(input=(new N).parse(b.childNodes[c]),this.input[input.semantic]=
- input);return this};N.prototype.parse=function(b){this.semantic=b.getAttribute("semantic");this.source=b.getAttribute("source").replace(/^#/,"");this.set=ja(b,"set",-1);this.offset=ja(b,"offset",0);if(this.semantic=="TEXCOORD"&&this.set<0)this.set=0;return this};L.prototype.parse=function(b){this.id=b.getAttribute("id");for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];switch(e.nodeName){case "bool_array":for(var f=ca(e.textContent),k=[],h=0;h<f.length;h++)k.push(f[h]=="true"||f[h]=="1"?
- !0:!1);this.data=k;this.type=e.nodeName;break;case "float_array":this.data=fa(e.textContent);this.type=e.nodeName;break;case "int_array":this.data=oa(e.textContent);this.type=e.nodeName;break;case "IDREF_array":case "Name_array":this.data=ca(e.textContent);this.type=e.nodeName;break;case "technique_common":for(f=0;f<e.childNodes.length;f++)if(e.childNodes[f].nodeName=="accessor"){this.accessor=(new G).parse(e.childNodes[f]);break}}}return this};L.prototype.read=function(){var b=[],c=this.accessor.params[0];
- switch(c.type){case "IDREF":case "Name":case "name":case "float":return this.data;case "float4x4":for(c=0;c<this.data.length;c+=16){var e=this.data.slice(c,c+16),f=new THREE.Matrix4;f.set(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);b.push(f)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+c.type+".")}return b};B.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");for(var c=0;c<b.childNodes.length;c++)if(b.childNodes[c].nodeName==
- "instance_effect"){this.instance_effect=(new Y).parse(b.childNodes[c]);break}return this};M.prototype.isColor=function(){return this.texture==null};M.prototype.isTexture=function(){return this.texture!=null};M.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "color":e=fa(e.textContent);this.color=new THREE.Color(0);this.color.setRGB(e[0],e[1],e[2]);this.color.a=e[3];break;case "texture":this.texture=e.getAttribute("texture"),
- this.texcoord=e.getAttribute("texcoord")}}return this};U.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "ambient":case "emission":case "diffuse":case "specular":case "transparent":this[e.nodeName]=(new M).parse(e);break;case "shininess":case "reflectivity":case "transparency":var f;f=X.evaluate(".//dae:float",e,ha,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);for(var k=f.iterateNext(),h=[];k;)h.push(k),k=f.iterateNext();
- f=h;f.length>0&&(this[e.nodeName]=parseFloat(f[0].textContent))}}this.create();return this};U.prototype.create=function(){var b={},c=this.transparency!==void 0&&this.transparency<1,e;for(e in this)switch(e){case "ambient":case "emission":case "diffuse":case "specular":var f=this[e];if(f instanceof M)if(f.isTexture()){if(this.effect.sampler&&this.effect.surface&&this.effect.sampler.source==this.effect.surface.sid&&(f=ma[this.effect.surface.init_from]))b.map=THREE.ImageUtils.loadTexture(Ea+f.init_from),
- b.map.wrapS=THREE.RepeatWrapping,b.map.wrapT=THREE.RepeatWrapping,b.map.repeat.x=1,b.map.repeat.y=-1}else e=="diffuse"?b.color=f.color.getHex():c||(b[e]=f.color.getHex());break;case "shininess":case "reflectivity":b[e]=this[e];break;case "transparency":if(c)b.transparent=!0,b.opacity=this[e],c=!0}b.shading=ya;return this.material=new THREE.MeshLambertMaterial(b)};I.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "init_from":this.init_from=
- e.textContent;break;case "format":this.format=e.textContent;break;default:console.log("unhandled Surface prop: "+e.nodeName)}}return this};S.prototype.parse=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":this.source=e.textContent;break;case "minfilter":this.minfilter=e.textContent;break;case "magfilter":this.magfilter=e.textContent;break;case "mipfilter":this.mipfilter=e.textContent;break;case "wrap_s":this.wrap_s=e.textContent;
- break;case "wrap_t":this.wrap_t=e.textContent;break;default:console.log("unhandled Sampler2D prop: "+e.nodeName)}}return this};Q.prototype.create=function(){if(this.shader==null)return null};Q.prototype.parse=function(b){this.id=b.getAttribute("id");this.name=b.getAttribute("name");this.shader=null;for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(e))}}return this};Q.prototype.parseNewparam=
- function(b){for(var c=b.getAttribute("sid"),e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "surface":this.surface=(new I(this)).parse(f);this.surface.sid=c;break;case "sampler2D":this.sampler=(new S(this)).parse(f);this.sampler.sid=c;break;case "extra":break;default:console.log(f.nodeName)}}};Q.prototype.parseProfileCOMMON=function(b){for(var c,e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if(f.nodeType==1)switch(f.nodeName){case "profile_COMMON":this.parseProfileCOMMON(f);
- break;case "technique":c=f;break;case "newparam":this.parseNewparam(f);break;case "extra":break;default:console.log(f.nodeName)}}return c};Q.prototype.parseTechnique=function(b){for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "lambert":case "blinn":case "phong":this.shader=(new U(e.nodeName,this)).parse(e)}}};Y.prototype.parse=function(b){this.url=b.getAttribute("url").replace(/^#/,"");return this};W.prototype.parse=function(b){this.id=b.getAttribute("id");
- this.name=b.getAttribute("name");this.source={};for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "source":e=(new L).parse(e);this.source[e.id]=e;break;case "sampler":this.sampler.push((new $(this)).parse(e));break;case "channel":this.channel.push((new o(this)).parse(e))}}return this};o.prototype.parse=function(b){this.source=b.getAttribute("source").replace(/^#/,"");this.target=b.getAttribute("target");var c=this.target.split("/");c.shift();var b=
- c.shift(),e=b.indexOf(".")>=0,f=b.indexOf("(")>=0,k,h;if(e)c=b.split("."),b=c.shift(),h=c.shift();else if(f){k=b.split("(");b=k.shift();for(c=0;c<k.length;c++)k[c]=parseInt(k[c].replace(/\)/,""))}this.sid=b;this.dotSyntax=e;this.arrSyntax=f;this.arrIndices=k;this.member=h;return this};$.prototype.parse=function(b){this.id=b.getAttribute("id");this.inputs=[];for(var c=0;c<b.childNodes.length;c++){var e=b.childNodes[c];if(e.nodeType==1)switch(e.nodeName){case "input":this.inputs.push((new N).parse(e))}}return this};
- $.prototype.create=function(){for(var b=0;b<this.inputs.length;b++){var c=this.inputs[b],e=this.animation.source[c.source];switch(c.semantic){case "INPUT":this.input=e.read();break;case "OUTPUT":this.output=e.read();break;case "INTERPOLATION":this.interpolation=e.read();break;case "IN_TANGENT":break;case "OUT_TANGENT":break;default:console.log(c.semantic)}}this.duration=this.endTime=this.startTime=0;if(this.input.length){this.startTime=1E8;this.endTime=-1E8;for(b=0;b<this.input.length;b++)this.startTime=
- Math.min(this.startTime,this.input[b]),this.endTime=Math.max(this.endTime,this.input[b]);this.duration=this.endTime-this.startTime}};return{load:function(c,e){if(document.implementation&&document.implementation.createDocument){document.implementation.createDocument("http://www.collada.org/2005/11/COLLADASchema","COLLADA",null);c+="?rnd="+Math.random();var f=new XMLHttpRequest;f.overrideMimeType&&f.overrideMimeType("text/xml");f.onreadystatechange=function(){if(f.readyState==4&&(f.status==0||f.status==
- 200))ia=e,b(f.responseXML,void 0,c)};f.open("GET",c,!0);f.send(null)}else alert("Don't know how to parse XML!")},parse:b,setPreferredShading:function(b){ya=b},applySkin:h,geometries:qa}};THREE.JSONLoader=function(b){THREE.Loader.call(this,b)};THREE.JSONLoader.prototype=new THREE.Loader;THREE.JSONLoader.prototype.constructor=THREE.JSONLoader;THREE.JSONLoader.prototype.supr=THREE.Loader.prototype;
- THREE.JSONLoader.prototype.load=function(b,e,c){var f=this,h;if(b instanceof Object)console.warn("DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath )."),h=b,b=h.model,e=h.callback,c=h.texture_path;h=new Worker(b);c=c?c:this.extractUrlbase(b);h.onmessage=function(b){f.createModel(b.data,e,c);f.onLoadComplete()};this.onLoadStart();h.postMessage((new Date).getTime())};
- THREE.JSONLoader.prototype.createModel=function(b,e,c){var f=new THREE.Geometry,h=b.scale!==void 0?1/b.scale:1;this.init_materials(f,b.materials,c);(function(c){if(b.version===void 0||b.version!=2)console.error("Deprecated file format.");else{var e,h,p,v,w,u,x,t,z,y,A,E,F,D,G=b.faces;u=b.vertices;var K=b.normals,N=b.colors,L=0;for(e=0;e<b.uvs.length;e++)b.uvs[e].length&&L++;for(e=0;e<L;e++)f.faceUvs[e]=[],f.faceVertexUvs[e]=[];v=0;for(w=u.length;v<w;)x=new THREE.Vertex,x.position.x=u[v++]*c,x.position.y=
- u[v++]*c,x.position.z=u[v++]*c,f.vertices.push(x);v=0;for(w=G.length;v<w;){c=G[v++];u=c&1;p=c&2;e=c&4;h=c&8;t=c&16;x=c&32;y=c&64;c&=128;u?(A=new THREE.Face4,A.a=G[v++],A.b=G[v++],A.c=G[v++],A.d=G[v++],u=4):(A=new THREE.Face3,A.a=G[v++],A.b=G[v++],A.c=G[v++],u=3);if(p)p=G[v++],A.materials=f.materials[p];p=f.faces.length;if(e)for(e=0;e<L;e++)E=b.uvs[e],z=G[v++],D=E[z*2],z=E[z*2+1],f.faceUvs[e][p]=new THREE.UV(D,z);if(h)for(e=0;e<L;e++){E=b.uvs[e];F=[];for(h=0;h<u;h++)z=G[v++],D=E[z*2],z=E[z*2+1],F[h]=
- new THREE.UV(D,z);f.faceVertexUvs[e][p]=F}if(t)t=G[v++]*3,h=new THREE.Vector3,h.x=K[t++],h.y=K[t++],h.z=K[t],A.normal=h;if(x)for(e=0;e<u;e++)t=G[v++]*3,h=new THREE.Vector3,h.x=K[t++],h.y=K[t++],h.z=K[t],A.vertexNormals.push(h);if(y)x=G[v++],x=new THREE.Color(N[x]),A.color=x;if(c)for(e=0;e<u;e++)x=G[v++],x=new THREE.Color(N[x]),A.vertexColors.push(x);f.faces.push(A)}}})(h);(function(){var c,e,h,p;if(b.skinWeights){c=0;for(e=b.skinWeights.length;c<e;c+=2)h=b.skinWeights[c],p=b.skinWeights[c+1],f.skinWeights.push(new THREE.Vector4(h,
- p,0,0))}if(b.skinIndices){c=0;for(e=b.skinIndices.length;c<e;c+=2)h=b.skinIndices[c],p=b.skinIndices[c+1],f.skinIndices.push(new THREE.Vector4(h,p,0,0))}f.bones=b.bones;f.animation=b.animation})();(function(c){if(b.morphTargets!==void 0){var e,h,p,v,w,u,x,t,z;e=0;for(h=b.morphTargets.length;e<h;e++){f.morphTargets[e]={};f.morphTargets[e].name=b.morphTargets[e].name;f.morphTargets[e].vertices=[];t=f.morphTargets[e].vertices;z=b.morphTargets[e].vertices;p=0;for(v=z.length;p<v;p+=3)w=z[p]*c,u=z[p+1]*
- c,x=z[p+2]*c,t.push(new THREE.Vertex(new THREE.Vector3(w,u,x)))}}if(b.morphColors!==void 0){e=0;for(h=b.morphColors.length;e<h;e++){f.morphColors[e]={};f.morphColors[e].name=b.morphColors[e].name;f.morphColors[e].colors=[];v=f.morphColors[e].colors;w=b.morphColors[e].colors;c=0;for(p=w.length;c<p;c+=3)u=new THREE.Color(16755200),u.setRGB(w[c],w[c+1],w[c+2]),v.push(u)}}})(h);f.computeCentroids();f.computeFaceNormals();this.hasNormals(f)&&f.computeTangents();e(f)};
- THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){}};
- THREE.SceneLoader.prototype={load:function(b,e){var c=this,f=new Worker(b);f.postMessage(0);var h=THREE.Loader.prototype.extractUrlbase(b);f.onmessage=function(b){function f(b,c){return c=="relativeToHTML"?b:h+"/"+b}function n(){for(t in S.objects)if(!T.objects[t])if(F=S.objects[t],F.geometry!==void 0){if(N=T.geometries[F.geometry]){var b=!1;U=[];for(fa=0;fa<F.materials.length;fa++)U[fa]=T.materials[F.materials[fa]],b=U[fa]instanceof THREE.ShaderMaterial;b&&N.computeTangents();D=F.position;r=F.rotation;
- q=F.quaternion;s=F.scale;q=0;U.length==0&&(U[0]=new THREE.MeshFaceMaterial);U.length>1&&(U=[new THREE.MeshFaceMaterial]);object=new THREE.Mesh(N,U);object.name=t;object.position.set(D[0],D[1],D[2]);q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=F.visible;T.scene.add(object);T.objects[t]=object;F.meshCollider&&(b=THREE.CollisionUtils.MeshColliderWBox(object),T.scene.collisions.colliders.push(b));
- if(F.castsShadow)b=new THREE.ShadowVolume(N),T.scene.add(b),b.position=object.position,b.rotation=object.rotation,b.scale=object.scale;F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},T.triggers[object.name]=b)}}else D=F.position,r=F.rotation,q=F.quaternion,s=F.scale,q=0,object=new THREE.Object3D,object.name=t,object.position.set(D[0],D[1],D[2]),q?(object.quaternion.set(q[0],q[1],q[2],q[3]),object.useQuaternion=!0):object.rotation.set(r[0],r[1],r[2]),object.scale.set(s[0],
- s[1],s[2]),object.visible=F.visible!==void 0?F.visible:!1,T.scene.add(object),T.objects[t]=object,T.empties[t]=object,F.trigger&&F.trigger.toLowerCase()!="none"&&(b={type:F.trigger,object:F},T.triggers[object.name]=b)}function p(b){return function(e){T.geometries[b]=e;n();Y-=1;c.onLoadComplete();w()}}function v(b){return function(c){T.geometries[b]=c}}function w(){c.callbackProgress({totalModels:o,totalTextures:$,loadedModels:o-Y,loadedTextures:$-W},T);c.onLoadProgress();Y==0&&W==0&&e(T)}var u,x,
- t,z,y,A,E,F,D,G,K,N,L,B,M,U,I,S,Q,Y,W,o,$,T;S=b.data;M=new THREE.BinaryLoader;Q=new THREE.JSONLoader;W=Y=0;T={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},triggers:{},empties:{}};b=!1;for(t in S.objects)if(F=S.objects[t],F.meshCollider){b=!0;break}if(b)T.scene.collisions=new THREE.CollisionSystem;if(S.transform){b=S.transform.position;G=S.transform.rotation;var ha=S.transform.scale;b&&T.scene.position.set(b[0],b[1],b[2]);G&&T.scene.rotation.set(G[0],
- G[1],G[2]);ha&&T.scene.scale.set(ha[0],ha[1],ha[2]);(b||G||ha)&&T.scene.updateMatrix()}b=function(){W-=1;w();c.onLoadComplete()};for(y in S.cameras)G=S.cameras[y],G.type=="perspective"?L=new THREE.PerspectiveCamera(G.fov,G.aspect,G.near,G.far):G.type=="ortho"&&(L=new THREE.OrthographicCamera(G.left,G.right,G.top,G.bottom,G.near,G.far)),D=G.position,G=G.target,L.position.set(D[0],D[1],D[2]),L.target=new THREE.Vector3(G[0],G[1],G[2]),T.cameras[y]=L;for(z in S.lights)y=S.lights[z],L=y.color!==void 0?
- y.color:16777215,G=y.intensity!==void 0?y.intensity:1,y.type=="directional"?(D=y.direction,I=new THREE.DirectionalLight(L,G),I.position.set(D[0],D[1],D[2]),I.position.normalize()):y.type=="point"?(D=y.position,d=y.distance,I=new THREE.PointLight(L,G,d),I.position.set(D[0],D[1],D[2])):y.type=="ambient"&&(I=new THREE.AmbientLight(L)),T.scene.add(I),T.lights[z]=I;for(A in S.fogs)z=S.fogs[A],z.type=="linear"?B=new THREE.Fog(0,z.near,z.far):z.type=="exp2"&&(B=new THREE.FogExp2(0,z.density)),G=z.color,
- B.color.setRGB(G[0],G[1],G[2]),T.fogs[A]=B;if(T.cameras&&S.defaults.camera)T.currentCamera=T.cameras[S.defaults.camera];if(T.fogs&&S.defaults.fog)T.scene.fog=T.fogs[S.defaults.fog];G=S.defaults.bgcolor;T.bgColor=new THREE.Color;T.bgColor.setRGB(G[0],G[1],G[2]);T.bgColorAlpha=S.defaults.bgalpha;for(u in S.geometries)if(A=S.geometries[u],A.type=="bin_mesh"||A.type=="ascii_mesh")Y+=1,c.onLoadStart();o=Y;for(u in S.geometries)A=S.geometries[u],A.type=="cube"?(N=new THREE.CubeGeometry(A.width,A.height,
- A.depth,A.segmentsWidth,A.segmentsHeight,A.segmentsDepth,null,A.flipped,A.sides),T.geometries[u]=N):A.type=="plane"?(N=new THREE.PlaneGeometry(A.width,A.height,A.segmentsWidth,A.segmentsHeight),T.geometries[u]=N):A.type=="sphere"?(N=new THREE.SphereGeometry(A.radius,A.segmentsWidth,A.segmentsHeight),T.geometries[u]=N):A.type=="cylinder"?(N=new THREE.CylinderGeometry(A.topRad,A.botRad,A.height,A.radSegs,A.heightSegs),T.geometries[u]=N):A.type=="torus"?(N=new THREE.TorusGeometry(A.radius,A.tube,A.segmentsR,
- A.segmentsT),T.geometries[u]=N):A.type=="icosahedron"?(N=new THREE.IcosahedronGeometry(A.subdivisions),T.geometries[u]=N):A.type=="bin_mesh"?M.load({model:f(A.url,S.urlBaseType),callback:p(u)}):A.type=="ascii_mesh"?Q.load({model:f(A.url,S.urlBaseType),callback:p(u)}):A.type=="embedded_mesh"&&(A=S.embeds[A.id])&&Q.createModel(A,v(u),"");for(E in S.textures)if(u=S.textures[E],u.url instanceof Array){W+=u.url.length;for(M=0;M<u.url.length;M++)c.onLoadStart()}else W+=1,c.onLoadStart();$=W;for(E in S.textures){u=
- S.textures[E];if(u.mapping!=void 0&&THREE[u.mapping]!=void 0)u.mapping=new THREE[u.mapping];if(u.url instanceof Array){M=[];for(var fa=0;fa<u.url.length;fa++)M[fa]=f(u.url[fa],S.urlBaseType);M=THREE.ImageUtils.loadTextureCube(M,u.mapping,b)}else{M=THREE.ImageUtils.loadTexture(f(u.url,S.urlBaseType),u.mapping,b);if(THREE[u.minFilter]!=void 0)M.minFilter=THREE[u.minFilter];if(THREE[u.magFilter]!=void 0)M.magFilter=THREE[u.magFilter];if(u.repeat){M.repeat.set(u.repeat[0],u.repeat[1]);if(u.repeat[0]!=
- 1)M.wrapS=THREE.RepeatWrapping;if(u.repeat[1]!=1)M.wrapT=THREE.RepeatWrapping}u.offset&&M.offset.set(u.offset[0],u.offset[1]);if(u.wrap){Q={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping};if(Q[u.wrap[0]]!==void 0)M.wrapS=Q[u.wrap[0]];if(Q[u.wrap[1]]!==void 0)M.wrapT=Q[u.wrap[1]]}}T.textures[E]=M}for(x in S.materials){E=S.materials[x];for(K in E.parameters)if(K=="envMap"||K=="map"||K=="lightMap")E.parameters[K]=T.textures[E.parameters[K]];else if(K=="shading")E.parameters[K]=E.parameters[K]==
- "flat"?THREE.FlatShading:THREE.SmoothShading;else if(K=="blending")E.parameters[K]=THREE[E.parameters[K]]?THREE[E.parameters[K]]:THREE.NormalBlending;else if(K=="combine")E.parameters[K]=E.parameters[K]=="MixOperation"?THREE.MixOperation:THREE.MultiplyOperation;else if(K=="vertexColors")if(E.parameters[K]=="face")E.parameters[K]=THREE.FaceColors;else if(E.parameters[K])E.parameters[K]=THREE.VertexColors;if(E.parameters.opacity!==void 0&&E.parameters.opacity<1)E.parameters.transparent=!0;if(E.parameters.normalMap){u=
- THREE.ShaderUtils.lib.normal;b=THREE.UniformsUtils.clone(u.uniforms);M=E.parameters.color;Q=E.parameters.specular;A=E.parameters.ambient;B=E.parameters.shininess;b.tNormal.texture=T.textures[E.parameters.normalMap];if(E.parameters.normalMapFactor)b.uNormalScale.value=E.parameters.normalMapFactor;if(E.parameters.map)b.tDiffuse.texture=E.parameters.map,b.enableDiffuse.value=!0;if(E.parameters.lightMap)b.tAO.texture=E.parameters.lightMap,b.enableAO.value=!0;if(E.parameters.specularMap)b.tSpecular.texture=
- T.textures[E.parameters.specularMap],b.enableSpecular.value=!0;b.uDiffuseColor.value.setHex(M);b.uSpecularColor.value.setHex(Q);b.uAmbientColor.value.setHex(A);b.uShininess.value=B;if(E.parameters.opacity)b.uOpacity.value=E.parameters.opacity;E=new THREE.ShaderMaterial({fragmentShader:u.fragmentShader,vertexShader:u.vertexShader,uniforms:b,lights:!0,fog:!0})}else E=new THREE[E.type](E.parameters);T.materials[x]=E}n();c.callbackSync(T)}},constructor:THREE.SceneLoader};THREE.UTF8Loader=function(){};
- THREE.UTF8Loader.prototype=new THREE.UTF8Loader;THREE.UTF8Loader.prototype.constructor=THREE.UTF8Loader;
- THREE.UTF8Loader.prototype.load=function(b){var e=new XMLHttpRequest,c=b.model,f=b.callback,h=b.scale!==void 0?b.scale:1,k=b.offsetX!==void 0?b.offsetX:0,m=b.offsetY!==void 0?b.offsetY:0,n=b.offsetZ!==void 0?b.offsetZ:0;e.onreadystatechange=function(){e.readyState==4?e.status==200||e.status==0?THREE.UTF8Loader.prototype.createModel(e.responseText,f,h,k,m,n):alert("Couldn't load ["+c+"] ["+e.status+"]"):e.readyState!=3&&e.readyState==2&&e.getResponseHeader("Content-Length")};e.open("GET",c,!0);e.send(null)};
- THREE.UTF8Loader.prototype.decompressMesh=function(b){var e=b.charCodeAt(0);e>=57344&&(e-=2048);e++;for(var c=new Float32Array(8*e),f=1,h=0;h<8;h++){for(var k=0,m=0;m<e;++m){var n=b.charCodeAt(m+f);k+=n>>1^-(n&1);c[8*m+h]=k}f+=e}e=b.length-f;k=new Uint16Array(e);for(h=m=0;h<e;h++)n=b.charCodeAt(h+f),k[h]=m-n,n==0&&m++;return[c,k]};
- THREE.UTF8Loader.prototype.createModel=function(b,e,c,f,h,k){var m=function(){var e=this;e.materials=[];THREE.Geometry.call(this);var m=THREE.UTF8Loader.prototype.decompressMesh(b),v=[],w=[];(function(b,m,p){for(var v,w,A,E=b.length;p<E;p+=m)v=b[p],w=b[p+1],A=b[p+2],v=v/16383*c,w=w/16383*c,A=A/16383*c,v+=f,w+=h,A+=k,e.vertices.push(new THREE.Vertex(new THREE.Vector3(v,w,A)))})(m[0],8,0);(function(b,c,e){for(var f,h,k=b.length;e<k;e+=c)f=b[e],h=b[e+1],f/=1023,h/=1023,w.push(f,1-h)})(m[0],8,3);(function(b,
- c,e){for(var f,h,k,m=b.length;e<m;e+=c)f=b[e],h=b[e+1],k=b[e+2],f=(f-512)/511,h=(h-512)/511,k=(k-512)/511,v.push(f,h,k)})(m[0],8,5);(function(b){var c,f,h,k,m,p,F,D,G,K=b.length;for(c=0;c<K;c+=3){f=b[c];h=b[c+1];k=b[c+2];m=e;D=f;G=h;p=k;F=f;var N=h,L=k,B=m.materials[0],M=v[N*3],U=v[N*3+1],N=v[N*3+2],I=v[L*3],S=v[L*3+1],L=v[L*3+2];F=new THREE.Vector3(v[F*3],v[F*3+1],v[F*3+2]);N=new THREE.Vector3(M,U,N);L=new THREE.Vector3(I,S,L);m.faces.push(new THREE.Face3(D,G,p,[F,N,L],null,B));m=w[f*2];f=w[f*2+
- 1];p=w[h*2];F=w[h*2+1];D=w[k*2];G=w[k*2+1];k=e.faceVertexUvs[0];h=p;p=F;F=[];F.push(new THREE.UV(m,f));F.push(new THREE.UV(h,p));F.push(new THREE.UV(D,G));k.push(F)}})(m[1]);this.computeCentroids();this.computeFaceNormals()};m.prototype=new THREE.Geometry;m.prototype.constructor=m;e(new m)};
- THREE.Axes=function(){THREE.Object3D.call(this);var b=new THREE.Geometry;b.vertices.push(new THREE.Vertex);b.vertices.push(new THREE.Vertex(new THREE.Vector3(0,100,0)));var e=new THREE.CylinderGeometry(0,5,25,5,1),c=new THREE.Line(b,new THREE.LineBasicMaterial({color:16711680}));c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Mesh(e,new THREE.MeshBasicMaterial({color:16711680}));c.position.x=100;c.rotation.z=-Math.PI/2;this.add(c);c=new THREE.Line(b,new THREE.LineBasicMaterial({color:65280}));this.add(c);
- c=new THREE.Mesh(e,new THREE.MeshBasicMaterial({color:65280}));c.position.y=100;this.add(c);c=new THREE.Line(b,new THREE.LineBasicMaterial({color:255}));c.rotation.x=Math.PI/2;this.add(c);c=new THREE.Mesh(e,new THREE.MeshBasicMaterial({color:255}));c.position.z=100;c.rotation.x=Math.PI/2;this.add(c)};THREE.Axes.prototype=new THREE.Object3D;THREE.Axes.prototype.constructor=THREE.Axes;
- THREE.MarchingCubes=function(b,e){THREE.Object3D.call(this);this.materials=e instanceof Array?e:[e];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.hasNormal=this.hasPos=!1;this.positionArray=new Float32Array(this.maxCount*3);this.normalArray=new Float32Array(this.maxCount*3)};this.lerp=function(b,e,h){return b+(e-b)*h};this.VIntX=function(b,e,h,k,m,n,p,v,w,u){m=(m-w)/(u-w);w=this.normal_cache;e[k]=n+m*this.delta;e[k+1]=p;e[k+2]=v;h[k]=this.lerp(w[b],w[b+3],m);h[k+1]=this.lerp(w[b+1],w[b+4],m);h[k+2]=this.lerp(w[b+2],w[b+5],m)};this.VIntY=function(b,e,h,k,m,n,p,v,w,u){m=(m-w)/(u-w);w=this.normal_cache;e[k]=n;e[k+1]=p+m*this.delta;e[k+
- 2]=v;e=b+this.yd*3;h[k]=this.lerp(w[b],w[e],m);h[k+1]=this.lerp(w[b+1],w[e+1],m);h[k+2]=this.lerp(w[b+2],w[e+2],m)};this.VIntZ=function(b,e,h,k,m,n,p,v,w,u){m=(m-w)/(u-w);w=this.normal_cache;e[k]=n;e[k+1]=p;e[k+2]=v+m*this.delta;e=b+this.zd*3;h[k]=this.lerp(w[b],w[e],m);h[k+1]=this.lerp(w[b+1],w[e+1],m);h[k+2]=this.lerp(w[b+2],w[e+2],m)};this.compNorm=function(b){var e=b*3;this.normal_cache[e]==0&&(this.normal_cache[e]=this.field[b-1]-this.field[b+1],this.normal_cache[e+1]=this.field[b-this.yd]-this.field[b+
- this.yd],this.normal_cache[e+2]=this.field[b-this.zd]-this.field[b+this.zd])};this.polygonize=function(b,e,h,k,m,n){var p=k+1,v=k+this.yd,w=k+this.zd,u=p+this.yd,x=p+this.zd,t=k+this.yd+this.zd,z=p+this.yd+this.zd,y=0,A=this.field[k],E=this.field[p],F=this.field[v],D=this.field[u],G=this.field[w],K=this.field[x],N=this.field[t],L=this.field[z];A<m&&(y|=1);E<m&&(y|=2);F<m&&(y|=8);D<m&&(y|=4);G<m&&(y|=16);K<m&&(y|=32);N<m&&(y|=128);L<m&&(y|=64);var B=THREE.edgeTable[y];if(B==0)return 0;var M=this.delta,
- U=b+M,I=e+M,M=h+M;B&1&&(this.compNorm(k),this.compNorm(p),this.VIntX(k*3,this.vlist,this.nlist,0,m,b,e,h,A,E));B&2&&(this.compNorm(p),this.compNorm(u),this.VIntY(p*3,this.vlist,this.nlist,3,m,U,e,h,E,D));B&4&&(this.compNorm(v),this.compNorm(u),this.VIntX(v*3,this.vlist,this.nlist,6,m,b,I,h,F,D));B&8&&(this.compNorm(k),this.compNorm(v),this.VIntY(k*3,this.vlist,this.nlist,9,m,b,e,h,A,F));B&16&&(this.compNorm(w),this.compNorm(x),this.VIntX(w*3,this.vlist,this.nlist,12,m,b,e,M,G,K));B&32&&(this.compNorm(x),
- this.compNorm(z),this.VIntY(x*3,this.vlist,this.nlist,15,m,U,e,M,K,L));B&64&&(this.compNorm(t),this.compNorm(z),this.VIntX(t*3,this.vlist,this.nlist,18,m,b,I,M,N,L));B&128&&(this.compNorm(w),this.compNorm(t),this.VIntY(w*3,this.vlist,this.nlist,21,m,b,e,M,G,N));B&256&&(this.compNorm(k),this.compNorm(w),this.VIntZ(k*3,this.vlist,this.nlist,24,m,b,e,h,A,G));B&512&&(this.compNorm(p),this.compNorm(x),this.VIntZ(p*3,this.vlist,this.nlist,27,m,U,e,h,E,K));B&1024&&(this.compNorm(u),this.compNorm(z),this.VIntZ(u*
- 3,this.vlist,this.nlist,30,m,U,I,h,D,L));B&2048&&(this.compNorm(v),this.compNorm(t),this.VIntZ(v*3,this.vlist,this.nlist,33,m,b,I,h,F,N));y<<=4;for(m=k=0;THREE.triTable[y+m]!=-1;)b=y+m,e=b+1,h=b+2,this.posnormtriv(this.vlist,this.nlist,3*THREE.triTable[b],3*THREE.triTable[e],3*THREE.triTable[h],n),m+=3,k++;return k};this.posnormtriv=function(b,e,h,k,m,n){var p=this.count*3;this.positionArray[p]=b[h];this.positionArray[p+1]=b[h+1];this.positionArray[p+2]=b[h+2];this.positionArray[p+3]=b[k];this.positionArray[p+
- 4]=b[k+1];this.positionArray[p+5]=b[k+2];this.positionArray[p+6]=b[m];this.positionArray[p+7]=b[m+1];this.positionArray[p+8]=b[m+2];this.normalArray[p]=e[h];this.normalArray[p+1]=e[h+1];this.normalArray[p+2]=e[h+2];this.normalArray[p+3]=e[k];this.normalArray[p+4]=e[k+1];this.normalArray[p+5]=e[k+2];this.normalArray[p+6]=e[m];this.normalArray[p+7]=e[m+1];this.normalArray[p+8]=e[m+2];this.hasNormal=this.hasPos=!0;this.count+=3;this.count>=this.maxCount-3&&n(this)};this.begin=function(){this.count=0;
- this.hasNormal=this.hasPos=!1};this.end=function(b){if(this.count!=0){for(var e=this.count*3;e<this.positionArray.length;e++)this.positionArray[e]=0;b(this)}};this.addBall=function(b,e,h,k,m){var n=this.size*Math.sqrt(k/m),p=h*this.size,v=e*this.size,w=b*this.size,u=Math.floor(p-n);u<1&&(u=1);p=Math.floor(p+n);p>this.size-1&&(p=this.size-1);var x=Math.floor(v-n);x<1&&(x=1);v=Math.floor(v+n);v>this.size-1&&(v=this.size-1);var t=Math.floor(w-n);t<1&&(t=1);n=Math.floor(w+n);n>this.size-1&&(n=this.size-
- 1);for(var z,y,A,E,F,D;u<p;u++){w=this.size2*u;y=u/this.size-h;F=y*y;for(y=x;y<v;y++){A=w+this.size*y;z=y/this.size-e;D=z*z;for(z=t;z<n;z++)E=z/this.size-b,E=k/(1.0E-6+E*E+D+F)-m,E>0&&(this.field[A+z]+=E)}}};this.addPlaneX=function(b,e){var h,k,m,n,p,v=this.size,w=this.yd,u=this.zd,x=this.field,t=v*Math.sqrt(b/e);t>v&&(t=v);for(h=0;h<t;h++)if(k=h/v,k*=k,n=b/(1.0E-4+k)-e,n>0)for(k=0;k<v;k++){p=h+k*w;for(m=0;m<v;m++)x[u*m+p]+=n}};this.addPlaneY=function(b,e){var h,k,m,n,p,v,w=this.size,u=this.yd,x=
- this.zd,t=this.field,z=w*Math.sqrt(b/e);z>w&&(z=w);for(k=0;k<z;k++)if(h=k/w,h*=h,n=b/(1.0E-4+h)-e,n>0){p=k*u;for(h=0;h<w;h++){v=p+h;for(m=0;m<w;m++)t[x*m+v]+=n}}};this.addPlaneZ=function(b,e){var h,k,m,n,p,v;size=this.size;yd=this.yd;zd=this.zd;field=this.field;dist=size*Math.sqrt(b/e);dist>size&&(dist=size);for(m=0;m<dist;m++)if(h=m/size,h*=h,n=b/(1.0E-4+h)-e,n>0){p=zd*m;for(k=0;k<size;k++){v=p+k*yd;for(h=0;h<size;h++)field[v+h]+=n}}};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 e,h,k,m,n,p,v,w,u,x=this.size-2;for(m=1;m<x;m++){u=this.size2*m;v=(m-this.halfsize)/this.halfsize;for(k=1;k<x;k++){w=u+this.size*k;p=(k-this.halfsize)/this.halfsize;for(h=1;h<x;h++)n=(h-this.halfsize)/this.halfsize,e=w+h,this.polygonize(n,p,v,e,this.isolation,b)}}this.end(b)};this.generateGeometry=function(){var b=0,e=new THREE.Geometry,h=[];this.render(function(k){var m,n,p,v,w,u,x,t;for(m=0;m<k.count;m++)x=m*3,w=x+1,t=x+2,n=k.positionArray[x],
- p=k.positionArray[w],v=k.positionArray[t],u=new THREE.Vector3(n,p,v),n=k.normalArray[x],p=k.normalArray[w],v=k.normalArray[t],x=new THREE.Vector3(n,p,v),x.normalize(),w=new THREE.Vertex(u),e.vertices.push(w),h.push(x);nfaces=k.count/3;for(m=0;m<nfaces;m++)x=(b+m)*3,w=x+1,t=x+2,u=h[x],n=h[w],p=h[t],x=new THREE.Face3(x,w,t,[u,n,p]),e.faces.push(x);b+=nfaces;k.count=0});return e};this.init(b)};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]);THREE.PlaneCollider=function(b,e){this.point=b;this.normal=e};THREE.SphereCollider=function(b,e){this.center=b;this.radius=e;this.radiusSq=e*e};THREE.BoxCollider=function(b,e){this.min=b;this.max=e;this.dynamic=!0;this.normal=new THREE.Vector3};
- THREE.MeshCollider=function(b,e){this.mesh=b;this.box=e;this.numFaces=this.mesh.geometry.faces.length;this.normal=new THREE.Vector3};THREE.CollisionSystem=function(){this.collisionNormal=new THREE.Vector3;this.colliders=[];this.hits=[]};THREE.Collisions=new THREE.CollisionSystem;THREE.CollisionSystem.prototype.merge=function(b){Array.prototype.push.apply(this.colliders,b.colliders);Array.prototype.push.apply(this.hits,b.hits)};
- THREE.CollisionSystem.prototype.rayCastAll=function(b){b.direction.normalize();this.hits.length=0;var e,c,f,h,k=0;e=0;for(c=this.colliders.length;e<c;e++)if(h=this.colliders[e],f=this.rayCast(b,h),f<Number.MAX_VALUE)h.distance=f,f>k?this.hits.push(h):this.hits.unshift(h),k=f;return this.hits};
- THREE.CollisionSystem.prototype.rayCastNearest=function(b){var e=this.rayCastAll(b);if(e.length==0)return null;for(var c=0;e[c]instanceof THREE.MeshCollider;){var f=this.rayMesh(b,e[c]);if(f.dist<Number.MAX_VALUE){e[c].distance=f.dist;e[c].faceIndex=f.faceIndex;break}c++}if(c>e.length)return null;return e[c]};
- THREE.CollisionSystem.prototype.rayCast=function(b,e){if(e instanceof THREE.PlaneCollider)return this.rayPlane(b,e);else if(e instanceof THREE.SphereCollider)return this.raySphere(b,e);else if(e instanceof THREE.BoxCollider)return this.rayBox(b,e);else if(e instanceof THREE.MeshCollider&&e.box)return this.rayBox(b,e.box)};
- THREE.CollisionSystem.prototype.rayMesh=function(b,e){for(var c=this.makeRayLocal(b,e.mesh),f=Number.MAX_VALUE,h,k=0;k<e.numFaces;k++){var m=e.mesh.geometry.faces[k],n=e.mesh.geometry.vertices[m.a].position,p=e.mesh.geometry.vertices[m.b].position,v=e.mesh.geometry.vertices[m.c].position,w=m instanceof THREE.Face4?e.mesh.geometry.vertices[m.d].position:null;m instanceof THREE.Face3?(m=this.rayTriangle(c,n,p,v,f,this.collisionNormal,e.mesh),m<f&&(f=m,h=k,e.normal.copy(this.collisionNormal),e.normal.normalize())):
- m instanceof THREE.Face4&&(m=this.rayTriangle(c,n,p,w,f,this.collisionNormal,e.mesh),m<f&&(f=m,h=k,e.normal.copy(this.collisionNormal),e.normal.normalize()),m=this.rayTriangle(c,p,v,w,f,this.collisionNormal,e.mesh),m<f&&(f=m,h=k,e.normal.copy(this.collisionNormal),e.normal.normalize()))}return{dist:f,faceIndex:h}};
- THREE.CollisionSystem.prototype.rayTriangle=function(b,e,c,f,h,k,m){var n=THREE.CollisionSystem.__v1,p=THREE.CollisionSystem.__v2;k.set(0,0,0);n.sub(c,e);p.sub(f,c);k.cross(n,p);n=k.dot(b.direction);if(!(n<0))if(m.doubleSided||m.flipSided)k.multiplyScalar(-1),n*=-1;else return Number.MAX_VALUE;m=k.dot(e)-k.dot(b.origin);if(!(m<=0))return Number.MAX_VALUE;if(!(m>=n*h))return Number.MAX_VALUE;m/=n;n=THREE.CollisionSystem.__v3;n.copy(b.direction);n.multiplyScalar(m);n.addSelf(b.origin);Math.abs(k.x)>
- Math.abs(k.y)?Math.abs(k.x)>Math.abs(k.z)?(b=n.y-e.y,k=c.y-e.y,h=f.y-e.y,n=n.z-e.z,c=c.z-e.z,f=f.z-e.z):(b=n.x-e.x,k=c.x-e.x,h=f.x-e.x,n=n.y-e.y,c=c.y-e.y,f=f.y-e.y):Math.abs(k.y)>Math.abs(k.z)?(b=n.x-e.x,k=c.x-e.x,h=f.x-e.x,n=n.z-e.z,c=c.z-e.z,f=f.z-e.z):(b=n.x-e.x,k=c.x-e.x,h=f.x-e.x,n=n.y-e.y,c=c.y-e.y,f=f.y-e.y);e=k*f-c*h;if(e==0)return Number.MAX_VALUE;e=1/e;f=(b*f-n*h)*e;if(!(f>=0))return Number.MAX_VALUE;e*=k*n-c*b;if(!(e>=0))return Number.MAX_VALUE;if(!(1-f-e>=0))return Number.MAX_VALUE;return m};
- THREE.CollisionSystem.prototype.makeRayLocal=function(b,e){var c=THREE.CollisionSystem.__m;THREE.Matrix4.makeInvert(e.matrixWorld,c);var f=THREE.CollisionSystem.__r;f.origin.copy(b.origin);f.direction.copy(b.direction);c.multiplyVector3(f.origin);c.rotateAxis(f.direction);f.direction.normalize();return f};
- THREE.CollisionSystem.prototype.rayBox=function(b,e){var c;e.dynamic&&e.mesh&&e.mesh.matrixWorld?c=this.makeRayLocal(b,e.mesh):(c=THREE.CollisionSystem.__r,c.origin.copy(b.origin),c.direction.copy(b.direction));var f=0,h=0,k=0,m=0,n=0,p=0,v=!0;c.origin.x<e.min.x?(f=e.min.x-c.origin.x,f/=c.direction.x,v=!1,m=-1):c.origin.x>e.max.x&&(f=e.max.x-c.origin.x,f/=c.direction.x,v=!1,m=1);c.origin.y<e.min.y?(h=e.min.y-c.origin.y,h/=c.direction.y,v=!1,n=-1):c.origin.y>e.max.y&&(h=e.max.y-c.origin.y,h/=c.direction.y,
- v=!1,n=1);c.origin.z<e.min.z?(k=e.min.z-c.origin.z,k/=c.direction.z,v=!1,p=-1):c.origin.z>e.max.z&&(k=e.max.z-c.origin.z,k/=c.direction.z,v=!1,p=1);if(v)return-1;v=0;h>f&&(v=1,f=h);k>f&&(v=2,f=k);switch(v){case 0:n=c.origin.y+c.direction.y*f;if(n<e.min.y||n>e.max.y)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*f;if(c<e.min.z||c>e.max.z)return Number.MAX_VALUE;e.normal.set(m,0,0);break;case 1:m=c.origin.x+c.direction.x*f;if(m<e.min.x||m>e.max.x)return Number.MAX_VALUE;c=c.origin.z+c.direction.z*
- f;if(c<e.min.z||c>e.max.z)return Number.MAX_VALUE;e.normal.set(0,n,0);break;case 2:m=c.origin.x+c.direction.x*f;if(m<e.min.x||m>e.max.x)return Number.MAX_VALUE;n=c.origin.y+c.direction.y*f;if(n<e.min.y||n>e.max.y)return Number.MAX_VALUE;e.normal.set(0,0,p)}return f};THREE.CollisionSystem.prototype.rayPlane=function(b,e){var c=b.direction.dot(e.normal),f=e.point.dot(e.normal);if(c<0)c=(f-b.origin.dot(e.normal))/c;else return Number.MAX_VALUE;return c>0?c:Number.MAX_VALUE};
- THREE.CollisionSystem.prototype.raySphere=function(b,e){var c=e.center.clone().subSelf(b.origin);if(c.lengthSq<e.radiusSq)return-1;var f=c.dot(b.direction.clone());if(f<=0)return Number.MAX_VALUE;c=e.radiusSq-(c.lengthSq()-f*f);if(c>=0)return Math.abs(f)-Math.sqrt(c);return Number.MAX_VALUE};THREE.CollisionSystem.__v1=new THREE.Vector3;THREE.CollisionSystem.__v2=new THREE.Vector3;THREE.CollisionSystem.__v3=new THREE.Vector3;THREE.CollisionSystem.__nr=new THREE.Vector3;THREE.CollisionSystem.__m=new THREE.Matrix4;
- THREE.CollisionSystem.__r=new THREE.Ray;THREE.CollisionUtils={};THREE.CollisionUtils.MeshOBB=function(b){b.geometry.computeBoundingBox();var e=b.geometry.boundingBox,c=new THREE.Vector3(e.x[0],e.y[0],e.z[0]),e=new THREE.Vector3(e.x[1],e.y[1],e.z[1]),c=new THREE.BoxCollider(c,e);c.mesh=b;return c};THREE.CollisionUtils.MeshAABB=function(b){var e=THREE.CollisionUtils.MeshOBB(b);e.min.addSelf(b.position);e.max.addSelf(b.position);e.dynamic=!1;return e};
- THREE.CollisionUtils.MeshColliderWBox=function(b){return new THREE.MeshCollider(b,THREE.CollisionUtils.MeshOBB(b))};
- if(THREE.WebGLRenderer)THREE.AnaglyphWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);var e=this,c=this.setSize,f=this.render,h=new THREE.PerspectiveCamera,k=new THREE.PerspectiveCamera,m=new THREE.Matrix4,n=new THREE.Matrix4,p,v,w;h.matrixAutoUpdate=k.matrixAutoUpdate=!1;var b={minFilter:THREE.LinearFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat},u=new THREE.WebGLRenderTarget(512,512,b),x=new THREE.WebGLRenderTarget(512,512,b),t=new THREE.PerspectiveCamera(53,1,1,1E4);t.position.z=
- 2;_material=new THREE.ShaderMaterial({uniforms:{mapLeft:{type:"t",value:0,texture:u},mapRight:{type:"t",value:1,texture:x}},vertexShader:"varying vec2 vUv;\nvoid main() {\nvUv = vec2( uv.x, 1.0 - uv.y );\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D mapLeft;\nuniform sampler2D mapRight;\nvarying vec2 vUv;\nvoid main() {\nvec4 colorL, colorR;\nvec2 uv = vUv;\ncolorL = texture2D( mapLeft, uv );\ncolorR = texture2D( mapRight, uv );\ngl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;\n}"});
- var z=new THREE.Scene;z.add(new THREE.Mesh(new THREE.PlaneGeometry(2,2),_material));this.setSize=function(b,f){c.call(e,b,f);u.width=b;u.height=f;x.width=b;x.height=f};this.render=function(b,c){c.update(null,!0);if(p!==c.aspect||v!==c.near||w!==c.fov){p=c.aspect;v=c.near;w=c.fov;var E=c.projectionMatrix.clone(),F=125/30*0.5,D=F*v/125,G=v*Math.tan(w*Math.PI/360),K;m.n14=F;n.n14=-F;F=-G*p+D;K=G*p+D;E.n11=2*v/(K-F);E.n13=(K+F)/(K-F);h.projectionMatrix=E.clone();F=-G*p-D;K=G*p-D;E.n11=2*v/(K-F);E.n13=
- (K+F)/(K-F);k.projectionMatrix=E.clone()}h.matrix=c.matrixWorld.clone().multiplySelf(n);h.update(null,!0);h.position.copy(c.position);h.near=v;h.far=c.far;f.call(e,b,h,u,!0);k.matrix=c.matrixWorld.clone().multiplySelf(m);k.update(null,!0);k.position.copy(c.position);k.near=v;k.far=c.far;f.call(e,b,k,x,!0);f.call(e,z,t)}};
- if(THREE.WebGLRenderer)THREE.CrosseyedWebGLRenderer=function(b){THREE.WebGLRenderer.call(this,b);this.autoClear=!1;var e=this,c=this.setSize,f=this.render,h,k,m=new THREE.PerspectiveCamera;m.target=new THREE.Vector3(0,0,0);var n=new THREE.PerspectiveCamera;n.target=new THREE.Vector3(0,0,0);e.separation=10;if(b&&b.separation!==void 0)e.separation=b.separation;this.setSize=function(b,f){c.call(e,b,f);h=b/2;k=f};this.render=function(b,c){this.clear();m.fov=c.fov;m.aspect=0.5*c.aspect;m.near=c.near;m.far=
- c.far;m.updateProjectionMatrix();m.position.copy(c.position);m.target.copy(c.target);m.translateX(e.separation);m.lookAt(m.target);n.projectionMatrix=m.projectionMatrix;n.position.copy(c.position);n.target.copy(c.target);n.translateX(-e.separation);n.lookAt(n.target);this.setViewport(0,0,h,k);f.call(e,b,m);this.setViewport(h,0,h,k);f.call(e,b,n,!1)}};
|