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