| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- // ThreeWebGL.js r47dev - http://github.com/mrdoob/three.js
- var THREE=THREE||{};if(!self.Int32Array)self.Int32Array=Array,self.Float32Array=Array;THREE.Color=function(a){a!==void 0&&this.setHex(a);return this};
- THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSV:function(a,b,c){var d,f,g;if(c===0)this.r=this.g=this.b=0;else switch(d=Math.floor(a*6),f=a*6-d,a=c*(1-b),g=c*(1-
- b*f),b=c*(1-b*(1-f)),d){case 1:this.r=g;this.g=c;this.b=a;break;case 2:this.r=a;this.g=c;this.b=b;break;case 3:this.r=a;this.g=g;this.b=c;break;case 4:this.r=b;this.g=a;this.b=c;break;case 5:this.r=c;this.g=a;this.b=g;break;case 6:case 0:this.r=c,this.g=b,this.b=a}return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},getHex:function(){return~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},getContextStyle:function(){return"rgb("+
- Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
- THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},
- divideScalar:function(a){a?(this.x/=a,this.y/=a):this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)},
- equals:function(a){return a.x===this.x&&a.y===this.y}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0};
- THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},
- addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},divideSelf:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},
- divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a):this.z=this.y=this.x=0;return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},
- cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.x=c*a.z-d*a.y;this.y=d*a.x-b*a.z;this.z=b*a.y-c*a.x;return this},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this,a).lengthSq()},setPositionFromMatrix:function(a){this.x=a.n14;this.y=a.n24;this.z=a.n34},setRotationFromMatrix:function(a){var b=Math.cos(this.y);
- this.y=Math.asin(a.n13);Math.abs(b)>1.0E-5?(this.x=Math.atan2(-a.n23/b,a.n33/b),this.z=Math.atan2(-a.n12/b,a.n11/b)):(this.x=0,this.z=Math.atan2(a.n21,a.n22))},isZero:function(){return this.lengthSq()<1.0E-4}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1};
- THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w!==void 0?a.w:1},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-
- b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):(this.z=this.y=this.x=0,this.w=1);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())},
- normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this}};
- THREE.Ray=function(a,b){function c(a,b,c){l.sub(c,a);G=l.dot(b);if(G<=0)return null;C=w.add(a,u.copy(b).multiplyScalar(G));return J=c.distanceTo(C)}function d(a,b,c,d){l.sub(d,b);w.sub(c,b);u.sub(a,b);qa=l.dot(l);T=l.dot(w);la=l.dot(u);ga=w.dot(w);K=w.dot(u);P=1/(qa*ga-T*T);N=(ga*la-T*K)*P;O=(qa*K-T*la)*P;return N>=0&&O>=0&&N+O<1}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;this.intersectScene=function(a){return this.intersectObjects(a.children)};this.intersectObjects=function(a){var b,
- c,d=[];b=0;for(c=a.length;b<c;b++)Array.prototype.push.apply(d,this.intersectObject(a[b]));d.sort(function(a,b){return a.distance-b.distance});return d};var f=new THREE.Vector3,g=new THREE.Vector3,h=new THREE.Vector3,i=new THREE.Vector3,a=new THREE.Vector3,b=new THREE.Vector3,p=new THREE.Vector3,n=new THREE.Vector3,k=new THREE.Vector3;this.intersectObject=function(u){for(var l,G=[],w=0,C=u.children.length;w<C;w++)Array.prototype.push.apply(G,this.intersectObject(u.children[w]));if(u instanceof THREE.Particle){w=
- c(this.origin,this.direction,u.matrixWorld.getPosition());if(w===null||w>u.scale.x)return[];l={distance:w,point:u.position,face:null,object:u};G.push(l)}else if(u instanceof THREE.Mesh){w=c(this.origin,this.direction,u.matrixWorld.getPosition());if(w===null||w>u.geometry.boundingSphere.radius*Math.max(u.scale.x,Math.max(u.scale.y,u.scale.z)))return G;var L,J=u.geometry,K=J.vertices,E;u.matrixRotationWorld.extractRotation(u.matrixWorld);w=0;for(C=J.faces.length;w<C;w++)if(l=J.faces[w],a.copy(this.origin),
- b.copy(this.direction),E=u.matrixWorld,p=E.multiplyVector3(p.copy(l.centroid)).subSelf(a),L=p.dot(b),!(L<=0)&&(f=E.multiplyVector3(f.copy(K[l.a].position)),g=E.multiplyVector3(g.copy(K[l.b].position)),h=E.multiplyVector3(h.copy(K[l.c].position)),l instanceof THREE.Face4&&(i=E.multiplyVector3(i.copy(K[l.d].position))),n=u.matrixRotationWorld.multiplyVector3(n.copy(l.normal)),L=b.dot(n),u.doubleSided||(u.flipSided?L>0:L<0)))if(L=n.dot(p.sub(f,a))/L,k.add(a,b.multiplyScalar(L)),l instanceof THREE.Face3)d(k,
- f,g,h)&&(l={distance:a.distanceTo(k),point:k.clone(),face:l,object:u},G.push(l));else if(l instanceof THREE.Face4&&(d(k,f,g,i)||d(k,g,h,i)))l={distance:a.distanceTo(k),point:k.clone(),face:l,object:u},G.push(l)}return G};var l=new THREE.Vector3,w=new THREE.Vector3,u=new THREE.Vector3,G,C,J,qa,T,la,ga,K,P,N,O};
- THREE.Rectangle=function(){function a(){g=d-b;h=f-c}var b,c,d,f,g,h,i=!0;this.getX=function(){return b};this.getY=function(){return c};this.getWidth=function(){return g};this.getHeight=function(){return h};this.getLeft=function(){return b};this.getTop=function(){return c};this.getRight=function(){return d};this.getBottom=function(){return f};this.set=function(g,h,k,l){i=!1;b=g;c=h;d=k;f=l;a()};this.addPoint=function(g,h){i?(i=!1,b=g,c=h,d=g,f=h):(b=b<g?b:g,c=c<h?c:h,d=d>g?d:g,f=f>h?f:h);a()};this.add3Points=
- function(g,h,k,l,w,u){i?(i=!1,b=g<k?g<w?g:w:k<w?k:w,c=h<l?h<u?h:u:l<u?l:u,d=g>k?g>w?g:w:k>w?k:w,f=h>l?h>u?h:u:l>u?l:u):(b=g<k?g<w?g<b?g:b:w<b?w:b:k<w?k<b?k:b:w<b?w:b,c=h<l?h<u?h<c?h:c:u<c?u:c:l<u?l<c?l:c:u<c?u:c,d=g>k?g>w?g>d?g:d:w>d?w:d:k>w?k>d?k:d:w>d?w:d,f=h>l?h>u?h>f?h:f:u>f?u:f:l>u?l>f?l:f:u>f?u:f);a()};this.addRectangle=function(g){i?(i=!1,b=g.getLeft(),c=g.getTop(),d=g.getRight(),f=g.getBottom()):(b=b<g.getLeft()?b:g.getLeft(),c=c<g.getTop()?c:g.getTop(),d=d>g.getRight()?d:g.getRight(),f=f>
- g.getBottom()?f:g.getBottom());a()};this.inflate=function(g){b-=g;c-=g;d+=g;f+=g;a()};this.minSelf=function(g){b=b>g.getLeft()?b:g.getLeft();c=c>g.getTop()?c:g.getTop();d=d<g.getRight()?d:g.getRight();f=f<g.getBottom()?f:g.getBottom();a()};this.intersects=function(a){return Math.min(d,a.getRight())-Math.max(b,a.getLeft())>=0&&Math.min(f,a.getBottom())-Math.max(c,a.getTop())>=0};this.empty=function(){i=!0;f=d=c=b=0;a()};this.isEmpty=function(){return i}};
- THREE.Math={clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,f){return d+(a-b)*(f-d)/(c-b)},random16:function(){return(65280*Math.random()+255*Math.random())/65535}};THREE.Matrix3=function(){this.m=[]};
- THREE.Matrix3.prototype={constructor:THREE.Matrix3,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,c,d,f,g,h,i,p,n,k,l,w,u,G,C){this.set(a!==void 0?a:1,b||0,c||0,d||0,f||0,g!==void 0?g:1,h||0,i||0,p||0,n||0,k!==void 0?k:1,l||0,w||0,u||0,G||0,C!==void 0?C:1);this.flat=Array(16);this.m33=new THREE.Matrix3};
- THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,f,g,h,i,p,n,k,l,w,u,G,C){this.n11=a;this.n12=b;this.n13=c;this.n14=d;this.n21=f;this.n22=g;this.n23=h;this.n24=i;this.n31=p;this.n32=n;this.n33=k;this.n34=l;this.n41=w;this.n42=u;this.n43=G;this.n44=C;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,c){var d=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;d.cross(c,g).normalize();d.length()===0&&(g.x+=1.0E-4,d.cross(c,g).normalize());f.cross(g,d).normalize();this.n11=d.x;this.n12=f.x;this.n13=g.x;this.n21=d.y;this.n22=f.y;this.n23=g.y;this.n31=d.z;this.n32=f.z;this.n33=g.z;return this},multiply:function(a,b){var c=a.n11,d=a.n12,f=a.n13,g=a.n14,h=a.n21,i=a.n22,p=a.n23,n=a.n24,k=a.n31,l=a.n32,w=a.n33,u=a.n34,G=a.n41,C=a.n42,J=a.n43,
- qa=a.n44,T=b.n11,la=b.n12,ga=b.n13,K=b.n14,P=b.n21,N=b.n22,O=b.n23,ja=b.n24,ua=b.n31,da=b.n32,ta=b.n33,ra=b.n34,L=b.n41,va=b.n42,wa=b.n43,E=b.n44;this.n11=c*T+d*P+f*ua+g*L;this.n12=c*la+d*N+f*da+g*va;this.n13=c*ga+d*O+f*ta+g*wa;this.n14=c*K+d*ja+f*ra+g*E;this.n21=h*T+i*P+p*ua+n*L;this.n22=h*la+i*N+p*da+n*va;this.n23=h*ga+i*O+p*ta+n*wa;this.n24=h*K+i*ja+p*ra+n*E;this.n31=k*T+l*P+w*ua+u*L;this.n32=k*la+l*N+w*da+u*va;this.n33=k*ga+l*O+w*ta+u*wa;this.n34=k*K+l*ja+w*ra+u*E;this.n41=G*T+C*P+J*ua+qa*L;this.n42=
- G*la+C*N+J*da+qa*va;this.n43=G*ga+C*O+J*ta+qa*wa;this.n44=G*K+C*ja+J*ra+qa*E;return this},multiplySelf:function(a){return this.multiply(this,a)},multiplyToArray:function(a,b,c){this.multiply(a,b);c[0]=this.n11;c[1]=this.n21;c[2]=this.n31;c[3]=this.n41;c[4]=this.n12;c[5]=this.n22;c[6]=this.n32;c[7]=this.n42;c[8]=this.n13;c[9]=this.n23;c[10]=this.n33;c[11]=this.n43;c[12]=this.n14;c[13]=this.n24;c[14]=this.n34;c[15]=this.n44;return this},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},multiplyVector3:function(a){var b=a.x,c=a.y,d=a.z,f=1/(this.n41*b+this.n42*c+this.n43*d+this.n44);a.x=(this.n11*b+this.n12*c+this.n13*d+this.n14)*f;a.y=(this.n21*b+this.n22*c+this.n23*d+this.n24)*f;a.z=(this.n31*b+this.n32*c+this.n33*d+this.n34)*f;return a},multiplyVector4:function(a){var b=a.x,c=a.y,d=a.z,f=a.w;a.x=this.n11*b+this.n12*
- c+this.n13*d+this.n14*f;a.y=this.n21*b+this.n22*c+this.n23*d+this.n24*f;a.z=this.n31*b+this.n32*c+this.n33*d+this.n34*f;a.w=this.n41*b+this.n42*c+this.n43*d+this.n44*f;return a},rotateAxis:function(a){var b=a.x,c=a.y,d=a.z;a.x=b*this.n11+c*this.n12+d*this.n13;a.y=b*this.n21+c*this.n22+d*this.n23;a.z=b*this.n31+c*this.n32+d*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},determinant:function(){var a=this.n11,b=this.n12,c=this.n13,d=this.n14,f=this.n21,g=this.n22,h=this.n23,i=this.n24,p=this.n31,n=this.n32,k=this.n33,l=this.n34,w=this.n41,u=this.n42,G=this.n43,C=this.n44;return d*h*n*w-c*i*n*w-d*g*k*w+b*i*k*w+c*g*l*w-b*h*l*w-d*h*p*u+c*i*p*u+d*f*k*u-a*i*k*u-c*f*l*u+a*h*l*u+d*g*p*G-b*i*p*G-d*f*n*G+a*i*n*G+b*f*l*G-a*g*l*G-c*
- g*p*C+b*h*p*C+c*f*n*C-a*h*n*C-b*f*k*C+a*g*k*C},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.n34=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,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},setScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,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 c=Math.cos(b),d=Math.sin(b),f=1-c,g=a.x,h=a.y,i=a.z,p=f*g,n=f*h;this.set(p*g+c,p*h-d*i,p*i+d*h,0,p*h+d*i,n*h+c,n*i-d*g,0,p*i-d*h,n*i+d*g,f*i*i+c,0,0,0,0,1);return this},setPosition:function(a){this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},getPosition:function(){return THREE.Matrix4.__v1.set(this.n14,this.n24,this.n34)},getColumnX:function(){return THREE.Matrix4.__v1.set(this.n11,this.n21,
- this.n31)},getColumnY:function(){return THREE.Matrix4.__v1.set(this.n12,this.n22,this.n32)},getColumnZ:function(){return THREE.Matrix4.__v1.set(this.n13,this.n23,this.n33)},getInverse:function(a){var b=a.n11,c=a.n12,d=a.n13,f=a.n14,g=a.n21,h=a.n22,i=a.n23,p=a.n24,n=a.n31,k=a.n32,l=a.n33,w=a.n34,u=a.n41,G=a.n42,C=a.n43,J=a.n44;this.n11=i*w*G-p*l*G+p*k*C-h*w*C-i*k*J+h*l*J;this.n12=f*l*G-d*w*G-f*k*C+c*w*C+d*k*J-c*l*J;this.n13=d*p*G-f*i*G+f*h*C-c*p*C-d*h*J+c*i*J;this.n14=f*i*k-d*p*k-f*h*l+c*p*l+d*h*w-
- c*i*w;this.n21=p*l*u-i*w*u-p*n*C+g*w*C+i*n*J-g*l*J;this.n22=d*w*u-f*l*u+f*n*C-b*w*C-d*n*J+b*l*J;this.n23=f*i*u-d*p*u-f*g*C+b*p*C+d*g*J-b*i*J;this.n24=d*p*n-f*i*n+f*g*l-b*p*l-d*g*w+b*i*w;this.n31=h*w*u-p*k*u+p*n*G-g*w*G-h*n*J+g*k*J;this.n32=f*k*u-c*w*u-f*n*G+b*w*G+c*n*J-b*k*J;this.n33=c*p*u-f*h*u+f*g*G-b*p*G-c*g*J+b*h*J;this.n34=f*h*n-c*p*n-f*g*k+b*p*k+c*g*w-b*h*w;this.n41=i*k*u-h*l*u-i*n*G+g*l*G+h*n*C-g*k*C;this.n42=c*l*u-d*k*u+d*n*G-b*l*G-c*n*C+b*k*C;this.n43=d*h*u-c*i*u-d*g*G+b*i*G+c*g*C-b*h*C;
- this.n44=c*i*n-d*h*n+d*g*k-b*i*k-c*g*l+b*h*l;this.multiplyScalar(1/a.determinant());return this},setRotationFromEuler:function(a,b){var c=a.x,d=a.y,f=a.z,g=Math.cos(c),c=Math.sin(c),h=Math.cos(d),d=Math.sin(d),i=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var p=h*i,n=h*f,k=d*i,l=d*f;this.n11=p+l*c;this.n12=k*c-n;this.n13=g*d;this.n21=g*f;this.n22=g*i;this.n23=-c;this.n31=n*c-k;this.n32=l+p*c;this.n33=g*h;break;case "ZXY":p=h*i;n=h*f;k=d*i;l=d*f;this.n11=p-l*c;this.n12=-g*f;this.n13=k+n*c;this.n21=
- n+k*c;this.n22=g*i;this.n23=l-p*c;this.n31=-g*d;this.n32=c;this.n33=g*h;break;case "ZYX":p=g*i;n=g*f;k=c*i;l=c*f;this.n11=h*i;this.n12=k*d-n;this.n13=p*d+l;this.n21=h*f;this.n22=l*d+p;this.n23=n*d-k;this.n31=-d;this.n32=c*h;this.n33=g*h;break;case "YZX":p=g*h;n=g*d;k=c*h;l=c*d;this.n11=h*i;this.n12=l-p*f;this.n13=k*f+n;this.n21=f;this.n22=g*i;this.n23=-c*i;this.n31=-d*i;this.n32=n*f+k;this.n33=p-l*f;break;case "XZY":p=g*h;n=g*d;k=c*h;l=c*d;this.n11=h*i;this.n12=-f;this.n13=d*i;this.n21=p*f+l;this.n22=
- g*i;this.n23=n*f-k;this.n31=k*f-n;this.n32=c*i;this.n33=l*f+p;break;default:p=g*i,n=g*f,k=c*i,l=c*f,this.n11=h*i,this.n12=-h*f,this.n13=d,this.n21=n+k*d,this.n22=p-l*d,this.n23=-c*h,this.n31=l-p*d,this.n32=k+n*d,this.n33=g*h}return this},setRotationFromQuaternion:function(a){var b=a.x,c=a.y,d=a.z,f=a.w,g=b+b,h=c+c,i=d+d,a=b*g,p=b*h;b*=i;var n=c*h;c*=i;d*=i;g*=f;h*=f;f*=i;this.n11=1-(n+d);this.n12=p-f;this.n13=b+h;this.n21=p+f;this.n22=1-(a+d);this.n23=c-g;this.n31=b-h;this.n32=c+g;this.n33=1-(a+n);
- return this},scale:function(a){var b=a.x,c=a.y,a=a.z;this.n11*=b;this.n12*=c;this.n13*=a;this.n21*=b;this.n22*=c;this.n23*=a;this.n31*=b;this.n32*=c;this.n33*=a;this.n41*=b;this.n42*=c;this.n43*=a;return this},compose:function(a,b,c){var d=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2;d.identity();d.setRotationFromQuaternion(b);f.setScale(c.x,c.y,c.z);this.multiply(d,f);this.n14=a.x;this.n24=a.y;this.n34=a.z;return this},decompose:function(a,b,c){var d=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;
- d.set(this.n11,this.n21,this.n31);f.set(this.n12,this.n22,this.n32);g.set(this.n13,this.n23,this.n33);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3;c.x=d.length();c.y=f.length();c.z=g.length();a.x=this.n14;a.y=this.n24;a.z=this.n34;d=THREE.Matrix4.__m1;d.copy(this);d.n11/=c.x;d.n21/=c.x;d.n31/=c.x;d.n12/=c.y;d.n22/=c.y;d.n32/=c.y;d.n13/=c.z;d.n23/=c.z;d.n33/=c.z;b.setFromRotationMatrix(d);return[a,
- b,c]},extractPosition:function(a){this.n14=a.n14;this.n24=a.n24;this.n34=a.n34;return this},extractRotation:function(a){var b=THREE.Matrix4.__v1,c=1/b.set(a.n11,a.n21,a.n31).length(),d=1/b.set(a.n12,a.n22,a.n32).length(),b=1/b.set(a.n13,a.n23,a.n33).length();this.n11=a.n11*c;this.n21=a.n21*c;this.n31=a.n31*c;this.n12=a.n12*d;this.n22=a.n22*d;this.n32=a.n32*d;this.n13=a.n13*b;this.n23=a.n23*b;this.n33=a.n33*b;return this}};
- THREE.Matrix4.makeInvert3x3=function(a){var b=a.m33,c=b.m,d=a.n33*a.n22-a.n32*a.n23,f=-a.n33*a.n21+a.n31*a.n23,g=a.n32*a.n21-a.n31*a.n22,h=-a.n33*a.n12+a.n32*a.n13,i=a.n33*a.n11-a.n31*a.n13,p=-a.n32*a.n11+a.n31*a.n12,n=a.n23*a.n12-a.n22*a.n13,k=-a.n23*a.n11+a.n21*a.n13,l=a.n22*a.n11-a.n21*a.n12,a=a.n11*d+a.n21*h+a.n31*n;a===0&&console.error("THREE.Matrix4.makeInvert3x3: Matrix not invertible.");a=1/a;c[0]=a*d;c[1]=a*f;c[2]=a*g;c[3]=a*h;c[4]=a*i;c[5]=a*p;c[6]=a*n;c[7]=a*k;c[8]=a*l;return b};
- THREE.Matrix4.makeFrustum=function(a,b,c,d,f,g){var h;h=new THREE.Matrix4;h.n11=2*f/(b-a);h.n12=0;h.n13=(b+a)/(b-a);h.n14=0;h.n21=0;h.n22=2*f/(d-c);h.n23=(d+c)/(d-c);h.n24=0;h.n31=0;h.n32=0;h.n33=-(g+f)/(g-f);h.n34=-2*g*f/(g-f);h.n41=0;h.n42=0;h.n43=-1;h.n44=0;return h};THREE.Matrix4.makePerspective=function(a,b,c,d){var f,a=c*Math.tan(a*Math.PI/360);f=-a;return THREE.Matrix4.makeFrustum(f*b,a*b,f,a,c,d)};
- THREE.Matrix4.makeOrtho=function(a,b,c,d,f,g){var h,i,p,n;h=new THREE.Matrix4;i=b-a;p=c-d;n=g-f;h.n11=2/i;h.n12=0;h.n13=0;h.n14=-((b+a)/i);h.n21=0;h.n22=2/p;h.n23=0;h.n24=-((c+d)/p);h.n31=0;h.n32=0;h.n33=-2/n;h.n34=-((g+f)/n);h.n41=0;h.n42=0;h.n43=0;h.n44=1;return h};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4;THREE.Matrix4.__m2=new THREE.Matrix4;
- THREE.Object3D=function(){this.name="";this.id=THREE.Object3DCount++;this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=this.dynamic=!1;this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=
- !0;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.boundRadius=0;this.boundRadiusScale=1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this._vector=new THREE.Vector3};
- THREE.Object3D.prototype={constructor:THREE.Object3D,translate:function(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(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)},add:function(a){if(this.children.indexOf(a)===
- -1){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.addObject(a)}},remove:function(a){var b=this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.removeObject(a)}},getChildByName:function(a,b){var c,d,f;c=0;for(d=this.children.length;c<d;c++){f=this.children[c];if(f.name===a)return f;
- if(b&&(f=f.getChildByName(a,b),f!==void 0))return f}},updateMatrix:function(){this.matrix.setPosition(this.position);this.useQuaternion?this.matrix.setRotationFromQuaternion(this.quaternion):this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z));this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){this.matrixAutoUpdate&&
- this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)}};THREE.Object3DCount=0;
- THREE.Projector=function(){function a(){var a=h[g]=h[g]||new THREE.RenderableObject;g++;return a}function b(){var a=n[p]=n[p]||new THREE.RenderableVertex;p++;return a}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,g=a.z+a.w,e=b.z+b.w,f=-a.z+a.w,h=-b.z+b.w;return g>=0&&e>=0&&f>=0&&h>=0?!0:g<0&&e<0||f<0&&h<0?!1:(g<0?c=Math.max(c,g/(g-e)):e<0&&(d=Math.min(d,g/(g-e))),f<0?c=Math.max(c,f/(f-h)):h<0&&(d=Math.min(d,f/(f-h))),d<c?!1:(a.lerpSelf(b,c),b.lerpSelf(a,1-d),!0))}var f,g,h=[],i,p,n=[],
- k,l,w=[],u,G=[],C,J,qa=[],T,la,ga=[],K={objects:[],sprites:[],lights:[],elements:[]},P=new THREE.Vector3,N=new THREE.Vector4,O=new THREE.Matrix4,ja=new THREE.Matrix4,ua=new THREE.Frustum,da=new THREE.Vector4,ta=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);O.multiply(b.projectionMatrix,b.matrixWorldInverse);O.multiplyVector3(a);return a};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);O.multiply(b.matrixWorld,
- b.projectionMatrixInverse);O.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Ray(a,c)};this.projectGraph=function(b,d){g=0;K.objects.length=0;K.sprites.length=0;K.lights.length=0;var h=function(b){if(b.visible!==!1){(b instanceof THREE.Mesh||b instanceof THREE.Line)&&(b.frustumCulled===!1||ua.contains(b))?(O.multiplyVector3(P.copy(b.position)),f=a(),
- f.object=b,f.z=P.z,K.objects.push(f)):b instanceof THREE.Sprite||b instanceof THREE.Particle?(O.multiplyVector3(P.copy(b.position)),f=a(),f.object=b,f.z=P.z,K.sprites.push(f)):b instanceof THREE.Light&&K.lights.push(b);for(var c=0,e=b.children.length;c<e;c++)h(b.children[c])}};h(b);d&&K.objects.sort(c);return K};this.projectScene=function(a,g,f){var h=g.near,E=g.far,e,P,R,na,D,S,pa,xa,Z,oa,sa,za,Ea,Ba,Ca,ya;la=J=u=l=0;K.elements.length=0;g.parent===void 0&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),
- a.add(g));a.updateMatrixWorld();g.matrixWorldInverse.getInverse(g.matrixWorld);O.multiply(g.projectionMatrix,g.matrixWorldInverse);ua.setFromMatrix(O);K=this.projectGraph(a,!1);a=0;for(e=K.objects.length;a<e;a++)if(Z=K.objects[a].object,oa=Z.matrixWorld,za=Z.material,p=0,Z instanceof THREE.Mesh){sa=Z.geometry;Ea=Z.geometry.materials;na=sa.vertices;Ba=sa.faces;Ca=sa.faceVertexUvs;sa=Z.matrixRotationWorld.extractRotation(oa);P=0;for(R=na.length;P<R;P++)i=b(),i.positionWorld.copy(na[P].position),oa.multiplyVector3(i.positionWorld),
- i.positionScreen.copy(i.positionWorld),O.multiplyVector4(i.positionScreen),i.positionScreen.x/=i.positionScreen.w,i.positionScreen.y/=i.positionScreen.w,i.visible=i.positionScreen.z>h&&i.positionScreen.z<E;na=0;for(P=Ba.length;na<P;na++){R=Ba[na];if(R instanceof THREE.Face3)if(D=n[R.a],S=n[R.b],pa=n[R.c],D.visible&&S.visible&&pa.visible&&(Z.doubleSided||Z.flipSided!=(pa.positionScreen.x-D.positionScreen.x)*(S.positionScreen.y-D.positionScreen.y)-(pa.positionScreen.y-D.positionScreen.y)*(S.positionScreen.x-
- D.positionScreen.x)<0))xa=w[l]=w[l]||new THREE.RenderableFace3,l++,k=xa,k.v1.copy(D),k.v2.copy(S),k.v3.copy(pa);else continue;else if(R instanceof THREE.Face4)if(D=n[R.a],S=n[R.b],pa=n[R.c],xa=n[R.d],D.visible&&S.visible&&pa.visible&&xa.visible&&(Z.doubleSided||Z.flipSided!=((xa.positionScreen.x-D.positionScreen.x)*(S.positionScreen.y-D.positionScreen.y)-(xa.positionScreen.y-D.positionScreen.y)*(S.positionScreen.x-D.positionScreen.x)<0||(S.positionScreen.x-pa.positionScreen.x)*(xa.positionScreen.y-
- pa.positionScreen.y)-(S.positionScreen.y-pa.positionScreen.y)*(xa.positionScreen.x-pa.positionScreen.x)<0)))ya=G[u]=G[u]||new THREE.RenderableFace4,u++,k=ya,k.v1.copy(D),k.v2.copy(S),k.v3.copy(pa),k.v4.copy(xa);else continue;k.normalWorld.copy(R.normal);sa.multiplyVector3(k.normalWorld);k.centroidWorld.copy(R.centroid);oa.multiplyVector3(k.centroidWorld);k.centroidScreen.copy(k.centroidWorld);O.multiplyVector3(k.centroidScreen);pa=R.vertexNormals;D=0;for(S=pa.length;D<S;D++)xa=k.vertexNormalsWorld[D],
- xa.copy(pa[D]),sa.multiplyVector3(xa);D=0;for(S=Ca.length;D<S;D++)if(ya=Ca[D][na]){pa=0;for(xa=ya.length;pa<xa;pa++)k.uvs[D][pa]=ya[pa]}k.material=za;k.faceMaterial=R.materialIndex!==null?Ea[R.materialIndex]:null;k.z=k.centroidScreen.z;K.elements.push(k)}}else if(Z instanceof THREE.Line){ja.multiply(O,oa);na=Z.geometry.vertices;D=b();D.positionScreen.copy(na[0].position);ja.multiplyVector4(D.positionScreen);P=1;for(R=na.length;P<R;P++)if(D=b(),D.positionScreen.copy(na[P].position),ja.multiplyVector4(D.positionScreen),
- S=n[p-2],da.copy(D.positionScreen),ta.copy(S.positionScreen),d(da,ta))da.multiplyScalar(1/da.w),ta.multiplyScalar(1/ta.w),Z=qa[J]=qa[J]||new THREE.RenderableLine,J++,C=Z,C.v1.positionScreen.copy(da),C.v2.positionScreen.copy(ta),C.z=Math.max(da.z,ta.z),C.material=za,K.elements.push(C)}a=0;for(e=K.sprites.length;a<e;a++)if(Z=K.sprites[a].object,oa=Z.matrixWorld,Z instanceof THREE.Particle&&(N.set(oa.n14,oa.n24,oa.n34,1),O.multiplyVector4(N),N.z/=N.w,N.z>0&&N.z<1))h=ga[la]=ga[la]||new THREE.RenderableParticle,
- la++,T=h,T.x=N.x/N.w,T.y=N.y/N.w,T.z=N.z,T.rotation=Z.rotation.z,T.scale.x=Z.scale.x*Math.abs(T.x-(N.x+g.projectionMatrix.n11)/(N.w+g.projectionMatrix.n14)),T.scale.y=Z.scale.y*Math.abs(T.y-(N.y+g.projectionMatrix.n22)/(N.w+g.projectionMatrix.n24)),T.material=Z.material,K.elements.push(T);f&&K.elements.sort(c);return K}};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==void 0?d:1)};
- THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,f=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-f),f=Math.sin(-f),g=Math.cos(c),c=Math.sin(c),h=a*b,i=d*f;this.w=h*g-i*c;this.x=h*c+i*g;this.y=d*b*g+a*f*c;this.z=a*f*g-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);
- this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.n11+a.n22+a.n33))/2;this.x=Math.sqrt(Math.max(0,b+a.n11-a.n22-a.n33))/2;this.y=Math.sqrt(Math.max(0,b-a.n11+a.n22-a.n33))/2;this.z=Math.sqrt(Math.max(0,b-a.n11-a.n22+a.n33))/2;this.x=a.n32-a.n23<0?-Math.abs(this.x):Math.abs(this.x);this.y=a.n13-a.n31<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.n21-a.n12<0?-Math.abs(this.z):Math.abs(this.z);
- this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);a===0?this.w=this.z=this.y=this.x=0:(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiplySelf:function(a){var b=
- this.x,c=this.y,d=this.z,f=this.w,g=a.x,h=a.y,i=a.z,a=a.w;this.x=b*a+f*g+c*i-d*h;this.y=c*a+f*h+d*g-b*i;this.z=d*a+f*i+b*h-c*g;this.w=f*a-b*g-c*h-d*i;return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,f=a.z,g=this.x,h=this.y,i=this.z,p=this.w,n=p*c+h*f-i*d,k=p*d+i*c-g*f,l=p*f+g*d-h*c,c=-g*
- c-h*d-i*f;b.x=n*p+c*-g+k*-i-l*-h;b.y=k*p+c*-h+l*-g-n*-i;b.z=l*p+c*-i+n*-h-k*-g;return b}};
- THREE.Quaternion.slerp=function(a,b,c,d){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;f<0?(c.w=-b.w,c.x=-b.x,c.y=-b.y,c.z=-b.z,f=-f):c.copy(b);if(Math.abs(f)>=1)return c.w=a.w,c.x=a.x,c.y=a.y,c.z=a.z,c;var g=Math.acos(f),f=Math.sqrt(1-f*f);if(Math.abs(f)<0.0010)return c.w=0.5*(a.w+b.w),c.x=0.5*(a.x+b.x),c.y=0.5*(a.y+b.y),c.z=0.5*(a.z+b.z),c;b=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(a){this.position=a||new THREE.Vector3};
- THREE.Face3=function(a,b,c,d,f,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
- THREE.Face4=function(a,b,c,d,f,g,h){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materialIndex=h;this.centroid=new THREE.Vector3};THREE.UV=function(a,b){this.u=a||0;this.v=b||0};
- THREE.UV.prototype={constructor:THREE.UV,set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.u=a.u;this.v=a.v;return this},clone:function(){return new THREE.UV(this.u,this.v)}};
- THREE.Geometry=function(){this.id=THREE.GeometryCount++;this.vertices=[];this.colors=[];this.materials=[];this.faces=[];this.faceUvs=[[]];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.dynamic=this.hasTangents=!1};
- THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){var b=new THREE.Matrix4;b.extractRotation(a,new THREE.Vector3(1,1,1));for(var c=0,d=this.vertices.length;c<d;c++)a.multiplyVector3(this.vertices[c].position);c=0;for(d=this.faces.length;c<d;c++){var f=this.faces[c];b.multiplyVector3(f.normal);for(var g=0,h=f.vertexNormals.length;g<h;g++)b.multiplyVector3(f.vertexNormals[g]);a.multiplyVector3(f.centroid)}},computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;a<
- b;a++)c=this.faces[a],c.centroid.set(0,0,0),c instanceof THREE.Face3?(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.divideScalar(3)):c instanceof THREE.Face4&&(c.centroid.addSelf(this.vertices[c.a].position),c.centroid.addSelf(this.vertices[c.b].position),c.centroid.addSelf(this.vertices[c.c].position),c.centroid.addSelf(this.vertices[c.d].position),c.centroid.divideScalar(4))},computeFaceNormals:function(){var a,
- b,c,d,f,g,h=new THREE.Vector3,i=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],d=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.sub(g.position,f.position),i.sub(d.position,f.position),h.crossSelf(i),h.isZero()||h.normalize(),c.normal.copy(h)},computeVertexNormals:function(){var a,b,c,d;if(this.__tmpVertices===void 0){d=this.__tmpVertices=Array(this.vertices.length);a=0;for(b=this.vertices.length;a<b;a++)d[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)if(c=
- this.faces[a],c instanceof THREE.Face3)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];else if(c instanceof THREE.Face4)c.vertexNormals=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3]}else{d=this.__tmpVertices;a=0;for(b=this.vertices.length;a<b;a++)d[a].set(0,0,0)}a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(d[c.a].addSelf(c.normal),d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal)):c instanceof THREE.Face4&&(d[c.a].addSelf(c.normal),
- d[c.b].addSelf(c.normal),d[c.c].addSelf(c.normal),d[c.d].addSelf(c.normal));a=0;for(b=this.vertices.length;a<b;a++)d[a].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c instanceof THREE.Face3?(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c])):c instanceof THREE.Face4&&(c.vertexNormals[0].copy(d[c.a]),c.vertexNormals[1].copy(d[c.b]),c.vertexNormals[2].copy(d[c.c]),c.vertexNormals[3].copy(d[c.d]))},computeTangents:function(){function a(a,
- b,c,d,g,f,O){i=a.vertices[b].position;p=a.vertices[c].position;n=a.vertices[d].position;k=h[g];l=h[f];w=h[O];u=p.x-i.x;G=n.x-i.x;C=p.y-i.y;J=n.y-i.y;qa=p.z-i.z;T=n.z-i.z;la=l.u-k.u;ga=w.u-k.u;K=l.v-k.v;P=w.v-k.v;N=1/(la*P-ga*K);da.set((P*u-K*G)*N,(P*C-K*J)*N,(P*qa-K*T)*N);ta.set((la*G-ga*u)*N,(la*J-ga*C)*N,(la*T-ga*qa)*N);ja[b].addSelf(da);ja[c].addSelf(da);ja[d].addSelf(da);ua[b].addSelf(ta);ua[c].addSelf(ta);ua[d].addSelf(ta)}var b,c,d,f,g,h,i,p,n,k,l,w,u,G,C,J,qa,T,la,ga,K,P,N,O,ja=[],ua=[],da=
- new THREE.Vector3,ta=new THREE.Vector3,ra=new THREE.Vector3,L=new THREE.Vector3,va=new THREE.Vector3;b=0;for(c=this.vertices.length;b<c;b++)ja[b]=new THREE.Vector3,ua[b]=new THREE.Vector3;b=0;for(c=this.faces.length;b<c;b++)g=this.faces[b],h=this.faceVertexUvs[0][b],g instanceof THREE.Face3?a(this,g.a,g.b,g.c,0,1,2):g instanceof THREE.Face4&&(a(this,g.a,g.b,g.c,0,1,2),a(this,g.a,g.b,g.d,0,1,3));var wa=["a","b","c","d"];b=0;for(c=this.faces.length;b<c;b++){g=this.faces[b];for(d=0;d<g.vertexNormals.length;d++)va.copy(g.vertexNormals[d]),
- f=g[wa[d]],O=ja[f],ra.copy(O),ra.subSelf(va.multiplyScalar(va.dot(O))).normalize(),L.cross(g.vertexNormals[d],O),f=L.dot(ua[f]),f=f<0?-1:1,g.vertexTangents[d]=new THREE.Vector4(ra.x,ra.y,ra.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,c=this.vertices.length;b<
- c;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=
- 0,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},mergeVertices:function(){var a={},b=[],c=[],d,f=Math.pow(10,4),g,h;g=0;for(h=this.vertices.length;g<h;g++)d=this.vertices[g].position,d=[Math.round(d.x*f),Math.round(d.y*f),Math.round(d.z*f)].join("_"),a[d]===void 0?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];g=0;for(h=this.faces.length;g<h;g++)if(a=this.faces[g],a instanceof THREE.Face3)a.a=c[a.a],a.b=c[a.b],a.c=
- c[a.c];else if(a instanceof THREE.Face4)a.a=c[a.a],a.b=c[a.b],a.c=c[a.c],a.d=c[a.d];this.vertices=b}};THREE.GeometryCount=0;
- THREE.Spline=function(a){function b(a,b,c,d,g,f,h){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*h+(-3*(b-c)-2*a-d)*f+a*g+b}this.points=a;var c=[],d={x:0,y:0,z:0},f,g,h,i,p,n,k,l,w;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){f=(this.points.length-1)*a;g=Math.floor(f);h=f-g;c[0]=g===0?g:g-1;c[1]=g;c[2]=g>this.points.length-2?g:g+1;c[3]=g>this.points.length-3?g:g+2;n=this.points[c[0]];k=this.points[c[1]];
- l=this.points[c[2]];w=this.points[c[3]];i=h*h;p=h*i;d.x=b(n.x,k.x,l.x,w.x,h,i,p);d.y=b(n.y,k.y,l.y,w.y,h,i,p);d.z=b(n.z,k.z,l.z,w.z,h,i,p);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,g=b=b=0,f=new THREE.Vector3,h=new THREE.Vector3,i=[],k=0;i[0]=0;a||(a=100);c=this.points.length*a;f.copy(this.points[0]);for(a=1;a<c;a++)b=a/c,d=this.getPoint(b),h.copy(d),k+=h.distanceTo(f),
- f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=g&&(i[b]=k,g=b);i[i.length]=k;return{chunks:i,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,g,f,h,i=[],k=new THREE.Vector3,l=this.getLength();i.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=l.chunks[b]-l.chunks[b-1];h=Math.ceil(a*c/l.total);g=(b-1)/(this.points.length-1);f=b/(this.points.length-1);for(c=1;c<h-1;c++)d=g+c*(1/h)*(f-g),d=this.getPoint(d),i.push(k.copy(d).clone());i.push(k.copy(this.points[b]).clone())}this.points=
- i}};THREE.Edge=function(a,b,c,d){this.vertices=[a,b];this.vertexIndices=[c,d];this.faces=[];this.faceIndices=[]};THREE.Camera=function(){if(arguments.length)return console.warn("DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera()."),new THREE.PerspectiveCamera(arguments[0],arguments[1],arguments[2],arguments[3]);THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4;this.projectionMatrixInverse=new THREE.Matrix4};
- THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.lookAt=function(a){this.matrix.lookAt(this.position,a,this.up);this.rotationAutoUpdate&&this.rotation.setRotationFromMatrix(this.matrix)};THREE.OrthographicCamera=function(a,b,c,d,f,g){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=f!==void 0?f:0.1;this.far=g!==void 0?g:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=new THREE.Camera;
- THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera;THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makeOrtho(this.left,this.right,this.top,this.bottom,this.near,this.far)};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=a!==void 0?a:50;this.aspect=b!==void 0?b:1;this.near=c!==void 0?c:0.1;this.far=d!==void 0?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=new THREE.Camera;
- THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera;THREE.PerspectiveCamera.prototype.setLens=function(a,b){this.fov=2*Math.atan((b!==void 0?b:43.25)/(a*2));this.fov*=180/Math.PI;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,f,g){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=f;this.height=g;this.updateProjectionMatrix()};
- THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){if(this.fullWidth){var a=this.fullWidth/this.fullHeight,b=Math.tan(this.fov*Math.PI/360)*this.near,c=-b,d=a*c,a=Math.abs(a*b-d),c=Math.abs(b-c);this.projectionMatrix=THREE.Matrix4.makeFrustum(d+this.x*a/this.fullWidth,d+(this.x+this.width)*a/this.fullWidth,b-(this.y+this.height)*c/this.fullHeight,b-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix=THREE.Matrix4.makePerspective(this.fov,this.aspect,this.near,
- this.far)};THREE.Light=function(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,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,0,0);this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0};THREE.PointLight.prototype=new THREE.Light;
- THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.SpotLight=function(a,b,c,d){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.target=new THREE.Object3D;this.intensity=b!==void 0?b:1;this.distance=c!==void 0?c:0;this.castShadow=d!==void 0?d:!1};THREE.SpotLight.prototype=new THREE.Light;THREE.SpotLight.prototype.constructor=THREE.SpotLight;
- THREE.Material=function(a){this.name="";this.id=THREE.MaterialCount++;a=a||{};this.opacity=a.opacity!==void 0?a.opacity:1;this.transparent=a.transparent!==void 0?a.transparent:!1;this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.depthTest=a.depthTest!==void 0?a.depthTest:!0;this.depthWrite=a.depthWrite!==void 0?a.depthWrite:!0;this.polygonOffset=a.polygonOffset!==void 0?a.polygonOffset:!1;this.polygonOffsetFactor=a.polygonOffsetFactor!==void 0?a.polygonOffsetFactor:0;this.polygonOffsetUnits=
- a.polygonOffsetUnits!==void 0?a.polygonOffsetUnits:0;this.alphaTest=a.alphaTest!==void 0?a.alphaTest:0;this.overdraw=a.overdraw!==void 0?a.overdraw:!1};THREE.MaterialCount=0;THREE.NoShading=0;THREE.FlatShading=1;THREE.SmoothShading=2;THREE.NoColors=0;THREE.FaceColors=1;THREE.VertexColors=2;THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.MultiplyBlending=3;THREE.AdditiveAlphaBlending=4;
- THREE.LineBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.linewidth=a.linewidth!==void 0?a.linewidth:1;this.linecap=a.linecap!==void 0?a.linecap:"round";this.linejoin=a.linejoin!==void 0?a.linejoin:"round";this.vertexColors=a.vertexColors?a.vertexColors:!1;this.fog=a.fog!==void 0?a.fog:!0};THREE.LineBasicMaterial.prototype=new THREE.Material;THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;
- THREE.MeshBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.fog=a.fog!==void 0?a.fog:
- !0;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:
- !1};THREE.MeshBasicMaterial.prototype=new THREE.Material;THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;
- THREE.MeshLambertMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.ambient=a.ambient!==void 0?new THREE.Color(a.ambient):new THREE.Color(328965);this.map=a.map!==void 0?a.map:null;this.lightMap=a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=
- a.refractionRatio!==void 0?a.refractionRatio:0.98;this.fog=a.fog!==void 0?a.fog:!0;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=
- a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};THREE.MeshLambertMaterial.prototype=new THREE.Material;THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial;
- THREE.MeshPhongMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.ambient=a.ambient!==void 0?new THREE.Color(a.ambient):new THREE.Color(328965);this.specular=a.specular!==void 0?new THREE.Color(a.specular):new THREE.Color(1118481);this.shininess=a.shininess!==void 0?a.shininess:30;this.metal=a.metal!==void 0?a.metal:!1;this.perPixel=a.perPixel!==void 0?a.perPixel:!1;this.map=a.map!==void 0?a.map:null;this.lightMap=
- a.lightMap!==void 0?a.lightMap:null;this.envMap=a.envMap!==void 0?a.envMap:null;this.combine=a.combine!==void 0?a.combine:THREE.MultiplyOperation;this.reflectivity=a.reflectivity!==void 0?a.reflectivity:1;this.refractionRatio=a.refractionRatio!==void 0?a.refractionRatio:0.98;this.fog=a.fog!==void 0?a.fog:!0;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.wireframeLinecap=
- a.wireframeLinecap!==void 0?a.wireframeLinecap:"round";this.wireframeLinejoin=a.wireframeLinejoin!==void 0?a.wireframeLinejoin:"round";this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};THREE.MeshPhongMaterial.prototype=new THREE.Material;THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial;
- THREE.MeshDepthMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1};THREE.MeshDepthMaterial.prototype=new THREE.Material;THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;
- THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.shading=a.shading?a.shading:THREE.FlatShading;this.wireframe=a.wireframe?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth?a.wireframeLinewidth:1};THREE.MeshNormalMaterial.prototype=new THREE.Material;THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshFaceMaterial=function(){};
- THREE.MeshShaderMaterial=function(a){console.warn("DEPRECATED: MeshShaderMaterial() is now ShaderMaterial().");return new THREE.ShaderMaterial(a)};
- THREE.ParticleBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map!==void 0?a.map:null;this.size=a.size!==void 0?a.size:1;this.sizeAttenuation=a.sizeAttenuation!==void 0?a.sizeAttenuation:!0;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.fog=a.fog!==void 0?a.fog:!0};THREE.ParticleBasicMaterial.prototype=new THREE.Material;THREE.ParticleBasicMaterial.prototype.constructor=THREE.ParticleBasicMaterial;
- THREE.ShaderMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.fragmentShader=a.fragmentShader!==void 0?a.fragmentShader:"void main() {}";this.vertexShader=a.vertexShader!==void 0?a.vertexShader:"void main() {}";this.uniforms=a.uniforms!==void 0?a.uniforms:{};this.attributes=a.attributes;this.shading=a.shading!==void 0?a.shading:THREE.SmoothShading;this.wireframe=a.wireframe!==void 0?a.wireframe:!1;this.wireframeLinewidth=a.wireframeLinewidth!==void 0?a.wireframeLinewidth:1;this.fog=a.fog!==
- void 0?a.fog:!1;this.lights=a.lights!==void 0?a.lights:!1;this.vertexColors=a.vertexColors!==void 0?a.vertexColors:!1;this.skinning=a.skinning!==void 0?a.skinning:!1;this.morphTargets=a.morphTargets!==void 0?a.morphTargets:!1};THREE.ShaderMaterial.prototype=new THREE.Material;THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;
- THREE.Texture=function(a,b,c,d,f,g){this.id=THREE.TextureCount++;this.image=a;this.mapping=b!==void 0?b:new THREE.UVMapping;this.wrapS=c!==void 0?c:THREE.ClampToEdgeWrapping;this.wrapT=d!==void 0?d:THREE.ClampToEdgeWrapping;this.magFilter=f!==void 0?f:THREE.LinearFilter;this.minFilter=g!==void 0?g:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.needsUpdate=!1;this.onUpdate=null};
- THREE.Texture.prototype={constructor:THREE.Texture,clone:function(){var a=new THREE.Texture(this.image,this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a}};THREE.TextureCount=0;THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};
- THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2;THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;
- THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.DataTexture=function(a,b,c,d,f,g,h,i,p){THREE.Texture.call(this,null,f,g,h,i,p);this.image={data:a,width:b,height:c};this.format=d!==void 0?d:THREE.RGBAFormat};THREE.DataTexture.prototype=new THREE.Texture;THREE.DataTexture.prototype.constructor=THREE.DataTexture;
- THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture(this.data.slice(0),this.mapping,this.wrapS,this.wrapT,this.magFilter,this.minFilter);a.offset.copy(this.offset);a.repeat.copy(this.repeat);return a};THREE.Particle=function(a){THREE.Object3D.call(this);this.material=a};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.material=b;this.sortParticles=!1};
- THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.material=b;this.type=c!==void 0?c:THREE.LineStrip;this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere())};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.material=b;if(b instanceof Array)console.warn("DEPRECATED: Mesh material can no longer be an Array. Using material at index 0..."),this.material=b[0];if(this.geometry&&(this.geometry.boundingSphere||this.geometry.computeBoundingSphere(),this.boundRadius=a.boundingSphere.radius,this.geometry.morphTargets.length)){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};
- for(var c=0;c<this.geometry.morphTargets.length;c++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[c].name]=c}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype;
- THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(this.morphTargetDictionary[a]!==void 0)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};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){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 c,d=this.children.length;for(c=0;c<d;c++)this.children[c].update(this.skinMatrix,b)};
- THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,d,f,g,h,i;if(this.geometry.bones!==void 0){for(c=0;c<this.geometry.bones.length;c++)f=this.geometry.bones[c],g=f.pos,h=f.rotq,i=f.scl,d=this.addBone(),d.name=f.name,d.position.set(g[0],g[1],g[2]),d.quaternion.set(h[0],h[1],h[2],h[3]),d.useQuaternion=!0,i!==void 0?d.scale.set(i[0],i[1],i[2]):d.scale.set(1,1,1);for(c=0;c<this.bones.length;c++)f=this.geometry.bones[c],
- d=this.bones[c],f.parent===-1?this.add(d):this.bones[f.parent].add(d);this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;THREE.SkinnedMesh.prototype.addBone=function(a){a===void 0&&(a=new THREE.Bone(this));this.bones.push(a);return a};
- THREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1;for(var a=0,b=this.children.length;a<b;a++){var c=this.children[a];c instanceof THREE.Bone?c.update(this.identityMatrix,!1):c.updateMatrixWorld(!0)}for(var b=this.bones.length,c=this.bones,d=this.boneMatrices,a=0;a<b;a++)c[a].skinMatrix.flattenToArrayOffset(d,
- a*16)};
- THREE.SkinnedMesh.prototype.pose=function(){this.updateMatrixWorld(!0);for(var a,b=[],c=0;c<this.bones.length;c++){a=this.bones[c];var d=new THREE.Matrix4;d.getInverse(a.skinMatrix);b.push(d);a.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16)}if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];for(a=0;a<this.geometry.skinIndices.length;a++){var c=this.geometry.vertices[a].position,f=this.geometry.skinIndices[a].x,g=this.geometry.skinIndices[a].y,d=
- new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesA.push(b[f].multiplyVector3(d));d=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(b[g].multiplyVector3(d));this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1&&(c=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5,this.geometry.skinWeights[a].x+=c,this.geometry.skinWeights[a].y+=c)}}};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};
- THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
- THREE.LOD.prototype.update=function(a){if(this.LODs.length>1){a.matrixWorldInverse.getInverse(a.matrixWorld);a=a.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 b=1;b<this.LODs.length;b++)if(a>=this.LODs[b].visibleAtDistance)this.LODs[b-1].object3D.visible=!1,this.LODs[b].object3D.visible=!0;else break;for(;b<this.LODs.length;b++)this.LODs[b].object3D.visible=!1}};
- THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map instanceof THREE.Texture?a.map:THREE.ImageUtils.loadTexture(a.map);this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.useScreenCoordinates=a.useScreenCoordinates!==void 0?a.useScreenCoordinates:!0;this.mergeWith3D=a.mergeWith3D!==void 0?a.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=a.affectedByDistance!==void 0?a.affectedByDistance:
- !this.useScreenCoordinates;this.scaleByViewport=a.scaleByViewport!==void 0?a.scaleByViewport:!this.affectedByDistance;this.alignment=a.alignment instanceof THREE.Vector2?a.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;
- THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);
- THREE.SpriteAlignment.topRight=new THREE.Vector2(-1,-1);THREE.SpriteAlignment.centerLeft=new THREE.Vector2(1,0);THREE.SpriteAlignment.center=new THREE.Vector2(0,0);THREE.SpriteAlignment.centerRight=new THREE.Vector2(-1,0);THREE.SpriteAlignment.bottomLeft=new THREE.Vector2(1,1);THREE.SpriteAlignment.bottomCenter=new THREE.Vector2(0,1);THREE.SpriteAlignment.bottomRight=new THREE.Vector2(-1,1);
- THREE.Scene=function(){THREE.Object3D.call(this);this.overrideMaterial=this.fog=null;this.matrixAutoUpdate=!1;this.objects=[];this.lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;
- THREE.Scene.prototype.addObject=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.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);var b=this.__objectsRemoved.indexOf(a);b!==-1&&this.__objectsRemoved.splice(b,1)}for(b=0;b<a.children.length;b++)this.addObject(a.children[b])};
- THREE.Scene.prototype.removeObject=function(a){if(a instanceof THREE.Light){var b=this.lights.indexOf(a);b!==-1&&this.lights.splice(b,1)}else a instanceof THREE.Camera||(b=this.objects.indexOf(a),b!==-1&&(this.objects.splice(b,1),this.__objectsRemoved.push(a),b=this.__objectsAdded.indexOf(a),b!==-1&&this.__objectsAdded.splice(b,1)));for(b=0;b<a.children.length;b++)this.removeObject(a.children[b])};
- THREE.Fog=function(a,b,c){this.color=new THREE.Color(a);this.near=b!==void 0?b:1;this.far=c!==void 0?c:1E3};THREE.FogExp2=function(a,b){this.color=new THREE.Color(a);this.density=b!==void 0?b:2.5E-4};
- 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 float flipEnvMap;\nuniform int combine;\n#endif",
- envmap_fragment:"#ifdef USE_ENVMAP\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * vReflect.x, vReflect.yz ) );\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity );\n} else {\ngl_FragColor.xyz = gl_FragColor.xyz * cubeColor.xyz;\n}\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;\nif ( useRefract ) {\nvReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );\n} else {\nvReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );\n}\n#endif",
- map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\ngl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );\n#endif",map_pars_vertex:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform vec4 offsetRepeat;\n#endif",map_pars_fragment:"#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif",map_vertex:"#ifdef USE_MAP\nvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",map_fragment:"#ifdef USE_MAP\n#ifdef GAMMA_INPUT\nvec4 texelColor = texture2D( map, vUv );\ntexelColor.xyz *= texelColor.xyz;\ngl_FragColor = gl_FragColor * texelColor;\n#else\ngl_FragColor = gl_FragColor * texture2D( map, vUv );\n#endif\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_lambert_pars_vertex:"uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#endif",
- lights_lambert_vertex:"vLightWeighting = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nfloat directionalLightWeighting = max( dot( transformedNormal, normalize( lDirection.xyz ) ), 0.0 );\nvLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;\n}\n#endif\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nfloat pointLightWeighting = max( dot( transformedNormal, lVector ), 0.0 );\nvLightWeighting += pointLightColor[ i ] * pointLightWeighting * lDistance;\n}\n#endif\nvLightWeighting = vLightWeighting * diffuse + ambient * ambientLightColor;",
- lights_phong_pars_vertex:"#if MAX_POINT_LIGHTS > 0\n#ifndef PHONG_PER_PIXEL\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#endif",lights_phong_vertex:"#if MAX_POINT_LIGHTS > 0\n#ifndef PHONG_PER_PIXEL\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#endif",
- lights_phong_pars_fragment:"uniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n#ifdef PHONG_PER_PIXEL\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#else\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",
- lights_phong_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\n#if MAX_POINT_LIGHTS > 0\nvec3 pointDiffuse = vec3( 0.0 );\nvec3 pointSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n#ifdef PHONG_PER_PIXEL\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz + vViewPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\n#else\nvec3 lVector = normalize( vPointLight[ i ].xyz );\nfloat lDistance = vPointLight[ i ].w;\n#endif\nvec3 pointHalfVector = normalize( lVector + viewPosition );\nfloat pointDistance = lDistance;\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointDiffuseWeight = max( dot( normal, lVector ), 0.0 );\nfloat pointSpecularWeight = pow( pointDotNormalHalf, shininess );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( lVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance;\n#endif\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * pointDistance;\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec3 dirDiffuse = vec3( 0.0 );\nvec3 dirSpecular = vec3( 0.0 );\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nvec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\nfloat dirSpecularWeight = pow( dirDotNormalHalf, shininess );\n#ifdef PHYSICALLY_BASED_SHADING\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( dirVector, dirHalfVector ), 5.0 );\ndirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;\n#else\ndirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;\n#endif\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\n}\n#endif\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\ntotalDiffuse += dirDiffuse;\ntotalSpecular += dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalDiffuse += pointDiffuse;\ntotalSpecular += pointSpecular;\n#endif\n#ifdef METAL\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );\n#else\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n#endif",
- 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\n#ifdef GAMMA_INPUT\nvColor = color * color;\n#else\nvColor = color;\n#endif\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\nuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n#endif",skinning_vertex:"#ifdef USE_SKINNING\ngl_Position = ( boneGlobalMatrices[ int( skinIndex.x ) ] * skinVertexA ) * skinWeight.x;\ngl_Position += ( boneGlobalMatrices[ int( skinIndex.y ) ] * skinVertexB ) * skinWeight.y;\ngl_Position = projectionMatrix * viewMatrix * objectMatrix * gl_Position;\n#endif",
- morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\nuniform float morphTargetInfluences[ 8 ];\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\nvec3 morphed = vec3( 0.0, 0.0, 0.0 );\nmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\nmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\nmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\nmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\nmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\nmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\nmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\nmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\nmorphed += position;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( morphed, 1.0 );\n#endif",
- default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform float shadowDarkness;\nuniform float shadowBias;\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",
- shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_SOFT\nconst float xPixelOffset = 1.0 / SHADOWMAP_WIDTH;\nconst float yPixelOffset = 1.0 / SHADOWMAP_HEIGHT;\n#endif\nvec3 shadowColor = vec3( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nshadowCoord.z += shadowBias;\nif ( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) {\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nfor ( float y = -1.25; y <= 1.25; y += 1.25 )\nfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\nvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadow += 1.0;\n}\nshadow /= 9.0;\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness * shadow ) );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( shadowDarkness );\n#endif\n}\n}\n#ifdef GAMMA_OUTPUT\nshadowColor *= shadowColor;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n#endif",
- shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif",linear_to_gamma_fragment:"#ifdef GAMMA_OUTPUT\ngl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n#endif"};
- THREE.UniformsUtils={merge:function(a){var b,c,d,f={};for(b=0;b<a.length;b++)for(c in d=this.clone(a[b]),d)f[c]=d[c];return f},clone:function(a){var b,c,d,f={};for(b in a)for(c in f[b]={},a[b])d=a[b][c],f[b][c]=d instanceof THREE.Color||d instanceof THREE.Vector2||d instanceof THREE.Vector3||d instanceof THREE.Vector4||d instanceof THREE.Matrix4||d instanceof THREE.Texture?d.clone():d instanceof Array?d.slice():d;return f}};
- THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:0,texture:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:2,texture:null},envMap:{type:"t",value:1,texture:null},flipEnvMap:{type:"f",value:-1},useRefract:{type:"i",value:0},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:0.98},combine:{type:"i",value:0},morphTargetInfluences:{type:"f",value:0}},fog:{fogDensity:{type:"f",
- value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",
- value:1},map:{type:"t",value:0,texture:null},fogDensity:{type:"f",value:2.5E-4},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2E3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:6,texture:[]},shadowMatrix:{type:"m4v",value:[]},shadowBias:{type:"f",value:0.0039},shadowDarkness:{type:"f",value:0.2}}};
- THREE.ShaderLib={depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},vertexShader:"void main() {\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform float mNear;\nuniform float mFar;\nuniform float opacity;\nvoid main() {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat color = 1.0 - smoothstep( mNear, mFar, depth );\ngl_FragColor = vec4( vec3( color ), opacity );\n}"},normal:{uniforms:{opacity:{type:"f",
- value:1}},vertexShader:"varying vec3 vNormal;\nvoid main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvNormal = normalize( normalMatrix * normal );\ngl_Position = projectionMatrix * mvPosition;\n}",fragmentShader:"uniform float opacity;\nvarying vec3 vNormal;\nvoid main() {\ngl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n}"},basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.shadowmap]),vertexShader:[THREE.ShaderChunk.map_pars_vertex,
- THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,
- THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphatest_fragment,
- THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{ambient:{type:"c",value:new THREE.Color(328965)}}]),vertexShader:["varying vec3 vLightWeighting;",THREE.ShaderChunk.map_pars_vertex,
- THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_lambert_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,"vec3 transformedNormal = normalize( normalMatrix * normal );",
- THREE.ShaderChunk.lights_lambert_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vLightWeighting;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3 ( 1.0 ), opacity );",
- THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.alphatest_fragment,"gl_FragColor.xyz = gl_FragColor.xyz * vLightWeighting;",THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{ambient:{type:"c",
- value:new THREE.Color(328965)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30}}]),vertexShader:["varying vec3 vViewPosition;\nvarying vec3 vNormal;",THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_phong_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
- THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.color_vertex,"#ifndef USE_ENVMAP\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\n#endif\nvViewPosition = -mvPosition.xyz;\nvec3 transformedNormal = normalMatrix * normal;\nvNormal = transformedNormal;",THREE.ShaderChunk.lights_phong_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.shadowmap_vertex,
- "}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform vec3 ambient;\nuniform vec3 specular;\nuniform float shininess;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_phong_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3 ( 1.0 ), opacity );",THREE.ShaderChunk.map_fragment,
- THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.lights_phong_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.color_pars_vertex,
- THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n#else\ngl_PointSize = size;\n#endif\ngl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,
- THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,"void main() {\ngl_FragColor = vec4( psColor, opacity );",THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.morphtarget_vertex,
- THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};
- THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if(a.__webglCustomAttributesList===void 0)a.__webglCustomAttributesList=[];for(var g in d.attributes){var f=d.attributes[g];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var h=1;f.type==="v2"?h=2:f.type==="v3"?h=3:f.type==="v4"?h=4:f.type==="c"&&(h=3);f.size=h;f.array=new Float32Array(c*h);f.buffer=e.createBuffer();f.buffer.belongsToAttribute=g;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}}
- function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMaterial))return a.material;else if(b.materialIndex>=0)return a.geometry.materials[b.materialIndex]}function d(a){if(a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial)return!1;return a&&a.shading!==void 0&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function f(a){if(a.vertexColors)return a.vertexColors;return!1}function g(a){if(a.map||a.lightMap||a instanceof THREE.ShaderMaterial)return!0;
- return!1}function h(a,b,c){var d,g,f,h,o=a.vertices;h=o.length;var H=a.colors,i=H.length,s=a.__vertexArray,k=a.__colorArray,j=a.__sortArray,q=a.__dirtyVertices,l=a.__dirtyColors,p=a.__webglCustomAttributesList;if(c.sortParticles){Fa.multiplySelf(c.matrixWorld);for(d=0;d<h;d++)g=o[d].position,Da.copy(g),Fa.multiplyVector3(Da),j[d]=[Da.z,d];j.sort(function(a,b){return b[0]-a[0]});for(d=0;d<h;d++)g=o[j[d][1]].position,f=d*3,s[f]=g.x,s[f+1]=g.y,s[f+2]=g.z;for(d=0;d<i;d++)f=d*3,g=H[j[d][1]],k[f]=g.r,k[f+
- 1]=g.g,k[f+2]=g.b;if(p){H=0;for(i=p.length;H<i;H++)if(o=p[H],o.boundTo===void 0||o.boundTo==="vertices")if(f=0,g=o.value.length,o.size===1)for(d=0;d<g;d++)h=j[d][1],o.array[d]=o.value[h];else if(o.size===2)for(d=0;d<g;d++)h=j[d][1],h=o.value[h],o.array[f]=h.x,o.array[f+1]=h.y,f+=2;else if(o.size===3)if(o.type==="c")for(d=0;d<g;d++)h=j[d][1],h=o.value[h],o.array[f]=h.r,o.array[f+1]=h.g,o.array[f+2]=h.b,f+=3;else for(d=0;d<g;d++)h=j[d][1],h=o.value[h],o.array[f]=h.x,o.array[f+1]=h.y,o.array[f+2]=h.z,
- f+=3;else if(o.size===4)for(d=0;d<g;d++)h=j[d][1],h=o.value[h],o.array[f]=h.x,o.array[f+1]=h.y,o.array[f+2]=h.z,o.array[f+3]=h.w,f+=4}}else{if(q)for(d=0;d<h;d++)g=o[d].position,f=d*3,s[f]=g.x,s[f+1]=g.y,s[f+2]=g.z;if(l)for(d=0;d<i;d++)g=H[d],f=d*3,k[f]=g.r,k[f+1]=g.g,k[f+2]=g.b;if(p){H=0;for(i=p.length;H<i;H++)if(o=p[H],o.needsUpdate&&(o.boundTo===void 0||o.boundTo==="vertices"))if(g=o.value.length,f=0,o.size===1)for(d=0;d<g;d++)o.array[d]=o.value[d];else if(o.size===2)for(d=0;d<g;d++)h=o.value[d],
- o.array[f]=h.x,o.array[f+1]=h.y,f+=2;else if(o.size===3)if(o.type==="c")for(d=0;d<g;d++)h=o.value[d],o.array[f]=h.r,o.array[f+1]=h.g,o.array[f+2]=h.b,f+=3;else for(d=0;d<g;d++)h=o.value[d],o.array[f]=h.x,o.array[f+1]=h.y,o.array[f+2]=h.z,f+=3;else if(o.size===4)for(d=0;d<g;d++)h=o.value[d],o.array[f]=h.x,o.array[f+1]=h.y,o.array[f+2]=h.z,o.array[f+3]=h.w,f+=4}}if(q||c.sortParticles)e.bindBuffer(e.ARRAY_BUFFER,a.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,s,b);if(l||c.sortParticles)e.bindBuffer(e.ARRAY_BUFFER,
- a.__webglColorBuffer),e.bufferData(e.ARRAY_BUFFER,k,b);if(p){H=0;for(i=p.length;H<i;H++)if(o=p[H],o.needsUpdate||c.sortParticles)e.bindBuffer(e.ARRAY_BUFFER,o.buffer),e.bufferData(e.ARRAY_BUFFER,o.array,b)}}function i(a,b){return b.z-a.z}function p(a,b,c){if(a.length)for(var e=0,d=a.length;e<d;e++)R=null,D=S=za=sa=oa=-1,a[e].render(b,c,Ga,Ha),R=null,D=S=za=sa=oa=-1}function n(a,b,c,e,d,f,g,h){var i,k,s,l;b?(k=a.length-1,l=b=-1):(k=0,b=a.length,l=1);for(var j=k;j!==b;j+=l)if(i=a[j],i.render){k=i.object;
- s=i.buffer;if(h)i=h;else{i=i[c];if(!i)continue;g&&E.setBlending(i.blending);E.setDepthTest(i.depthTest);T(i.depthWrite);la(i.polygonOffset,i.polygonOffsetFactor,i.polygonOffsetUnits)}E.setObjectFaces(k);E.renderBuffer(e,d,f,i,s,k)}}function k(a,b,c,e,d,f,g){for(var h,i,k=0,s=a.length;k<s;k++)if(h=a[k],i=h.object,i.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&E.setBlending(h.blending);E.setDepthTest(h.depthTest);T(h.depthWrite);la(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}E.renderImmediateObject(c,
- e,d,h,i)}}function l(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}function w(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function u(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function G(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===b&&a.splice(c,1)}function C(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}function J(a,b,c,d,f){d.program||E.initMaterial(d,b,c,f);if(d.morphTargets&&!f.__webglMorphTargetInfluences){f.__webglMorphTargetInfluences=
- new Float32Array(E.maxMorphTargets);for(var g=0,h=E.maxMorphTargets;g<h;g++)f.__webglMorphTargetInfluences[g]=0}var o=!1,g=d.program,h=g.uniforms,i=d.uniforms;g!==R&&(e.useProgram(g),R=g,o=!0);if(d.id!==D)D=d.id,o=!0;if(o){e.uniformMatrix4fv(h.projectionMatrix,!1,a._projectionMatrixArray);if(c&&d.fog)if(i.fogColor.value=c.color,c instanceof THREE.Fog)i.fogNear.value=c.near,i.fogFar.value=c.far;else if(c instanceof THREE.FogExp2)i.fogDensity.value=c.density;if(d instanceof THREE.MeshPhongMaterial||
- d instanceof THREE.MeshLambertMaterial||d.lights){for(var k,s,l=0,j=0,q=0,p,n,u,w=La,C=w.directional.colors,G=w.directional.positions,t=w.point.colors,J=w.point.positions,O=w.point.distances,v=0,U=0,c=k=u=0,o=b.length;c<o;c++)if(k=b[c],s=k.color,p=k.position,n=k.intensity,u=k.distance,k instanceof THREE.AmbientLight)E.gammaInput?(l+=s.r*s.r,j+=s.g*s.g,q+=s.b*s.b):(l+=s.r,j+=s.g,q+=s.b);else if(k instanceof THREE.DirectionalLight)u=v*3,E.gammaInput?(C[u]=s.r*s.r*n*n,C[u+1]=s.g*s.g*n*n,C[u+2]=s.b*s.b*
- n*n):(C[u]=s.r*n,C[u+1]=s.g*n,C[u+2]=s.b*n),G[u]=p.x,G[u+1]=p.y,G[u+2]=p.z,v+=1;else if(k instanceof THREE.SpotLight)u=v*3,E.gammaInput?(C[u]=s.r*s.r*n*n,C[u+1]=s.g*s.g*n*n,C[u+2]=s.b*s.b*n*n):(C[u]=s.r*n,C[u+1]=s.g*n,C[u+2]=s.b*n),s=1/p.length(),G[u]=p.x*s,G[u+1]=p.y*s,G[u+2]=p.z*s,v+=1;else if(k instanceof THREE.PointLight)k=U*3,E.gammaInput?(t[k]=s.r*s.r*n*n,t[k+1]=s.g*s.g*n*n,t[k+2]=s.b*s.b*n*n):(t[k]=s.r*n,t[k+1]=s.g*n,t[k+2]=s.b*n),J[k]=p.x,J[k+1]=p.y,J[k+2]=p.z,O[U]=u,U+=1;c=v*3;for(o=C.length;c<
- o;c++)C[c]=0;c=U*3;for(o=t.length;c<o;c++)t[c]=0;w.point.length=U;w.directional.length=v;w.ambient[0]=l;w.ambient[1]=j;w.ambient[2]=q;b=La;i.ambientLightColor.value=b.ambient;i.directionalLightColor.value=b.directional.colors;i.directionalLightDirection.value=b.directional.positions;i.pointLightColor.value=b.point.colors;i.pointLightPosition.value=b.point.positions;i.pointLightDistance.value=b.point.distances}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof
- THREE.MeshPhongMaterial)i.opacity.value=d.opacity,E.gammaInput?i.diffuse.value.copyGammaToLinear(d.color):i.diffuse.value=d.color,(i.map.texture=d.map)&&i.offsetRepeat.value.set(d.map.offset.x,d.map.offset.y,d.map.repeat.x,d.map.repeat.y),i.lightMap.texture=d.lightMap,i.envMap.texture=d.envMap,i.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,i.reflectivity.value=d.reflectivity,i.refractionRatio.value=d.refractionRatio,i.combine.value=d.combine,i.useRefract.value=d.envMap&&d.envMap.mapping instanceof
- THREE.CubeRefractionMapping;if(d instanceof THREE.LineBasicMaterial)i.diffuse.value=d.color,i.opacity.value=d.opacity;else if(d instanceof THREE.ParticleBasicMaterial)i.psColor.value=d.color,i.opacity.value=d.opacity,i.size.value=d.size,i.scale.value=ja.height/2,i.map.texture=d.map;else if(d instanceof THREE.MeshPhongMaterial)i.shininess.value=d.shininess,E.gammaInput?(i.ambient.value.copyGammaToLinear(d.ambient),i.specular.value.copyGammaToLinear(d.specular)):(i.ambient.value=d.ambient,i.specular.value=
- d.specular);else if(d instanceof THREE.MeshLambertMaterial)E.gammaInput?i.ambient.value.copyGammaToLinear(d.ambient):i.ambient.value=d.ambient;else if(d instanceof THREE.MeshDepthMaterial)i.mNear.value=a.near,i.mFar.value=a.far,i.opacity.value=d.opacity;else if(d instanceof THREE.MeshNormalMaterial)i.opacity.value=d.opacity;if(f.receiveShadow&&!d._shadowPass&&i.shadowMatrix){for(b=0;b<E.shadowMapPlugin.shadowMatrix.length;b++)i.shadowMatrix.value[b]=E.shadowMapPlugin.shadowMatrix[b],i.shadowMap.texture[b]=
- E.shadowMapPlugin.shadowMap[b];i.shadowDarkness.value=E.shadowMapDarkness;i.shadowBias.value=E.shadowMapBias}b=d.uniformsList;i=0;for(c=b.length;i<c;i++)if(j=g.uniforms[b[i][1]])if(l=b[i][0],q=l.type,o=l.value,q==="i")e.uniform1i(j,o);else if(q==="f")e.uniform1f(j,o);else if(q==="v2")e.uniform2f(j,o.x,o.y);else if(q==="v3")e.uniform3f(j,o.x,o.y,o.z);else if(q==="v4")e.uniform4f(j,o.x,o.y,o.z,o.w);else if(q==="c")e.uniform3f(j,o.r,o.g,o.b);else if(q==="fv1")e.uniform1fv(j,o);else if(q==="fv")e.uniform3fv(j,
- o);else if(q==="v3v"){if(!l._array)l._array=new Float32Array(3*o.length);q=0;for(p=o.length;q<p;q++)w=q*3,l._array[w]=o[q].x,l._array[w+1]=o[q].y,l._array[w+2]=o[q].z;e.uniform3fv(j,l._array)}else if(q==="m4"){if(!l._array)l._array=new Float32Array(16);o.flattenToArray(l._array);e.uniformMatrix4fv(j,!1,l._array)}else if(q==="m4v"){if(!l._array)l._array=new Float32Array(16*o.length);q=0;for(p=o.length;q<p;q++)o[q].flattenToArrayOffset(l._array,q*16);e.uniformMatrix4fv(j,!1,l._array)}else if(q==="t"){if(e.uniform1i(j,
- o),j=l.texture)if(j.image instanceof Array&&j.image.length===6){if(l=j,l.image.length===6)if(l.needsUpdate){if(!l.image.__webglTextureCube)l.image.__webglTextureCube=e.createTexture();e.activeTexture(e.TEXTURE0+o);e.bindTexture(e.TEXTURE_CUBE_MAP,l.image.__webglTextureCube);o=K(e.TEXTURE_CUBE_MAP,l,l.image[0]);for(j=0;j<6;j++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+j,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,l.image[j]);o&&e.generateMipmap(e.TEXTURE_CUBE_MAP);l.needsUpdate=!1}else e.activeTexture(e.TEXTURE0+
- o),e.bindTexture(e.TEXTURE_CUBE_MAP,l.image.__webglTextureCube)}else j instanceof THREE.WebGLRenderTargetCube?(l=j,e.activeTexture(e.TEXTURE0+o),e.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture)):E.setTexture(j,o)}else if(q==="tv"){if(!l._array){l._array=[];q=0;for(p=l.texture.length;q<p;q++)l._array[q]=o+q}e.uniform1iv(j,l._array);q=0;for(p=l.texture.length;q<p;q++)(j=l.texture[q])&&E.setTexture(j,l._array[q])}(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&
- h.cameraPosition!==null&&e.uniform3f(h.cameraPosition,a.position.x,a.position.y,a.position.z);(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&h.viewMatrix!==null&&e.uniformMatrix4fv(h.viewMatrix,!1,a._viewMatrixArray);d.skinning&&(e.uniformMatrix4fv(h.cameraInverseMatrix,!1,a._viewMatrixArray),e.uniformMatrix4fv(h.boneGlobalMatrices,!1,f.boneMatrices))}e.uniformMatrix4fv(h.modelViewMatrix,!1,f._modelViewMatrixArray);h.normalMatrix&&
- e.uniformMatrix3fv(h.normalMatrix,!1,f._normalMatrixArray);(d instanceof THREE.ShaderMaterial||d.envMap||d.skinning||f.receiveShadow)&&h.objectMatrix!==null&&e.uniformMatrix4fv(h.objectMatrix,!1,f._objectMatrixArray);return g}function qa(a,b){a._modelViewMatrix.multiplyToArray(b.matrixWorldInverse,a.matrixWorld,a._modelViewMatrixArray);THREE.Matrix4.makeInvert3x3(a._modelViewMatrix).transposeIntoArray(a._normalMatrixArray)}function T(a){za!==a&&(e.depthMask(a),za=a)}function la(a,b,c){Ea!==a&&(a?
- e.enable(e.POLYGON_OFFSET_FILL):e.disable(e.POLYGON_OFFSET_FILL),Ea=a);if(a&&(Ba!==b||Ca!==c))e.polygonOffset(b,c),Ba=b,Ca=c}function ga(a,b){var c;a==="fragment"?c=e.createShader(e.FRAGMENT_SHADER):a==="vertex"&&(c=e.createShader(e.VERTEX_SHADER));e.shaderSource(c,b);e.compileShader(c);if(!e.getShaderParameter(c,e.COMPILE_STATUS))return console.error(e.getShaderInfoLog(c)),console.error(b),null;return c}function K(a,b,c){return(c.width&c.width-1)===0&&(c.height&c.height-1)===0?(e.texParameteri(a,
- e.TEXTURE_WRAP_S,O(b.wrapS)),e.texParameteri(a,e.TEXTURE_WRAP_T,O(b.wrapT)),e.texParameteri(a,e.TEXTURE_MAG_FILTER,O(b.magFilter)),e.texParameteri(a,e.TEXTURE_MIN_FILTER,O(b.minFilter)),!0):(e.texParameteri(a,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(a,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(a,e.TEXTURE_MAG_FILTER,N(b.magFilter)),e.texParameteri(a,e.TEXTURE_MIN_FILTER,N(b.minFilter)),!1)}function P(a,b){e.bindRenderbuffer(e.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,
- e.DEPTH_COMPONENT16,b.width,b.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,b.width,b.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,a)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,b.width,b.height)}function N(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMapNearestFilter:case THREE.NearestMipMapLinearFilter:return e.NEAREST;
- default:return e.LINEAR}}function O(a){switch(a){case THREE.RepeatWrapping:return e.REPEAT;case THREE.ClampToEdgeWrapping:return e.CLAMP_TO_EDGE;case THREE.MirroredRepeatWrapping:return e.MIRRORED_REPEAT;case THREE.NearestFilter:return e.NEAREST;case THREE.NearestMipMapNearestFilter:return e.NEAREST_MIPMAP_NEAREST;case THREE.NearestMipMapLinearFilter:return e.NEAREST_MIPMAP_LINEAR;case THREE.LinearFilter:return e.LINEAR;case THREE.LinearMipMapNearestFilter:return e.LINEAR_MIPMAP_NEAREST;case THREE.LinearMipMapLinearFilter:return e.LINEAR_MIPMAP_LINEAR;
- case THREE.ByteType:return e.BYTE;case THREE.UnsignedByteType:return e.UNSIGNED_BYTE;case THREE.ShortType:return e.SHORT;case THREE.UnsignedShortType:return e.UNSIGNED_SHORT;case THREE.IntType:return e.INT;case THREE.UnsignedShortType:return e.UNSIGNED_INT;case THREE.FloatType:return e.FLOAT;case THREE.AlphaFormat:return e.ALPHA;case THREE.RGBFormat:return e.RGB;case THREE.RGBAFormat:return e.RGBA;case THREE.LuminanceFormat:return e.LUMINANCE;case THREE.LuminanceAlphaFormat:return e.LUMINANCE_ALPHA}return 0}
- var a=a||{},ja=a.canvas!==void 0?a.canvas:document.createElement("canvas"),ua=a.precision!==void 0?a.precision:"highp",da=a.antialias!==void 0?a.antialias:!1,ta=a.stencil!==void 0?a.stencil:!0,ra=a.preserveDrawingBuffer!==void 0?a.preserveDrawingBuffer:!1,L=a.clearColor!==void 0?new THREE.Color(a.clearColor):new THREE.Color(0),va=a.clearAlpha!==void 0?a.clearAlpha:0,wa=a.maxLights!==void 0?a.maxLights:4;this.domElement=ja;this.context=null;this.autoUpdateScene=this.autoUpdateObjects=this.sortObjects=
- this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.physicallyBasedShading=this.gammaOutput=this.gammaInput=!1;this.shadowMapBias=0.0039;this.shadowMapDarkness=0.5;this.shadowMapHeight=this.shadowMapWidth=512;this.shadowCameraNear=1;this.shadowCameraFar=5E3;this.shadowCameraFov=50;this.shadowMapEnabled=!1;this.shadowMapSoft=this.shadowMapAutoUpdate=!0;this.maxMorphTargets=8;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,
- textures:0},render:{calls:0,vertices:0,faces:0}};var E=this,e,Aa=[],R=null,na=null,D=-1,S=null,pa=0,xa=null,Z=null,oa=null,sa=null,za=null,Ea=null,Ba=null,Ca=null,ya=null,Ia=0,Ja=0,Ga=0,Ha=0,Ka=new THREE.Frustum,Fa=new THREE.Matrix4,Da=new THREE.Vector4,La={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]}};e=function(){var a;try{if(!(a=ja.getContext("experimental-webgl",{antialias:da,stencil:ta,preserveDrawingBuffer:ra})))throw"Error creating WebGL context.";
- console.log(navigator.userAgent+" | "+a.getParameter(a.VERSION)+" | "+a.getParameter(a.VENDOR)+" | "+a.getParameter(a.RENDERER)+" | "+a.getParameter(a.SHADING_LANGUAGE_VERSION))}catch(b){console.error(b)}return a}();e.clearColor(0,0,0,1);e.clearDepth(1);e.clearStencil(0);e.enable(e.DEPTH_TEST);e.depthFunc(e.LEQUAL);e.frontFace(e.CCW);e.cullFace(e.BACK);e.enable(e.CULL_FACE);e.enable(e.BLEND);e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA);e.clearColor(L.r,L.g,L.b,va);this.context=
- e;var Ma=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;this.getContext=function(){return e};this.supportsVertexTextures=function(){return Ma};this.setSize=function(a,b){ja.width=a;ja.height=b;this.setViewport(0,0,ja.width,ja.height)};this.setViewport=function(a,b,c,d){Ia=a;Ja=b;Ga=c;Ha=d;e.viewport(Ia,Ja,Ga,Ha)};this.setScissor=function(a,b,c,d){e.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST)};this.setClearColorHex=function(a,b){L.setHex(a);
- va=b;e.clearColor(L.r,L.g,L.b,va)};this.setClearColor=function(a,b){L.copy(a);va=b;e.clearColor(L.r,L.g,L.b,va)};this.getClearColor=function(){return L};this.getClearAlpha=function(){return va};this.clear=function(a,b,c){var d=0;if(a===void 0||a)d|=e.COLOR_BUFFER_BIT;if(b===void 0||b)d|=e.DEPTH_BUFFER_BIT;if(c===void 0||c)d|=e.STENCIL_BUFFER_BIT;e.clear(d)};this.clearTarget=function(a,b,c,e){this.setRenderTarget(a);this.clear(b,c,e)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};
- this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)};this.deallocateObject=function(a){if(a.__webglInit)if(a.__webglInit=!1,delete a._modelViewMatrix,delete a._normalMatrixArray,delete a._modelViewMatrixArray,delete a._objectMatrixArray,a instanceof THREE.Mesh)for(var b in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[b];e.deleteBuffer(c.__webglVertexBuffer);e.deleteBuffer(c.__webglNormalBuffer);e.deleteBuffer(c.__webglTangentBuffer);e.deleteBuffer(c.__webglColorBuffer);
- e.deleteBuffer(c.__webglUVBuffer);e.deleteBuffer(c.__webglUV2Buffer);e.deleteBuffer(c.__webglSkinVertexABuffer);e.deleteBuffer(c.__webglSkinVertexBBuffer);e.deleteBuffer(c.__webglSkinIndicesBuffer);e.deleteBuffer(c.__webglSkinWeightsBuffer);e.deleteBuffer(c.__webglFaceBuffer);e.deleteBuffer(c.__webglLineBuffer);if(c.numMorphTargets)for(var d=0,f=c.numMorphTargets;d<f;d++)e.deleteBuffer(c.__webglMorphTargetsBuffers[d]);if(c.__webglCustomAttributesList)for(d in d=void 0,c.__webglCustomAttributesList)e.deleteBuffer(c.__webglCustomAttributesList[d].buffer);
- E.info.memory.geometries--}else if(a instanceof THREE.Ribbon)a=a.geometry,e.deleteBuffer(a.__webglVertexBuffer),e.deleteBuffer(a.__webglColorBuffer),E.info.memory.geometries--;else if(a instanceof THREE.Line)a=a.geometry,e.deleteBuffer(a.__webglVertexBuffer),e.deleteBuffer(a.__webglColorBuffer),E.info.memory.geometries--;else if(a instanceof THREE.ParticleSystem)a=a.geometry,e.deleteBuffer(a.__webglVertexBuffer),e.deleteBuffer(a.__webglColorBuffer),E.info.memory.geometries--};this.deallocateTexture=
- function(a){if(a.__webglInit)a.__webglInit=!1,e.deleteTexture(a.__webglTexture),E.info.memory.textures--};this.updateShadowMap=function(a,b){R=null;D=S=za=sa=oa=-1;this.shadowMapPlugin.update(a,b)};this.renderBufferImmediate=function(a,b,c){if(!a.__webglVertexBuffer)a.__webglVertexBuffer=e.createBuffer();if(!a.__webglNormalBuffer)a.__webglNormalBuffer=e.createBuffer();a.hasPos&&(e.bindBuffer(e.ARRAY_BUFFER,a.__webglVertexBuffer),e.bufferData(e.ARRAY_BUFFER,a.positionArray,e.DYNAMIC_DRAW),e.enableVertexAttribArray(b.attributes.position),
- e.vertexAttribPointer(b.attributes.position,3,e.FLOAT,!1,0,0));if(a.hasNormal){e.bindBuffer(e.ARRAY_BUFFER,a.__webglNormalBuffer);if(c===THREE.FlatShading){var d,f,g,h,i,l,k,s,p,j,q=a.count*3;for(j=0;j<q;j+=9)c=a.normalArray,d=c[j],f=c[j+1],g=c[j+2],h=c[j+3],l=c[j+4],s=c[j+5],i=c[j+6],k=c[j+7],p=c[j+8],d=(d+h+i)/3,f=(f+l+k)/3,g=(g+s+p)/3,c[j]=d,c[j+1]=f,c[j+2]=g,c[j+3]=d,c[j+4]=f,c[j+5]=g,c[j+6]=d,c[j+7]=f,c[j+8]=g}e.bufferData(e.ARRAY_BUFFER,a.normalArray,e.DYNAMIC_DRAW);e.enableVertexAttribArray(b.attributes.normal);
- e.vertexAttribPointer(b.attributes.normal,3,e.FLOAT,!1,0,0)}e.drawArrays(e.TRIANGLES,0,a.count);a.count=0};this.renderBuffer=function(a,b,c,d,f,g){if(d.opacity!==0){var h,i,c=J(a,b,c,d,g),b=c.attributes,a=!1,c=f.id*16777215+c.id*2+(d.wireframe?1:0);c!==S&&(S=c,a=!0);if(!d.morphTargets&&b.position>=0)a&&(e.bindBuffer(e.ARRAY_BUFFER,f.__webglVertexBuffer),e.vertexAttribPointer(b.position,3,e.FLOAT,!1,0,0));else if(g.morphTargetBase){c=d.program.attributes;g.morphTargetBase!==-1?(e.bindBuffer(e.ARRAY_BUFFER,
- f.__webglMorphTargetsBuffers[g.morphTargetBase]),e.vertexAttribPointer(c.position,3,e.FLOAT,!1,0,0)):c.position>=0&&(e.bindBuffer(e.ARRAY_BUFFER,f.__webglVertexBuffer),e.vertexAttribPointer(c.position,3,e.FLOAT,!1,0,0));if(g.morphTargetForcedOrder.length){h=0;var l=g.morphTargetForcedOrder;for(i=g.morphTargetInfluences;h<d.numSupportedMorphTargets&&h<l.length;)e.bindBuffer(e.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[l[h]]),e.vertexAttribPointer(c["morphTarget"+h],3,e.FLOAT,!1,0,0),g.__webglMorphTargetInfluences[h]=
- i[l[h]],h++}else{var l=[],k=-1,s=0;i=g.morphTargetInfluences;var p,j=i.length;h=0;for(g.morphTargetBase!==-1&&(l[g.morphTargetBase]=!0);h<d.numSupportedMorphTargets;){for(p=0;p<j;p++)!l[p]&&i[p]>k&&(s=p,k=i[s]);e.bindBuffer(e.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[s]);e.vertexAttribPointer(c["morphTarget"+h],3,e.FLOAT,!1,0,0);g.__webglMorphTargetInfluences[h]=k;l[s]=1;k=-1;h++}}d.program.uniforms.morphTargetInfluences!==null&&e.uniform1fv(d.program.uniforms.morphTargetInfluences,g.__webglMorphTargetInfluences)}if(a){if(f.__webglCustomAttributesList){h=
- 0;for(i=f.__webglCustomAttributesList.length;h<i;h++)c=f.__webglCustomAttributesList[h],b[c.buffer.belongsToAttribute]>=0&&(e.bindBuffer(e.ARRAY_BUFFER,c.buffer),e.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,e.FLOAT,!1,0,0))}b.color>=0&&(e.bindBuffer(e.ARRAY_BUFFER,f.__webglColorBuffer),e.vertexAttribPointer(b.color,3,e.FLOAT,!1,0,0));b.normal>=0&&(e.bindBuffer(e.ARRAY_BUFFER,f.__webglNormalBuffer),e.vertexAttribPointer(b.normal,3,e.FLOAT,!1,0,0));b.tangent>=0&&(e.bindBuffer(e.ARRAY_BUFFER,
- f.__webglTangentBuffer),e.vertexAttribPointer(b.tangent,4,e.FLOAT,!1,0,0));b.uv>=0&&(f.__webglUVBuffer?(e.bindBuffer(e.ARRAY_BUFFER,f.__webglUVBuffer),e.vertexAttribPointer(b.uv,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(b.uv)):e.disableVertexAttribArray(b.uv));b.uv2>=0&&(f.__webglUV2Buffer?(e.bindBuffer(e.ARRAY_BUFFER,f.__webglUV2Buffer),e.vertexAttribPointer(b.uv2,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(b.uv2)):e.disableVertexAttribArray(b.uv2));d.skinning&&b.skinVertexA>=0&&b.skinVertexB>=
- 0&&b.skinIndex>=0&&b.skinWeight>=0&&(e.bindBuffer(e.ARRAY_BUFFER,f.__webglSkinVertexABuffer),e.vertexAttribPointer(b.skinVertexA,4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,f.__webglSkinVertexBBuffer),e.vertexAttribPointer(b.skinVertexB,4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),e.vertexAttribPointer(b.skinIndex,4,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),e.vertexAttribPointer(b.skinWeight,4,e.FLOAT,!1,0,0))}g instanceof THREE.Mesh?(d.wireframe?
- (d=d.wireframeLinewidth,d!==ya&&(e.lineWidth(d),ya=d),a&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),e.drawElements(e.LINES,f.__webglLineCount,e.UNSIGNED_SHORT,0)):(a&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),e.drawElements(e.TRIANGLES,f.__webglFaceCount,e.UNSIGNED_SHORT,0)),E.info.render.calls++,E.info.render.vertices+=f.__webglFaceCount,E.info.render.faces+=f.__webglFaceCount/3):g instanceof THREE.Line?(g=g.type===THREE.LineStrip?e.LINE_STRIP:e.LINES,d=d.linewidth,d!==
- ya&&(e.lineWidth(d),ya=d),e.drawArrays(g,0,f.__webglLineCount),E.info.render.calls++):g instanceof THREE.ParticleSystem?(e.drawArrays(e.POINTS,0,f.__webglParticleCount),E.info.render.calls++):g instanceof THREE.Ribbon&&(e.drawArrays(e.TRIANGLE_STRIP,0,f.__webglVertexCount),E.info.render.calls++)}};this.render=function(a,b,c,d){var f,g,h,o,l=a.lights,u=a.fog;D=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);b.parent===void 0&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),
- a.add(b));this.autoUpdateScene&&a.updateMatrixWorld();p(this.renderPluginsPre,a,b);E.info.render.calls=0;E.info.render.vertices=0;E.info.render.faces=0;b.matrixWorldInverse.getInverse(b.matrixWorld);if(!b._viewMatrixArray)b._viewMatrixArray=new Float32Array(16);b.matrixWorldInverse.flattenToArray(b._viewMatrixArray);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.projectionMatrix.flattenToArray(b._projectionMatrixArray);Fa.multiply(b.projectionMatrix,b.matrixWorldInverse);
- Ka.setFromMatrix(Fa);this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);o=a.__webglObjects;d=0;for(f=o.length;d<f;d++)if(g=o[d],h=g.object,g.render=!1,h.visible&&(!(h instanceof THREE.Mesh)||!h.frustumCulled||Ka.contains(h))){h.matrixWorld.flattenToArray(h._objectMatrixArray);qa(h,b);var s=g,w=s.object,j=s.buffer,q=void 0,q=q=void 0,q=w.material;if(q instanceof THREE.MeshFaceMaterial){if(q=j.materialIndex,q>=0)q=w.geometry.materials[q],
- q.transparent?(s.transparent=q,s.opaque=null):(s.opaque=q,s.transparent=null)}else if(q)q.transparent?(s.transparent=q,s.opaque=null):(s.opaque=q,s.transparent=null);g.render=!0;if(this.sortObjects)h.renderDepth?g.z=h.renderDepth:(Da.copy(h.position),Fa.multiplyVector3(Da),g.z=Da.z)}this.sortObjects&&o.sort(i);o=a.__webglObjectsImmediate;d=0;for(f=o.length;d<f;d++)if(g=o[d],h=g.object,h.visible)h.matrixAutoUpdate&&h.matrixWorld.flattenToArray(h._objectMatrixArray),qa(h,b),h=g.object.material,h.transparent?
- (g.transparent=h,g.opaque=null):(g.opaque=h,g.transparent=null);a.overrideMaterial?(this.setBlending(a.overrideMaterial.blending),this.setDepthTest(a.overrideMaterial.depthTest),T(a.overrideMaterial.depthWrite),la(a.overrideMaterial.polygonOffset,a.overrideMaterial.polygonOffsetFactor,a.overrideMaterial.polygonOffsetUnits),n(a.__webglObjects,!1,"",b,l,u,!0,a.overrideMaterial),k(a.__webglObjectsImmediate,"",b,l,u,!1,a.overrideMaterial)):(this.setBlending(THREE.NormalBlending),n(a.__webglObjects,!0,
- "opaque",b,l,u,!1),k(a.__webglObjectsImmediate,"opaque",b,l,u,!1),n(a.__webglObjects,!1,"transparent",b,l,u,!0),k(a.__webglObjectsImmediate,"transparent",b,l,u,!0));p(this.renderPluginsPost,a,b);c&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(e.bindTexture(e.TEXTURE_CUBE_MAP,c.__webglTexture),e.generateMipmap(e.TEXTURE_CUBE_MAP),e.bindTexture(e.TEXTURE_CUBE_MAP,null)):(e.bindTexture(e.TEXTURE_2D,c.__webglTexture),e.generateMipmap(e.TEXTURE_2D),
- e.bindTexture(e.TEXTURE_2D,null)))};this.renderImmediateObject=function(a,b,c,d,f){var g=J(a,b,c,d,f);S=-1;E.setObjectFaces(f);f.immediateRenderCallback?f.immediateRenderCallback(g,e,Ka):f.render(function(a){E.renderBufferImmediate(a,g,d.shading)})};this.initWebGLObjects=function(a){if(!a.__webglObjects)a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[];for(;a.__objectsAdded.length;){var i=a.__objectsAdded[0],k=a,p=void 0,n=void 0,A=void 0;if(!i.__webglInit)if(i.__webglInit=
- !0,i._modelViewMatrix=new THREE.Matrix4,i._normalMatrixArray=new Float32Array(9),i._modelViewMatrixArray=new Float32Array(16),i._objectMatrixArray=new Float32Array(16),i.matrixWorld.flattenToArray(i._objectMatrixArray),i instanceof THREE.Mesh){n=i.geometry;if(n.geometryGroups===void 0){var A=n,B=void 0,o=void 0,H=void 0,aa=void 0,s=void 0,Y=void 0,j=void 0,q={},J=A.morphTargets.length;A.geometryGroups={};B=0;for(o=A.faces.length;B<o;B++)H=A.faces[B],aa=H.materialIndex,Y=aa!==void 0?aa:-1,q[Y]===void 0&&
- (q[Y]={hash:Y,counter:0}),j=q[Y].hash+"_"+q[Y].counter,A.geometryGroups[j]===void 0&&(A.geometryGroups[j]={faces3:[],faces4:[],materialIndex:aa,vertices:0,numMorphTargets:J}),s=H instanceof THREE.Face3?3:4,A.geometryGroups[j].vertices+s>65535&&(q[Y].counter+=1,j=q[Y].hash+"_"+q[Y].counter,A.geometryGroups[j]===void 0&&(A.geometryGroups[j]={faces3:[],faces4:[],materialIndex:aa,vertices:0,numMorphTargets:J})),H instanceof THREE.Face3?A.geometryGroups[j].faces3.push(B):A.geometryGroups[j].faces4.push(B),
- A.geometryGroups[j].vertices+=s;A.geometryGroupsList=[];B=void 0;for(B in A.geometryGroups)A.geometryGroups[B].id=pa++,A.geometryGroupsList.push(A.geometryGroups[B])}for(p in n.geometryGroups)if(A=n.geometryGroups[p],!A.__webglVertexBuffer){B=A;B.__webglVertexBuffer=e.createBuffer();B.__webglNormalBuffer=e.createBuffer();B.__webglTangentBuffer=e.createBuffer();B.__webglColorBuffer=e.createBuffer();B.__webglUVBuffer=e.createBuffer();B.__webglUV2Buffer=e.createBuffer();B.__webglSkinVertexABuffer=e.createBuffer();
- B.__webglSkinVertexBBuffer=e.createBuffer();B.__webglSkinIndicesBuffer=e.createBuffer();B.__webglSkinWeightsBuffer=e.createBuffer();B.__webglFaceBuffer=e.createBuffer();B.__webglLineBuffer=e.createBuffer();if(B.numMorphTargets){H=o=void 0;B.__webglMorphTargetsBuffers=[];o=0;for(H=B.numMorphTargets;o<H;o++)B.__webglMorphTargetsBuffers.push(e.createBuffer())}E.info.memory.geometries++;aa=i;s=aa.geometry;o=A.faces3;Y=A.faces4;B=o.length*3+Y.length*4;H=o.length*1+Y.length*2;Y=o.length*3+Y.length*4;o=
- c(aa,A);j=g(o);q=d(o);J=f(o);A.__vertexArray=new Float32Array(B*3);if(q)A.__normalArray=new Float32Array(B*3);if(s.hasTangents)A.__tangentArray=new Float32Array(B*4);if(J)A.__colorArray=new Float32Array(B*3);if(j){if(s.faceUvs.length>0||s.faceVertexUvs.length>0)A.__uvArray=new Float32Array(B*2);if(s.faceUvs.length>1||s.faceVertexUvs.length>1)A.__uv2Array=new Float32Array(B*2)}if(aa.geometry.skinWeights.length&&aa.geometry.skinIndices.length)A.__skinVertexAArray=new Float32Array(B*4),A.__skinVertexBArray=
- new Float32Array(B*4),A.__skinIndexArray=new Float32Array(B*4),A.__skinWeightArray=new Float32Array(B*4);A.__faceArray=new Uint16Array(H*3);A.__lineArray=new Uint16Array(Y*2);if(A.numMorphTargets){A.__morphTargetsArrays=[];aa=0;for(s=A.numMorphTargets;aa<s;aa++)A.__morphTargetsArrays.push(new Float32Array(B*3))}A.__webglFaceCount=H*3;A.__webglLineCount=Y*2;if(o.attributes){if(A.__webglCustomAttributesList===void 0)A.__webglCustomAttributesList=[];H=void 0;for(H in o.attributes){var aa=o.attributes[H],
- s={},ma;for(ma in aa)s[ma]=aa[ma];if(!s.__webglInitialized||s.createUniqueBuffers)s.__webglInitialized=!0,Y=1,s.type==="v2"?Y=2:s.type==="v3"?Y=3:s.type==="v4"?Y=4:s.type==="c"&&(Y=3),s.size=Y,s.array=new Float32Array(B*Y),s.buffer=e.createBuffer(),s.buffer.belongsToAttribute=H,aa.needsUpdate=!0,s.__original=aa;A.__webglCustomAttributesList.push(s)}}A.__inittedArrays=!0;n.__dirtyVertices=!0;n.__dirtyMorphTargets=!0;n.__dirtyElements=!0;n.__dirtyUvs=!0;n.__dirtyNormals=!0;n.__dirtyTangents=!0;n.__dirtyColors=
- !0}}else if(i instanceof THREE.Ribbon){if(n=i.geometry,!n.__webglVertexBuffer)A=n,A.__webglVertexBuffer=e.createBuffer(),A.__webglColorBuffer=e.createBuffer(),E.info.memory.geometries++,A=n,B=A.vertices.length,A.__vertexArray=new Float32Array(B*3),A.__colorArray=new Float32Array(B*3),A.__webglVertexCount=B,n.__dirtyVertices=!0,n.__dirtyColors=!0}else if(i instanceof THREE.Line){if(n=i.geometry,!n.__webglVertexBuffer)A=n,A.__webglVertexBuffer=e.createBuffer(),A.__webglColorBuffer=e.createBuffer(),
- E.info.memory.geometries++,A=n,B=i,o=A.vertices.length,A.__vertexArray=new Float32Array(o*3),A.__colorArray=new Float32Array(o*3),A.__webglLineCount=o,b(A,B),n.__dirtyVertices=!0,n.__dirtyColors=!0}else if(i instanceof THREE.ParticleSystem&&(n=i.geometry,!n.__webglVertexBuffer))A=n,A.__webglVertexBuffer=e.createBuffer(),A.__webglColorBuffer=e.createBuffer(),E.info.geometries++,A=n,B=i,o=A.vertices.length,A.__vertexArray=new Float32Array(o*3),A.__colorArray=new Float32Array(o*3),A.__sortArray=[],A.__webglParticleCount=
- o,b(A,B),n.__dirtyVertices=!0,n.__dirtyColors=!0;if(!i.__webglActive){if(i instanceof THREE.Mesh)for(p in n=i.geometry,n.geometryGroups)A=n.geometryGroups[p],l(k.__webglObjects,A,i);else i instanceof THREE.Ribbon||i instanceof THREE.Line||i instanceof THREE.ParticleSystem?(n=i.geometry,l(k.__webglObjects,n,i)):THREE.MarchingCubes!==void 0&&i instanceof THREE.MarchingCubes||i.immediateRenderCallback?k.__webglObjectsImmediate.push({object:i,opaque:null,transparent:null}):i instanceof THREE.Sprite?k.__webglSprites.push(i):
- i instanceof THREE.LensFlare&&k.__webglFlares.push(i);i.__webglActive=!0}a.__objectsAdded.splice(0,1)}for(;a.__objectsRemoved.length;)i=a.__objectsRemoved[0],k=a,i instanceof THREE.Mesh||i instanceof THREE.ParticleSystem||i instanceof THREE.Ribbon||i instanceof THREE.Line?G(k.__webglObjects,i):i instanceof THREE.Sprite?C(k.__webglSprites,i):i instanceof THREE.LensFlare?C(k.__webglFlares,i):(i instanceof THREE.MarchingCubes||i.immediateRenderCallback)&&G(k.__webglObjectsImmediate,i),i.__webglActive=
- !1,a.__objectsRemoved.splice(0,1);i=0;for(k=a.__webglObjects.length;i<k;i++)if(ma=a.__webglObjects[i].object,p=ma.geometry,n=H=o=void 0,ma instanceof THREE.Mesh){A=0;for(B=p.geometryGroupsList.length;A<B;A++)if(o=p.geometryGroupsList[A],n=c(ma,o),H=n.attributes&&w(n),p.__dirtyVertices||p.__dirtyMorphTargets||p.__dirtyElements||p.__dirtyUvs||p.__dirtyNormals||p.__dirtyColors||p.__dirtyTangents||H){var M=ma,H=e.DYNAMIC_DRAW,aa=!p.dynamic,j=n;if(o.__inittedArrays){var s=d(j),Y=f(j),K=g(j),O=s===THREE.SmoothShading,
- D=q=j=void 0,t=void 0,ca=void 0,N=void 0,v=void 0,U=void 0,P=void 0,T=D=void 0,x=void 0,y=void 0,z=void 0,ea=t=void 0,fa=void 0,L=void 0,V=t=P=void 0,W=void 0,R=z=y=x=v=void 0,F=t=z=y=x=R=z=y=x=R=z=y=x=void 0,I=void 0,S=N=void 0,Z=void 0,$=void 0,la=void 0,ha=void 0,ja=T=$=I=0,ga=0,da=F=D=0,Q=v=ea=0,r=0,ia=void 0,Q=o.__vertexArray,Z=o.__uvArray,r=o.__uv2Array,S=o.__normalArray,ca=o.__tangentArray,fa=o.__colorArray,V=o.__skinVertexAArray,W=o.__skinVertexBArray,U=o.__skinIndexArray,ka=o.__skinWeightArray,
- R=o.__morphTargetsArrays,J=o.__webglCustomAttributesList,m=void 0,m=o.__faceArray,ia=o.__lineArray,L=M.geometry,ta=L.__dirtyElements,qa=L.__dirtyUvs,N=L.__dirtyNormals,P=L.__dirtyTangents,xa=L.__dirtyColors,la=L.__dirtyMorphTargets,ha=L.vertices,M=o.faces3,X=o.faces4,ba=L.faces,ua=L.faceVertexUvs[0],va=L.faceVertexUvs[1],na=L.skinVerticesA,oa=L.skinVerticesB,sa=L.skinIndices,ra=L.skinWeights,wa=L.morphTargets;if(L.__dirtyVertices){j=0;for(q=M.length;j<q;j++)t=ba[M[j]],x=ha[t.a].position,y=ha[t.b].position,
- z=ha[t.c].position,Q[$]=x.x,Q[$+1]=x.y,Q[$+2]=x.z,Q[$+3]=y.x,Q[$+4]=y.y,Q[$+5]=y.z,Q[$+6]=z.x,Q[$+7]=z.y,Q[$+8]=z.z,$+=9;j=0;for(q=X.length;j<q;j++)t=ba[X[j]],x=ha[t.a].position,y=ha[t.b].position,z=ha[t.c].position,t=ha[t.d].position,Q[$]=x.x,Q[$+1]=x.y,Q[$+2]=x.z,Q[$+3]=y.x,Q[$+4]=y.y,Q[$+5]=y.z,Q[$+6]=z.x,Q[$+7]=z.y,Q[$+8]=z.z,Q[$+9]=t.x,Q[$+10]=t.y,Q[$+11]=t.z,$+=12;e.bindBuffer(e.ARRAY_BUFFER,o.__webglVertexBuffer);e.bufferData(e.ARRAY_BUFFER,Q,H)}if(la){$=0;for(la=wa.length;$<la;$++){j=Q=0;
- for(q=M.length;j<q;j++)t=ba[M[j]],x=wa[$].vertices[t.a].position,y=wa[$].vertices[t.b].position,z=wa[$].vertices[t.c].position,ha=R[$],ha[Q]=x.x,ha[Q+1]=x.y,ha[Q+2]=x.z,ha[Q+3]=y.x,ha[Q+4]=y.y,ha[Q+5]=y.z,ha[Q+6]=z.x,ha[Q+7]=z.y,ha[Q+8]=z.z,Q+=9;j=0;for(q=X.length;j<q;j++)t=ba[X[j]],x=wa[$].vertices[t.a].position,y=wa[$].vertices[t.b].position,z=wa[$].vertices[t.c].position,t=wa[$].vertices[t.d].position,ha=R[$],ha[Q]=x.x,ha[Q+1]=x.y,ha[Q+2]=x.z,ha[Q+3]=y.x,ha[Q+4]=y.y,ha[Q+5]=y.z,ha[Q+6]=z.x,ha[Q+
- 7]=z.y,ha[Q+8]=z.z,ha[Q+9]=t.x,ha[Q+10]=t.y,ha[Q+11]=t.z,Q+=12;e.bindBuffer(e.ARRAY_BUFFER,o.__webglMorphTargetsBuffers[$]);e.bufferData(e.ARRAY_BUFFER,R[$],H)}}if(ra.length){j=0;for(q=M.length;j<q;j++)t=ba[M[j]],x=ra[t.a],y=ra[t.b],z=ra[t.c],ka[v]=x.x,ka[v+1]=x.y,ka[v+2]=x.z,ka[v+3]=x.w,ka[v+4]=y.x,ka[v+5]=y.y,ka[v+6]=y.z,ka[v+7]=y.w,ka[v+8]=z.x,ka[v+9]=z.y,ka[v+10]=z.z,ka[v+11]=z.w,x=sa[t.a],y=sa[t.b],z=sa[t.c],U[v]=x.x,U[v+1]=x.y,U[v+2]=x.z,U[v+3]=x.w,U[v+4]=y.x,U[v+5]=y.y,U[v+6]=y.z,U[v+7]=y.w,
- U[v+8]=z.x,U[v+9]=z.y,U[v+10]=z.z,U[v+11]=z.w,x=na[t.a],y=na[t.b],z=na[t.c],V[v]=x.x,V[v+1]=x.y,V[v+2]=x.z,V[v+3]=1,V[v+4]=y.x,V[v+5]=y.y,V[v+6]=y.z,V[v+7]=1,V[v+8]=z.x,V[v+9]=z.y,V[v+10]=z.z,V[v+11]=1,x=oa[t.a],y=oa[t.b],z=oa[t.c],W[v]=x.x,W[v+1]=x.y,W[v+2]=x.z,W[v+3]=1,W[v+4]=y.x,W[v+5]=y.y,W[v+6]=y.z,W[v+7]=1,W[v+8]=z.x,W[v+9]=z.y,W[v+10]=z.z,W[v+11]=1,v+=12;j=0;for(q=X.length;j<q;j++)t=ba[X[j]],x=ra[t.a],y=ra[t.b],z=ra[t.c],R=ra[t.d],ka[v]=x.x,ka[v+1]=x.y,ka[v+2]=x.z,ka[v+3]=x.w,ka[v+4]=y.x,ka[v+
- 5]=y.y,ka[v+6]=y.z,ka[v+7]=y.w,ka[v+8]=z.x,ka[v+9]=z.y,ka[v+10]=z.z,ka[v+11]=z.w,ka[v+12]=R.x,ka[v+13]=R.y,ka[v+14]=R.z,ka[v+15]=R.w,x=sa[t.a],y=sa[t.b],z=sa[t.c],R=sa[t.d],U[v]=x.x,U[v+1]=x.y,U[v+2]=x.z,U[v+3]=x.w,U[v+4]=y.x,U[v+5]=y.y,U[v+6]=y.z,U[v+7]=y.w,U[v+8]=z.x,U[v+9]=z.y,U[v+10]=z.z,U[v+11]=z.w,U[v+12]=R.x,U[v+13]=R.y,U[v+14]=R.z,U[v+15]=R.w,x=na[t.a],y=na[t.b],z=na[t.c],R=na[t.d],V[v]=x.x,V[v+1]=x.y,V[v+2]=x.z,V[v+3]=1,V[v+4]=y.x,V[v+5]=y.y,V[v+6]=y.z,V[v+7]=1,V[v+8]=z.x,V[v+9]=z.y,V[v+
- 10]=z.z,V[v+11]=1,V[v+12]=R.x,V[v+13]=R.y,V[v+14]=R.z,V[v+15]=1,x=oa[t.a],y=oa[t.b],z=oa[t.c],t=oa[t.d],W[v]=x.x,W[v+1]=x.y,W[v+2]=x.z,W[v+3]=1,W[v+4]=y.x,W[v+5]=y.y,W[v+6]=y.z,W[v+7]=1,W[v+8]=z.x,W[v+9]=z.y,W[v+10]=z.z,W[v+11]=1,W[v+12]=t.x,W[v+13]=t.y,W[v+14]=t.z,W[v+15]=1,v+=16;v>0&&(e.bindBuffer(e.ARRAY_BUFFER,o.__webglSkinVertexABuffer),e.bufferData(e.ARRAY_BUFFER,V,H),e.bindBuffer(e.ARRAY_BUFFER,o.__webglSkinVertexBBuffer),e.bufferData(e.ARRAY_BUFFER,W,H),e.bindBuffer(e.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),
- e.bufferData(e.ARRAY_BUFFER,U,H),e.bindBuffer(e.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),e.bufferData(e.ARRAY_BUFFER,ka,H))}if(xa&&Y){j=0;for(q=M.length;j<q;j++)t=ba[M[j]],v=t.vertexColors,U=t.color,v.length===3&&Y===THREE.VertexColors?(t=v[0],V=v[1],W=v[2]):W=V=t=U,fa[ea]=t.r,fa[ea+1]=t.g,fa[ea+2]=t.b,fa[ea+3]=V.r,fa[ea+4]=V.g,fa[ea+5]=V.b,fa[ea+6]=W.r,fa[ea+7]=W.g,fa[ea+8]=W.b,ea+=9;j=0;for(q=X.length;j<q;j++)t=ba[X[j]],v=t.vertexColors,U=t.color,v.length===4&&Y===THREE.VertexColors?(t=v[0],V=v[1],
- W=v[2],v=v[3]):v=W=V=t=U,fa[ea]=t.r,fa[ea+1]=t.g,fa[ea+2]=t.b,fa[ea+3]=V.r,fa[ea+4]=V.g,fa[ea+5]=V.b,fa[ea+6]=W.r,fa[ea+7]=W.g,fa[ea+8]=W.b,fa[ea+9]=v.r,fa[ea+10]=v.g,fa[ea+11]=v.b,ea+=12;ea>0&&(e.bindBuffer(e.ARRAY_BUFFER,o.__webglColorBuffer),e.bufferData(e.ARRAY_BUFFER,fa,H))}if(P&&L.hasTangents){j=0;for(q=M.length;j<q;j++)t=ba[M[j]],P=t.vertexTangents,ea=P[0],fa=P[1],L=P[2],ca[F]=ea.x,ca[F+1]=ea.y,ca[F+2]=ea.z,ca[F+3]=ea.w,ca[F+4]=fa.x,ca[F+5]=fa.y,ca[F+6]=fa.z,ca[F+7]=fa.w,ca[F+8]=L.x,ca[F+9]=
- L.y,ca[F+10]=L.z,ca[F+11]=L.w,F+=12;j=0;for(q=X.length;j<q;j++)t=ba[X[j]],P=t.vertexTangents,ea=P[0],fa=P[1],L=P[2],P=P[3],ca[F]=ea.x,ca[F+1]=ea.y,ca[F+2]=ea.z,ca[F+3]=ea.w,ca[F+4]=fa.x,ca[F+5]=fa.y,ca[F+6]=fa.z,ca[F+7]=fa.w,ca[F+8]=L.x,ca[F+9]=L.y,ca[F+10]=L.z,ca[F+11]=L.w,ca[F+12]=P.x,ca[F+13]=P.y,ca[F+14]=P.z,ca[F+15]=P.w,F+=16;e.bindBuffer(e.ARRAY_BUFFER,o.__webglTangentBuffer);e.bufferData(e.ARRAY_BUFFER,ca,H)}if(N&&s){j=0;for(q=M.length;j<q;j++)if(t=ba[M[j]],ca=t.vertexNormals,N=t.normal,ca.length===
- 3&&O)for(F=0;F<3;F++)N=ca[F],S[D]=N.x,S[D+1]=N.y,S[D+2]=N.z,D+=3;else for(F=0;F<3;F++)S[D]=N.x,S[D+1]=N.y,S[D+2]=N.z,D+=3;j=0;for(q=X.length;j<q;j++)if(t=ba[X[j]],ca=t.vertexNormals,N=t.normal,ca.length===4&&O)for(F=0;F<4;F++)N=ca[F],S[D]=N.x,S[D+1]=N.y,S[D+2]=N.z,D+=3;else for(F=0;F<4;F++)S[D]=N.x,S[D+1]=N.y,S[D+2]=N.z,D+=3;e.bindBuffer(e.ARRAY_BUFFER,o.__webglNormalBuffer);e.bufferData(e.ARRAY_BUFFER,S,H)}if(qa&&ua&&K){j=0;for(q=M.length;j<q;j++)if(D=M[j],D=ua[D],D!==void 0)for(F=0;F<3;F++)S=D[F],
- Z[T]=S.u,Z[T+1]=S.v,T+=2;j=0;for(q=X.length;j<q;j++)if(D=X[j],D=ua[D],D!==void 0)for(F=0;F<4;F++)S=D[F],Z[T]=S.u,Z[T+1]=S.v,T+=2;T>0&&(e.bindBuffer(e.ARRAY_BUFFER,o.__webglUVBuffer),e.bufferData(e.ARRAY_BUFFER,Z,H))}if(qa&&va&&K){j=0;for(q=M.length;j<q;j++)if(D=M[j],T=va[D],T!==void 0)for(F=0;F<3;F++)Z=T[F],r[ja]=Z.u,r[ja+1]=Z.v,ja+=2;j=0;for(q=X.length;j<q;j++)if(D=X[j],T=va[D],T!==void 0)for(F=0;F<4;F++)Z=T[F],r[ja]=Z.u,r[ja+1]=Z.v,ja+=2;ja>0&&(e.bindBuffer(e.ARRAY_BUFFER,o.__webglUV2Buffer),e.bufferData(e.ARRAY_BUFFER,
- r,H))}if(ta){j=0;for(q=M.length;j<q;j++)m[ga]=I,m[ga+1]=I+1,m[ga+2]=I+2,ga+=3,ia[da]=I,ia[da+1]=I+1,ia[da+2]=I,ia[da+3]=I+2,ia[da+4]=I+1,ia[da+5]=I+2,da+=6,I+=3;j=0;for(q=X.length;j<q;j++)m[ga]=I,m[ga+1]=I+1,m[ga+2]=I+3,m[ga+3]=I+1,m[ga+4]=I+2,m[ga+5]=I+3,ga+=6,ia[da]=I,ia[da+1]=I+1,ia[da+2]=I,ia[da+3]=I+3,ia[da+4]=I+1,ia[da+5]=I+2,ia[da+6]=I+2,ia[da+7]=I+3,da+=8,I+=4;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer);e.bufferData(e.ELEMENT_ARRAY_BUFFER,m,H);e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,
- o.__webglLineBuffer);e.bufferData(e.ELEMENT_ARRAY_BUFFER,ia,H)}if(J){F=0;for(I=J.length;F<I;F++)if(m=J[F],m.__original.needsUpdate){r=0;if(m.size===1)if(m.boundTo===void 0||m.boundTo==="vertices"){j=0;for(q=M.length;j<q;j++)t=ba[M[j]],m.array[r]=m.value[t.a],m.array[r+1]=m.value[t.b],m.array[r+2]=m.value[t.c],r+=3;j=0;for(q=X.length;j<q;j++)t=ba[X[j]],m.array[r]=m.value[t.a],m.array[r+1]=m.value[t.b],m.array[r+2]=m.value[t.c],m.array[r+3]=m.value[t.d],r+=4}else{if(m.boundTo==="faces"){j=0;for(q=M.length;j<
- q;j++)ia=m.value[M[j]],m.array[r]=ia,m.array[r+1]=ia,m.array[r+2]=ia,r+=3;j=0;for(q=X.length;j<q;j++)ia=m.value[X[j]],m.array[r]=ia,m.array[r+1]=ia,m.array[r+2]=ia,m.array[r+3]=ia,r+=4}}else if(m.size===2)if(m.boundTo===void 0||m.boundTo==="vertices"){j=0;for(q=M.length;j<q;j++)t=ba[M[j]],x=m.value[t.a],y=m.value[t.b],z=m.value[t.c],m.array[r]=x.x,m.array[r+1]=x.y,m.array[r+2]=y.x,m.array[r+3]=y.y,m.array[r+4]=z.x,m.array[r+5]=z.y,r+=6;j=0;for(q=X.length;j<q;j++)t=ba[X[j]],x=m.value[t.a],y=m.value[t.b],
- z=m.value[t.c],t=m.value[t.d],m.array[r]=x.x,m.array[r+1]=x.y,m.array[r+2]=y.x,m.array[r+3]=y.y,m.array[r+4]=z.x,m.array[r+5]=z.y,m.array[r+6]=t.x,m.array[r+7]=t.y,r+=8}else{if(m.boundTo==="faces"){j=0;for(q=M.length;j<q;j++)z=y=x=ia=m.value[M[j]],m.array[r]=x.x,m.array[r+1]=x.y,m.array[r+2]=y.x,m.array[r+3]=y.y,m.array[r+4]=z.x,m.array[r+5]=z.y,r+=6;j=0;for(q=X.length;j<q;j++)t=z=y=x=ia=m.value[X[j]],m.array[r]=x.x,m.array[r+1]=x.y,m.array[r+2]=y.x,m.array[r+3]=y.y,m.array[r+4]=z.x,m.array[r+5]=
- z.y,m.array[r+6]=t.x,m.array[r+7]=t.y,r+=8}}else if(m.size===3)if(s=m.type==="c"?["r","g","b"]:["x","y","z"],m.boundTo===void 0||m.boundTo==="vertices"){j=0;for(q=M.length;j<q;j++)t=ba[M[j]],x=m.value[t.a],y=m.value[t.b],z=m.value[t.c],m.array[r]=x[s[0]],m.array[r+1]=x[s[1]],m.array[r+2]=x[s[2]],m.array[r+3]=y[s[0]],m.array[r+4]=y[s[1]],m.array[r+5]=y[s[2]],m.array[r+6]=z[s[0]],m.array[r+7]=z[s[1]],m.array[r+8]=z[s[2]],r+=9;j=0;for(q=X.length;j<q;j++)t=ba[X[j]],x=m.value[t.a],y=m.value[t.b],z=m.value[t.c],
- t=m.value[t.d],m.array[r]=x[s[0]],m.array[r+1]=x[s[1]],m.array[r+2]=x[s[2]],m.array[r+3]=y[s[0]],m.array[r+4]=y[s[1]],m.array[r+5]=y[s[2]],m.array[r+6]=z[s[0]],m.array[r+7]=z[s[1]],m.array[r+8]=z[s[2]],m.array[r+9]=t[s[0]],m.array[r+10]=t[s[1]],m.array[r+11]=t[s[2]],r+=12}else{if(m.boundTo==="faces"){j=0;for(q=M.length;j<q;j++)z=y=x=ia=m.value[M[j]],m.array[r]=x[s[0]],m.array[r+1]=x[s[1]],m.array[r+2]=x[s[2]],m.array[r+3]=y[s[0]],m.array[r+4]=y[s[1]],m.array[r+5]=y[s[2]],m.array[r+6]=z[s[0]],m.array[r+
- 7]=z[s[1]],m.array[r+8]=z[s[2]],r+=9;j=0;for(q=X.length;j<q;j++)t=z=y=x=ia=m.value[X[j]],m.array[r]=x[s[0]],m.array[r+1]=x[s[1]],m.array[r+2]=x[s[2]],m.array[r+3]=y[s[0]],m.array[r+4]=y[s[1]],m.array[r+5]=y[s[2]],m.array[r+6]=z[s[0]],m.array[r+7]=z[s[1]],m.array[r+8]=z[s[2]],m.array[r+9]=t[s[0]],m.array[r+10]=t[s[1]],m.array[r+11]=t[s[2]],r+=12}}else if(m.size===4)if(m.boundTo===void 0||m.boundTo==="vertices"){j=0;for(q=M.length;j<q;j++)t=ba[M[j]],x=m.value[t.a],y=m.value[t.b],z=m.value[t.c],m.array[r]=
- x.x,m.array[r+1]=x.y,m.array[r+2]=x.z,m.array[r+3]=x.w,m.array[r+4]=y.x,m.array[r+5]=y.y,m.array[r+6]=y.z,m.array[r+7]=y.w,m.array[r+8]=z.x,m.array[r+9]=z.y,m.array[r+10]=z.z,m.array[r+11]=z.w,r+=12;j=0;for(q=X.length;j<q;j++)t=ba[X[j]],x=m.value[t.a],y=m.value[t.b],z=m.value[t.c],t=m.value[t.d],m.array[r]=x.x,m.array[r+1]=x.y,m.array[r+2]=x.z,m.array[r+3]=x.w,m.array[r+4]=y.x,m.array[r+5]=y.y,m.array[r+6]=y.z,m.array[r+7]=y.w,m.array[r+8]=z.x,m.array[r+9]=z.y,m.array[r+10]=z.z,m.array[r+11]=z.w,
- m.array[r+12]=t.x,m.array[r+13]=t.y,m.array[r+14]=t.z,m.array[r+15]=t.w,r+=16}else if(m.boundTo==="faces"){j=0;for(q=M.length;j<q;j++)z=y=x=ia=m.value[M[j]],m.array[r]=x.x,m.array[r+1]=x.y,m.array[r+2]=x.z,m.array[r+3]=x.w,m.array[r+4]=y.x,m.array[r+5]=y.y,m.array[r+6]=y.z,m.array[r+7]=y.w,m.array[r+8]=z.x,m.array[r+9]=z.y,m.array[r+10]=z.z,m.array[r+11]=z.w,r+=12;j=0;for(q=X.length;j<q;j++)t=z=y=x=ia=m.value[X[j]],m.array[r]=x.x,m.array[r+1]=x.y,m.array[r+2]=x.z,m.array[r+3]=x.w,m.array[r+4]=y.x,
- m.array[r+5]=y.y,m.array[r+6]=y.z,m.array[r+7]=y.w,m.array[r+8]=z.x,m.array[r+9]=z.y,m.array[r+10]=z.z,m.array[r+11]=z.w,m.array[r+12]=t.x,m.array[r+13]=t.y,m.array[r+14]=t.z,m.array[r+15]=t.w,r+=16}e.bindBuffer(e.ARRAY_BUFFER,m.buffer);e.bufferData(e.ARRAY_BUFFER,m.array,H)}}aa&&(delete o.__inittedArrays,delete o.__colorArray,delete o.__normalArray,delete o.__tangentArray,delete o.__uvArray,delete o.__uv2Array,delete o.__faceArray,delete o.__vertexArray,delete o.__lineArray,delete o.__skinVertexAArray,
- delete o.__skinVertexBArray,delete o.__skinIndexArray,delete o.__skinWeightArray)}}p.__dirtyVertices=!1;p.__dirtyMorphTargets=!1;p.__dirtyElements=!1;p.__dirtyUvs=!1;p.__dirtyNormals=!1;p.__dirtyColors=!1;p.__dirtyTangents=!1;n.attributes&&u(n)}else if(ma instanceof THREE.Ribbon){if(p.__dirtyVertices||p.__dirtyColors){n=p;ma=e.DYNAMIC_DRAW;s=A=s=aa=aa=void 0;Y=n.vertices;B=n.colors;j=Y.length;o=B.length;q=n.__vertexArray;H=n.__colorArray;J=n.__dirtyColors;if(n.__dirtyVertices){for(aa=0;aa<j;aa++)s=
- Y[aa].position,A=aa*3,q[A]=s.x,q[A+1]=s.y,q[A+2]=s.z;e.bindBuffer(e.ARRAY_BUFFER,n.__webglVertexBuffer);e.bufferData(e.ARRAY_BUFFER,q,ma)}if(J){for(aa=0;aa<o;aa++)s=B[aa],A=aa*3,H[A]=s.r,H[A+1]=s.g,H[A+2]=s.b;e.bindBuffer(e.ARRAY_BUFFER,n.__webglColorBuffer);e.bufferData(e.ARRAY_BUFFER,H,ma)}}p.__dirtyVertices=!1;p.__dirtyColors=!1}else if(ma instanceof THREE.Line){n=c(ma,o);H=n.attributes&&w(n);if(p.__dirtyVertices||p.__dirtyColors||H){ma=p;A=e.DYNAMIC_DRAW;j=B=O=Y=K=void 0;Y=ma.vertices;o=ma.colors;
- j=Y.length;H=o.length;q=ma.__vertexArray;aa=ma.__colorArray;J=ma.__dirtyColors;s=ma.__webglCustomAttributesList;I=ba=X=M=O=K=void 0;if(ma.__dirtyVertices){for(K=0;K<j;K++)O=Y[K].position,B=K*3,q[B]=O.x,q[B+1]=O.y,q[B+2]=O.z;e.bindBuffer(e.ARRAY_BUFFER,ma.__webglVertexBuffer);e.bufferData(e.ARRAY_BUFFER,q,A)}if(J){for(Y=0;Y<H;Y++)j=o[Y],B=Y*3,aa[B]=j.r,aa[B+1]=j.g,aa[B+2]=j.b;e.bindBuffer(e.ARRAY_BUFFER,ma.__webglColorBuffer);e.bufferData(e.ARRAY_BUFFER,aa,A)}if(s){K=0;for(O=s.length;K<O;K++)if(I=
- s[K],I.needsUpdate&&(I.boundTo===void 0||I.boundTo==="vertices")){B=0;X=I.value.length;if(I.size===1)for(M=0;M<X;M++)I.array[M]=I.value[M];else if(I.size===2)for(M=0;M<X;M++)ba=I.value[M],I.array[B]=ba.x,I.array[B+1]=ba.y,B+=2;else if(I.size===3)if(I.type==="c")for(M=0;M<X;M++)ba=I.value[M],I.array[B]=ba.r,I.array[B+1]=ba.g,I.array[B+2]=ba.b,B+=3;else for(M=0;M<X;M++)ba=I.value[M],I.array[B]=ba.x,I.array[B+1]=ba.y,I.array[B+2]=ba.z,B+=3;else if(I.size===4)for(M=0;M<X;M++)ba=I.value[M],I.array[B]=
- ba.x,I.array[B+1]=ba.y,I.array[B+2]=ba.z,I.array[B+3]=ba.w,B+=4;e.bindBuffer(e.ARRAY_BUFFER,I.buffer);e.bufferData(e.ARRAY_BUFFER,I.array,A)}}}p.__dirtyVertices=!1;p.__dirtyColors=!1;n.attributes&&u(n)}else if(ma instanceof THREE.ParticleSystem)n=c(ma,o),H=n.attributes&&w(n),(p.__dirtyVertices||p.__dirtyColors||ma.sortParticles||H)&&h(p,e.DYNAMIC_DRAW,ma),p.__dirtyVertices=!1,p.__dirtyColors=!1,n.attributes&&u(n)};this.initMaterial=function(a,b,c,d){var f,g,h,i;a instanceof THREE.MeshDepthMaterial?
- i="depth":a instanceof THREE.MeshNormalMaterial?i="normal":a instanceof THREE.MeshBasicMaterial?i="basic":a instanceof THREE.MeshLambertMaterial?i="lambert":a instanceof THREE.MeshPhongMaterial?i="phong":a instanceof THREE.LineBasicMaterial?i="basic":a instanceof THREE.ParticleBasicMaterial&&(i="particle_basic");if(i){var k=THREE.ShaderLib[i];a.uniforms=THREE.UniformsUtils.clone(k.uniforms);a.vertexShader=k.vertexShader;a.fragmentShader=k.fragmentShader}var l,n,p;l=p=k=0;for(n=b.length;l<n;l++)h=
- b[l],h instanceof THREE.SpotLight&&p++,h instanceof THREE.DirectionalLight&&p++,h instanceof THREE.PointLight&&k++;k+p<=wa?l=p:(l=Math.ceil(wa*p/(k+p)),k=wa-l);h={directional:l,point:k};k=p=0;for(l=b.length;k<l;k++)n=b[k],n instanceof THREE.SpotLight&&n.castShadow&&p++;var j=50;if(d!==void 0&&d instanceof THREE.SkinnedMesh)j=d.bones.length;var q;a:{l=a.fragmentShader;n=a.vertexShader;var k=a.uniforms,b=a.attributes,c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,vertexColors:a.vertexColors,
- fog:c,useFog:a.fog,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,morphTargets:a.morphTargets,maxMorphTargets:this.maxMorphTargets,maxDirLights:h.directional,maxPointLights:h.point,maxBones:j,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapSoft:this.shadowMapSoft,shadowMapWidth:this.shadowMapWidth,shadowMapHeight:this.shadowMapHeight,maxShadows:p,alphaTest:a.alphaTest,metal:a.metal,perPixel:a.perPixel},u,d=[];i?d.push(i):(d.push(l),d.push(n));for(u in c)d.push(u),d.push(c[u]);
- i=d.join();u=0;for(d=Aa.length;u<d;u++)if(Aa[u].code===i){q=Aa[u].program;break a}u=e.createProgram();d=[Ma?"#define VERTEX_TEXTURES":"",E.gammaInput?"#define GAMMA_INPUT":"",E.gammaOutput?"#define GAMMA_OUTPUT":"",E.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?
- "#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
- h=["#ifdef GL_ES","precision "+ua+" float;","#endif","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",E.gammaInput?"#define GAMMA_INPUT":"",E.gammaOutput?"#define GAMMA_OUTPUT":"",E.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":
- "",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapSoft?"#define SHADOWMAP_WIDTH "+c.shadowMapWidth.toFixed(1):"",c.shadowMapSoft?"#define SHADOWMAP_HEIGHT "+c.shadowMapHeight.toFixed(1):"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");e.attachShader(u,ga("fragment",h+l));e.attachShader(u,
- ga("vertex",d+n));e.linkProgram(u);e.getProgramParameter(u,e.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+e.getProgramParameter(u,e.VALIDATE_STATUS)+", gl error ["+e.getError()+"]");u.uniforms={};u.attributes={};var w,d=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","boneGlobalMatrices","morphTargetInfluences"];for(w in k)d.push(w);w=d;d=0;for(k=w.length;d<k;d++)l=w[d],u.uniforms[l]=e.getUniformLocation(u,
- l);d=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];for(w=0;w<c.maxMorphTargets;w++)d.push("morphTarget"+w);for(q in b)d.push(q);q=d;w=0;for(b=q.length;w<b;w++)c=q[w],u.attributes[c]=e.getAttribLocation(u,c);u.id=Aa.length;Aa.push({program:u,code:i});E.info.memory.programs=Aa.length;q=u}a.program=q;q=a.program.attributes;q.position>=0&&e.enableVertexAttribArray(q.position);q.color>=0&&e.enableVertexAttribArray(q.color);q.normal>=0&&e.enableVertexAttribArray(q.normal);
- q.tangent>=0&&e.enableVertexAttribArray(q.tangent);a.skinning&&q.skinVertexA>=0&&q.skinVertexB>=0&&q.skinIndex>=0&&q.skinWeight>=0&&(e.enableVertexAttribArray(q.skinVertexA),e.enableVertexAttribArray(q.skinVertexB),e.enableVertexAttribArray(q.skinIndex),e.enableVertexAttribArray(q.skinWeight));if(a.attributes)for(g in a.attributes)q[g]!==void 0&&q[g]>=0&&e.enableVertexAttribArray(q[g]);if(a.morphTargets)for(g=a.numSupportedMorphTargets=0;g<this.maxMorphTargets;g++)w="morphTarget"+g,q[w]>=0&&(e.enableVertexAttribArray(q[w]),
- a.numSupportedMorphTargets++);a.uniformsList=[];for(f in a.uniforms)a.uniformsList.push([a.uniforms[f],f])};this.setFaceCulling=function(a,b){a?(!b||b==="ccw"?e.frontFace(e.CCW):e.frontFace(e.CW),a==="back"?e.cullFace(e.BACK):a==="front"?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK),e.enable(e.CULL_FACE)):e.disable(e.CULL_FACE)};this.setObjectFaces=function(a){if(xa!==a.doubleSided)a.doubleSided?e.disable(e.CULL_FACE):e.enable(e.CULL_FACE),xa=a.doubleSided;if(Z!==a.flipSided)a.flipSided?e.frontFace(e.CW):
- e.frontFace(e.CCW),Z=a.flipSided};this.setDepthTest=function(a){sa!==a&&(a?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),sa=a)};this.setBlending=function(a){if(a!==oa){switch(a){case THREE.AdditiveBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.SRC_ALPHA,e.ONE);break;case THREE.SubtractiveBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:e.blendEquation(e.FUNC_ADD);e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:e.blendEquationSeparate(e.FUNC_ADD,
- e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)}oa=a}};this.setTexture=function(a,b){if(a.needsUpdate){if(!a.__webglInit)a.__webglInit=!0,a.__webglTexture=e.createTexture(),E.info.memory.textures++;e.activeTexture(e.TEXTURE0+b);e.bindTexture(e.TEXTURE_2D,a.__webglTexture);var c=K(e.TEXTURE_2D,a,a.image);a instanceof THREE.DataTexture?e.texImage2D(e.TEXTURE_2D,0,O(a.format),a.image.width,a.image.height,0,O(a.format),e.UNSIGNED_BYTE,a.image.data):e.texImage2D(e.TEXTURE_2D,
- 0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,a.image);c&&e.generateMipmap(e.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdated)a.onUpdated()}else e.activeTexture(e.TEXTURE0+b),e.bindTexture(e.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=!0;if(a.stencilBuffer===void 0)a.stencilBuffer=!0;a.__webglTexture=e.createTexture();if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];e.bindTexture(e.TEXTURE_CUBE_MAP,
- a.__webglTexture);K(e.TEXTURE_CUBE_MAP,a,a);for(var c=0;c<6;c++){a.__webglFramebuffer[c]=e.createFramebuffer();a.__webglRenderbuffer[c]=e.createRenderbuffer();e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,O(a.format),a.width,a.height,0,O(a.format),O(a.type),null);var d=a,f=e.TEXTURE_CUBE_MAP_POSITIVE_X+c;e.bindFramebuffer(e.FRAMEBUFFER,a.__webglFramebuffer[c]);e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,f,d.__webglTexture,0);P(a.__webglRenderbuffer[c],a)}}else a.__webglFramebuffer=e.createFramebuffer(),
- a.__webglRenderbuffer=e.createRenderbuffer(),e.bindTexture(e.TEXTURE_2D,a.__webglTexture),K(e.TEXTURE_2D,a,a),e.texImage2D(e.TEXTURE_2D,0,O(a.format),a.width,a.height,0,O(a.format),O(a.type),null),c=e.TEXTURE_2D,e.bindFramebuffer(e.FRAMEBUFFER,a.__webglFramebuffer),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,c,a.__webglTexture,0),P(a.__webglRenderbuffer,a);b?e.bindTexture(e.TEXTURE_CUBE_MAP,null):e.bindTexture(e.TEXTURE_2D,null);e.bindRenderbuffer(e.RENDERBUFFER,null);e.bindFramebuffer(e.FRAMEBUFFER,
- null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,f=d=0):(b=null,c=Ga,a=Ha,d=Ia,f=Ja);b!==na&&(e.bindFramebuffer(e.FRAMEBUFFER,b),e.viewport(d,f,c,a),na=b)};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};
- THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=c.wrapS!==void 0?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=c.wrapT!==void 0?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=c.magFilter!==void 0?c.magFilter:THREE.LinearFilter;this.minFilter=c.minFilter!==void 0?c.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=c.format!==void 0?c.format:THREE.RGBAFormat;this.type=c.type!==void 0?c.type:
- THREE.UnsignedByteType;this.depthBuffer=c.depthBuffer!==void 0?c.depthBuffer:!0;this.stencilBuffer=c.stencilBuffer!==void 0?c.stencilBuffer:!0};
- THREE.WebGLRenderTarget.prototype.clone=function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;return a};THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};
- THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;
|