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