123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- // ThreeWebGL.js r36 - 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 f,g,l,m,s,o;if(d==0)f=g=l=0;else{m=Math.floor(a*6);s=a*6-m;a=d*(1-b);o=d*(1-b*s);b=d*(1-b*(1-s));switch(m){case 1:f=o;g=d;l=a;break;case 2:f=a;g=d;l=b;break;case 3:f=a;g=o;l=d;break;case 4:f=b;g=a;l=d;break;case 5:f=d;g=a;l=o;break;case 6:case 0:f=d;g=b;l=a}}this.r=f;this.g=g;this.b=l;if(this.autoUpdate){this.updateHex();
- this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGB();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGB:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)}};
- THREE.Vector2=function(a,b){this.set(a||0,b||0)};
- THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/
- this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,d){this.set(a||0,b||0,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.set(a.x,a.y,a.z);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a,
- b){this.set(a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x);return this},crossSelf:function(a){var b=this.x,d=this.y,f=this.z;this.set(d*a.z-f*a.y,f*a.x-b*a.z,b*a.y-d*a.x);return this},multiply:function(a,b){this.set(a.x*b.x,a.y*b.y,a.z*b.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/
- a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var 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.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a=
- this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){this.y=Math.asin(a.n13);var b=Math.cos(this.y);if(Math.abs(b)>1.0E-5){this.x=Math.atan2(-a.n23/b,a.n33/b);this.z=Math.atan2(-a.n13/b,a.n11/b)}else{this.x=0;this.z=Math.atan2(a.n21,a.n22)}},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<
- 1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,d,f){this.set(a||0,b||0,d||0,f||1)};
- THREE.Vector4.prototype={set:function(a,b,d,f){this.x=a;this.y=b;this.z=d;this.w=f;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x*
- a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(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)}};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,f=a.objects,g=[];a=0;for(b=f.length;a<b;a++){d=f[a];d instanceof THREE.Mesh&&(g=g.concat(this.intersectObject(d)))}g.sort(function(l,m){return l.distance-m.distance});return g},intersectObject:function(a){function b(L,M,W,$){$=$.clone().subSelf(M);W=W.clone().subSelf(M);var ia=L.clone().subSelf(M);L=$.dot($);M=$.dot(W);$=$.dot(ia);var ea=W.dot(W);W=W.dot(ia);ia=1/(L*ea-M*M);ea=(ea*$-M*W)*ia;L=(L*W-M*$)*ia;return ea>0&&L>0&&ea+L<1}var d,f,g,l,
- m,s,o,v,B,A,D,E=a.geometry,H=E.vertices,I=[];d=0;for(f=E.faces.length;d<f;d++){g=E.faces[d];A=this.origin.clone();D=this.direction.clone();o=a.matrixWorld;l=o.multiplyVector3(H[g.a].position.clone());m=o.multiplyVector3(H[g.b].position.clone());s=o.multiplyVector3(H[g.c].position.clone());o=g instanceof THREE.Face4?o.multiplyVector3(H[g.d].position.clone()):null;v=a.matrixRotationWorld.multiplyVector3(g.normal.clone());B=D.dot(v);if(B<0){v=v.dot((new THREE.Vector3).sub(l,A))/B;A=A.addSelf(D.multiplyScalar(v));
- if(g instanceof THREE.Face3){if(b(A,l,m,s)){g={distance:this.origin.distanceTo(A),point:A,face:g,object:a};I.push(g)}}else if(g instanceof THREE.Face4&&(b(A,l,m,o)||b(A,m,s,o))){g={distance:this.origin.distanceTo(A),point:A,face:g,object:a};I.push(g)}}}return I}};
- THREE.Rectangle=function(){function a(){l=f-b;m=g-d}var b,d,f,g,l,m,s=!0;this.getX=function(){return b};this.getY=function(){return d};this.getWidth=function(){return l};this.getHeight=function(){return m};this.getLeft=function(){return b};this.getTop=function(){return d};this.getRight=function(){return f};this.getBottom=function(){return g};this.set=function(o,v,B,A){s=!1;b=o;d=v;f=B;g=A;a()};this.addPoint=function(o,v){if(s){s=!1;b=o;d=v;f=o;g=v}else{b=b<o?b:o;d=d<v?d:v;f=f>o?f:o;g=g>v?g:v}a()};
- this.add3Points=function(o,v,B,A,D,E){if(s){s=!1;b=o<B?o<D?o:D:B<D?B:D;d=v<A?v<E?v:E:A<E?A:E;f=o>B?o>D?o:D:B>D?B:D;g=v>A?v>E?v:E:A>E?A:E}else{b=o<B?o<D?o<b?o:b:D<b?D:b:B<D?B<b?B:b:D<b?D:b;d=v<A?v<E?v<d?v:d:E<d?E:d:A<E?A<d?A:d:E<d?E:d;f=o>B?o>D?o>f?o:f:D>f?D:f:B>D?B>f?B:f:D>f?D:f;g=v>A?v>E?v>g?v:g:E>g?E:g:A>E?A>g?A:g:E>g?E:g}a()};this.addRectangle=function(o){if(s){s=!1;b=o.getLeft();d=o.getTop();f=o.getRight();g=o.getBottom()}else{b=b<o.getLeft()?b:o.getLeft();d=d<o.getTop()?d:o.getTop();f=f>o.getRight()?
- f:o.getRight();g=g>o.getBottom()?g:o.getBottom()}a()};this.inflate=function(o){b-=o;d-=o;f+=o;g+=o;a()};this.minSelf=function(o){b=b>o.getLeft()?b:o.getLeft();d=d>o.getTop()?d:o.getTop();f=f<o.getRight()?f:o.getRight();g=g<o.getBottom()?g:o.getBottom();a()};this.instersects=function(o){return Math.min(f,o.getRight())-Math.max(b,o.getLeft())>=0&&Math.min(g,o.getBottom())-Math.max(d,o.getTop())>=0};this.empty=function(){s=!0;g=f=d=b=0;a()};this.isEmpty=function(){return s}};
- 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,f,g,l,m,s,o,v,B,A,D,E,H,I){this.set(a||1,b||0,d||0,f||0,g||0,l||1,m||0,s||0,o||0,v||0,B||1,A||0,D||0,E||0,H||0,I||1);this.flat=Array(16);this.m33=new THREE.Matrix3};
- THREE.Matrix4.prototype={set:function(a,b,d,f,g,l,m,s,o,v,B,A,D,E,H,I){this.n11=a;this.n12=b;this.n13=d;this.n14=f;this.n21=g;this.n22=l;this.n23=m;this.n24=s;this.n31=o;this.n32=v;this.n33=B;this.n34=A;this.n41=D;this.n42=E;this.n43=H;this.n44=I;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.set(a.n11,a.n12,a.n13,a.n14,a.n21,a.n22,a.n23,a.n24,a.n31,a.n32,a.n33,a.n34,a.n41,a.n42,a.n43,a.n44);return this},lookAt:function(a,b,d){var f=THREE.Matrix4.__v1,
- g=THREE.Matrix4.__v2,l=THREE.Matrix4.__v3;l.sub(a,b).normalize();if(l.length()===0)l.z=1;f.cross(d,l).normalize();if(f.length()===0){l.x+=1.0E-4;f.cross(d,l).normalize()}g.cross(l,f).normalize();this.n11=f.x;this.n12=g.x;this.n13=l.x;this.n21=f.y;this.n22=g.y;this.n23=l.y;this.n31=f.z;this.n32=g.z;this.n33=l.z;return this},multiplyVector3:function(a){var b=a.x,d=a.y,f=a.z,g=1/(this.n41*b+this.n42*d+this.n43*f+this.n44);a.x=(this.n11*b+this.n12*d+this.n13*f+this.n14)*g;a.y=(this.n21*b+this.n22*d+this.n23*
- f+this.n24)*g;a.z=(this.n31*b+this.n32*d+this.n33*f+this.n34)*g;return a},multiplyVector4:function(a){var b=a.x,d=a.y,f=a.z,g=a.w;a.x=this.n11*b+this.n12*d+this.n13*f+this.n14*g;a.y=this.n21*b+this.n22*d+this.n23*f+this.n24*g;a.z=this.n31*b+this.n32*d+this.n33*f+this.n34*g;a.w=this.n41*b+this.n42*d+this.n43*f+this.n44*g;return a},rotateAxis:function(a){var b=a.x,d=a.y,f=a.z;a.x=b*this.n11+d*this.n12+f*this.n13;a.y=b*this.n21+d*this.n22+f*this.n23;a.z=b*this.n31+d*this.n32+f*this.n33;a.normalize();
- 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,f=a.n12,g=a.n13,l=a.n14,m=a.n21,s=a.n22,o=a.n23,v=a.n24,B=a.n31,A=a.n32,D=a.n33,E=a.n34,H=a.n41,I=a.n42,L=a.n43,M=a.n44,W=b.n11,$=b.n12,ia=b.n13,ea=b.n14,aa=b.n21,ja=b.n22,
- c=b.n23,ra=b.n24,pa=b.n31,ya=b.n32,sa=b.n33,ta=b.n34;this.n11=d*W+f*aa+g*pa;this.n12=d*$+f*ja+g*ya;this.n13=d*ia+f*c+g*sa;this.n14=d*ea+f*ra+g*ta+l;this.n21=m*W+s*aa+o*pa;this.n22=m*$+s*ja+o*ya;this.n23=m*ia+s*c+o*sa;this.n24=m*ea+s*ra+o*ta+v;this.n31=B*W+A*aa+D*pa;this.n32=B*$+A*ja+D*ya;this.n33=B*ia+A*c+D*sa;this.n34=B*ea+A*ra+D*ta+E;this.n41=H*W+I*aa+L*pa;this.n42=H*$+I*ja+L*ya;this.n43=H*ia+I*c+L*sa;this.n44=H*ea+I*ra+L*ta+M;return this},multiplyToArray:function(a,b,d){this.multiply(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){this.multiply(this,a);return this},multiplyScalar:function(a){this.n11*=a;this.n12*=a;this.n13*=a;this.n14*=a;this.n21*=a;this.n22*=a;this.n23*=a;this.n24*=a;this.n31*=a;this.n32*=a;this.n33*=a;this.n34*=a;this.n41*=a;this.n42*=a;this.n43*=
- a;this.n44*=a;return this},determinant:function(){var a=this.n11,b=this.n12,d=this.n13,f=this.n14,g=this.n21,l=this.n22,m=this.n23,s=this.n24,o=this.n31,v=this.n32,B=this.n33,A=this.n34,D=this.n41,E=this.n42,H=this.n43,I=this.n44;return f*m*v*D-d*s*v*D-f*l*B*D+b*s*B*D+d*l*A*D-b*m*A*D-f*m*o*E+d*s*o*E+f*g*B*E-a*s*B*E-d*g*A*E+a*m*A*E+f*l*o*H-b*s*o*H-f*g*v*H+a*s*v*H+b*g*A*H-a*l*A*H-d*l*o*I+b*m*o*I+d*g*v*I-a*m*v*I-b*g*B*I+a*l*B*I},transpose:function(){var a;a=this.n21;this.n21=this.n12;this.n12=a;a=this.n31;
- this.n31=this.n13;this.n13=a;a=this.n32;this.n32=this.n23;this.n23=a;a=this.n41;this.n41=this.n14;this.n14=a;a=this.n42;this.n42=this.n24;this.n24=a;a=this.n43;this.n43=this.n34;this.n43=a;return this},clone:function(){var a=new THREE.Matrix4;a.n11=this.n11;a.n12=this.n12;a.n13=this.n13;a.n14=this.n14;a.n21=this.n21;a.n22=this.n22;a.n23=this.n23;a.n24=this.n24;a.n31=this.n31;a.n32=this.n32;a.n33=this.n33;a.n34=this.n34;a.n41=this.n41;a.n42=this.n42;a.n43=this.n43;a.n44=this.n44;return a},flatten:function(){this.flat[0]=
- this.n11;this.flat[1]=this.n21;this.flat[2]=this.n31;this.flat[3]=this.n41;this.flat[4]=this.n12;this.flat[5]=this.n22;this.flat[6]=this.n32;this.flat[7]=this.n42;this.flat[8]=this.n13;this.flat[9]=this.n23;this.flat[10]=this.n33;this.flat[11]=this.n43;this.flat[12]=this.n14;this.flat[13]=this.n24;this.flat[14]=this.n34;this.flat[15]=this.n44;return this.flat},flattenToArray:function(a){a[0]=this.n11;a[1]=this.n21;a[2]=this.n31;a[3]=this.n41;a[4]=this.n12;a[5]=this.n22;a[6]=this.n32;a[7]=this.n42;
- a[8]=this.n13;a[9]=this.n23;a[10]=this.n33;a[11]=this.n43;a[12]=this.n14;a[13]=this.n24;a[14]=this.n34;a[15]=this.n44;return a},flattenToArrayOffset:function(a,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},setRotationX: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},setRotationY: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},setRotationZ: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},setRotationAxis:function(a,b){var d=Math.cos(b),f=Math.sin(b),g=
- 1-d,l=a.x,m=a.y,s=a.z,o=g*l,v=g*m;this.set(o*l+d,o*m-f*s,o*s+f*m,0,o*m+f*s,v*m+d,v*s-f*l,0,o*s-f*m,v*s+f*l,g*s*s+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,f=a.z;a=Math.cos(b);b=Math.sin(b);var g=Math.cos(d);d=Math.sin(d);var l=Math.cos(f);f=Math.sin(f);var m=a*d,s=b*d;this.n11=g*l;this.n12=-g*f;this.n13=d;this.n21=s*l+a*f;this.n22=-s*f+a*l;this.n23=-b*g;this.n31=-m*l+b*f;this.n32=m*f+b*l;this.n33=
- a*g;return this},setRotationFromQuaternion:function(a){var b=a.x,d=a.y,f=a.z,g=a.w,l=b+b,m=d+d,s=f+f;a=b*l;var o=b*m;b*=s;var v=d*m;d*=s;f*=s;l*=g;m*=g;g*=s;this.n11=1-(v+f);this.n12=o-g;this.n13=b+m;this.n21=o+g;this.n22=1-(a+f);this.n23=d-l;this.n31=b-m;this.n32=d+l;this.n33=1-(a+v);return this},scale:function(a){var b=a.x,d=a.y;a=a.z;this.n11*=b;this.n12*=d;this.n13*=a;this.n21*=b;this.n22*=d;this.n23*=a;this.n31*=b;this.n32*=d;this.n33*=a;this.n41*=b;this.n42*=d;this.n43*=a;return this},extractPosition:function(a){this.n14=
- a.n14;this.n24=a.n24;this.n34=a.n34},extractRotation:function(a,b){var d=1/b.x,f=1/b.y,g=1/b.z;this.n11=a.n11*d;this.n21=a.n21*d;this.n31=a.n31*d;this.n12=a.n12*f;this.n22=a.n22*f;this.n32=a.n32*f;this.n13=a.n13*g;this.n23=a.n23*g;this.n33=a.n33*g}};
- THREE.Matrix4.makeInvert=function(a,b){var d=a.n11,f=a.n12,g=a.n13,l=a.n14,m=a.n21,s=a.n22,o=a.n23,v=a.n24,B=a.n31,A=a.n32,D=a.n33,E=a.n34,H=a.n41,I=a.n42,L=a.n43,M=a.n44;b===undefined&&(b=new THREE.Matrix4);b.n11=o*E*I-v*D*I+v*A*L-s*E*L-o*A*M+s*D*M;b.n12=l*D*I-g*E*I-l*A*L+f*E*L+g*A*M-f*D*M;b.n13=g*v*I-l*o*I+l*s*L-f*v*L-g*s*M+f*o*M;b.n14=l*o*A-g*v*A-l*s*D+f*v*D+g*s*E-f*o*E;b.n21=v*D*H-o*E*H-v*B*L+m*E*L+o*B*M-m*D*M;b.n22=g*E*H-l*D*H+l*B*L-d*E*L-g*B*M+d*D*M;b.n23=l*o*H-g*v*H-l*m*L+d*v*L+g*m*M-d*o*M;
- b.n24=g*v*B-l*o*B+l*m*D-d*v*D-g*m*E+d*o*E;b.n31=s*E*H-v*A*H+v*B*I-m*E*I-s*B*M+m*A*M;b.n32=l*A*H-f*E*H-l*B*I+d*E*I+f*B*M-d*A*M;b.n33=g*v*H-l*s*H+l*m*I-d*v*I-f*m*M+d*s*M;b.n34=l*s*B-f*v*B-l*m*A+d*v*A+f*m*E-d*s*E;b.n41=o*A*H-s*D*H-o*B*I+m*D*I+s*B*L-m*A*L;b.n42=f*D*H-g*A*H+g*B*I-d*D*I-f*B*L+d*A*L;b.n43=g*s*H-f*o*H-g*m*I+d*o*I+f*m*L-d*s*L;b.n44=f*o*B-g*s*B+g*m*A-d*o*A-f*m*D+d*s*D;b.multiplyScalar(1/a.determinant());return b};
- THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,d=b.m,f=a.n33*a.n22-a.n32*a.n23,g=-a.n33*a.n21+a.n31*a.n23,l=a.n32*a.n21-a.n31*a.n22,m=-a.n33*a.n12+a.n32*a.n13,s=a.n33*a.n11-a.n31*a.n13,o=-a.n32*a.n11+a.n31*a.n12,v=a.n23*a.n12-a.n22*a.n13,B=-a.n23*a.n11+a.n21*a.n13,A=a.n22*a.n11-a.n21*a.n12;a=a.n11*f+a.n21*m+a.n31*v;if(a==0)throw"matrix not invertible";a=1/a;d[0]=a*f;d[1]=a*g;d[2]=a*l;d[3]=a*m;d[4]=a*s;d[5]=a*o;d[6]=a*v;d[7]=a*B;d[8]=a*A;return b};
- THREE.Matrix4.makeFrustum=function(a,b,d,f,g,l){var m;m=new THREE.Matrix4;m.n11=2*g/(b-a);m.n12=0;m.n13=(b+a)/(b-a);m.n14=0;m.n21=0;m.n22=2*g/(f-d);m.n23=(f+d)/(f-d);m.n24=0;m.n31=0;m.n32=0;m.n33=-(l+g)/(l-g);m.n34=-2*l*g/(l-g);m.n41=0;m.n42=0;m.n43=-1;m.n44=0;return m};THREE.Matrix4.makePerspective=function(a,b,d,f){var g;a=d*Math.tan(a*Math.PI/360);g=-a;return THREE.Matrix4.makeFrustum(g*b,a*b,g,a,d,f)};
- THREE.Matrix4.makeOrtho=function(a,b,d,f,g,l){var m,s,o,v;m=new THREE.Matrix4;s=b-a;o=d-f;v=l-g;m.n11=2/s;m.n12=0;m.n13=0;m.n14=-((b+a)/s);m.n21=0;m.n22=2/o;m.n23=0;m.n24=-((d+f)/o);m.n31=0;m.n32=0;m.n33=-2/v;m.n34=-((l+g)/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.Object3D=function(){this.parent=undefined;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixAutoUpdate=!0;this.matrixWorldNeedsUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=
- !0;this._vector=new THREE.Vector3};
- THREE.Object3D.prototype={translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a,this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},addChild:function(a){if(this.children.indexOf(a)===-1){a.parent!==
- undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);for(var b=this;b instanceof THREE.Scene===!1&&b!==undefined;)b=b.parent;b!==undefined&&b.addChildRecurse(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=undefined;this.children.splice(b,1)}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation);if(this.scale.x!==1||this.scale.y!==
- 1||this.scale.z!==1){this.matrix.scale(this.scale);this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z))}this.matrixWorldNeedsUpdate=!0},update:function(a,b,d){if(this.visible){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||b){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixRotationWorld.extractRotation(this.matrixWorld,this.scale);this.matrixWorldNeedsUpdate=!1;b=!0}a=0;for(var f=this.children.length;a<
- f;a++)this.children[a].update(this.matrixWorld,b,d)}}};THREE.Quaternion=function(a,b,d,f){this.set(a||0,b||0,d||0,f!==undefined?f:1)};
- THREE.Quaternion.prototype={set:function(a,b,d,f){this.x=a;this.y=b;this.z=d;this.w=f;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,d=a.x*b,f=a.y*b,g=a.z*b;a=Math.cos(f);f=Math.sin(f);b=Math.cos(-g);g=Math.sin(-g);var l=Math.cos(d);d=Math.sin(d);var m=a*b,s=f*g;this.w=m*l-s*d;this.x=m*d+s*l;this.y=f*b*l+a*g*d;this.z=a*g*l-f*b*d;return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=
- -1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a==0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x*=a;this.y*=a;this.z*=a;this.w*=a}return this},multiplySelf:function(a){var b=this.x,d=this.y,f=this.z,g=this.w,l=a.x,m=a.y,s=a.z;a=a.w;this.x=b*a+g*l+d*s-f*m;this.y=d*a+g*m+f*l-b*s;this.z=f*a+g*s+b*m-d*l;this.w=g*a-b*l-d*m-f*s;return this},
- multiplyVector3:function(a,b){b||(b=a);var d=a.x,f=a.y,g=a.z,l=this.x,m=this.y,s=this.z,o=this.w,v=o*d+m*g-s*f,B=o*f+s*d-l*g,A=o*g+l*f-m*d;d=-l*d-m*f-s*g;b.x=v*o+d*-l+B*-s-A*-m;b.y=B*o+d*-m+A*-l-v*-s;b.z=A*o+d*-s+v*-m-B*-l;return b}};
- THREE.Quaternion.slerp=function(a,b,d,f){var g=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(g)>=1){d.w=a.w;d.x=a.x;d.y=a.y;d.z=a.z;return d}var l=Math.acos(g),m=Math.sqrt(1-g*g);if(Math.abs(m)<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-f)*l)/m;f=Math.sin(f*l)/m;d.w=a.w*g+b.w*f;d.x=a.x*g+b.x*f;d.y=a.y*g+b.y*f;d.z=a.z*g+b.z*f;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.Face3=function(a,b,d,f,g){this.a=a;this.b=b;this.c=d;this.centroid=new THREE.Vector3;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.materials=g instanceof Array?g:[g]};THREE.Face4=function(a,b,d,f,g,l){this.a=a;this.b=b;this.c=d;this.d=f;this.centroid=new THREE.Vector3;this.normal=g instanceof THREE.Vector3?g:new THREE.Vector3;this.vertexNormals=g instanceof Array?g:[];this.materials=l instanceof Array?l:[l]};
- THREE.UV=function(a,b){this.set(a||0,b||0)};THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.faces=[];this.uvs=[];this.uvs2=[];this.colors=[];this.morphTargets=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1};
- THREE.Geometry.prototype={computeCentroids:function(){var a,b,d;a=0;for(b=this.faces.length;a<b;a++){d=this.faces[a];d.centroid.set(0,0,0);if(d instanceof THREE.Face3){d.centroid.addSelf(this.vertices[d.a].position);d.centroid.addSelf(this.vertices[d.b].position);d.centroid.addSelf(this.vertices[d.c].position);d.centroid.divideScalar(3)}else if(d instanceof THREE.Face4){d.centroid.addSelf(this.vertices[d.a].position);d.centroid.addSelf(this.vertices[d.b].position);d.centroid.addSelf(this.vertices[d.c].position);
- d.centroid.addSelf(this.vertices[d.d].position);d.centroid.divideScalar(4)}}},computeFaceNormals:function(a){var b,d,f,g,l,m,s=new THREE.Vector3,o=new THREE.Vector3;f=0;for(g=this.vertices.length;f<g;f++){l=this.vertices[f];l.normal.set(0,0,0)}f=0;for(g=this.faces.length;f<g;f++){l=this.faces[f];if(a&&l.vertexNormals.length){s.set(0,0,0);b=0;for(d=l.vertexNormals.length;b<d;b++)s.addSelf(l.vertexNormals[b]);s.divideScalar(3)}else{b=this.vertices[l.a];d=this.vertices[l.b];m=this.vertices[l.c];s.sub(m.position,
- d.position);o.sub(b.position,d.position);s.crossSelf(o)}s.isZero()||s.normalize();l.normal.copy(s)}},computeVertexNormals:function(){var a,b,d,f;if(this.__tmpVertices==undefined){f=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)f[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++){d=this.faces[a];if(d instanceof THREE.Face3)d.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(d instanceof THREE.Face4)d.vertexNormals=[new THREE.Vector3,
- new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}}else{f=this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)f[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++){d=this.faces[a];if(d instanceof THREE.Face3){f[d.a].addSelf(d.normal);f[d.b].addSelf(d.normal);f[d.c].addSelf(d.normal)}else if(d instanceof THREE.Face4){f[d.a].addSelf(d.normal);f[d.b].addSelf(d.normal);f[d.c].addSelf(d.normal);f[d.d].addSelf(d.normal)}}a=0;for(b=this.vertices.length;a<b;a++)f[a].normalize();a=0;for(b=this.faces.length;a<
- b;a++){d=this.faces[a];if(d instanceof THREE.Face3){d.vertexNormals[0].copy(f[d.a]);d.vertexNormals[1].copy(f[d.b]);d.vertexNormals[2].copy(f[d.c])}else if(d instanceof THREE.Face4){d.vertexNormals[0].copy(f[d.a]);d.vertexNormals[1].copy(f[d.b]);d.vertexNormals[2].copy(f[d.c]);d.vertexNormals[3].copy(f[d.d])}}},computeTangents:function(){function a(ta,Ea,Fa,Aa,Ja,Ka,La){l=ta.vertices[Ea].position;m=ta.vertices[Fa].position;s=ta.vertices[Aa].position;o=g[Ja];v=g[Ka];B=g[La];A=m.x-l.x;D=s.x-l.x;E=m.y-
- l.y;H=s.y-l.y;I=m.z-l.z;L=s.z-l.z;M=v.u-o.u;W=B.u-o.u;$=v.v-o.v;ia=B.v-o.v;ea=1/(M*ia-W*$);c.set((ia*A-$*D)*ea,(ia*E-$*H)*ea,(ia*I-$*L)*ea);ra.set((M*D-W*A)*ea,(M*H-W*E)*ea,(M*L-W*I)*ea);aa[Ea].addSelf(c);aa[Fa].addSelf(c);aa[Aa].addSelf(c);ja[Ea].addSelf(ra);ja[Fa].addSelf(ra);ja[Aa].addSelf(ra)}var b,d,f,g,l,m,s,o,v,B,A,D,E,H,I,L,M,W,$,ia,ea,aa=[],ja=[],c=new THREE.Vector3,ra=new THREE.Vector3,pa=new THREE.Vector3,ya=new THREE.Vector3,sa=new THREE.Vector3;b=0;for(d=this.vertices.length;b<d;b++){aa[b]=
- new THREE.Vector3;ja[b]=new THREE.Vector3}b=0;for(d=this.faces.length;b<d;b++){f=this.faces[b];g=this.uvs[b];if(f instanceof THREE.Face3){a(this,f.a,f.b,f.c,0,1,2);this.vertices[f.a].normal.copy(f.vertexNormals[0]);this.vertices[f.b].normal.copy(f.vertexNormals[1]);this.vertices[f.c].normal.copy(f.vertexNormals[2])}else if(f instanceof THREE.Face4){a(this,f.a,f.b,f.c,0,1,2);a(this,f.a,f.b,f.d,0,1,3);this.vertices[f.a].normal.copy(f.vertexNormals[0]);this.vertices[f.b].normal.copy(f.vertexNormals[1]);
- this.vertices[f.c].normal.copy(f.vertexNormals[2]);this.vertices[f.d].normal.copy(f.vertexNormals[3])}}b=0;for(d=this.vertices.length;b<d;b++){sa.copy(this.vertices[b].normal);f=aa[b];pa.copy(f);pa.subSelf(sa.multiplyScalar(sa.dot(f))).normalize();ya.cross(this.vertices[b].normal,f);f=ya.dot(ja[b]);f=f<0?-1:1;this.vertices[b].tangent.set(pa.x,pa.y,pa.z,f)}this.hasTangents=!0},computeBoundingBox:function(){var a;if(this.vertices.length>0){this.boundingBox={x:[this.vertices[0].position.x,this.vertices[0].position.x],
- y:[this.vertices[0].position.y,this.vertices[0].position.y],z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,d=this.vertices.length;b<d;b++){a=this.vertices[b];if(a.position.x<this.boundingBox.x[0])this.boundingBox.x[0]=a.position.x;else if(a.position.x>this.boundingBox.x[1])this.boundingBox.x[1]=a.position.x;if(a.position.y<this.boundingBox.y[0])this.boundingBox.y[0]=a.position.y;else if(a.position.y>this.boundingBox.y[1])this.boundingBox.y[1]=a.position.y;if(a.position.z<
- this.boundingBox.z[0])this.boundingBox.z[0]=a.position.z;else if(a.position.z>this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,b=0,d=this.vertices.length;b<d;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}}};THREE.GeometryIdCounter=0;
- THREE.Camera=function(a,b,d,f,g){THREE.Object3D.call(this);this.fov=a||50;this.aspect=b||1;this.near=d||0.1;this.far=f||2E3;this.target=g||new THREE.Object3D;this.useTarget=!0;this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=null;this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;
- THREE.Camera.prototype.translate=function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a));this.target.position.addSelf(b.multiplyScalar(a))};THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,this.far)};THREE.Camera.prototype.updateMatrix=function(){this.update(undefined,!0)};
- THREE.Camera.prototype.update=function(a,b,d){if(this.useTarget){this.matrix.lookAt(this.position,this.target.position,this.up);this.matrix.setPosition(this.position);a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse);b=!0}else{this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=
- !1;b=!0;THREE.Matrix4.makeInvert(this.matrixWorld,this.matrixWorldInverse)}}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,d)};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.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};
- THREE.LineBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;this.depthTest=!0;this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.linewidth!==undefined)this.linewidth=
- a.linewidth;if(a.linecap!==undefined)this.linecap=a.linecap;if(a.linejoin!==undefined)this.linejoin=a.linejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors}};
- THREE.MeshBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;this.morphTargets=!1;
- if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.lightMap!==undefined)this.lightMap=a.lightMap;if(a.envMap!==undefined)this.envMap=a.envMap;if(a.combine!==undefined)this.combine=a.combine;if(a.reflectivity!==undefined)this.reflectivity=a.reflectivity;if(a.refractionRatio!==undefined)this.refractionRatio=a.refractionRatio;if(a.fog!==undefined)this.fog=a.fog;if(a.shading!==undefined)this.shading=a.shading;
- if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==undefined)this.wireframeLinewidth=a.wireframeLinewidth;if(a.wireframeLinecap!==undefined)this.wireframeLinecap=a.wireframeLinecap;if(a.wireframeLinejoin!==undefined)this.wireframeLinejoin=a.wireframeLinejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors;if(a.skinning!==undefined)this.skinning=a.skinning;
- if(a.morphTargets!==undefined)this.morphTargets=a.morphTargets}};
- THREE.MeshLambertMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;this.morphTargets=
- !1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.lightMap!==undefined)this.lightMap=a.lightMap;if(a.envMap!==undefined)this.envMap=a.envMap;if(a.combine!==undefined)this.combine=a.combine;if(a.reflectivity!==undefined)this.reflectivity=a.reflectivity;if(a.refractionRatio!==undefined)this.refractionRatio=a.refractionRatio;if(a.fog!==undefined)this.fog=a.fog;if(a.shading!==undefined)this.shading=a.shading;
- if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==undefined)this.wireframeLinewidth=a.wireframeLinewidth;if(a.wireframeLinecap!==undefined)this.wireframeLinecap=a.wireframeLinecap;if(a.wireframeLinejoin!==undefined)this.wireframeLinejoin=a.wireframeLinejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors;if(a.skinning!==undefined)this.skinning=a.skinning;
- if(a.morphTargets!==undefined)this.morphTargets=a.morphTargets}};
- THREE.MeshPhongMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(328965);this.specular=new THREE.Color(1118481);this.shininess=30;this.opacity=1;this.envMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.fog=!0;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=
- this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;this.morphTargets=!1;if(a){if(a.color!==undefined)this.color=new THREE.Color(a.color);if(a.ambient!==undefined)this.ambient=new THREE.Color(a.ambient);if(a.specular!==undefined)this.specular=new THREE.Color(a.specular);if(a.shininess!==undefined)this.shininess=a.shininess;if(a.opacity!==undefined)this.opacity=a.opacity;if(a.lightMap!==undefined)this.lightMap=a.lightMap;if(a.map!==undefined)this.map=a.map;if(a.envMap!==undefined)this.envMap=
- a.envMap;if(a.combine!==undefined)this.combine=a.combine;if(a.reflectivity!==undefined)this.reflectivity=a.reflectivity;if(a.refractionRatio!==undefined)this.refractionRatio=a.refractionRatio;if(a.fog!==undefined)this.fog=a.fog;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==undefined)this.wireframeLinewidth=a.wireframeLinewidth;
- if(a.wireframeLinecap!==undefined)this.wireframeLinecap=a.wireframeLinecap;if(a.wireframeLinejoin!==undefined)this.wireframeLinejoin=a.wireframeLinejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors;if(a.skinning!==undefined)this.skinning=a.skinning;if(a.morphTargets!==undefined)this.morphTargets=a.morphTargets}};
- THREE.MeshDepthMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.opacity=1;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;if(a){if(a.opacity!==undefined)this.opacity=a.opacity;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==
- undefined)this.wireframeLinewidth=a.wireframeLinewidth}};
- THREE.MeshNormalMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.opacity=1;this.shading=THREE.FlatShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;if(a){if(a.opacity!==undefined)this.opacity=a.opacity;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==
- undefined)this.wireframeLinewidth=a.wireframeLinewidth}};THREE.MeshFaceMaterial=function(){};
- THREE.MeshShaderMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.vertexShader=this.fragmentShader="void main() {}";this.uniforms={};this.opacity=1;this.shading=THREE.SmoothShading;this.blending=THREE.NormalBlending;this.depthTest=!0;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=!1;this.skinning=!1;this.morphTargets=!1;if(a){if(a.fragmentShader!==undefined)this.fragmentShader=a.fragmentShader;if(a.vertexShader!==undefined)this.vertexShader=
- a.vertexShader;if(a.uniforms!==undefined)this.uniforms=a.uniforms;if(a.opacity!==undefined)this.opacity=a.opacity;if(a.shading!==undefined)this.shading=a.shading;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.wireframe!==undefined)this.wireframe=a.wireframe;if(a.wireframeLinewidth!==undefined)this.wireframeLinewidth=a.wireframeLinewidth;if(a.wireframeLinecap!==undefined)this.wireframeLinecap=a.wireframeLinecap;if(a.wireframeLinejoin!==
- undefined)this.wireframeLinejoin=a.wireframeLinejoin;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors;if(a.skinning!==undefined)this.skinning=a.skinning;if(a.morphTargets!==undefined)this.morphTargets=a.morphTargets}};
- THREE.ParticleBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.map=null;this.size=1;this.sizeAttenuation=!0;this.blending=THREE.NormalBlending;this.depthTest=!0;this.offset=new THREE.Vector2;this.vertexColors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.map!==undefined)this.map=a.map;if(a.size!==undefined)this.size=a.size;if(a.sizeAttenuation!==undefined)this.sizeAttenuation=
- a.sizeAttenuation;if(a.blending!==undefined)this.blending=a.blending;if(a.depthTest!==undefined)this.depthTest=a.depthTest;if(a.vertexColors!==undefined)this.vertexColors=a.vertexColors}};THREE.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.Texture=function(a,b,d,f,g,l){this.image=a;this.mapping=b!==undefined?b:new THREE.UVMapping;this.wrapS=d!==undefined?d:THREE.ClampToEdgeWrapping;this.wrapT=f!==undefined?f:THREE.ClampToEdgeWrapping;this.magFilter=g!==undefined?g:THREE.LinearFilter;this.minFilter=l!==undefined?l:THREE.LinearMipMapLinearFilter;this.needsUpdate=!1};THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter)}};
- THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;
- THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;
- THREE.RenderTarget=function(a,b,d){this.width=a;this.height=b;d=d||{};this.wrapS=d.wrapS!==undefined?d.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=d.wrapT!==undefined?d.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=d.magFilter!==undefined?d.magFilter:THREE.LinearFilter;this.minFilter=d.minFilter!==undefined?d.minFilter: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,f,g={};for(b in a){g[b]={};for(d in a[b]){f=a[b][d];g[b][d]=f instanceof THREE.Color||f instanceof THREE.Vector3||f instanceof THREE.Texture?f.clone():f}}return g},merge:function(a){var b,d,f,g={};for(b=0;b<a.length;b++){f=this.clone(a[b]);for(d in f)g[d]=f[d]}return g}};THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a];this.matrixAutoUpdate=!1};THREE.Particle.prototype=new THREE.Object3D;
- THREE.Particle.prototype.constructor=THREE.Particle;THREE.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(a,b,d){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.type=d!=undefined?d:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;
- THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line;
- THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b&&b.length?b:[b];this.flipSided=!1;this.doubleSided=!1;this.overdraw=!1;if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius;if(this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var d=0;d<this.geometry.morphTargets.length;d++){this.morphTargetInfluences.push(0);this.morphTargetDictionary[this.geometry.morphTargets[d].name]=
- d}}}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==undefined)return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
- THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
- THREE.Bone.prototype.update=function(a,b,d){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.skinMatrix.multiply(a,this.matrix):this.skinMatrix.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;b=!0}var f,g=this.children.length;if(this.hasNoneBoneChildren){this.matrixWorld.multiply(this.skin.matrixWorld,this.skinMatrix);for(f=0;f<g;f++){a=this.children[f];a instanceof THREE.Bone?a.update(this.skinMatrix,b,d):a.update(this.matrixWorld,!0,d)}}else for(f=0;f<g;f++)this.children[f].update(this.skinMatrix,
- b,d)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};if(!window.Float32Array)window.Float32Array=Array;
- THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var d,f,g,l,m,s;if(this.geometry.bones!==undefined){for(d=0;d<this.geometry.bones.length;d++){g=this.geometry.bones[d];l=g.pos;m=g.rotq;s=g.scl;f=this.addBone();f.name=g.name;f.position.set(l[0],l[1],l[2]);f.quaternion.set(m[0],m[1],m[2],m[3]);f.useQuaternion=!0;s!==undefined?f.scale.set(s[0],s[1],s[2]):f.scale.set(1,1,1)}for(d=0;d<this.bones.length;d++){g=this.geometry.bones[d];
- f=this.bones[d];g.parent===-1?this.addChild(f):this.bones[g.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(a,b,d){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;b=!0}var f,g=this.children.length;for(f=0;f<g;f++){a=this.children[f];a instanceof THREE.Bone?a.update(this.identityMatrix,!1,d):a.update(this.matrixWorld,b,d)}d=this.bones.length;ba=this.bones;bm=this.boneMatrices;for(b=0;b<d;b++)ba[b].skinMatrix.flattenToArrayOffset(bm,
- b*16)}};THREE.SkinnedMesh.prototype.addBone=function(a){a===undefined&&(a=new THREE.Bone(this));this.bones.push(a);return a};
- THREE.SkinnedMesh.prototype.pose=function(){this.update(undefined,!0);for(var a,b=[],d=0;d<this.bones.length;d++){a=this.bones[d];b.push(THREE.Matrix4.makeInvert(a.skinMatrix));a.skinMatrix.flattenToArrayOffset(this.boneMatrices,d*16)}if(this.geometry.skinVerticesA===undefined){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var f;for(a=0;a<this.geometry.skinIndices.length;a++){d=this.geometry.vertices[a].position;var g=this.geometry.skinIndices[a].x,l=this.geometry.skinIndices[a].y;
- f=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesA.push(b[g].multiplyVector3(f));f=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesB.push(b[l].multiplyVector3(f));if(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1){d=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5;this.geometry.skinWeights[a].x+=d;this.geometry.skinWeights[a].y+=d}}}};
- THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.flipSided=!1;this.doubleSided=!1};THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;
- THREE.Sound=function(a,b,d,f){THREE.Object3D.call(this);this.isLoaded=!1;this.isAddedToDOM=!1;this.isPlaying=!1;this.duration=-1;this.radius=b!==undefined?Math.abs(b):100;this.volume=Math.min(1,Math.max(0,d!==undefined?d:1));this.domElement=document.createElement("audio");this.domElement.volume=0;this.domElement.pan=0;this.domElement.loop=f!==undefined?f:!0;this.sources=a instanceof Array?a:[a];var g;d=this.sources.length;for(a=0;a<d;a++){b=this.sources[a];b.toLowerCase();if(b.indexOf(".mp3")!==-1)g=
- "audio/mpeg";else if(b.indexOf(".ogg")!==-1)g="audio/ogg";else b.indexOf(".wav")!==-1&&(g="audio/wav");if(this.domElement.canPlayType(g)){g=document.createElement("source");g.src=this.sources[a];this.domElement.THREESound=this;this.domElement.appendChild(g);this.domElement.addEventListener("canplay",this.onLoad,!0);this.domElement.load();break}}};THREE.Sound.prototype=new THREE.Object3D;THREE.Sound.prototype.constructor=THREE.Sound;THREE.Sound.prototype.supr=THREE.Object3D.prototype;
- THREE.Sound.prototype.onLoad=function(){var a=this.THREESound;if(!a.isLoaded){this.removeEventListener("canplay",this.onLoad,!0);a.isLoaded=!0;a.duration=this.duration;a.isPlaying&&a.play()}};THREE.Sound.prototype.addToDOM=function(a){this.isAddedToDOM=!0;a.appendChild(this.domElement)};THREE.Sound.prototype.play=function(a){this.isPlaying=!0;if(this.isLoaded){this.domElement.play();if(a)this.domElement.currentTime=a%this.duration}};THREE.Sound.prototype.pause=function(){this.isPlaying=!1;this.domElement.pause()};
- THREE.Sound.prototype.stop=function(){this.isPlaying=!1;this.domElement.pause();this.domElement.currentTime=0};THREE.Sound.prototype.calculateVolumeAndPan=function(a){a=a.length();this.domElement.volume=a<=this.radius?this.volume*(1-a/this.radius):0};
- THREE.Sound.prototype.update=function(a,b,d){if(this.matrixAutoUpdate){this.matrix.setPosition(this.position);b=!0}if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;b=!0}var f=this.children.length;for(a=0;a<f;a++)this.children[a].update(this.matrixWorld,b,d)};THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;
- THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.add=function(a,b){b===undefined&&(b=0);b=Math.abs(b);for(var d=0;d<this.LODs.length;d++)if(b<this.LODs[d].visibleAtDistance)break;this.LODs.splice(d,0,{visibleAtDistance:b,object3D:a});this.addChild(a)};
- THREE.LOD.prototype.update=function(a,b,d){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate){a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix);this.matrixWorldNeedsUpdate=!1;b=!0}if(this.LODs.length>1){a=d.matrixWorldInverse;a=-(a.n31*this.position.x+a.n32*this.position.y+a.n33*this.position.z+a.n34);this.LODs[0].object3D.visible=!0;for(var f=1;f<this.LODs.length;f++)if(a>=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(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,d)};THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;
- THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1){this.objects.push(a);this.__objectsAdded.push(a)}for(var b=0;b<a.children.length;b++)this.addChildRecurse(a.children[b])};
- THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else if(a instanceof THREE.Sound){b=this.sounds.indexOf(a);b!==-1&&this.sounds.splice(b,1)}else if(!(a instanceof THREE.Camera)){b=this.objects.indexOf(a);if(b!==-1){this.objects.splice(b,1);this.__objectsRemoved.push(a)}}for(b=0;b<a.children.length;b++)this.removeChildRecurse(a.children[b])};
- THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(a,b,d){this.color=new THREE.Color(a);this.near=b||1;this.far=d||1E3};THREE.FogExp2=function(a,b){this.color=new THREE.Color(a);this.density=b!==undefined?b:2.5E-4};
- THREE.SoundRenderer=function(){this.volume=1;this.domElement=document.createElement("div");this.domElement.id="THREESound";this.cameraPosition=new THREE.Vector3;this.soundPosition=new THREE.Vector3;this.render=function(a,b,d){d&&a.update(undefined,!1,b);d=a.sounds;var f,g=d.length;for(f=0;f<g;f++){a=d[f];this.soundPosition.set(a.matrixWorld.n14,a.matrixWorld.n24,a.matrixWorld.n34);this.soundPosition.subSelf(b.position);if(a.isPlaying&&a.isLoaded){a.isAddedToDOM||a.addToDOM(this.domElement);a.calculateVolumeAndPan(this.soundPosition)}}}};
- THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
- envmap_pars_fragment:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform int combine;\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( -vReflect.x, vReflect.yz ) );\nif ( combine == 1 ) {\ngl_FragColor = vec4( mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity ), opacity );\n} else {\ngl_FragColor = gl_FragColor * cubeColor;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",
- envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",
- map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\n#endif",map_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\nuniform sampler2D lightMap;\n#endif",lightmap_pars_vertex:"#ifdef USE_LIGHTMAP\nvarying vec2 vUv2;\n#endif",
- lightmap_fragment:"#ifdef USE_LIGHTMAP\ngl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\n#endif",lightmap_vertex:"#ifdef USE_LIGHTMAP\nvUv2 = uv2;\n#endif",lights_pars_vertex:"uniform bool enableLighting;\nuniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\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[ 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 || USE_SKINNING\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},lightMap:{type:"t",value:2,texture:null},envMap:{type:"t",value:1,texture:null},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)},morphTargetInfluences:{type:"f",
- value:0}},lights:{enableLighting:{type:"i",value:1},ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},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},scale:{type:"f",value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",
- value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}}};
- THREE.ShaderLib={depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},fragmentShader:"uniform float mNear;\nuniform float mFar;\nuniform float opacity;\nvoid main() {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat color = 1.0 - smoothstep( mNear, mFar, depth );\ngl_FragColor = vec4( vec3( color ), opacity );\n}",vertexShader:"void main() {\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},normal:{uniforms:{opacity:{type:"f",
- value:1}},fragmentShader:"uniform float opacity;\nvarying vec3 vNormal;\nvoid main() {\ngl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n}",vertexShader:"varying vec3 vNormal;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvNormal = normalize( normalMatrix * normal );\ngl_Position = projectionMatrix * mvPosition;\n}"},basic:{uniforms:THREE.UniformsLib.common,fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,
- THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:[THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,
- THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")},lambert:{uniforms:Uniforms.merge([THREE.UniformsLib.common,THREE.UniformsLib.lights]),
- fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vLightWeighting;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );\ngl_FragColor = gl_FragColor * vec4( vLightWeighting, 1.0 );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,
- THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["varying vec3 vLightWeighting;",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,
- THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,"vec3 transformedNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")},phong:{uniforms:Uniforms.merge([THREE.UniformsLib.common,THREE.UniformsLib.lights,{ambient:{type:"c",value:new THREE.Color(328965)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30}}]),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform vec3 ambient;\nuniform vec3 specular;\nuniform float shininess;\nvarying vec3 vLightWeighting;",
- THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_pars_fragment,"void main() {\ngl_FragColor = vec4( vLightWeighting, 1.0 );",THREE.ShaderChunk.lights_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),
- vertexShader:["#define PHONG\nvarying vec3 vLightWeighting;\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,
- THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,"#ifndef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\n#endif\nvViewPosition = cameraPosition - mPosition.xyz;\nvec3 transformedNormal = normalize( normalMatrix * normal );\nvNormal = transformedNormal;",THREE.ShaderChunk.lights_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsLib.particle,fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",
- THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;\n}"].join("\n")}};
- THREE.WebGLRenderer=function(a){function b(e,j,k){var h,i,r,n=e.vertices,q=n.length,x=e.colors,C=x.length,p=e.__vertexArray,F=e.__colorArray,N=e.__sortArray,K=e.__dirtyVertices,J=e.__dirtyColors;if(k.sortParticles){Ma.multiplySelf(k.matrixWorld);for(h=0;h<q;h++){i=n[h].position;Ga.copy(i);Ma.multiplyVector3(Ga);N[h]=[Ga.z,h]}N.sort(function(G,P){return P[0]-G[0]});for(h=0;h<q;h++){i=n[N[h][1]].position;r=h*3;p[r]=i.x;p[r+1]=i.y;p[r+2]=i.z}for(h=0;h<C;h++){r=h*3;color=x[N[h][1]];F[r]=color.r;F[r+1]=
- color.g;F[r+2]=color.b}}else{if(K)for(h=0;h<q;h++){i=n[h].position;r=h*3;p[r]=i.x;p[r+1]=i.y;p[r+2]=i.z}if(J)for(h=0;h<C;h++){color=x[h];r=h*3;F[r]=color.r;F[r+1]=color.g;F[r+2]=color.b}}if(K||k.sortParticles){c.bindBuffer(c.ARRAY_BUFFER,e.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,p,j)}if(J||k.sortParticles){c.bindBuffer(c.ARRAY_BUFFER,e.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,F,j)}}function d(e,j){e.fragmentShader=j.fragmentShader;e.vertexShader=j.vertexShader;e.uniforms=Uniforms.clone(j.uniforms)}
- function f(e,j,k,h,i){h.program||ya.initMaterial(h,j,k,i);var r=h.program,n=r.uniforms,q=h.uniforms;if(r!=ra){c.useProgram(r);ra=r}c.uniformMatrix4fv(n.projectionMatrix,!1,Xa);if(k&&(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial||h instanceof THREE.LineBasicMaterial||h instanceof THREE.ParticleBasicMaterial)){q.fogColor.value.setHex(k.color.hex);if(k instanceof THREE.Fog){q.fogNear.value=k.near;q.fogFar.value=k.far}else if(k instanceof
- THREE.FogExp2)q.fogDensity.value=k.density}if(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial){var x,C,p=0,F=0,N=0,K,J,G,P=Ya,Q=P.directional.colors,na=P.directional.positions,u=P.point.colors,la=P.point.positions,fa=0,ka=0;k=C=C=0;for(x=j.length;k<x;k++){C=j[k];K=C.color;J=C.position;G=C.intensity;if(C instanceof THREE.AmbientLight){p+=K.r;F+=K.g;N+=K.b}else if(C instanceof THREE.DirectionalLight){C=fa*3;Q[C]=K.r*G;Q[C+1]=K.g*G;Q[C+2]=K.b*G;na[C]=J.x;na[C+1]=J.y;na[C+
- 2]=J.z;fa+=1}else if(C instanceof THREE.PointLight){C=ka*3;u[C]=K.r*G;u[C+1]=K.g*G;u[C+2]=K.b*G;la[C]=J.x;la[C+1]=J.y;la[C+2]=J.z;ka+=1}}for(k=fa*3;k<Q.length;k++)Q[k]=0;for(k=ka*3;k<u.length;k++)u[k]=0;P.point.length=ka;P.directional.length=fa;P.ambient[0]=p;P.ambient[1]=F;P.ambient[2]=N;j=Ya;q.enableLighting.value=j.directional.length+j.point.length;q.ambientLightColor.value=j.ambient;q.directionalLightColor.value=j.directional.colors;q.directionalLightDirection.value=j.directional.positions;q.pointLightColor.value=
- j.point.colors;q.pointLightPosition.value=j.point.positions}if(h instanceof THREE.MeshBasicMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshPhongMaterial){q.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);q.opacity.value=h.opacity;q.map.texture=h.map;q.lightMap.texture=h.lightMap;q.envMap.texture=h.envMap;q.reflectivity.value=h.reflectivity;q.refractionRatio.value=h.refractionRatio;q.combine.value=h.combine;q.useRefract.value=h.envMap&&h.envMap.mapping instanceof
- THREE.CubeRefractionMapping}if(h instanceof THREE.LineBasicMaterial){q.diffuse.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);q.opacity.value=h.opacity}else if(h instanceof THREE.ParticleBasicMaterial){q.psColor.value.setRGB(h.color.r*h.opacity,h.color.g*h.opacity,h.color.b*h.opacity);q.opacity.value=h.opacity;q.size.value=h.size;q.scale.value=ja.height/2;q.map.texture=h.map}else if(h instanceof THREE.MeshPhongMaterial){q.ambient.value.setRGB(h.ambient.r,h.ambient.g,h.ambient.b);
- q.specular.value.setRGB(h.specular.r,h.specular.g,h.specular.b);q.shininess.value=h.shininess}else if(h instanceof THREE.MeshDepthMaterial){q.mNear.value=e.near;q.mFar.value=e.far;q.opacity.value=h.opacity}else if(h instanceof THREE.MeshNormalMaterial)q.opacity.value=h.opacity;for(var w in q)if(p=r.uniforms[w]){k=q[w];x=k.type;j=k.value;if(x=="i")c.uniform1i(p,j);else if(x=="f")c.uniform1f(p,j);else if(x=="fv1")c.uniform1fv(p,j);else if(x=="fv")c.uniform3fv(p,j);else if(x=="v2")c.uniform2f(p,j.x,
- j.y);else if(x=="v3")c.uniform3f(p,j.x,j.y,j.z);else if(x=="c")c.uniform3f(p,j.r,j.g,j.b);else if(x=="t"){c.uniform1i(p,j);if(k=k.texture)if(k.image instanceof Array&&k.image.length==6){if(k.image.length==6){if(k.needsUpdate){if(k.__wasSetOnce){c.bindTexture(c.TEXTURE_CUBE_MAP,k.image.__webGLTextureCube);for(x=0;x<6;++x)c.texSubImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+x,0,0,0,c.RGBA,c.UNSIGNED_BYTE,k.image[x])}else{k.image.__webGLTextureCube=c.createTexture();c.bindTexture(c.TEXTURE_CUBE_MAP,k.image.__webGLTextureCube);
- for(x=0;x<6;++x)c.texImage2D(c.TEXTURE_CUBE_MAP_POSITIVE_X+x,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,k.image[x]);k.__wasSetOnce=!0}W(c.TEXTURE_CUBE_MAP,k,k.image[0]);c.bindTexture(c.TEXTURE_CUBE_MAP,null);k.needsUpdate=!1}c.activeTexture(c.TEXTURE0+j);c.bindTexture(c.TEXTURE_CUBE_MAP,k.image.__webGLTextureCube)}}else{if(k.needsUpdate){if(k.__wasSetOnce){c.bindTexture(c.TEXTURE_2D,k.__webGLTexture);c.texSubImage2D(c.TEXTURE_2D,0,0,0,c.RGBA,c.UNSIGNED_BYTE,k.image)}else{k.__webGLTexture=c.createTexture();c.bindTexture(c.TEXTURE_2D,
- k.__webGLTexture);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,k.image);k.__wasSetOnce=!0}W(c.TEXTURE_2D,k,k.image);c.bindTexture(c.TEXTURE_2D,null);k.needsUpdate=!1}c.activeTexture(c.TEXTURE0+j);c.bindTexture(c.TEXTURE_2D,k.__webGLTexture)}}}c.uniformMatrix4fv(n.modelViewMatrix,!1,i._modelViewMatrixArray);c.uniformMatrix3fv(n.normalMatrix,!1,i._normalMatrixArray);(h instanceof THREE.MeshShaderMaterial||h instanceof THREE.MeshPhongMaterial||h.envMap)&&c.uniform3f(n.cameraPosition,e.position.x,
- e.position.y,e.position.z);(h instanceof THREE.MeshShaderMaterial||h.envMap||h.skinning)&&c.uniformMatrix4fv(n.objectMatrix,!1,i._objectMatrixArray);(h instanceof THREE.MeshPhongMaterial||h instanceof THREE.MeshLambertMaterial||h instanceof THREE.MeshShaderMaterial||h.skinning)&&c.uniformMatrix4fv(n.viewMatrix,!1,Pa);if(h.skinning){c.uniformMatrix4fv(n.cameraInverseMatrix,!1,Pa);c.uniformMatrix4fv(n.boneGlobalMatrices,!1,i.boneMatrices)}return r}function g(e,j,k,h,i,r){if(h.opacity!=0){e=f(e,j,k,
- h,r).attributes;if(h.morphTargets){r.morphTargetBase!==-1?c.bindBuffer(c.ARRAY_BUFFER,i.__webGLMorphTargetsBuffers[r.morphTargetBase]):c.bindBuffer(c.ARRAY_BUFFER,i.__webGLVertexBuffer);c.vertexAttribPointer(e.position,3,c.FLOAT,!1,0,0);j=[];k=-1;var n=0,q=r.morphTargetInfluences,x,C=q.length,p=0;for(r.morphTargetBase!==-1&&(j[r.morphTargetBase]=!0);p<h.numSupportedMorphTargets;){for(x=0;x<C;x++)if(!j[x]&&q[x]>k){n=x;k=q[n]}c.bindBuffer(c.ARRAY_BUFFER,i.__webGLMorphTargetsBuffers[n]);c.vertexAttribPointer(e["morphTarget"+
- p],3,c.FLOAT,!1,0,0);r.__webGLMorphTargetInfluences[p]=k;j[n]=1;k=-1;p++}c.uniform1fv(h.program.uniforms.morphTargetInfluences,r.__webGLMorphTargetInfluences)}else{c.bindBuffer(c.ARRAY_BUFFER,i.__webGLVertexBuffer);c.vertexAttribPointer(e.position,3,c.FLOAT,!1,0,0)}if(e.color>=0){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLColorBuffer);c.vertexAttribPointer(e.color,3,c.FLOAT,!1,0,0)}if(e.normal>=0){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLNormalBuffer);c.vertexAttribPointer(e.normal,3,c.FLOAT,!1,0,0)}if(e.tangent>=
- 0){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLTangentBuffer);c.vertexAttribPointer(e.tangent,4,c.FLOAT,!1,0,0)}if(e.uv>=0)if(i.__webGLUVBuffer){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLUVBuffer);c.vertexAttribPointer(e.uv,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(e.uv)}else c.disableVertexAttribArray(e.uv);if(e.uv2>=0)if(i.__webGLUV2Buffer){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLUV2Buffer);c.vertexAttribPointer(e.uv2,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(e.uv2)}else c.disableVertexAttribArray(e.uv2);
- if(h.skinning&&e.skinVertexA>=0&&e.skinVertexB>=0&&e.skinIndex>=0&&e.skinWeight>=0){c.bindBuffer(c.ARRAY_BUFFER,i.__webGLSkinVertexABuffer);c.vertexAttribPointer(e.skinVertexA,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,i.__webGLSkinVertexBBuffer);c.vertexAttribPointer(e.skinVertexB,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,i.__webGLSkinIndicesBuffer);c.vertexAttribPointer(e.skinIndex,4,c.FLOAT,!1,0,0);c.bindBuffer(c.ARRAY_BUFFER,i.__webGLSkinWeightsBuffer);c.vertexAttribPointer(e.skinWeight,
- 4,c.FLOAT,!1,0,0)}if(r instanceof THREE.Mesh)if(h.wireframe){c.lineWidth(h.wireframeLinewidth);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,i.__webGLLineBuffer);c.drawElements(c.LINES,i.__webGLLineCount,c.UNSIGNED_SHORT,0)}else{c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,i.__webGLFaceBuffer);c.drawElements(c.TRIANGLES,i.__webGLFaceCount,c.UNSIGNED_SHORT,0)}else if(r instanceof THREE.Line){r=r.type==THREE.LineStrip?c.LINE_STRIP:c.LINES;c.lineWidth(h.linewidth);c.drawArrays(r,0,i.__webGLLineCount)}else if(r instanceof
- THREE.ParticleSystem)c.drawArrays(c.POINTS,0,i.__webGLParticleCount);else r instanceof THREE.Ribbon&&c.drawArrays(c.TRIANGLE_STRIP,0,i.__webGLVertexCount)}}function l(e,j){if(!e.__webGLVertexBuffer)e.__webGLVertexBuffer=c.createBuffer();if(!e.__webGLNormalBuffer)e.__webGLNormalBuffer=c.createBuffer();if(e.hasPos){c.bindBuffer(c.ARRAY_BUFFER,e.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,e.positionArray,c.DYNAMIC_DRAW);c.enableVertexAttribArray(j.attributes.position);c.vertexAttribPointer(j.attributes.position,
- 3,c.FLOAT,!1,0,0)}if(e.hasNormal){c.bindBuffer(c.ARRAY_BUFFER,e.__webGLNormalBuffer);c.bufferData(c.ARRAY_BUFFER,e.normalArray,c.DYNAMIC_DRAW);c.enableVertexAttribArray(j.attributes.normal);c.vertexAttribPointer(j.attributes.normal,3,c.FLOAT,!1,0,0)}c.drawArrays(c.TRIANGLES,0,e.count);e.count=0}function m(e){if(sa!=e.doubleSided){e.doubleSided?c.disable(c.CULL_FACE):c.enable(c.CULL_FACE);sa=e.doubleSided}if(ta!=e.flipSided){e.flipSided?c.frontFace(c.CW):c.frontFace(c.CCW);ta=e.flipSided}}function s(e){if(Fa!=
- e){e?c.enable(c.DEPTH_TEST):c.disable(c.DEPTH_TEST);Fa=e}}function o(e){ua[0].set(e.n41-e.n11,e.n42-e.n12,e.n43-e.n13,e.n44-e.n14);ua[1].set(e.n41+e.n11,e.n42+e.n12,e.n43+e.n13,e.n44+e.n14);ua[2].set(e.n41+e.n21,e.n42+e.n22,e.n43+e.n23,e.n44+e.n24);ua[3].set(e.n41-e.n21,e.n42-e.n22,e.n43-e.n23,e.n44-e.n24);ua[4].set(e.n41-e.n31,e.n42-e.n32,e.n43-e.n33,e.n44-e.n34);ua[5].set(e.n41+e.n31,e.n42+e.n32,e.n43+e.n33,e.n44+e.n34);var j;for(e=0;e<6;e++){j=ua[e];j.divideScalar(Math.sqrt(j.x*j.x+j.y*j.y+j.z*
- j.z))}}function v(e){for(var j=e.matrixWorld,k=-e.geometry.boundingSphere.radius*Math.max(e.scale.x,Math.max(e.scale.y,e.scale.z)),h=0;h<6;h++){e=ua[h].x*j.n14+ua[h].y*j.n24+ua[h].z*j.n34+ua[h].w;if(e<=k)return!1}return!0}function B(e,j){e.list[e.count]=j;e.count+=1}function A(e){var j,k,h=e.object,i=e.opaque,r=e.transparent;r.count=0;e=i.count=0;for(j=h.materials.length;e<j;e++){k=h.materials[e];k.opacity&&k.opacity<1||k.blending!=THREE.NormalBlending?B(r,k):B(i,k)}}function D(e){var j,k,h,i,r=e.object,
- n=e.buffer,q=e.opaque,x=e.transparent;x.count=0;e=q.count=0;for(h=r.materials.length;e<h;e++){j=r.materials[e];if(j instanceof THREE.MeshFaceMaterial){j=0;for(k=n.materials.length;j<k;j++)(i=n.materials[j])&&(i.opacity&&i.opacity<1||i.blending!=THREE.NormalBlending?B(x,i):B(q,i))}else{i=j;i.opacity&&i.opacity<1||i.blending!=THREE.NormalBlending?B(x,i):B(q,i)}}}function E(e,j){return j.z-e.z}function H(e,j){e._modelViewMatrix.multiplyToArray(j.matrixWorldInverse,e.matrixWorld,e._modelViewMatrixArray);
- THREE.Matrix4.makeInvert3x3(e._modelViewMatrix).transposeIntoArray(e._normalMatrixArray)}function I(e){function j(N){var K=[];k=0;for(h=N.length;k<h;k++)N[k]==undefined?K.push("undefined"):K.push(N[k].id);return K.join("_")}var k,h,i,r,n,q,x,C,p={},F=e.morphTargets!==undefined?e.morphTargets.length:0;e.geometryGroups={};i=0;for(r=e.faces.length;i<r;i++){n=e.faces[i];q=n.materials;x=j(q);p[x]==undefined&&(p[x]={hash:x,counter:0});C=p[x].hash+"_"+p[x].counter;e.geometryGroups[C]==undefined&&(e.geometryGroups[C]=
- {faces:[],materials:q,vertices:0,numMorphTargets:F});n=n instanceof THREE.Face3?3:4;if(e.geometryGroups[C].vertices+n>65535){p[x].counter+=1;C=p[x].hash+"_"+p[x].counter;e.geometryGroups[C]==undefined&&(e.geometryGroups[C]={faces:[],materials:q,vertices:0,numMorphTargets:F})}e.geometryGroups[C].faces.push(i);e.geometryGroups[C].vertices+=n}}function L(e,j,k){e.push({buffer:j,object:k,opaque:{list:[],count:0},transparent:{list:[],count:0}})}function M(e){if(e!=Ea){switch(e){case THREE.AdditiveBlending:c.blendEquation(c.FUNC_ADD);
- c.blendFunc(c.ONE,c.ONE);break;case THREE.SubtractiveBlending:c.blendFunc(c.DST_COLOR,c.ZERO);break;case THREE.BillboardBlending:c.blendEquation(c.FUNC_ADD);c.blendFunc(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA);break;case THREE.ReverseSubtractiveBlending:c.blendEquation(c.FUNC_REVERSE_SUBTRACT);c.blendFunc(c.ONE,c.ONE);break;default:c.blendEquation(c.FUNC_ADD);c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA)}Ea=e}}function W(e,j,k){if((k.width&k.width-1)==0&&(k.height&k.height-1)==0){c.texParameteri(e,c.TEXTURE_WRAP_S,
- aa(j.wrapS));c.texParameteri(e,c.TEXTURE_WRAP_T,aa(j.wrapT));c.texParameteri(e,c.TEXTURE_MAG_FILTER,aa(j.magFilter));c.texParameteri(e,c.TEXTURE_MIN_FILTER,aa(j.minFilter));c.generateMipmap(e)}else{c.texParameteri(e,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(e,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(e,c.TEXTURE_MAG_FILTER,ea(j.magFilter));c.texParameteri(e,c.TEXTURE_MIN_FILTER,ea(j.minFilter))}}function $(e){if(e&&!e.__webGLFramebuffer){e.__webGLFramebuffer=c.createFramebuffer();
- e.__webGLRenderbuffer=c.createRenderbuffer();e.__webGLTexture=c.createTexture();c.bindRenderbuffer(c.RENDERBUFFER,e.__webGLRenderbuffer);c.renderbufferStorage(c.RENDERBUFFER,c.DEPTH_COMPONENT16,e.width,e.height);c.bindTexture(c.TEXTURE_2D,e.__webGLTexture);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,aa(e.wrapS));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,aa(e.wrapT));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,aa(e.magFilter));c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,aa(e.minFilter));
- c.texImage2D(c.TEXTURE_2D,0,aa(e.format),e.width,e.height,0,aa(e.format),aa(e.type),null);c.bindFramebuffer(c.FRAMEBUFFER,e.__webGLFramebuffer);c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,e.__webGLTexture,0);c.framebufferRenderbuffer(c.FRAMEBUFFER,c.DEPTH_ATTACHMENT,c.RENDERBUFFER,e.__webGLRenderbuffer);c.bindTexture(c.TEXTURE_2D,null);c.bindRenderbuffer(c.RENDERBUFFER,null);c.bindFramebuffer(c.FRAMEBUFFER,null)}var j,k;if(e){j=e.__webGLFramebuffer;k=e.width;e=e.height}else{j=
- null;k=Ka;e=La}if(j!=pa){c.bindFramebuffer(c.FRAMEBUFFER,j);c.viewport(Aa,Ja,k,e);pa=j}}function ia(e,j){var k;if(e=="fragment")k=c.createShader(c.FRAGMENT_SHADER);else e=="vertex"&&(k=c.createShader(c.VERTEX_SHADER));c.shaderSource(k,j);c.compileShader(k);if(!c.getShaderParameter(k,c.COMPILE_STATUS)){alert(c.getShaderInfoLog(k));return null}return k}function ea(e){switch(e){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return c.NEAREST;case THREE.LinearFilter:case THREE.LinearMipMapNearestFilter:case THREE.LinearMipMapLinearFilter:return c.LINEAR}}
- function aa(e){switch(e){case THREE.RepeatWrapping:return c.REPEAT;case THREE.ClampToEdgeWrapping:return c.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return c.MIRRORED_REPEAT;case THREE.NearestFilter:return c.NEAREST;case THREE.NearestMipMapNearestFilter:return c.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return c.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return c.LINEAR;case THREE.LinearMipMapNearestFilter:return c.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return c.LINEAR_MIPMAP_LINEAR;
- case THREE.ByteType:return c.BYTE;case THREE.UnsignedByteType:return c.UNSIGNED_BYTE;case THREE.ShortType:return c.SHORT;case THREE.UnsignedShortType:return c.UNSIGNED_SHORT;case THREE.IntType:return c.INT;case THREE.UnsignedShortType:return c.UNSIGNED_INT;case THREE.FloatType:return c.FLOAT;case THREE.AlphaFormat:return c.ALPHA;case THREE.RGBFormat:return c.RGB;case THREE.RGBAFormat:return c.RGBA;case THREE.LuminanceFormat:return c.LUMINANCE;case THREE.LuminanceAlphaFormat:return c.LUMINANCE_ALPHA}return 0}
- var ja=document.createElement("canvas"),c,ra=null,pa=null,ya=this,sa=null,ta=null,Ea=null,Fa=null,Aa=0,Ja=0,Ka=0,La=0,ua=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],Ma=new THREE.Matrix4,Xa=new Float32Array(16),Pa=new Float32Array(16),Ga=new THREE.Vector4,Ya={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[]}},Za=!0,$a=new THREE.Color(0),ab=0;if(a){if(a.antialias!==undefined)Za=a.antialias;
- a.clearColor!==undefined&&$a.setHex(a.clearColor);if(a.clearAlpha!==undefined)ab=a.clearAlpha}this.maxMorphTargets=8;this.domElement=ja;this.autoClear=!0;this.sortObjects=!0;(function(e,j,k){try{if(!(c=ja.getContext("experimental-webgl",{antialias:e})))throw"Error creating WebGL context.";}catch(h){console.error(h)}c.clearColor(0,0,0,1);c.clearDepth(1);c.enable(c.DEPTH_TEST);c.depthFunc(c.LEQUAL);c.frontFace(c.CCW);c.cullFace(c.BACK);c.enable(c.CULL_FACE);c.enable(c.BLEND);c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA);
- c.clearColor(j.r,j.g,j.b,k);_cullEnabled=!0})(Za,$a,ab);this.context=c;this.setSize=function(e,j){ja.width=e;ja.height=j;this.setViewport(0,0,ja.width,ja.height)};this.setViewport=function(e,j,k,h){Aa=e;Ja=j;Ka=k;La=h;c.viewport(Aa,Ja,Ka,La)};this.setScissor=function(e,j,k,h){c.scissor(e,j,k,h)};this.enableScissorTest=function(e){e?c.enable(c.SCISSOR_TEST):c.disable(c.SCISSOR_TEST)};this.enableDepthBufferWrite=function(e){c.depthMask(e)};this.setClearColorHex=function(e,j){var k=new THREE.Color(e);
- c.clearColor(k.r,k.g,k.b,j)};this.setClearColor=function(e,j){c.clearColor(e.r,e.g,e.b,j)};this.clear=function(){c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT)};this.initMaterial=function(e,j,k,h){var i,r,n;if(e instanceof THREE.MeshDepthMaterial)d(e,THREE.ShaderLib.depth);else if(e instanceof THREE.MeshNormalMaterial)d(e,THREE.ShaderLib.normal);else if(e instanceof THREE.MeshBasicMaterial)d(e,THREE.ShaderLib.basic);else if(e instanceof THREE.MeshLambertMaterial)d(e,THREE.ShaderLib.lambert);else if(e instanceof
- THREE.MeshPhongMaterial)d(e,THREE.ShaderLib.phong);else if(e instanceof THREE.LineBasicMaterial)d(e,THREE.ShaderLib.basic);else e instanceof THREE.ParticleBasicMaterial&&d(e,THREE.ShaderLib.particle_basic);var q,x,C,p;n=C=p=0;for(q=j.length;n<q;n++){x=j[n];x instanceof THREE.DirectionalLight&&C++;x instanceof THREE.PointLight&&p++}if(p+C<=4)j=C;else{j=Math.ceil(4*C/(p+C));p=4-j}n={directional:j,point:p};q=50;if(h!==undefined&&h instanceof THREE.SkinnedMesh)q=h.bones.length;p=e.fragmentShader;j=e.vertexShader;
- q={fog:k,map:e.map,envMap:e.envMap,lightMap:e.lightMap,vertexColors:e.vertexColors,sizeAttenuation:e.sizeAttenuation,skinning:e.skinning,morphTargets:e.morphTargets,maxDirLights:n.directional,maxPointLights:n.point,maxBones:q};k=c.createProgram();n=["#ifdef GL_ES\nprecision highp float;\n#endif","#define MAX_DIR_LIGHTS "+q.maxDirLights,"#define MAX_POINT_LIGHTS "+q.maxPointLights,q.fog?"#define USE_FOG":"",q.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",q.map?"#define USE_MAP":"",q.envMap?"#define USE_ENVMAP":
- "",q.lightMap?"#define USE_LIGHTMAP":"",q.vertexColors?"#define USE_COLOR":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");q=[c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0?"#define VERTEX_TEXTURES":"","#define MAX_DIR_LIGHTS "+q.maxDirLights,"#define MAX_POINT_LIGHTS "+q.maxPointLights,"#define MAX_BONES "+q.maxBones,q.map?"#define USE_MAP":"",q.envMap?"#define USE_ENVMAP":"",q.lightMap?"#define USE_LIGHTMAP":"",q.vertexColors?"#define USE_COLOR":"",q.skinning?"#define USE_SKINNING":
- "",q.morphTargets?"#define USE_MORPHTARGETS":"",q.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 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\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(k,ia("fragment",n+p));c.attachShader(k,ia("vertex",q+j));c.linkProgram(k);c.getProgramParameter(k,c.LINK_STATUS)||alert("Could not initialise shaders\nVALIDATE_STATUS: "+c.getProgramParameter(k,c.VALIDATE_STATUS)+", gl error ["+c.getError()+"]");k.uniforms={};k.attributes={};e.program=k;k=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(i in e.uniforms)k.push(i);
- i=e.program;p=0;for(j=k.length;p<j;p++){n=k[p];i.uniforms[n]=c.getUniformLocation(i,n)}k=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(i=0;i<this.maxMorphTargets;i++)k.push("morphTarget"+i);for(r in e.attributes)k.push(r);r=e.program;i=k;k=0;for(p=i.length;k<p;k++){j=i[k];r.attributes[j]=c.getAttribLocation(r,j)}r=e.program.attributes;c.enableVertexAttribArray(r.position);r.color>=0&&c.enableVertexAttribArray(r.color);r.normal>=0&&c.enableVertexAttribArray(r.normal);
- r.tangent>=0&&c.enableVertexAttribArray(r.tangent);if(e.skinning&&r.skinVertexA>=0&&r.skinVertexB>=0&&r.skinIndex>=0&&r.skinWeight>=0){c.enableVertexAttribArray(r.skinVertexA);c.enableVertexAttribArray(r.skinVertexB);c.enableVertexAttribArray(r.skinIndex);c.enableVertexAttribArray(r.skinWeight)}if(e.morphTargets){e.numSupportedMorphTargets=0;if(r.morphTarget0>=0){c.enableVertexAttribArray(r.morphTarget0);e.numSupportedMorphTargets++}if(r.morphTarget1>=0){c.enableVertexAttribArray(r.morphTarget1);
- e.numSupportedMorphTargets++}if(r.morphTarget2>=0){c.enableVertexAttribArray(r.morphTarget2);e.numSupportedMorphTargets++}if(r.morphTarget3>=0){c.enableVertexAttribArray(r.morphTarget3);e.numSupportedMorphTargets++}if(r.morphTarget4>=0){c.enableVertexAttribArray(r.morphTarget4);e.numSupportedMorphTargets++}if(r.morphTarget5>=0){c.enableVertexAttribArray(r.morphTarget5);e.numSupportedMorphTargets++}if(r.morphTarget6>=0){c.enableVertexAttribArray(r.morphTarget6);e.numSupportedMorphTargets++}if(r.morphTarget7>=
- 0){c.enableVertexAttribArray(r.morphTarget7);e.numSupportedMorphTargets++}h.__webGLMorphTargetInfluences=new Float32Array(this.maxMorphTargets);for(i=0;i<this.maxMorphTargets;i++)h.__webGLMorphTargetInfluences[i]=0}};this.render=function(e,j,k,h){var i,r,n,q,x,C,p,F,N=e.lights,K=e.fog;j.matrixAutoUpdate&&j.updateMatrix();e.update(undefined,!1,j);j.matrixWorldInverse.flattenToArray(Pa);j.projectionMatrix.flattenToArray(Xa);Ma.multiply(j.projectionMatrix,j.matrixWorldInverse);o(Ma);this.initWebGLObjects(e);
- $(k);(this.autoClear||h)&&this.clear();x=e.__webglObjects.length;for(h=0;h<x;h++){i=e.__webglObjects[h];p=i.object;if(p.visible)if(!(p instanceof THREE.Mesh)||v(p)){p.matrixWorld.flattenToArray(p._objectMatrixArray);H(p,j);D(i);i.render=!0;if(this.sortObjects){Ga.copy(p.position);Ma.multiplyVector3(Ga);i.z=Ga.z}}else i.render=!1;else i.render=!1}this.sortObjects&&e.__webglObjects.sort(E);C=e.__webglObjectsImmediate.length;for(h=0;h<C;h++){i=e.__webglObjectsImmediate[h];p=i.object;if(p.visible){p.matrixAutoUpdate&&
- p.matrixWorld.flattenToArray(p._objectMatrixArray);H(p,j);A(i)}}M(THREE.NormalBlending);for(h=0;h<x;h++){i=e.__webglObjects[h];if(i.render){p=i.object;F=i.buffer;n=i.opaque;m(p);for(i=0;i<n.count;i++){q=n.list[i];s(q.depthTest);g(j,N,K,q,F,p)}}}for(h=0;h<C;h++){i=e.__webglObjectsImmediate[h];p=i.object;if(p.visible){n=i.opaque;m(p);for(i=0;i<n.count;i++){q=n.list[i];s(q.depthTest);r=f(j,N,K,q,p);p.render(function(J){l(J,r)})}}}for(h=0;h<x;h++){i=e.__webglObjects[h];if(i.render){p=i.object;F=i.buffer;
- n=i.transparent;m(p);for(i=0;i<n.count;i++){q=n.list[i];M(q.blending);s(q.depthTest);g(j,N,K,q,F,p)}}}for(h=0;h<C;h++){i=e.__webglObjectsImmediate[h];p=i.object;if(p.visible){n=i.transparent;m(p);for(i=0;i<n.count;i++){q=n.list[i];M(q.blending);s(q.depthTest);r=f(j,N,K,q,p);p.render(function(J){l(J,r)})}}}if(k&&k.minFilter!==THREE.NearestFilter&&k.minFilter!==THREE.LinearFilter){c.bindTexture(c.TEXTURE_2D,k.__webGLTexture);c.generateMipmap(c.TEXTURE_2D);c.bindTexture(c.TEXTURE_2D,null)}};this.initWebGLObjects=
- function(e){if(!e.__webglObjects){e.__webglObjects=[];e.__webglObjectsImmediate=[]}for(;e.__objectsAdded.length;){var j=e.__objectsAdded[0],k=e,h=void 0,i=void 0,r=void 0;if(j._modelViewMatrix==undefined){j._modelViewMatrix=new THREE.Matrix4;j._normalMatrixArray=new Float32Array(9);j._modelViewMatrixArray=new Float32Array(16);j._objectMatrixArray=new Float32Array(16);j.matrixWorld.flattenToArray(j._objectMatrixArray)}if(j instanceof THREE.Mesh){i=j.geometry;i.geometryGroups==undefined&&I(i);for(h in i.geometryGroups){r=
- i.geometryGroups[h];if(!r.__webGLVertexBuffer){var n=r;n.__webGLVertexBuffer=c.createBuffer();n.__webGLNormalBuffer=c.createBuffer();n.__webGLTangentBuffer=c.createBuffer();n.__webGLColorBuffer=c.createBuffer();n.__webGLUVBuffer=c.createBuffer();n.__webGLUV2Buffer=c.createBuffer();n.__webGLSkinVertexABuffer=c.createBuffer();n.__webGLSkinVertexBBuffer=c.createBuffer();n.__webGLSkinIndicesBuffer=c.createBuffer();n.__webGLSkinWeightsBuffer=c.createBuffer();n.__webGLFaceBuffer=c.createBuffer();n.__webGLLineBuffer=
- c.createBuffer();if(n.numMorphTargets){var q=void 0,x=void 0;n.__webGLMorphTargetsBuffers=[];q=0;for(x=n.numMorphTargets;q<x;q++)n.__webGLMorphTargetsBuffers.push(c.createBuffer())}n=r;var C=j,p=void 0,F=void 0,N=x=q=0,K=C.geometry.faces,J=n.faces;p=0;for(F=J.length;p<F;p++){fi=J[p];face=K[fi];if(face instanceof THREE.Face3){q+=3;x+=1;N+=3}else if(face instanceof THREE.Face4){q+=4;x+=2;N+=4}}n.__vertexArray=new Float32Array(q*3);n.__normalArray=new Float32Array(q*3);n.__tangentArray=new Float32Array(q*
- 4);n.__colorArray=new Float32Array(q*3);n.__uvArray=new Float32Array(q*2);n.__uv2Array=new Float32Array(q*2);n.__skinVertexAArray=new Float32Array(q*4);n.__skinVertexBArray=new Float32Array(q*4);n.__skinIndexArray=new Float32Array(q*4);n.__skinWeightArray=new Float32Array(q*4);n.__faceArray=new Uint16Array(x*3);n.__lineArray=new Uint16Array(N*2);F=p=n;K=void 0;J=void 0;var G=void 0,P=void 0;G=void 0;var Q=!1;K=0;for(J=C.materials.length;K<J;K++){G=C.materials[K];if(G instanceof THREE.MeshFaceMaterial){G=
- 0;for(P=F.materials.length;G<P;G++)if(F.materials[G]&&F.materials[G].shading!=undefined&&F.materials[G].shading==THREE.SmoothShading){Q=!0;break}}else if(G&&G.shading!=undefined&&G.shading==THREE.SmoothShading){Q=!0;break}if(Q)break}p.__needsSmoothNormals=Q;n.__webGLFaceCount=x*3;n.__webGLLineCount=N*2;if(n.numMorphTargets){x=void 0;N=void 0;n.__morphTargetsArrays=[];x=0;for(N=n.numMorphTargets;x<N;x++)n.__morphTargetsArrays.push(new Float32Array(q*3))}i.__dirtyVertices=!0;i.__dirtyMorphTargets=!0;
- i.__dirtyElements=!0;i.__dirtyUvs=!0;i.__dirtyNormals=!0;i.__dirtyTangents=!0;i.__dirtyColors=!0}L(k.__webglObjects,r,j)}}else if(j instanceof THREE.Ribbon){i=j.geometry;if(!i.__webGLVertexBuffer){h=i;h.__webGLVertexBuffer=c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h=i;r=h.vertices.length;h.__vertexArray=new Float32Array(r*3);h.__colorArray=new Float32Array(r*3);h.__webGLVertexCount=r;i.__dirtyVertices=!0;i.__dirtyColors=!0}L(k.__webglObjects,i,j)}else if(j instanceof THREE.Line){i=j.geometry;
- if(!i.__webGLVertexBuffer){h=i;h.__webGLVertexBuffer=c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h=i;r=h.vertices.length;h.__vertexArray=new Float32Array(r*3);h.__colorArray=new Float32Array(r*3);h.__webGLLineCount=r;i.__dirtyVertices=!0;i.__dirtyColors=!0}L(k.__webglObjects,i,j)}else if(j instanceof THREE.ParticleSystem){i=j.geometry;if(!i.__webGLVertexBuffer){h=i;h.__webGLVertexBuffer=c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h=i;r=h.vertices.length;h.__vertexArray=new Float32Array(r*
- 3);h.__colorArray=new Float32Array(r*3);h.__sortArray=[];h.__webGLParticleCount=r;i.__dirtyVertices=!0;i.__dirtyColors=!0}L(k.__webglObjects,i,j)}else THREE.MarchingCubes!==undefined&&j instanceof THREE.MarchingCubes&&k.__webglObjectsImmediate.push({object:j,opaque:{list:[],count:0},transparent:{list:[],count:0}});e.__objectsAdded.splice(0,1)}for(;e.__objectsRemoved.length;){j=e.__objectsRemoved[0];k=e;i=void 0;h=void 0;for(i=k.__webglObjects.length-1;i>=0;i--){h=k.__webglObjects[i].object;j==h&&
- k.__webglObjects.splice(i,1)}e.__objectsRemoved.splice(0,1)}j=0;for(k=e.__webglObjects.length;j<k;j++){h=e.__webglObjects[j].object;r=void 0;i=void 0;n=void 0;if(h instanceof THREE.Mesh){i=h.geometry;for(r in i.geometryGroups){n=i.geometryGroups[r];if(i.__dirtyVertices||i.__dirtyMorphTargets||i.__dirtyElements||i.__dirtyUvs||i.__dirtyNormals||i.__dirtyColors||i.__dirtyTangents){q=c.DYNAMIC_DRAW;x=void 0;N=void 0;var na=void 0,u=void 0,la=void 0,fa=void 0,ka=void 0;na=void 0;var w=void 0,y=void 0,
- z=void 0,O=void 0;w=void 0;y=void 0;z=void 0;u=void 0;w=void 0;y=void 0;z=void 0;O=void 0;w=void 0;y=void 0;z=void 0;O=void 0;w=void 0;y=void 0;z=void 0;O=void 0;w=void 0;y=void 0;z=void 0;O=void 0;w=void 0;y=void 0;z=void 0;O=void 0;u=void 0;fa=void 0;la=void 0;ka=void 0;var ga=void 0,Ha=void 0,X=void 0,Y=P=G=Q=J=K=C=F=p=0,t=0,Z=0,ca=n.__vertexArray,Na=n.__uvArray,Oa=n.__uv2Array,qa=n.__normalArray,R=n.__tangentArray,da=n.__colorArray,S=n.__skinVertexAArray,T=n.__skinVertexBArray,U=n.__skinIndexArray,
- V=n.__skinWeightArray,Qa=n.__morphTargetsArrays,va=n.__faceArray,ma=n.__lineArray,bb=n.__needsSmoothNormals,ha=h.geometry,Ra=ha.__dirtyVertices,Sa=ha.__dirtyElements,Ia=ha.__dirtyUvs,Ta=ha.__dirtyNormals,Ua=ha.__dirtyTangents,Va=ha.__dirtyColors,Wa=ha.__dirtyMorphTargets,oa=ha.vertices,cb=n.faces,db=ha.faces,eb=ha.uvs,fb=ha.uvs2,wa=ha.colors,Ba=ha.skinVerticesA,Ca=ha.skinVerticesB,Da=ha.skinIndices,za=ha.skinWeights,xa=ha.morphTargets;x=0;for(N=cb.length;x<N;x++){na=cb[x];u=db[na];ka=eb[na];na=fb[na];
- la=u.vertexNormals;fa=u.normal;if(u instanceof THREE.Face3){if(Ra){w=oa[u.a].position;y=oa[u.b].position;z=oa[u.c].position;ca[F]=w.x;ca[F+1]=w.y;ca[F+2]=w.z;ca[F+3]=y.x;ca[F+4]=y.y;ca[F+5]=y.z;ca[F+6]=z.x;ca[F+7]=z.y;ca[F+8]=z.z;F+=9}if(Wa){ga=0;for(Ha=xa.length;ga<Ha;ga++){w=xa[ga].vertices[u.a].position;y=xa[ga].vertices[u.b].position;z=xa[ga].vertices[u.c].position;X=Qa[ga];X[Z+0]=w.x;X[Z+1]=w.y;X[Z+2]=w.z;X[Z+3]=y.x;X[Z+4]=y.y;X[Z+5]=y.z;X[Z+6]=z.x;X[Z+7]=z.y;X[Z+8]=z.z}Z+=9}if(za.length){w=
- za[u.a];y=za[u.b];z=za[u.c];V[t]=w.x;V[t+1]=w.y;V[t+2]=w.z;V[t+3]=w.w;V[t+4]=y.x;V[t+5]=y.y;V[t+6]=y.z;V[t+7]=y.w;V[t+8]=z.x;V[t+9]=z.y;V[t+10]=z.z;V[t+11]=z.w;w=Da[u.a];y=Da[u.b];z=Da[u.c];U[t]=w.x;U[t+1]=w.y;U[t+2]=w.z;U[t+3]=w.w;U[t+4]=y.x;U[t+5]=y.y;U[t+6]=y.z;U[t+7]=y.w;U[t+8]=z.x;U[t+9]=z.y;U[t+10]=z.z;U[t+11]=z.w;w=Ba[u.a];y=Ba[u.b];z=Ba[u.c];S[t]=w.x;S[t+1]=w.y;S[t+2]=w.z;S[t+3]=1;S[t+4]=y.x;S[t+5]=y.y;S[t+6]=y.z;S[t+7]=1;S[t+8]=z.x;S[t+9]=z.y;S[t+10]=z.z;S[t+11]=1;w=Ca[u.a];y=Ca[u.b];z=Ca[u.c];
- T[t]=w.x;T[t+1]=w.y;T[t+2]=w.z;T[t+3]=1;T[t+4]=y.x;T[t+5]=y.y;T[t+6]=y.z;T[t+7]=1;T[t+8]=z.x;T[t+9]=z.y;T[t+10]=z.z;T[t+11]=1;t+=12}if(Va&&wa.length){w=wa[u.a];y=wa[u.b];z=wa[u.c];da[Y]=w.r;da[Y+1]=w.g;da[Y+2]=w.b;da[Y+3]=y.r;da[Y+4]=y.g;da[Y+5]=y.b;da[Y+6]=z.r;da[Y+7]=z.g;da[Y+8]=z.b;Y+=9}if(Ua&&ha.hasTangents){w=oa[u.a].tangent;y=oa[u.b].tangent;z=oa[u.c].tangent;R[G]=w.x;R[G+1]=w.y;R[G+2]=w.z;R[G+3]=w.w;R[G+4]=y.x;R[G+5]=y.y;R[G+6]=y.z;R[G+7]=y.w;R[G+8]=z.x;R[G+9]=z.y;R[G+10]=z.z;R[G+11]=z.w;G+=
- 12}if(Ta)if(la.length==3&&bb)for(u=0;u<3;u++){fa=la[u];qa[Q]=fa.x;qa[Q+1]=fa.y;qa[Q+2]=fa.z;Q+=3}else for(u=0;u<3;u++){qa[Q]=fa.x;qa[Q+1]=fa.y;qa[Q+2]=fa.z;Q+=3}if(Ia&&ka)for(u=0;u<3;u++){la=ka[u];Na[C]=la.u;Na[C+1]=la.v;C+=2}if(Ia&&na)for(u=0;u<3;u++){ka=na[u];Oa[K]=ka.u;Oa[K+1]=ka.v;K+=2}if(Sa){va[J]=p;va[J+1]=p+1;va[J+2]=p+2;J+=3;ma[P]=p;ma[P+1]=p+1;ma[P+2]=p;ma[P+3]=p+2;ma[P+4]=p+1;ma[P+5]=p+2;P+=6;p+=3}}else if(u instanceof THREE.Face4){if(Ra){w=oa[u.a].position;y=oa[u.b].position;z=oa[u.c].position;
- O=oa[u.d].position;ca[F]=w.x;ca[F+1]=w.y;ca[F+2]=w.z;ca[F+3]=y.x;ca[F+4]=y.y;ca[F+5]=y.z;ca[F+6]=z.x;ca[F+7]=z.y;ca[F+8]=z.z;ca[F+9]=O.x;ca[F+10]=O.y;ca[F+11]=O.z;F+=12}if(Wa){ga=0;for(Ha=xa.length;ga<Ha;ga++){w=xa[ga].vertices[u.a].position;y=xa[ga].vertices[u.b].position;z=xa[ga].vertices[u.c].position;O=xa[ga].vertices[u.d].position;X=Qa[ga];X[Z+0]=w.x;X[Z+1]=w.y;X[Z+2]=w.z;X[Z+3]=y.x;X[Z+4]=y.y;X[Z+5]=y.z;X[Z+6]=z.x;X[Z+7]=z.y;X[Z+8]=z.z;X[Z+9]=O.x;X[Z+10]=O.y;X[Z+11]=O.z}Z+=12}if(za.length){w=
- za[u.a];y=za[u.b];z=za[u.c];O=za[u.d];V[t]=w.x;V[t+1]=w.y;V[t+2]=w.z;V[t+3]=w.w;V[t+4]=y.x;V[t+5]=y.y;V[t+6]=y.z;V[t+7]=y.w;V[t+8]=z.x;V[t+9]=z.y;V[t+10]=z.z;V[t+11]=z.w;V[t+12]=O.x;V[t+13]=O.y;V[t+14]=O.z;V[t+15]=O.w;w=Da[u.a];y=Da[u.b];z=Da[u.c];O=Da[u.d];U[t]=w.x;U[t+1]=w.y;U[t+2]=w.z;U[t+3]=w.w;U[t+4]=y.x;U[t+5]=y.y;U[t+6]=y.z;U[t+7]=y.w;U[t+8]=z.x;U[t+9]=z.y;U[t+10]=z.z;U[t+11]=z.w;U[t+12]=O.x;U[t+13]=O.y;U[t+14]=O.z;U[t+15]=O.w;w=Ba[u.a];y=Ba[u.b];z=Ba[u.c];O=Ba[u.d];S[t]=w.x;S[t+1]=w.y;S[t+
- 2]=w.z;S[t+3]=1;S[t+4]=y.x;S[t+5]=y.y;S[t+6]=y.z;S[t+7]=1;S[t+8]=z.x;S[t+9]=z.y;S[t+10]=z.z;S[t+11]=1;S[t+12]=O.x;S[t+13]=O.y;S[t+14]=O.z;S[t+15]=1;w=Ca[u.a];y=Ca[u.b];z=Ca[u.c];O=Ca[u.d];T[t]=w.x;T[t+1]=w.y;T[t+2]=w.z;T[t+3]=1;T[t+4]=y.x;T[t+5]=y.y;T[t+6]=y.z;T[t+7]=1;T[t+8]=z.x;T[t+9]=z.y;T[t+10]=z.z;T[t+11]=1;T[t+12]=O.x;T[t+13]=O.y;T[t+14]=O.z;T[t+15]=1;t+=16}if(Va&&wa.length){w=wa[u.a];y=wa[u.b];z=wa[u.c];O=wa[u.d];da[Y]=w.r;da[Y+1]=w.g;da[Y+2]=w.b;da[Y+3]=y.r;da[Y+4]=y.g;da[Y+5]=y.b;da[Y+6]=
- z.r;da[Y+7]=z.g;da[Y+8]=z.b;da[Y+9]=O.r;da[Y+10]=O.g;da[Y+11]=O.b;Y+=12}if(Ua&&ha.hasTangents){w=oa[u.a].tangent;y=oa[u.b].tangent;z=oa[u.c].tangent;u=oa[u.d].tangent;R[G]=w.x;R[G+1]=w.y;R[G+2]=w.z;R[G+3]=w.w;R[G+4]=y.x;R[G+5]=y.y;R[G+6]=y.z;R[G+7]=y.w;R[G+8]=z.x;R[G+9]=z.y;R[G+10]=z.z;R[G+11]=z.w;R[G+12]=u.x;R[G+13]=u.y;R[G+14]=u.z;R[G+15]=u.w;G+=16}if(Ta)if(la.length==4&&bb)for(u=0;u<4;u++){fa=la[u];qa[Q]=fa.x;qa[Q+1]=fa.y;qa[Q+2]=fa.z;Q+=3}else for(u=0;u<4;u++){qa[Q]=fa.x;qa[Q+1]=fa.y;qa[Q+2]=
- fa.z;Q+=3}if(Ia&&ka)for(u=0;u<4;u++){la=ka[u];Na[C]=la.u;Na[C+1]=la.v;C+=2}if(Ia&&na)for(u=0;u<4;u++){ka=na[u];Oa[K]=ka.u;Oa[K+1]=ka.v;K+=2}if(Sa){va[J]=p;va[J+1]=p+1;va[J+2]=p+2;va[J+3]=p;va[J+4]=p+2;va[J+5]=p+3;J+=6;ma[P]=p;ma[P+1]=p+1;ma[P+2]=p;ma[P+3]=p+3;ma[P+4]=p+1;ma[P+5]=p+2;ma[P+6]=p+2;ma[P+7]=p+3;P+=8;p+=4}}}if(Ra){c.bindBuffer(c.ARRAY_BUFFER,n.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,ca,q)}if(Wa){ga=0;for(Ha=xa.length;ga<Ha;ga++){c.bindBuffer(c.ARRAY_BUFFER,n.__webGLMorphTargetsBuffers[ga]);
- c.bufferData(c.ARRAY_BUFFER,Qa[ga],q)}}if(Va&&wa.length){c.bindBuffer(c.ARRAY_BUFFER,n.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,da,q)}if(Ta){c.bindBuffer(c.ARRAY_BUFFER,n.__webGLNormalBuffer);c.bufferData(c.ARRAY_BUFFER,qa,q)}if(Ua&&ha.hasTangents){c.bindBuffer(c.ARRAY_BUFFER,n.__webGLTangentBuffer);c.bufferData(c.ARRAY_BUFFER,R,q)}if(Ia&&C>0){c.bindBuffer(c.ARRAY_BUFFER,n.__webGLUVBuffer);c.bufferData(c.ARRAY_BUFFER,Na,q)}if(Ia&&K>0){c.bindBuffer(c.ARRAY_BUFFER,n.__webGLUV2Buffer);c.bufferData(c.ARRAY_BUFFER,
- Oa,q)}if(Sa){c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,n.__webGLFaceBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,va,q);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,n.__webGLLineBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,ma,q)}if(t>0){c.bindBuffer(c.ARRAY_BUFFER,n.__webGLSkinVertexABuffer);c.bufferData(c.ARRAY_BUFFER,S,q);c.bindBuffer(c.ARRAY_BUFFER,n.__webGLSkinVertexBBuffer);c.bufferData(c.ARRAY_BUFFER,T,q);c.bindBuffer(c.ARRAY_BUFFER,n.__webGLSkinIndicesBuffer);c.bufferData(c.ARRAY_BUFFER,U,q);c.bindBuffer(c.ARRAY_BUFFER,
- n.__webGLSkinWeightsBuffer);c.bufferData(c.ARRAY_BUFFER,V,q)}}}i.__dirtyVertices=!1;i.__dirtyMorphTargets=!1;i.__dirtyElements=!1;i.__dirtyUvs=!1;i.__dirtyNormals=!1;i.__dirtyTangents=!1;i.__dirtyColors=!1}else if(h instanceof THREE.Ribbon){i=h.geometry;if(i.__dirtyVertices||i.__dirtyColors){h=i;r=c.DYNAMIC_DRAW;p=void 0;p=void 0;F=void 0;n=void 0;C=h.vertices;q=h.colors;K=C.length;x=q.length;J=h.__vertexArray;N=h.__colorArray;Q=h.__dirtyColors;if(h.__dirtyVertices){for(p=0;p<K;p++){F=C[p].position;
- n=p*3;J[n]=F.x;J[n+1]=F.y;J[n+2]=F.z}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,J,r)}if(Q){for(p=0;p<x;p++){color=q[p];n=p*3;N[n]=color.r;N[n+1]=color.g;N[n+2]=color.b}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,N,r)}}i.__dirtyVertices=!1;i.__dirtyColors=!1}else if(h instanceof THREE.Line){i=h.geometry;if(i.__dirtyVertices||i.__dirtyColors){h=i;r=c.DYNAMIC_DRAW;p=void 0;p=void 0;F=void 0;n=void 0;C=h.vertices;q=h.colors;K=C.length;
- x=q.length;J=h.__vertexArray;N=h.__colorArray;Q=h.__dirtyColors;if(h.__dirtyVertices){for(p=0;p<K;p++){F=C[p].position;n=p*3;J[n]=F.x;J[n+1]=F.y;J[n+2]=F.z}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLVertexBuffer);c.bufferData(c.ARRAY_BUFFER,J,r)}if(Q){for(p=0;p<x;p++){color=q[p];n=p*3;N[n]=color.r;N[n+1]=color.g;N[n+2]=color.b}c.bindBuffer(c.ARRAY_BUFFER,h.__webGLColorBuffer);c.bufferData(c.ARRAY_BUFFER,N,r)}}i.__dirtyVertices=!1;i.__dirtyColors=!1}else if(h instanceof THREE.ParticleSystem){i=h.geometry;
- (i.__dirtyVertices||i.__dirtyColors||h.sortParticles)&&b(i,c.DYNAMIC_DRAW,h);i.__dirtyVertices=!1;i.__dirtyColors=!1}}};this.setFaceCulling=function(e,j){if(e){!j||j=="ccw"?c.frontFace(c.CCW):c.frontFace(c.CW);if(e=="back")c.cullFace(c.BACK);else e=="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}};
|