// Three.js r32 - http://github.com/mrdoob/three.js var THREE=THREE||{};THREE.Color=function(a){this.setHex(a)}; THREE.Color.prototype={autoUpdate:!0,setRGB:function(a,b,d){this.r=a;this.g=b;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,d){var e,g,i,l,m,k;if(d==0)e=g=i=0;else{l=Math.floor(a*6);m=a*6-l;a=d*(1-b);k=d*(1-b*m);b=d*(1-b*(1-m));switch(l){case 1:e=k;g=d;i=a;break;case 2:e=a;g=d;i=b;break;case 3:e=a;g=k;i=d;break;case 4:e=b;g=a;i=d;break;case 5:e=d;g=a;i=k;break;case 6:case 0:e=d;g=b;i=a}}this.r=e;this.g=g;this.b=i;if(this.autoUpdate){this.updateHex(); this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGBA();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGBA:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)},toString:function(){return"THREE.Color ( r: "+ this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},unit:function(){this.multiplyScalar(1/this.length());return this},length:function(){return Math.sqrt(this.x* this.x+this.y*this.y)},lengthSq:function(){return this.x*this.x+this.y*this.y},negate:function(){this.x=-this.x;this.y=-this.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,b,d){this.x=a||0;this.y=b||0;this.z=d||0}; THREE.Vector3.prototype={set:function(a,b,d){this.x=a;this.y=b;this.z=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this}, cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){var b=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=e*a.x-b*a.z;this.z=b*a.y-d*a.x;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},divideSelf:function(a){this.x/=a.x;this.y/=a.y;this.z/= a.z;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){var b=this.x-a.x,d=this.y-a.y;a=this.z-a.z;return Math.sqrt(b*b+d*d+a*a)},distanceToSquared:function(a){var b=this.x-a.x,d=this.y-a.y;a=this.z-a.z;return b*b+d*d+a*a},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+ this.y+this.z},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+ this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,b,d,e){this.x=a||0;this.y=b||0;this.z=d||0;this.w=e||1}; THREE.Vector4.prototype={set:function(a,b,d,e){this.x=a;this.y=b;this.z=d;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w; return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;this.w/=a;return this},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}}; THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={intersectScene:function(a){var b,d,e=a.objects,g=[];a=0;for(b=e.length;a0&&H>0&&c+H<1}var d,e,g,i,l,m,k,o,s,w, u,x=a.geometry,F=x.vertices,I=[];d=0;for(e=x.faces.length;dk?e:k;g=g>o?g:o}a()}; this.add3Points=function(k,o,s,w,u,x){if(m){m=!1;b=ks?k>u?k:u:s>u?s:u;g=o>w?o>x?o:x:w>x?w:x}else{b=ks?k>u?k>e?k:e:u>e?u:e:s>u?s>e?s:e:u>e?u:e;g=o>w?o>x?o>g?o:g:x>g?x:g:w>x?w>g?w:g:x>g?x:g}a()};this.addRectangle=function(k){if(m){m=!1;b=k.getLeft();d=k.getTop();e=k.getRight();g=k.getBottom()}else{b=bk.getRight()? e:k.getRight();g=g>k.getBottom()?g:k.getBottom()}a()};this.inflate=function(k){b-=k;d-=k;e+=k;g+=k;a()};this.minSelf=function(k){b=b>k.getLeft()?b:k.getLeft();d=d>k.getTop()?d:k.getTop();e=e=0&&Math.min(g,k.getBottom())-Math.max(d,k.getTop())>=0};this.empty=function(){m=!0;g=e=d=b=0;a()};this.isEmpty=function(){return m};this.toString=function(){return"THREE.Rectangle ( left: "+ b+", right: "+e+", top: "+d+", bottom: "+g+", width: "+i+", height: "+l+" )"}};THREE.Matrix3=function(){this.m=[]};THREE.Matrix3.prototype={transpose:function(){var a,b=this.m;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}}; THREE.Matrix4=function(a,b,d,e,g,i,l,m,k,o,s,w,u,x,F,I){this.n11=a||1;this.n12=b||0;this.n13=d||0;this.n14=e||0;this.n21=g||0;this.n22=i||1;this.n23=l||0;this.n24=m||0;this.n31=k||0;this.n32=o||0;this.n33=s||1;this.n34=w||0;this.n41=u||0;this.n42=x||0;this.n43=F||0;this.n44=I||1;this.flat=Array(16);this.m33=new THREE.Matrix3}; THREE.Matrix4.prototype={identity:function(){this.n11=1;this.n21=this.n14=this.n13=this.n12=0;this.n22=1;this.n32=this.n31=this.n24=this.n23=0;this.n33=1;this.n43=this.n42=this.n41=this.n34=0;this.n44=1;return this},set:function(a,b,d,e,g,i,l,m,k,o,s,w,u,x,F,I){this.n11=a;this.n12=b;this.n13=d;this.n14=e;this.n21=g;this.n22=i;this.n23=l;this.n24=m;this.n31=k;this.n32=o;this.n33=s;this.n34=w;this.n41=u;this.n42=x;this.n43=F;this.n44=I;return this},copy:function(a){this.n11=a.n11;this.n12=a.n12;this.n13= a.n13;this.n14=a.n14;this.n21=a.n21;this.n22=a.n22;this.n23=a.n23;this.n24=a.n24;this.n31=a.n31;this.n32=a.n32;this.n33=a.n33;this.n34=a.n34;this.n41=a.n41;this.n42=a.n42;this.n43=a.n43;this.n44=a.n44;return this},lookAt:function(a,b,d){var e=THREE.Matrix4.__tmpVec1,g=THREE.Matrix4.__tmpVec2,i=THREE.Matrix4.__tmpVec3;i.sub(a,b).normalize();e.cross(d,i).normalize();g.cross(i,e).normalize();this.n11=e.x;this.n12=e.y;this.n13=e.z;this.n14=-e.dot(a);this.n21=g.x;this.n22=g.y;this.n23=g.z;this.n24=-g.dot(a); this.n31=i.x;this.n32=i.y;this.n33=i.z;this.n34=-i.dot(a);this.n43=this.n42=this.n41=0;this.n44=1;return this},multiplyVector3:function(a){var b=a.x,d=a.y,e=a.z,g=1/(this.n41*b+this.n42*d+this.n43*e+this.n44);a.x=(this.n11*b+this.n12*d+this.n13*e+this.n14)*g;a.y=(this.n21*b+this.n22*d+this.n23*e+this.n24)*g;a.z=(this.n31*b+this.n32*d+this.n33*e+this.n34)*g;return a},multiplyVector3OnlyZ:function(a){var b=a.x,d=a.y;a=a.z;return(this.n31*b+this.n32*d+this.n33*a+this.n34)*(1/(this.n41*b+this.n42*d+this.n43* a+this.n44))},multiplyVector4:function(a){var b=a.x,d=a.y,e=a.z,g=a.w;a.x=this.n11*b+this.n12*d+this.n13*e+this.n14*g;a.y=this.n21*b+this.n22*d+this.n23*e+this.n24*g;a.z=this.n31*b+this.n32*d+this.n33*e+this.n34*g;a.w=this.n41*b+this.n42*d+this.n43*e+this.n44*g;return a},crossVector:function(a){var b=new THREE.Vector4;b.x=this.n11*a.x+this.n12*a.y+this.n13*a.z+this.n14*a.w;b.y=this.n21*a.x+this.n22*a.y+this.n23*a.z+this.n24*a.w;b.z=this.n31*a.x+this.n32*a.y+this.n33*a.z+this.n34*a.w;b.w=a.w?this.n41* a.x+this.n42*a.y+this.n43*a.z+this.n44*a.w:1;return b},multiply:function(a,b){var d=a.n11,e=a.n12,g=a.n13,i=a.n14,l=a.n21,m=a.n22,k=a.n23,o=a.n24,s=a.n31,w=a.n32,u=a.n33,x=a.n34,F=a.n41,I=a.n42,H=a.n43,r=a.n44,Z=b.n11,E=b.n12,L=b.n13,c=b.n14,ia=b.n21,T=b.n22,O=b.n23,ca=b.n24,S=b.n31,ba=b.n32,V=b.n33,D=b.n34,J=b.n41,la=b.n42,Q=b.n43,ja=b.n44;this.n11=d*Z+e*ia+g*S+i*J;this.n12=d*E+e*T+g*ba+i*la;this.n13=d*L+e*O+g*V+i*Q;this.n14=d*c+e*ca+g*D+i*ja;this.n21=l*Z+m*ia+k*S+o*J;this.n22=l*E+m*T+k*ba+o*la; this.n23=l*L+m*O+k*V+o*Q;this.n24=l*c+m*ca+k*D+o*ja;this.n31=s*Z+w*ia+u*S+x*J;this.n32=s*E+w*T+u*ba+x*la;this.n33=s*L+w*O+u*V+x*Q;this.n34=s*c+w*ca+u*D+x*ja;this.n41=F*Z+I*ia+H*S+r*J;this.n42=F*E+I*T+H*ba+r*la;this.n43=F*L+I*O+H*V+r*Q;this.n44=F*c+I*ca+H*D+r*ja;return this},multiplyToArray:function(a,b,d){var e=a.n11,g=a.n12,i=a.n13,l=a.n14,m=a.n21,k=a.n22,o=a.n23,s=a.n24,w=a.n31,u=a.n32,x=a.n33,F=a.n34,I=a.n41,H=a.n42,r=a.n43;a=a.n44;var Z=b.n11,E=b.n12,L=b.n13,c=b.n14,ia=b.n21,T=b.n22,O=b.n23,ca= b.n24,S=b.n31,ba=b.n32,V=b.n33,D=b.n34,J=b.n41,la=b.n42,Q=b.n43;b=b.n44;this.n11=e*Z+g*ia+i*S+l*J;this.n12=e*E+g*T+i*ba+l*la;this.n13=e*L+g*O+i*V+l*Q;this.n14=e*c+g*ca+i*D+l*b;this.n21=m*Z+k*ia+o*S+s*J;this.n22=m*E+k*T+o*ba+s*la;this.n23=m*L+k*O+o*V+s*Q;this.n24=m*c+k*ca+o*D+s*b;this.n31=w*Z+u*ia+x*S+F*J;this.n32=w*E+u*T+x*ba+F*la;this.n33=w*L+u*O+x*V+F*Q;this.n34=w*c+u*ca+x*D+F*b;this.n41=I*Z+H*ia+r*S+a*J;this.n42=I*E+H*T+r*ba+a*la;this.n43=I*L+H*O+r*V+a*Q;this.n44=I*c+H*ca+r*D+a*b;d[0]=this.n11; d[1]=this.n21;d[2]=this.n31;d[3]=this.n41;d[4]=this.n12;d[5]=this.n22;d[6]=this.n32;d[7]=this.n42;d[8]=this.n13;d[9]=this.n23;d[10]=this.n33;d[11]=this.n43;d[12]=this.n14;d[13]=this.n24;d[14]=this.n34;d[15]=this.n44;return this},multiplySelf:function(a){var b=this.n11,d=this.n12,e=this.n13,g=this.n14,i=this.n21,l=this.n22,m=this.n23,k=this.n24,o=this.n31,s=this.n32,w=this.n33,u=this.n34,x=this.n41,F=this.n42,I=this.n43,H=this.n44,r=a.n11,Z=a.n21,E=a.n31,L=a.n41,c=a.n12,ia=a.n22,T=a.n32,O=a.n42,ca= a.n13,S=a.n23,ba=a.n33,V=a.n43,D=a.n14,J=a.n24,la=a.n34;a=a.n44;this.n11=b*r+d*Z+e*E+g*L;this.n12=b*c+d*ia+e*T+g*O;this.n13=b*ca+d*S+e*ba+g*V;this.n14=b*D+d*J+e*la+g*a;this.n21=i*r+l*Z+m*E+k*L;this.n22=i*c+l*ia+m*T+k*O;this.n23=i*ca+l*S+m*ba+k*V;this.n24=i*D+l*J+m*la+k*a;this.n31=o*r+s*Z+w*E+u*L;this.n32=o*c+s*ia+w*T+u*O;this.n33=o*ca+s*S+w*ba+u*V;this.n34=o*D+s*J+w*la+u*a;this.n41=x*r+F*Z+I*E+H*L;this.n42=x*c+F*ia+I*T+H*O;this.n43=x*ca+F*S+I*ba+H*V;this.n44=x*D+F*J+I*la+H*a;return this},multiplyScalar:function(a){this.n11*= a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,d=this.n13,e=this.n14,g=this.n21,i=this.n22,l=this.n23,m=this.n24,k=this.n31,o=this.n32,s=this.n33,w=this.n34,u=this.n41,x=this.n42,F=this.n43,I=this.n44;return e*l*o*u-d*m*o*u-e*i*s*u+b*m*s*u+d*i*w*u-b*l*w*u-e*l*k*x+d*m*k*x+e*g*s*x-a*m*s*x-d*g*w*x+a*l*w*x+ e*i*k*F-b*m*k*F-e*g*o*F+a*m*o*F+b*g*w*F-a*i*w*F-d*i*k*I+b*l*k*I+d*g*o*I-a*l*o*I-b*g*s*I+a*i*s*I},transpose:function(){function a(b,d,e){var g=b[d];b[d]=b[e];b[e]=g}a(this,"n21","n12");a(this,"n31","n13");a(this,"n32","n23");a(this,"n41","n14");a(this,"n42","n24");a(this,"n43","n34");return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33; a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){var a=this.flat;a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArray:function(a){a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;a[8]= this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,b){a[b]=this.n11;a[b+1]=this.n21;a[b+2]=this.n31;a[b+3]=this.n41;a[b+4]=this.n12;a[b+5]=this.n22;a[b+6]=this.n32;a[b+7]=this.n42;a[b+8]=this.n13;a[b+9]=this.n23;a[b+10]=this.n33;a[b+11]=this.n43;a[b+12]=this.n14;a[b+13]=this.n24;a[b+14]=this.n34;a[b+15]=this.n44;return a},setTranslation:function(a,b,d){this.set(1,0,0,a,0,1,0,b,0,0,1,d,0,0,0,1); return this},setScale:function(a,b,d){this.set(a,0,0,0,0,b,0,0,0,0,d,0,0,0,0,1);return this},setRotX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},setRotY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},setRotZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},setRotAxis:function(a,b){var d=Math.cos(b),e=Math.sin(b),g=1-d,i=a.x,l=a.y,m=a.z,k=g* i,o=g*l;this.set(k*i+d,k*l-e*m,k*m+e*l,0,k*l+e*m,o*l+d,o*m-e*i,0,k*m-e*l,o*m+e*i,g*m*m+d,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},setRotationFromEuler:function(a){var b=a.x,d=a.y,e=a.z;a=Math.cos(d);d=Math.sin(d);var g=Math.cos(-e);e=Math.sin(-e);var i=Math.cos(b);b=Math.sin(b);var l=a*e,m=d*e;this.n11=a*g;this.n12=d*b-l*i;this.n13=l*b+d*i;this.n21=e;this.n22=g*i;this.n23=-g*b;this.n31=-d*g;this.n32=m*i+a*b;this.n33=-m*b+a*i},setRotationFromQuaternion:function(a){var b= a.x,d=a.y,e=a.z,g=a.w,i=b+b,l=d+d,m=e+e;a=b*i;var k=b*l;b*=m;var o=d*l;d*=m;e*=m;i*=g;l*=g;g*=m;this.n11=1-(o+e);this.n12=k-g;this.n13=b+l;this.n21=k+g;this.n22=1-(a+e);this.n23=d-i;this.n31=b-l;this.n32=d+i;this.n33=1-(a+o)},scale:function(a){var b=a.x,d=a.y;a=a.z;this.n11*=b;this.n12*=b;this.n13*=b;this.n21*=d;this.n22*=d;this.n23*=d;this.n31*=a;this.n32*=a;this.n33*=a;return this},extractRotationMatrix:function(a){a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=0;a.n21=this.n21;a.n22=this.n22; a.n23=this.n23;a.n24=0;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=0;a.n41=0;a.n42=0;a.n43=0;a.n44=1},toString:function(){return"| "+this.n11+" "+this.n12+" "+this.n13+" "+this.n14+" |\n| "+this.n21+" "+this.n22+" "+this.n23+" "+this.n24+" |\n| "+this.n31+" "+this.n32+" "+this.n33+" "+this.n34+" |\n| "+this.n41+" "+this.n42+" "+this.n43+" "+this.n44+" |"}};THREE.Matrix4.translationMatrix=function(a,b,d){var e=new THREE.Matrix4;e.setTranslation(a,b,d);return e}; THREE.Matrix4.scaleMatrix=function(a,b,d){var e=new THREE.Matrix4;e.setScale(a,b,d);return e};THREE.Matrix4.rotationXMatrix=function(a){var b=new THREE.Matrix4;b.setRotX(a);return b};THREE.Matrix4.rotationYMatrix=function(a){var b=new THREE.Matrix4;b.setRotY(a);return b};THREE.Matrix4.rotationZMatrix=function(a){var b=new THREE.Matrix4;b.setRotZ(a);return b};THREE.Matrix4.rotationAxisAngleMatrix=function(a,b){var d=new THREE.Matrix4;d.setRotAxis(a,b);return d}; THREE.Matrix4.makeInvert=function(a,b){var d=a.n11,e=a.n12,g=a.n13,i=a.n14,l=a.n21,m=a.n22,k=a.n23,o=a.n24,s=a.n31,w=a.n32,u=a.n33,x=a.n34,F=a.n41,I=a.n42,H=a.n43,r=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=k*x*I-o*u*I+o*w*H-m*x*H-k*w*r+m*u*r;b.n12=i*u*I-g*x*I-i*w*H+e*x*H+g*w*r-e*u*r;b.n13=g*o*I-i*k*I+i*m*H-e*o*H-g*m*r+e*k*r;b.n14=i*k*w-g*o*w-i*m*u+e*o*u+g*m*x-e*k*x;b.n21=o*u*F-k*x*F-o*s*H+l*x*H+k*s*r-l*u*r;b.n22=g*x*F-i*u*F+i*s*H-d*x*H-g*s*r+d*u*r;b.n23=i*k*F-g*o*F-i*l*H+d*o*H+g*l*r-d*k*r; b.n24=g*o*s-i*k*s+i*l*u-d*o*u-g*l*x+d*k*x;b.n31=m*x*F-o*w*F+o*s*I-l*x*I-m*s*r+l*w*r;b.n32=i*w*F-e*x*F-i*s*I+d*x*I+e*s*r-d*w*r;b.n33=g*o*F-i*m*F+i*l*I-d*o*I-e*l*r+d*m*r;b.n34=i*m*s-e*o*s-i*l*w+d*o*w+e*l*x-d*m*x;b.n41=k*w*F-m*u*F-k*s*I+l*u*I+m*s*H-l*w*H;b.n42=e*u*F-g*w*F+g*s*I-d*u*I-e*s*H+d*w*H;b.n43=g*m*F-e*k*F-g*l*I+d*k*I+e*l*H-d*m*H;b.n44=e*k*s-g*m*s+g*l*w-d*k*w-e*l*u+d*m*u;b.multiplyScalar(1/a.determinant());return b}; THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,d=b.m,e=a.n33*a.n22-a.n32*a.n23,g=-a.n33*a.n21+a.n31*a.n23,i=a.n32*a.n21-a.n31*a.n22,l=-a.n33*a.n12+a.n32*a.n13,m=a.n33*a.n11-a.n31*a.n13,k=-a.n32*a.n11+a.n31*a.n12,o=a.n23*a.n12-a.n22*a.n13,s=-a.n23*a.n11+a.n21*a.n13,w=a.n22*a.n11-a.n21*a.n12;a=a.n11*e+a.n21*l+a.n31*o;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*e;d[1]=a*g;d[2]=a*i;d[3]=a*l;d[4]=a*m;d[5]=a*k;d[6]=a*o;d[7]=a*s;d[8]=a*w;return b}; THREE.Matrix4.makeFrustum=function(a,b,d,e,g,i){var l;l=new THREE.Matrix4;l.n11=2*g/(b-a);l.n12=0;l.n13=(b+a)/(b-a);l.n14=0;l.n21=0;l.n22=2*g/(e-d);l.n23=(e+d)/(e-d);l.n24=0;l.n31=0;l.n32=0;l.n33=-(i+g)/(i-g);l.n34=-2*i*g/(i-g);l.n41=0;l.n42=0;l.n43=-1;l.n44=0;return l};THREE.Matrix4.makePerspective=function(a,b,d,e){var g;a=d*Math.tan(a*Math.PI/360);g=-a;return THREE.Matrix4.makeFrustum(g*b,a*b,g,a,d,e)}; THREE.Matrix4.makeOrtho=function(a,b,d,e,g,i){var l,m,k,o;l=new THREE.Matrix4;m=b-a;k=d-e;o=i-g;l.n11=2/m;l.n12=0;l.n13=0;l.n14=-((b+a)/m);l.n21=0;l.n22=2/k;l.n23=0;l.n24=-((d+e)/k);l.n31=0;l.n32=0;l.n33=-2/o;l.n34=-((i+g)/o);l.n41=0;l.n42=0;l.n43=0;l.n44=1;return l};THREE.Matrix4.__tmpVec1=new THREE.Vector3;THREE.Matrix4.__tmpVec2=new THREE.Vector3;THREE.Matrix4.__tmpVec3=new THREE.Vector3; THREE.Object3D=function(){this.id=THREE.Object3DCounter.value++;this.parent=undefined;this.children=[];this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.matrixRotation=new THREE.Matrix4;this.localMatrix=new THREE.Matrix4;this.globalMatrix=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixNeedsUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.screenPosition=new THREE.Vector4;this.boundRadius=0;this.boundRadiusScale= 1;this.visible=!0};THREE.Object3D.prototype.update=function(a,b,d){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0}var e=this.children.length;for(a=0;a=1){d.w=a.w;d.x=a.x;d.y=a.y;d.z=a.z;return d}var i=Math.acos(g),l=Math.sqrt(1-g*g);if(Math.abs(l)<0.001){d.w=0.5*(a.w+b.w);d.x=0.5*(a.x+b.x);d.y=0.5*(a.y+b.y);d.z=0.5*(a.z+b.z);return d}g=Math.sin((1-e)*i)/l;e=Math.sin(e*i)/l;d.w=a.w*g+b.w*e;d.x=a.x*g+b.x*e;d.y=a.y*g+b.y*e;d.z=a.z*g+b.z*e;return d}; THREE.Vertex=function(a,b){this.position=a||new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.normal=b||new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.normalScreen=new THREE.Vector3;this.tangent=new THREE.Vector4;this.__visible=!0};THREE.Vertex.prototype={toString:function(){return"THREE.Vertex ( position: "+this.position+", normal: "+this.normal+" )"}}; THREE.Face3=function(a,b,d,e,g){this.a=a;this.b=b;this.c=d;this.centroid=new THREE.Vector3;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.materials=g instanceof Array?g:[g]};THREE.Face3.prototype={toString:function(){return"THREE.Face3 ( "+this.a+", "+this.b+", "+this.c+" )"}}; THREE.Face4=function(a,b,d,e,g,i){this.a=a;this.b=b;this.c=d;this.d=e;this.centroid=new THREE.Vector3;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.materials=i instanceof Array?i:[i]};THREE.Face4.prototype={toString:function(){return"THREE.Face4 ( "+this.a+", "+this.b+", "+this.c+" "+this.d+" )"}};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; THREE.UV.prototype={copy:function(a){this.u=a.u;this.v=a.v},toString:function(){return"THREE.UV ("+this.u+", "+this.v+")"}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.faces=[];this.uvs=[];this.uvs2=[];this.colors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.geometryChunks={};this.hasTangents=!1}; THREE.Geometry.prototype={computeCentroids:function(){var a,b,d;a=0;for(b=this.faces.length;a0){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 b=1,d=this.vertices.length;bthis.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.ythis.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,b=0,d=this.vertices.length;b65535){o[m].counter+=1;k=o[m].hash+"_"+o[m].counter;this.geometryChunks[k]==undefined&&(this.geometryChunks[k]={faces:[],materials:l,vertices:0})}this.geometryChunks[k].faces.push(e);this.geometryChunks[k].vertices+=i}},toString:function(){return"THREE.Geometry ( vertices: "+ this.vertices+", faces: "+this.faces+", uvs: "+this.uvs+" )"}};THREE.GeometryIdCounter=0; THREE.AnimationHandler=function(){var a=[],b={};b.update=function(d){for(var e=0;ethis.data.length){for(;k>this.data.length;)k-=this.data.length;this.startTime=(new Date).getTime()*0.001-k;k=(new Date).getTime()*0.001-this.startTime}l=Math.min(parseInt(k*this.data.fps),parseInt(this.data.length*this.data.fps));for(var s=0,w=this.hierarchy.length;s1){console.log("Scale out of bounds:"+b);b=b<0?0:1}THREE.Quaternion.slerp(e,g,i.quaternion,b)}else{d=d==="pos"?i.position:i.scale;d.x=e[0]+(g[0]-e[0])*b;d.y=e[1]+(g[1]-e[1])*b;d.z=e[2]+(g[2]-e[2])*b}}}if(m[0][l]===undefined){this.hierarchy[0].update(undefined,!0);for(s=0;s-this.zNear)return!1;if(l+i<-this.zFar)return!1;l-=i;var m=this.projectionMatrix,k=1/(m.n43*l),o=k*this.screenCenterX,s=(g.n11*b+g.n12*d+g.n13*e+g.n14)*m.n11*o;i=m.n11*i*o;if(s+i<-this.screenCenterX)return!1;if(s-i>this.screenCenterX)return!1;b=(g.n21*b+g.n22*d+g.n23*e+g.n24)*m.n22*k*this.screenCenterY; if(b+i<-this.screenCenterY)return!1;if(b-i>this.screenCenterY)return!1;a.screenPosition.set(s,b,l,i);return!0};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight; THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.FlatShading=0;THREE.SmoothShading=1; THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.BillboardBlending=3;THREE.ReverseSubtractiveBlending=4;THREE.MaterialCounter={value:0}; THREE.LineBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;this.depth_test=!0;this.linewidth=1;this.linejoin=this.linecap="round";this.vertex_colors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending;if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.linewidth!==undefined)this.linewidth= a.linewidth;if(a.linecap!==undefined)this.linecap=a.linecap;if(a.linejoin!==undefined)this.linejoin=a.linejoin;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors}}; THREE.LineBasicMaterial.prototype={toString:function(){return"THREE.LineBasicMaterial (
id: "+this.id+"
color: "+this.color+"
opacity: "+this.opacity+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
linewidth: "+this.linewidth+"
linecap: "+this.linecap+"
linejoin: "+this.linejoin+"
vertex_colors: "+this.vertex_colors+"
)"}}; THREE.MeshBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.env_map=this.light_map=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refraction_ratio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depth_test=!0;this.wireframe=!1;this.wireframe_linewidth=1;this.wireframe_linejoin=this.wireframe_linecap="round";this.vertex_colors=!1;this.skinning=!1;if(a){a.color!== undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.light_map!==undefined)this.light_map=a.light_map;if(a.env_map!==undefined)this.env_map=a.env_map;if(a.combine!==undefined)this.combine=a.combine;if(a.reflectivity!==undefined)this.reflectivity=a.reflectivity;if(a.refraction_ratio!==undefined)this.refraction_ratio=a.refraction_ratio;if(a.fog!==undefined)this.fog=a.fog;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!== undefined)this.blending=a.blending;if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframe_linewidth!==undefined)this.wireframe_linewidth=a.wireframe_linewidth;if(a.wireframe_linecap!==undefined)this.wireframe_linecap=a.wireframe_linecap;if(a.wireframe_linejoin!==undefined)this.wireframe_linejoin=a.wireframe_linejoin;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors;if(a.skinning!==undefined)this.skinning=a.skinning}}; THREE.MeshBasicMaterial.prototype={toString:function(){return"THREE.MeshBasicMaterial (
id: "+this.id+"
color: "+this.color+"
opacity: "+this.opacity+"
map: "+this.map+"
light_map: "+this.light_map+"
env_map: "+this.env_map+"
combine: "+this.combine+"
reflectivity: "+this.reflectivity+"
refraction_ratio: "+this.refraction_ratio+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
wireframe: "+this.wireframe+"
wireframe_linewidth: "+this.wireframe_linewidth+ "
wireframe_linecap: "+this.wireframe_linecap+"
wireframe_linejoin: "+this.wireframe_linejoin+"
vertex_colors: "+this.vertex_colors+"
skinning: "+this.skinning+"
)"}}; THREE.MeshLambertMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.env_map=this.light_map=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refraction_ratio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depth_test=!0;this.wireframe=!1;this.wireframe_linewidth=1;this.wireframe_linejoin=this.wireframe_linecap="round";this.vertex_colors=!1;this.skinning=!1;if(a){a.color!== undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.light_map!==undefined)this.light_map=a.light_map;if(a.env_map!==undefined)this.env_map=a.env_map;if(a.combine!==undefined)this.combine=a.combine;if(a.reflectivity!==undefined)this.reflectivity=a.reflectivity;if(a.refraction_ratio!==undefined)this.refraction_ratio=a.refraction_ratio;if(a.fog!==undefined)this.fog=a.fog;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!== undefined)this.blending=a.blending;if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframe_linewidth!==undefined)this.wireframe_linewidth=a.wireframe_linewidth;if(a.wireframe_linecap!==undefined)this.wireframe_linecap=a.wireframe_linecap;if(a.wireframe_linejoin!==undefined)this.wireframe_linejoin=a.wireframe_linejoin;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors;if(a.skinning!==undefined)this.skinning=a.skinning}}; THREE.MeshLambertMaterial.prototype={toString:function(){return"THREE.MeshLambertMaterial (
id: "+this.id+"
color: "+this.color+"
opacity: "+this.opacity+"
map: "+this.map+"
light_map: "+this.light_map+"
env_map: "+this.env_map+"
combine: "+this.combine+"
reflectivity: "+this.reflectivity+"
refraction_ratio: "+this.refraction_ratio+"
shading: "+this.shading+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
wireframe: "+this.wireframe+ "
wireframe_linewidth: "+this.wireframe_linewidth+"
wireframe_linecap: "+this.wireframe_linecap+"
wireframe_linejoin: "+this.wireframe_linejoin+"
vertex_colors: "+this.vertex_colors+"
skinning: "+this.skinning+"
)"}}; THREE.MeshPhongMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(328965);this.specular=new THREE.Color(1118481);this.shininess=30;this.opacity=1;this.env_map=this.light_map=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refraction_ratio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depth_test=!0;this.wireframe=!1;this.wireframe_linewidth=1;this.wireframe_linejoin= this.wireframe_linecap="round";this.vertex_colors=!1;this.skinning=!1;if(a){if(a.color!==undefined)this.color=new THREE.Color(a.color);if(a.ambient!==undefined)this.ambient=new THREE.Color(a.ambient);if(a.specular!==undefined)this.specular=new THREE.Color(a.specular);if(a.shininess!==undefined)this.shininess=a.shininess;if(a.opacity!==undefined)this.opacity=a.opacity;if(a.light_map!==undefined)this.light_map=a.light_map;if(a.map!==undefined)this.map=a.map;if(a.env_map!==undefined)this.env_map=a.env_map; if(a.combine!==undefined)this.combine=a.combine;if(a.reflectivity!==undefined)this.reflectivity=a.reflectivity;if(a.refraction_ratio!==undefined)this.refraction_ratio=a.refraction_ratio;if(a.fog!==undefined)this.fog=a.fog;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframe_linewidth!==undefined)this.wireframe_linewidth=a.wireframe_linewidth; if(a.wireframe_linecap!==undefined)this.wireframe_linecap=a.wireframe_linecap;if(a.wireframe_linejoin!==undefined)this.wireframe_linejoin=a.wireframe_linejoin;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors;if(a.skinning!==undefined)this.skinning=a.skinning}}; THREE.MeshPhongMaterial.prototype={toString:function(){return"THREE.MeshPhongMaterial (
id: "+this.id+"
color: "+this.color+"
ambient: "+this.ambient+"
specular: "+this.specular+"
shininess: "+this.shininess+"
opacity: "+this.opacity+"
map: "+this.map+"
env_map: "+this.env_map+"
combine: "+this.combine+"
reflectivity: "+this.reflectivity+"
refraction_ratio: "+this.refraction_ratio+"
shading: "+this.shading+"
blending: "+this.blending+"
depth_test: "+ this.depth_test+"
wireframe: "+this.wireframe+"
wireframe_linewidth: "+this.wireframe_linewidth+"
wireframe_linecap: "+this.wireframe_linecap+"
wireframe_linejoin: "+this.wireframe_linejoin+"
vertex_colors: "+this.vertex_colors+"
skinning: "+this.skinning+"
)"}}; THREE.MeshDepthMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.opacity=1;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depth_test=!0;this.wireframe=!1;this.wireframe_linewidth=1;if(a){if(a.opacity!==undefined)this.opacity=a.opacity;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframe_linewidth!== undefined)this.wireframe_linewidth=a.wireframe_linewidth}};THREE.MeshDepthMaterial.prototype={toString:function(){return"THREE.MeshDepthMaterial (
id: "+this.id+"
opacity: "+this.opacity+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
wireframe: "+this.wireframe+"
wireframe_linewidth: "+this.wireframe_linewidth+"
)"}}; THREE.MeshNormalMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.opacity=1;this.shading=THREE.FlatShading;this.blending=THREE.NormalBlending;this.depth_test=!0;this.wireframe=!1;this.wireframe_linewidth=1;if(a){if(a.opacity!==undefined)this.opacity=a.opacity;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframe_linewidth!== undefined)this.wireframe_linewidth=a.wireframe_linewidth}};THREE.MeshNormalMaterial.prototype={toString:function(){return"THREE.MeshNormalMaterial (
id: "+this.id+"
opacity: "+this.opacity+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
wireframe: "+this.wireframe+"
wireframe_linewidth: "+this.wireframe_linewidth+"
)"}};THREE.MeshFaceMaterial=function(){};THREE.MeshFaceMaterial.prototype={toString:function(){return"THREE.MeshFaceMaterial"}}; THREE.MeshShaderMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.vertex_shader=this.fragment_shader="void main() {}";this.uniforms={};this.opacity=1;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depth_test=!0;this.wireframe=!1;this.wireframe_linewidth=1;this.wireframe_linejoin=this.wireframe_linecap="round";this.vertex_colors=!1;this.skinning=!1;if(a){if(a.fragment_shader!==undefined)this.fragment_shader=a.fragment_shader;if(a.vertex_shader!==undefined)this.vertex_shader= a.vertex_shader;if(a.uniforms!==undefined)this.uniforms=a.uniforms;if(a.opacity!==undefined)this.opacity=a.opacity;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframe_linewidth!==undefined)this.wireframe_linewidth=a.wireframe_linewidth;if(a.wireframe_linecap!==undefined)this.wireframe_linecap=a.wireframe_linecap;if(a.wireframe_linejoin!== undefined)this.wireframe_linejoin=a.wireframe_linejoin;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors;if(a.skinning!==undefined)this.skinning=a.skinning}}; THREE.MeshShaderMaterial.prototype={toString:function(){return"THREE.MeshShaderMaterial (
id: "+this.id+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
wireframe: "+this.wireframe+"
wireframe_linewidth: "+this.wireframe_linewidth+"
wireframe_linecap: "+this.wireframe_linecap+"
wireframe_linejoin: "+this.wireframe_linejoin+"
vertex_colors: "+this.vertex_colors+"
skinning: "+this.skinning+"
)"}}; THREE.ParticleBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.map=null;this.size=1;this.blending=THREE.NormalBlending;this.depth_test=!0;this.offset=new THREE.Vector2;this.vertex_colors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.size!==undefined)this.size=a.size;if(a.blending!==undefined)this.blending=a.blending;if(a.depth_test!== undefined)this.depth_test=a.depth_test;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors}};THREE.ParticleBasicMaterial.prototype={toString:function(){return"THREE.ParticleBasicMaterial (
id: "+this.id+"
color: "+this.color+"
opacity: "+this.opacity+"
map: "+this.map+"
size: "+this.size+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
vertex_colors: "+this.vertex_colors+"
)"}}; THREE.ParticleCircleMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending}}; THREE.ParticleCircleMaterial.prototype={toString:function(){return"THREE.ParticleCircleMaterial (
color: "+this.color+"
opacity: "+this.opacity+"
blending: "+this.blending+"
)"}};THREE.ParticleDOMMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.domElement=a};THREE.ParticleDOMMaterial.prototype={toString:function(){return"THREE.ParticleDOMMaterial ( domElement: "+this.domElement+" )"}}; THREE.Texture=function(a,b,d,e,g,i){if(a.getContext)a.loaded=!0;this.image=a;this.mapping=b!==undefined?b:new THREE.UVMapping;this.wrap_s=d!==undefined?d:THREE.ClampToEdgeWrapping;this.wrap_t=e!==undefined?e:THREE.ClampToEdgeWrapping;this.mag_filter=g!==undefined?g:THREE.LinearFilter;this.min_filter=i!==undefined?i:THREE.LinearMipMapLinearFilter}; THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrap_s,this.wrap_t,this.mag_filter,this.min_filter)},toString:function(){return"THREE.Texture (
image: "+this.image+"
wrap_s: "+this.wrap_s+"
wrap_t: "+this.wrap_t+"
mag_filter: "+this.mag_filter+"
min_filter: "+this.min_filter+"
)"}};THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2; THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20; THREE.RenderTarget=function(a,b,d){this.width=a;this.height=b;d=d||{};this.wrap_s=d.wrap_s!==undefined?d.wrap_s:THREE.ClampToEdgeWrapping;this.wrap_t=d.wrap_t!==undefined?d.wrap_t:THREE.ClampToEdgeWrapping;this.mag_filter=d.mag_filter!==undefined?d.mag_filter:THREE.LinearFilter;this.min_filter=d.min_filter!==undefined?d.min_filter:THREE.LinearMipMapLinearFilter;this.format=d.format!==undefined?d.format:THREE.RGBFormat;this.type=d.type!==undefined?d.type:THREE.UnsignedByteType}; var Uniforms={clone:function(a){var b,d,e,g={};for(b in a){g[b]={};for(d in a[b]){e=a[b][d];g[b][d]=e instanceof THREE.Color||e instanceof THREE.Vector3||e instanceof THREE.Texture?e.clone():e}}return g},merge:function(a){var b,d,e,g={};for(b=0;b=0&&V>=0&&D>=0&&J>=0)return!0;else if(ba<0&&V<0||D<0&&J<0)return!1;else{if(ba<0)ca=Math.max(ca,ba/(ba-V));else V<0&&(S=Math.min(S,ba/(ba-V)));if(D<0)ca=Math.max(ca,D/(D-J));else J<0&&(S=Math.min(S,D/(D-J)));if(Sba&&Q.z0&&H.z<1){u=F[x]=F[x]||new THREE.RenderableParticle;u.x=H.x/H.w;u.y=H.y/H.w;u.z=H.z;u.rotation=R.rotation.z;u.scale.x=R.scale.x*Math.abs(u.x- (H.x+O.projectionMatrix.n11)/(H.w+O.projectionMatrix.n14));u.scale.y=R.scale.y*Math.abs(u.y-(H.y+O.projectionMatrix.n22)/(H.w+O.projectionMatrix.n24));u.materials=R.materials;S.push(u);x++}}}}ca&&S.sort(a);return S};this.unprojectVector=function(T,O){var ca=THREE.Matrix4.makeInvert(O.globalMatrix);ca.multiplySelf(THREE.Matrix4.makeInvert(O.projectionMatrix));ca.multiplyVector3(T);return T}}; THREE.DOMRenderer=function(){THREE.Renderer.call(this);var a=null,b=new THREE.Projector,d,e,g,i;this.domElement=document.createElement("div");this.setSize=function(l,m){d=l;e=m;g=d/2;i=e/2};this.render=function(l,m){var k,o,s,w,u,x,F,I;a=b.projectScene(l,m);k=0;for(o=a.length;k0){B.r+=xa.r*ma;B.g+=xa.g*ma;B.b+=xa.b*ma}}else if(ma instanceof THREE.PointLight){C.sub(ma.position,X);C.normalize();ma=Y.dot(C)* Da;if(ma>0){B.r+=xa.r*ma;B.g+=xa.g*ma;B.b+=xa.b*ma}}}}function Ga(z,X,Y){if(Y.opacity!=0){a(Y.opacity);b(Y.blending);var B,U,ma,xa,Da,Ea;if(Y instanceof THREE.ParticleBasicMaterial){if(Y.map&&Y.map.image.loaded){xa=Y.map.image;Da=xa.width>>1;Ea=xa.height>>1;U=X.scale.x*m;ma=X.scale.y*k;Y=U*Da;B=ma*Ea;h.set(z.x-Y,z.y-B,z.x+Y,z.y+B);if(p.instersects(h)){o.save();o.translate(z.x,z.y);o.rotate(-X.rotation);o.scale(U,-ma);o.translate(-Da,-Ea);o.drawImage(xa,0,0);o.restore()}}}else if(Y instanceof THREE.ParticleCircleMaterial){if(q){t.r= A.r+W.r+G.r;t.g=A.g+W.g+G.g;t.b=A.b+W.b+G.b;S.r=Y.color.r*t.r;S.g=Y.color.g*t.g;S.b=Y.color.b*t.b;S.updateStyleString()}else S.__styleString=Y.color.__styleString;Y=X.scale.x*m;B=X.scale.y*k;h.set(z.x-Y,z.y-B,z.x+Y,z.y+B);if(p.instersects(h)){U=S.__styleString;if(I!=U)o.fillStyle=I=U;o.save();o.translate(z.x,z.y);o.rotate(-X.rotation);o.scale(Y,B);o.beginPath();o.arc(0,0,1,0,M,!0);o.closePath();o.fill();o.restore()}}}}function P(z,X,Y,B){if(B.opacity!=0){a(B.opacity);b(B.blending);o.beginPath();o.moveTo(z.positionScreen.x, z.positionScreen.y);o.lineTo(X.positionScreen.x,X.positionScreen.y);o.closePath();if(B instanceof THREE.LineBasicMaterial){S.__styleString=B.color.__styleString;z=B.linewidth;if(H!=z)o.lineWidth=H=z;z=S.__styleString;if(F!=z)o.strokeStyle=F=z;o.stroke();h.inflate(B.linewidth*2)}}}function N(z,X,Y,B,U,ma){if(U.opacity!=0){a(U.opacity);b(U.blending);L=z.positionScreen.x;c=z.positionScreen.y;ia=X.positionScreen.x;T=X.positionScreen.y;O=Y.positionScreen.x;ca=Y.positionScreen.y;o.beginPath();o.moveTo(L, c);o.lineTo(ia,T);o.lineTo(O,ca);o.lineTo(L,c);o.closePath();if(U instanceof THREE.MeshBasicMaterial)if(U.map)U.map.image.loaded&&U.map.mapping instanceof THREE.UVMapping&&Ca(L,c,ia,T,O,ca,U.map.image,B.uvs[0].u,B.uvs[0].v,B.uvs[1].u,B.uvs[1].v,B.uvs[2].u,B.uvs[2].v);else if(U.env_map){if(U.env_map.image.loaded&&U.env_map.mapping instanceof THREE.SphericalReflectionMapping){z=y.globalMatrix;C.copy(B.vertexNormalsWorld[0]);ea=(C.x*z.n11+C.y*z.n12+C.z*z.n13)*0.5+0.5;R=-(C.x*z.n21+C.y*z.n22+C.z*z.n23)* 0.5+0.5;C.copy(B.vertexNormalsWorld[1]);ra=(C.x*z.n11+C.y*z.n12+C.z*z.n13)*0.5+0.5;wa=-(C.x*z.n21+C.y*z.n22+C.z*z.n23)*0.5+0.5;C.copy(B.vertexNormalsWorld[2]);f=(C.x*z.n11+C.y*z.n12+C.z*z.n13)*0.5+0.5;n=-(C.x*z.n21+C.y*z.n22+C.z*z.n23)*0.5+0.5;Ca(L,c,ia,T,O,ca,U.env_map.image,ea,R,ra,wa,f,n)}}else U.wireframe?K(U.color.__styleString,U.wireframe_linewidth):oa(U.color.__styleString);else if(U instanceof THREE.MeshLambertMaterial){if(U.map&&!U.wireframe){U.map.mapping instanceof THREE.UVMapping&&Ca(L, c,ia,T,O,ca,U.map.image,B.uvs[0].u,B.uvs[0].v,B.uvs[1].u,B.uvs[1].v,B.uvs[2].u,B.uvs[2].v);b(THREE.SubtractiveBlending)}if(q)if(!U.wireframe&&U.shading==THREE.SmoothShading&&B.vertexNormalsWorld.length==3){ba.r=V.r=D.r=A.r;ba.g=V.g=D.g=A.g;ba.b=V.b=D.b=A.b;za(ma,B.v1.positionWorld,B.vertexNormalsWorld[0],ba);za(ma,B.v2.positionWorld,B.vertexNormalsWorld[1],V);za(ma,B.v3.positionWorld,B.vertexNormalsWorld[2],D);J.r=(V.r+D.r)*0.5;J.g=(V.g+D.g)*0.5;J.b=(V.b+D.b)*0.5;ja=Aa(ba,V,D,J);Ca(L,c,ia,T,O,ca, ja,0,0,1,0,0,1)}else{t.r=A.r;t.g=A.g;t.b=A.b;za(ma,B.centroidWorld,B.normalWorld,t);S.r=U.color.r*t.r;S.g=U.color.g*t.g;S.b=U.color.b*t.b;S.updateStyleString();U.wireframe?K(S.__styleString,U.wireframe_linewidth):oa(S.__styleString)}else U.wireframe?K(U.color.__styleString,U.wireframe_linewidth):oa(U.color.__styleString)}else if(U instanceof THREE.MeshDepthMaterial){la=y.near;Q=y.far;ba.r=ba.g=ba.b=1-v(z.positionScreen.z,la,Q);V.r=V.g=V.b=1-v(X.positionScreen.z,la,Q);D.r=D.g=D.b=1-v(Y.positionScreen.z, la,Q);J.r=(V.r+D.r)*0.5;J.g=(V.g+D.g)*0.5;J.b=(V.b+D.b)*0.5;ja=Aa(ba,V,D,J);Ca(L,c,ia,T,O,ca,ja,0,0,1,0,0,1)}else if(U instanceof THREE.MeshNormalMaterial){S.r=Ba(B.normalWorld.x);S.g=Ba(B.normalWorld.y);S.b=Ba(B.normalWorld.z);S.updateStyleString();U.wireframe?K(S.__styleString,U.wireframe_linewidth):oa(S.__styleString)}}}function K(z,X){if(F!=z)o.strokeStyle=F=z;if(H!=X)o.lineWidth=H=X;o.stroke();h.inflate(X*2)}function oa(z){if(I!=z)o.fillStyle=I=z;o.fill()}function Ca(z,X,Y,B,U,ma,xa,Da,Ea,Ia, ya,Ja,Qa){var Ka,La;Ka=xa.width-1;La=xa.height-1;Da*=Ka;Ea*=La;Ia*=Ka;ya*=La;Ja*=Ka;Qa*=La;Y-=z;B-=X;U-=z;ma-=X;Ia-=Da;ya-=Ea;Ja-=Da;Qa-=Ea;Ka=Ia*Qa-Ja*ya;if(Ka!=0){La=1/Ka;Ka=(Qa*Y-ya*U)*La;ya=(Qa*B-ya*ma)*La;Y=(Ia*U-Ja*Y)*La;B=(Ia*ma-Ja*B)*La;z=z-Ka*Da-Y*Ea;X=X-ya*Da-B*Ea;o.save();o.transform(Ka,ya,Y,B,z,X);o.clip();o.drawImage(xa,0,0);o.restore()}}function Aa(z,X,Y,B){var U=~~(z.r*255),ma=~~(z.g*255);z=~~(z.b*255);var xa=~~(X.r*255),Da=~~(X.g*255);X=~~(X.b*255);var Ea=~~(Y.r*255),Ia=~~(Y.g*255); Y=~~(Y.b*255);var ya=~~(B.r*255),Ja=~~(B.g*255);B=~~(B.b*255);ka[0]=U<0?0:U>255?255:U;ka[1]=ma<0?0:ma>255?255:ma;ka[2]=z<0?0:z>255?255:z;ka[4]=xa<0?0:xa>255?255:xa;ka[5]=Da<0?0:Da>255?255:Da;ka[6]=X<0?0:X>255?255:X;ka[8]=Ea<0?0:Ea>255?255:Ea;ka[9]=Ia<0?0:Ia>255?255:Ia;ka[10]=Y<0?0:Y>255?255:Y;ka[12]=ya<0?0:ya>255?255:ya;ka[13]=Ja<0?0:Ja>255?255:Ja;ka[14]=B<0?0:B>255?255:B;da.putImageData(ua,0,0);ga.drawImage(aa,0,0);return fa}function v(z,X,Y){z=(z-X)/(Y-X);return z*z*(3-2*z)}function Ba(z){z=(z+ 1)*0.5;return z<0?0:z>1?1:z}function Oa(z,X){var Y=X.x-z.x,B=X.y-z.y,U=1/Math.sqrt(Y*Y+B*B);Y*=U;B*=U;X.x+=Y;X.y+=B;z.x-=Y;z.y-=B}var Ma,Ha,$,sa,pa,ta,va,qa;this.autoClear?this.clear():o.setTransform(1,0,0,-1,m,k);d=e.projectScene(na,y,this.sortElements);(q=na.lights.length>0)&&Fa(na);Ma=0;for(Ha=d.length;Ma0){ra.r+=n.color.r*p;ra.g+=n.color.g*p;ra.b+=n.color.b*p}}else if(n instanceof THREE.PointLight){ca.sub(n.position,R.centroidWorld);ca.normalize();p=R.normalWorld.dot(ca)*n.intensity;if(p>0){ra.r+=n.color.r*p;ra.g+=n.color.g*p;ra.b+=n.color.b*p}}}}function b(ea,R,ra,wa,f,n){D=e(J++);D.setAttribute("d","M "+ ea.positionScreen.x+" "+ea.positionScreen.y+" L "+R.positionScreen.x+" "+R.positionScreen.y+" L "+ra.positionScreen.x+","+ra.positionScreen.y+"z");if(f instanceof THREE.MeshBasicMaterial)E.__styleString=f.color.__styleString;else if(f instanceof THREE.MeshLambertMaterial)if(Z){L.r=c.r;L.g=c.g;L.b=c.b;a(n,wa,L);E.r=f.color.r*L.r;E.g=f.color.g*L.g;E.b=f.color.b*L.b;E.updateStyleString()}else E.__styleString=f.color.__styleString;else if(f instanceof THREE.MeshDepthMaterial){O=1-f.__2near/(f.__farPlusNear- wa.z*f.__farMinusNear);E.setRGB(O,O,O)}else f instanceof THREE.MeshNormalMaterial&&E.setRGB(g(wa.normalWorld.x),g(wa.normalWorld.y),g(wa.normalWorld.z));f.wireframe?D.setAttribute("style","fill: none; stroke: "+E.__styleString+"; stroke-width: "+f.wireframe_linewidth+"; stroke-opacity: "+f.opacity+"; stroke-linecap: "+f.wireframe_linecap+"; stroke-linejoin: "+f.wireframe_linejoin):D.setAttribute("style","fill: "+E.__styleString+"; fill-opacity: "+f.opacity);m.appendChild(D)}function d(ea,R,ra,wa, f,n,p){D=e(J++);D.setAttribute("d","M "+ea.positionScreen.x+" "+ea.positionScreen.y+" L "+R.positionScreen.x+" "+R.positionScreen.y+" L "+ra.positionScreen.x+","+ra.positionScreen.y+" L "+wa.positionScreen.x+","+wa.positionScreen.y+"z");if(n instanceof THREE.MeshBasicMaterial)E.__styleString=n.color.__styleString;else if(n instanceof THREE.MeshLambertMaterial)if(Z){L.r=c.r;L.g=c.g;L.b=c.b;a(p,f,L);E.r=n.color.r*L.r;E.g=n.color.g*L.g;E.b=n.color.b*L.b;E.updateStyleString()}else E.__styleString=n.color.__styleString; else if(n instanceof THREE.MeshDepthMaterial){O=1-n.__2near/(n.__farPlusNear-f.z*n.__farMinusNear);E.setRGB(O,O,O)}else n instanceof THREE.MeshNormalMaterial&&E.setRGB(g(f.normalWorld.x),g(f.normalWorld.y),g(f.normalWorld.z));n.wireframe?D.setAttribute("style","fill: none; stroke: "+E.__styleString+"; stroke-width: "+n.wireframe_linewidth+"; stroke-opacity: "+n.opacity+"; stroke-linecap: "+n.wireframe_linecap+"; stroke-linejoin: "+n.wireframe_linejoin):D.setAttribute("style","fill: "+E.__styleString+ "; fill-opacity: "+n.opacity);m.appendChild(D)}function e(ea){if(S[ea]==null){S[ea]=document.createElementNS("http://www.w3.org/2000/svg","path");ja==0&&S[ea].setAttribute("shape-rendering","crispEdges")}return S[ea]}function g(ea){return ea<0?Math.min((1+ea)*0.5,0.5):0.5+Math.min(ea*0.5,0.5)}var i=null,l=new THREE.Projector,m=document.createElementNS("http://www.w3.org/2000/svg","svg"),k,o,s,w,u,x,F,I,H=new THREE.Rectangle,r=new THREE.Rectangle,Z=!1,E=new THREE.Color(16777215),L=new THREE.Color(16777215), c=new THREE.Color(0),ia=new THREE.Color(0),T=new THREE.Color(0),O,ca=new THREE.Vector3,S=[],ba=[],V=[],D,J,la,Q,ja=1;this.domElement=m;this.autoClear=!0;this.sortObjects=!0;this.sortElements=!0;this.setQuality=function(ea){switch(ea){case "high":ja=1;break;case "low":ja=0}};this.setSize=function(ea,R){k=ea;o=R;s=k/2;w=o/2;m.setAttribute("viewBox",-s+" "+-w+" "+k+" "+o);m.setAttribute("width",k);m.setAttribute("height",o);H.set(-s,-w,s,w)};this.clear=function(){for(;m.childNodes.length>0;)m.removeChild(m.childNodes[0])}; this.render=function(ea,R){var ra,wa,f,n,p,j,h,q;this.autoClear&&this.clear();i=l.projectScene(ea,R,this.sortElements);Q=la=J=0;if(Z=ea.lights.length>0){h=ea.lights;c.setRGB(0,0,0);ia.setRGB(0,0,0);T.setRGB(0,0,0);ra=0;for(wa=h.length;ra=0){c.bindBuffer(c.ARRAY_BUFFER, h.__webGLColorBuffer);c.vertexAttribPointer(f.color,3,c.FLOAT,!1,0,0)}if(f.normal>=0){c.bindBuffer(c.ARRAY_BUFFER,h.__webGLNormalBuffer);c.vertexAttribPointer(f.normal,3,c.FLOAT,!1,0,0)}if(f.tangent>=0){c.bindBuffer(c.ARRAY_BUFFER,h.__webGLTangentBuffer);c.vertexAttribPointer(f.tangent,4,c.FLOAT,!1,0,0)}if(f.uv>=0)if(h.__webGLUVBuffer){c.bindBuffer(c.ARRAY_BUFFER,h.__webGLUVBuffer);c.vertexAttribPointer(f.uv,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(f.uv)}else c.disableVertexAttribArray(f.uv);if(f.uv2>= 0)if(h.__webGLUV2Buffer){c.bindBuffer(c.ARRAY_BUFFER,h.__webGLUV2Buffer);c.vertexAttribPointer(f.uv2,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(f.uv2)}else c.disableVertexAttribArray(f.uv2);if(j.skinning&&f.skinVertexA>=0&&f.skinVertexB>=0&&f.skinIndex>=0&&f.skinWeight>=0){c.bindBuffer(c.ARRAY_BUFFER,h.__webGLSkinVertexABuffer);c.vertexAttribPointer(f.skinVertexA,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,h.__webGLSkinVertexBBuffer);c.vertexAttribPointer(f.skinVertexB,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER, h.__webGLSkinIndicesBuffer);c.vertexAttribPointer(f.skinIndex,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,h.__webGLSkinWeightsBuffer);c.vertexAttribPointer(f.skinWeight,4,c.FLOAT,!1,0,0)}if(q instanceof THREE.Mesh)if(j.wireframe){c.lineWidth(j.wireframe_linewidth);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,h.__webGLLineBuffer);c.drawElements(c.LINES,h.__webGLLineCount,c.UNSIGNED_SHORT,0)}else{c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,h.__webGLFaceBuffer);c.drawElements(c.TRIANGLES,h.__webGLFaceCount,c.UNSIGNED_SHORT, 0)}else if(q instanceof THREE.Line){q=q.type==THREE.LineStrip?c.LINE_STRIP:c.LINES;c.lineWidth(j.linewidth);c.drawArrays(q,0,h.__webGLLineCount)}else if(q instanceof THREE.ParticleSystem)c.drawArrays(c.POINTS,0,h.__webGLParticleCount);else q instanceof THREE.Ribbon&&c.drawArrays(c.TRIANGLE_STRIP,0,h.__webGLVertexCount)}function i(f,n){if(!f.__webGLVertexBuffer)f.__webGLVertexBuffer=c.createBuffer();if(!f.__webGLNormalBuffer)f.__webGLNormalBuffer=c.createBuffer();if(f.hasPos){c.bindBuffer(c.ARRAY_BUFFER, f.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,f.positionArray,c.DYNAMIC_DRAW);c.enableVertexAttribArray(n.attributes.position);c.vertexAttribPointer(n.attributes.position,3,c.FLOAT,!1,0,0)}if(f.hasNormal){c.bindBuffer(c.ARRAY_BUFFER,f.__webGLNormalBuffer);c.bufferData(c.ARRAY_BUFFER,f.normalArray,c.DYNAMIC_DRAW);c.enableVertexAttribArray(n.attributes.normal);c.vertexAttribPointer(n.attributes.normal,3,c.FLOAT,!1,0,0)}c.drawArrays(c.TRIANGLES,0,f.count);f.count=0}function l(f){if(ca!=f.doubleSided){f.doubleSided? c.disable(c.CULL_FACE):c.enable(c.CULL_FACE);ca=f.doubleSided}if(S!=f.flipSided){f.flipSided?c.frontFace(c.CW):c.frontFace(c.CCW);S=f.flipSided}}function m(f){if(V!=f){f?c.enable(c.DEPTH_TEST):c.disable(c.DEPTH_TEST);V=f}}function k(f){D[0].set(f.n41-f.n11,f.n42-f.n12,f.n43-f.n13,f.n44-f.n14);D[1].set(f.n41+f.n11,f.n42+f.n12,f.n43+f.n13,f.n44+f.n14);D[2].set(f.n41+f.n21,f.n42+f.n22,f.n43+f.n23,f.n44+f.n24);D[3].set(f.n41-f.n21,f.n42-f.n22,f.n43-f.n23,f.n44-f.n24);D[4].set(f.n41-f.n31,f.n42-f.n32, f.n43-f.n33,f.n44-f.n34);D[5].set(f.n41+f.n31,f.n42+f.n32,f.n43+f.n33,f.n44+f.n34);var n;for(f=0;f<6;f++){n=D[f];n.divideScalar(Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z))}}function o(f){for(var n=f.globalMatrix,p=-f.geometry.boundingSphere.radius*Math.max(f.scale.x,Math.max(f.scale.y,f.scale.z)),j=0;j<6;j++){f=D[j].x*n.n14+D[j].y*n.n24+D[j].z*n.n34+D[j].w;if(f<=p)return!1}return!0}function s(f,n){f.list[f.count]=n;f.count+=1}function w(f){var n,p,j=f.object,h=f.opaque,q=f.transparent;q.count=0;f=h.count= 0;for(n=j.materials.length;f0?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+q.maxDirLights,"#define MAX_POINT_LIGHTS "+q.maxPointLights,q.map?"#define USE_MAP":"",q.env_map?"#define USE_ENVMAP":"",q.light_map?"#define USE_LIGHTMAP":"",q.vertex_colors?"#define USE_COLOR":"",q.skinning?"#define USE_SKINNING":"","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 vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n"].join("\n"); c.attachShader(p,Z("fragment",h+W));c.attachShader(p,Z("vertex",q+n));c.linkProgram(p);c.getProgramParameter(p,c.LINK_STATUS)||alert("Could not initialise shaders\nVALIDATE_STATUS: "+c.getProgramParameter(p,c.VALIDATE_STATUS)+", gl error ["+c.getError()+"]");p.uniforms={};p.attributes={};f.program=p;p=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices"];for(j in f.uniforms)p.push(j);j=f.program;W=0;for(n=p.length;W< n;W++){h=p[W];j.uniforms[h]=c.getUniformLocation(j,h)}j=f.program;p=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];W=0;for(n=p.length;W=0&&c.enableVertexAttribArray(j.color);j.normal>=0&&c.enableVertexAttribArray(j.normal);j.tangent>=0&&c.enableVertexAttribArray(j.tangent);if(f.skinning&&j.skinVertexA>=0&&j.skinVertexB>= 0&&j.skinIndex>=0&&j.skinWeight>=0){c.enableVertexAttribArray(j.skinVertexA);c.enableVertexAttribArray(j.skinVertexB);c.enableVertexAttribArray(j.skinIndex);c.enableVertexAttribArray(j.skinWeight)}};this.render=function(f,n,p,j){var h,q,t,A,W,G,M,C,aa=f.lights,da=f.fog;n.matrixAutoUpdate&&n.update();n.globalMatrix.flattenToArray(ja);n.projectionMatrix.flattenToArray(la);n.inverseMatrix.flattenToArray(Q);J.multiply(n.projectionMatrix,n.globalMatrix);k(J);THREE.AnimationHandler&&THREE.AnimationHandler.update(); f.update(undefined,!1,n);this.initWebGLObjects(f,n);r(p,j!==undefined?j:!0);this.autoClear&&this.clear();W=f.__webGLObjects.length;for(j=0;j0){c.bindBuffer(c.ARRAY_BUFFER,h.__webGLUVBuffer);c.bufferData(c.ARRAY_BUFFER,Oa,da)}if(xa&&ka>0){c.bindBuffer(c.ARRAY_BUFFER,h.__webGLUV2Buffer);c.bufferData(c.ARRAY_BUFFER,Ma,da)}if(ma){c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,h.__webGLFaceBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,z,da);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,h.__webGLLineBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,X,da)}if(v>0){c.bindBuffer(c.ARRAY_BUFFER,h.__webGLSkinVertexABuffer);c.bufferData(c.ARRAY_BUFFER,pa,da); c.bindBuffer(c.ARRAY_BUFFER,h.__webGLSkinVertexBBuffer);c.bufferData(c.ARRAY_BUFFER,ta,da);c.bindBuffer(c.ARRAY_BUFFER,h.__webGLSkinIndicesBuffer);c.bufferData(c.ARRAY_BUFFER,va,da);c.bindBuffer(c.ARRAY_BUFFER,h.__webGLSkinWeightsBuffer);c.bufferData(c.ARRAY_BUFFER,qa,da)}}F(objlist,W,q,A,j)}t.__dirtyVertices=!1;t.__dirtyElements=!1;t.__dirtyUvs=!1;t.__dirtyNormals=!1;t.__dirtyTangents=!1;t.__dirtyColors=!1}else if(j instanceof THREE.Ribbon){if(!t.__webGLVertexBuffer){q=t;q.__webGLVertexBuffer=c.createBuffer(); q.__webGLColorBuffer=c.createBuffer();q=t;A=q.vertices.length;q.__vertexArray=new Float32Array(A*3);q.__colorArray=new Float32Array(A*3);q.__webGLVertexCount=A;t.__dirtyVertices=!0;t.__dirtyColors=!0}if(t.__dirtyVertices||t.__dirtyColors){q=t;A=c.DYNAMIC_DRAW;C=void 0;C=void 0;G=void 0;h=void 0;aa=q.vertices;da=q.colors;ka=aa.length;ua=da.length;fa=q.__vertexArray;M=q.__colorArray;ga=q.__dirtyColors;if(q.__dirtyVertices){for(C=0;C=0;p--){j=f.__webGLObjects[p].object;n==j&&f.__webGLObjects.splice(p,1)}};this.setFaceCulling= function(f,n){if(f){!n||n=="ccw"?c.frontFace(c.CCW):c.frontFace(c.CW);if(f=="back")c.cullFace(c.BACK);else f=="front"?c.cullFace(c.FRONT):c.cullFace(c.FRONT_AND_BACK);c.enable(c.CULL_FACE)}else c.disable(c.CULL_FACE)};this.supportsVertexTextures=function(){return c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0}}; THREE.Snippets={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 env_map;\nuniform int combine;\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( env_map, 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 refraction_ratio;\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 ), refraction_ratio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif", map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\nuniform sampler2D light_map;\n#endif",lightmap_pars_vertex:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\n#endif", lightmap_fragment:"#ifdef USE_LIGHTMAP\ngl_FragColor = gl_FragColor * texture2D( light_map, 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 ];\n#ifdef PHONG\nvarying vec3 vPointLightVector[ MAX_POINT_LIGHTS ];\n#endif\n#endif", lights_vertex:"if ( !enableLighting ) {\nvLightWeighting = vec3( 1.0 );\n} else {\nvLightWeighting = ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nfloat directionalLightWeighting = max( dot( transformedNormal, normalize( lDirection.xyz ) ), 0.0 );\nvLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;\n}\n#endif\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 pointLightVector = normalize( lPosition.xyz - mvPosition.xyz );\nfloat pointLightWeighting = max( dot( transformedNormal, pointLightVector ), 0.0 );\nvLightWeighting += pointLightColor[ i ] * pointLightWeighting;\n#ifdef PHONG\nvPointLightVector[ i ] = pointLightVector;\n#endif\n}\n#endif\n}", lights_pars_fragment:"#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nvarying vec3 vPointLightVector[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",lights_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\nvec4 mColor = vec4( diffuse, opacity );\nvec4 mSpecular = vec4( specular, opacity );\n#if MAX_POINT_LIGHTS > 0\nvec4 pointDiffuse = vec4( 0.0 );\nvec4 pointSpecular = vec4( 0.0 );\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec3 pointVector = normalize( vPointLightVector[ i ] );\nvec3 pointHalfVector = normalize( vPointLightVector[ i ] + vViewPosition );\nfloat pointDotNormalHalf = dot( normal, pointHalfVector );\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\nfloat pointSpecularWeight = 0.0;\nif ( pointDotNormalHalf >= 0.0 )\npointSpecularWeight = pow( pointDotNormalHalf, shininess );\npointDiffuse += mColor * pointDiffuseWeight;\npointSpecular += mSpecular * pointSpecularWeight;\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec4 dirDiffuse = vec4( 0.0 );\nvec4 dirSpecular = vec4( 0.0 );\nfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nvec3 dirHalfVector = normalize( lDirection.xyz + vViewPosition );\nfloat dirDotNormalHalf = dot( normal, dirHalfVector );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = 0.0;\nif ( dirDotNormalHalf >= 0.0 )\ndirSpecularWeight = pow( dirDotNormalHalf, shininess );\ndirDiffuse += mColor * dirDiffuseWeight;\ndirSpecular += mSpecular * dirSpecularWeight;\n}\n#endif\nvec4 totalLight = vec4( ambient, opacity );\n#if MAX_DIR_LIGHTS > 0\ntotalLight += dirDiffuse + dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalLight += pointDiffuse + pointSpecular;\n#endif\ngl_FragColor = gl_FragColor * totalLight;", color_pars_fragment:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_fragment:"#ifdef USE_COLOR\ngl_FragColor = gl_FragColor * vec4( vColor, opacity );\n#endif",color_pars_vertex:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\nvColor = color;\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\nuniform mat4 boneGlobalMatrices[20];\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#else\ngl_Position = projectionMatrix * mvPosition;\n#endif"}; THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},light_map:{type:"t",value:2,texture:null},env_map:{type:"t",value:1,texture:null},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refraction_ratio:{type:"f",value:0.98},combine:{type:"i",value:0},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{enableLighting:{type:"i", value:1},ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}}}; THREE.ShaderLib={depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},fragment_shader:"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}",vertex_shader:"void main() {\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},normal:{uniforms:{opacity:{type:"f", value:1}},fragment_shader:"uniform float opacity;\nvarying vec3 vNormal;\nvoid main() {\ngl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n}",vertex_shader:"varying vec3 vNormal;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvNormal = normalize( normalMatrix * normal );\ngl_Position = projectionMatrix * mvPosition;\n}"},basic:{uniforms:THREE.UniformsLib.common,fragment_shader:["uniform vec3 diffuse;\nuniform float opacity;",THREE.Snippets.color_pars_fragment, THREE.Snippets.map_pars_fragment,THREE.Snippets.lightmap_pars_fragment,THREE.Snippets.envmap_pars_fragment,THREE.Snippets.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );",THREE.Snippets.map_fragment,THREE.Snippets.lightmap_fragment,THREE.Snippets.color_fragment,THREE.Snippets.envmap_fragment,THREE.Snippets.fog_fragment,"}"].join("\n"),vertex_shader:[THREE.Snippets.map_pars_vertex,THREE.Snippets.lightmap_pars_vertex,THREE.Snippets.envmap_pars_vertex,THREE.Snippets.color_pars_vertex, THREE.Snippets.skinning_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.Snippets.map_vertex,THREE.Snippets.lightmap_vertex,THREE.Snippets.envmap_vertex,THREE.Snippets.color_vertex,THREE.Snippets.skinning_vertex,"}"].join("\n")},lambert:{uniforms:Uniforms.merge([THREE.UniformsLib.common,THREE.UniformsLib.lights]),fragment_shader:["uniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vLightWeighting;",THREE.Snippets.color_pars_fragment,THREE.Snippets.map_pars_fragment, THREE.Snippets.lightmap_pars_fragment,THREE.Snippets.envmap_pars_fragment,THREE.Snippets.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );\ngl_FragColor = gl_FragColor * vec4( vLightWeighting, 1.0 );",THREE.Snippets.map_fragment,THREE.Snippets.lightmap_fragment,THREE.Snippets.color_fragment,THREE.Snippets.envmap_fragment,THREE.Snippets.fog_fragment,"}"].join("\n"),vertex_shader:["varying vec3 vLightWeighting;",THREE.Snippets.map_pars_vertex,THREE.Snippets.lightmap_pars_vertex, THREE.Snippets.envmap_pars_vertex,THREE.Snippets.lights_pars_vertex,THREE.Snippets.color_pars_vertex,THREE.Snippets.skinning_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.Snippets.map_vertex,THREE.Snippets.lightmap_vertex,THREE.Snippets.envmap_vertex,THREE.Snippets.color_vertex,"vec3 transformedNormal = normalize( normalMatrix * normal );",THREE.Snippets.lights_vertex,THREE.Snippets.skinning_vertex,"}"].join("\n")},phong:{uniforms:Uniforms.merge([THREE.UniformsLib.common, THREE.UniformsLib.lights,{ambient:{type:"c",value:new THREE.Color(328965)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30}}]),fragment_shader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform vec3 ambient;\nuniform vec3 specular;\nuniform float shininess;\nvarying vec3 vLightWeighting;",THREE.Snippets.color_pars_fragment,THREE.Snippets.map_pars_fragment,THREE.Snippets.lightmap_pars_fragment,THREE.Snippets.envmap_pars_fragment,THREE.Snippets.fog_pars_fragment, THREE.Snippets.lights_pars_fragment,"void main() {\ngl_FragColor = vec4( vLightWeighting, 1.0 );",THREE.Snippets.lights_fragment,THREE.Snippets.map_fragment,THREE.Snippets.lightmap_fragment,THREE.Snippets.color_fragment,THREE.Snippets.envmap_fragment,THREE.Snippets.fog_fragment,"}"].join("\n"),vertex_shader:["#define PHONG\nvarying vec3 vLightWeighting;\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",THREE.Snippets.map_pars_vertex,THREE.Snippets.lightmap_pars_vertex,THREE.Snippets.envmap_pars_vertex, THREE.Snippets.lights_pars_vertex,THREE.Snippets.color_pars_vertex,THREE.Snippets.skinning_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.Snippets.map_vertex,THREE.Snippets.lightmap_vertex,THREE.Snippets.envmap_vertex,THREE.Snippets.color_vertex,"#ifndef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\n#endif\nvViewPosition = cameraPosition - mPosition.xyz;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = transformedNormal;", THREE.Snippets.lights_vertex,THREE.Snippets.skinning_vertex,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsLib.particle,fragment_shader:["uniform vec3 psColor;\nuniform float opacity;",THREE.Snippets.color_pars_fragment,THREE.Snippets.map_particle_pars_fragment,THREE.Snippets.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.Snippets.map_particle_fragment,THREE.Snippets.color_fragment,THREE.Snippets.fog_fragment,"}"].join("\n"),vertex_shader:["uniform float size;", THREE.Snippets.color_pars_vertex,"void main() {",THREE.Snippets.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\ngl_PointSize = size;\n}"].join("\n")}};THREE.RenderableObject=function(){this.z=this.object=null}; THREE.RenderableFace3=function(){this.z=null;this.v1=new THREE.Vertex;this.v2=new THREE.Vertex;this.v3=new THREE.Vertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[];this.faceMaterials=this.meshMaterials=null;this.overdraw=!1;this.uvs=[null,null,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.Vertex;this.v2=new THREE.Vertex;this.materials=null};