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