From 1ff8d2ab159d1d70968ca12a7c82785ef6c1307d Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 24 Dec 2019 03:04:55 +0000 Subject: [PATCH] Updated builds. --- build/three.js | 5 + build/three.min.js | 232 +++++++++++++++++++++--------------------- build/three.module.js | 5 + 3 files changed, 126 insertions(+), 116 deletions(-) diff --git a/build/three.js b/build/three.js index e55932af46..c9db0f7601 100644 --- a/build/three.js +++ b/build/three.js @@ -24772,6 +24772,7 @@ program = programCache.acquireProgram( material, materialProperties.shader, parameters, programCacheKey ); materialProperties.program = program; + materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null; materialProperties.outputEncoding = _this.outputEncoding; material.program = program; @@ -24899,6 +24900,10 @@ material.needsUpdate = true; + } else if ( materialProperties.environment !== environment ) { + + material.needsUpdate = true; + } else if ( materialProperties.needsLights && ( materialProperties.lightsStateVersion !== lights.state.version ) ) { material.needsUpdate = true; diff --git a/build/three.min.js b/build/three.min.js index 286a61bebd..8f4fabff35 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -175,122 +175,122 @@ var e=ta.update(a),f=a.material;f.visible&&G.push(a,e,f,c,Ib.z,null)}}else if(a. e.groups,k=0,m=g.length;kf.matrixWorld.determinant(),l=h(a,c,e,f);Z.setMaterial(e,k);var m=!1;if(b!==d.id||da!==l.id||ha!==(!0===e.wireframe))b=d.id,da=l.id,ha=!0===e.wireframe,m=!0;if(e.morphTargets||e.morphNormals)Aa.update(f,d,e,l),m=!0;a=d.index;c=d.attributes.position;if(null===a){if(void 0===c||0===c.count)return}else if(0===a.count)return;var p=1;!0===e.wireframe&&(a=za.getWireframeAttribute(d),p=2);k=Ba;if(null!==a){var v=ma.get(a);k=Da;k.setIndex(v)}if(m){if(!1!== -Ha.isWebGL2||!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==sa.get("ANGLE_instanced_arrays")){Z.initAttributes();m=d.attributes;l=l.getAttributes();var q=e.defaultAttributeValues;for(x in l){var r=l[x];if(0<=r){var t=m[x];if(void 0!==t){var n=t.normalized,u=t.itemSize,z=ma.get(t);if(void 0!==z){var w=z.buffer,A=z.type;z=z.bytesPerElement;if(t.isInterleavedBufferAttribute){var B=t.data,U=B.stride;t=t.offset;B&&B.isInstancedInterleavedBuffer?(Z.enableAttributeAndDivisor(r,B.meshPerAttribute), -void 0===d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):Z.enableAttribute(r);H.bindBuffer(34962,w);H.vertexAttribPointer(r,u,A,n,U*z,t*z)}else t.isInstancedBufferAttribute?(Z.enableAttributeAndDivisor(r,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):Z.enableAttribute(r),H.bindBuffer(34962,w),H.vertexAttribPointer(r,u,A,n,0,0)}}else if("instanceMatrix"===x)z=ma.get(f.instanceMatrix),void 0!==z&&(w=z.buffer,A=z.type,Z.enableAttributeAndDivisor(r+ -0,1),Z.enableAttributeAndDivisor(r+1,1),Z.enableAttributeAndDivisor(r+2,1),Z.enableAttributeAndDivisor(r+3,1),H.bindBuffer(34962,w),H.vertexAttribPointer(r+0,4,A,!1,64,0),H.vertexAttribPointer(r+1,4,A,!1,64,16),H.vertexAttribPointer(r+2,4,A,!1,64,32),H.vertexAttribPointer(r+3,4,A,!1,64,48));else if(void 0!==q&&(n=q[x],void 0!==n))switch(n.length){case 2:H.vertexAttrib2fv(r,n);break;case 3:H.vertexAttrib3fv(r,n);break;case 4:H.vertexAttrib4fv(r,n);break;default:H.vertexAttrib1fv(r,n)}}}Z.disableUnusedAttributes()}null!== -a&&H.bindBuffer(34963,v.buffer)}var x=d.drawRange.start*p;m=null!==g?g.start*p:0;v=Math.max(x,m);g=Math.max(0,Math.min(null!==a?a.count:c.count,x+d.drawRange.count*p,m+(null!==g?g.count*p:Infinity))-1-v+1);0!==g&&(f.isMesh?!0===e.wireframe?(Z.setLineWidth(e.wireframeLinewidth*(null===N?R:1)),k.setMode(1)):k.setMode(4):f.isLine?(e=e.linewidth,void 0===e&&(e=1),Z.setLineWidth(e*(null===N?R:1)),f.isLineSegments?k.setMode(1):f.isLineLoop?k.setMode(2):k.setMode(3)):f.isPoints?k.setMode(0):f.isSprite&& -k.setMode(4),f.isInstancedMesh?k.renderInstances(d,v,g,f.count):d.isInstancedBufferGeometry?k.renderInstances(d,v,g,d.maxInstancedCount):k.render(v,g))};this.compile=function(a,b){F=va.get(a,b);F.init();a.traverse(function(a){a.isLight&&(F.pushLight(a),a.castShadow&&F.pushShadow(a))});F.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=0;ce.far||f.push({distance:a,distanceToRay:Math.sqrt(k),point:c,index:b,face:null,object:g}))}function tg(a,b,c,d,e,f,g,k,l){T.call(this,a,b,c,d,e,f,g,k,l);this.format=void 0!==g?g:1022;this.minFilter=void 0!==f?f:1006;this.magFilter=void 0!==e?e:1006;this.generateMipmaps=!1}function Pc(a,b,c,d,e,f,g,k,l,m,h,p){T.call(this,null,f,g,k,l,m,d,e,h,p);this.image= -{width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Ud(a,b,c,d,e,f,g,k,l){T.call(this,a,b,c,d,e,f,g,k,l);this.needsUpdate=!0}function Vd(a,b,c,d,e,f,g,k,l,m){m=void 0!==m?m:1026;if(1026!==m&&1027!==m)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);T.call(this,null,d,e,f,g,k,m,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!== -k?k:1003;this.generateMipmaps=this.flipY=!1}function Qc(a){G.call(this);this.type="WireframeGeometry";var b=[],c,d,e,f=[0,0],g={},k=["a","b","c"];if(a&&a.isGeometry){var l=a.faces;var m=0;for(d=l.length;mc;c++){var p=h[k[c]];var q=h[k[(c+1)%3]];f[0]=Math.min(p,q);f[1]=Math.max(p,q);p=f[0]+","+f[1];void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]})}}for(p in g)m=g[p],k=a.vertices[m.index1],b.push(k.x,k.y,k.z),k=a.vertices[m.index2],b.push(k.x,k.y,k.z)}else if(a&&a.isBufferGeometry)if(k= -new n,null!==a.index){l=a.attributes.position;h=a.index;var t=a.groups;0===t.length&&(t=[{start:0,count:h.count,materialIndex:0}]);a=0;for(e=t.length;ac;c++)p=h.getX(m+c),q=h.getX(m+(c+1)%3),f[0]=Math.min(p,q),f[1]=Math.max(p,q),p=f[0]+","+f[1],void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]});for(p in g)m=g[p],k.fromBufferAttribute(l,m.index1),b.push(k.x,k.y,k.z),k.fromBufferAttribute(l,m.index2),b.push(k.x,k.y,k.z)}else for(l=a.attributes.position, -m=0,d=l.count/3;mc;c++)g=3*m+c,k.fromBufferAttribute(l,g),b.push(k.x,k.y,k.z),g=3*m+(c+1)%3,k.fromBufferAttribute(l,g),b.push(k.x,k.y,k.z);this.setAttribute("position",new C(b,3))}function Wd(a,b,c){M.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Rc(a,b,c));this.mergeVertices()}function Rc(a,b,c){G.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],k= -new n,l=new n,m=new n,h=new n,p=new n,q,t;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var r=b+1;for(q=0;q<=c;q++){var u=q/c;for(t=0;t<=b;t++){var z=t/b;a(z,u,l);e.push(l.x,l.y,l.z);0<=z-1E-5?(a(z-1E-5,u,m),h.subVectors(l,m)):(a(z+1E-5,u,m),h.subVectors(m,l));0<=u-1E-5?(a(z,u-1E-5,m),p.subVectors(l,m)):(a(z,u+1E-5,m),p.subVectors(m,l));k.crossVectors(h,p).normalize();f.push(k.x,k.y,k.z);g.push(z,u)}}for(q=0;qd&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}G.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var k=[],l=[];(function(a){for(var c=new n,d=new n,g=new n,k=0;ke&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.setAttribute("position", -new C(k,3));this.setAttribute("normal",new C(k.slice(),3));this.setAttribute("uv",new C(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Yd(a,b){M.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Sc(a,b));this.mergeVertices()}function Sc(a,b){Ga.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Zd(a,b){M.call(this); -this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ec(a,b));this.mergeVertices()}function ec(a,b){Ga.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function $d(a,b){M.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Tc(a,b));this.mergeVertices()}function Tc(a,b){var c= -(1+Math.sqrt(5))/2;Ga.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function ae(a,b){M.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Uc(a,b));this.mergeVertices()}function Uc(a,b){var c= -(1+Math.sqrt(5))/2,d=1/c;Ga.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters= -{radius:a,detail:b}}function be(a,b,c,d,e,f){M.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new fc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function fc(a,b,c,d,e){function f(e){h=a.getPointAt(e/b,h);var f=g.normals[e];e=g.binormals[e];for(q=0;q<=d;q++){var m=q/d*Math.PI* -2,p=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+p*e.x;l.y=m*f.y+p*e.y;l.z=m*f.z+p*e.z;l.normalize();r.push(l.x,l.y,l.z);k.x=h.x+c*l.x;k.y=h.y+c*l.y;k.z=h.z+c*l.z;t.push(k.x,k.y,k.z)}}G.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var k=new n,l=new n,m=new x,h=new n,p,q,t=[],r=[],u=[],z=[];for(p= -0;p=b;e-=d)f=$h(e,a[e],a[e+1],f);f&&gc(f,f.next)&&(ee(f),f=f.next);return f}function fe(a,b){if(!a)return a; -b||(b=a);do{var c=!1;if(a.steiner||!gc(a,a.next)&&0!==ta(a.prev,a,a.next))a=a.next;else{ee(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function ge(a,b,c,d,e,f,g){if(a){if(!g&&f){var k=a,l=k;do null===l.z&&(l.z=ug(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==k);l.prevZ.nextZ=null;l.prevZ=null;k=l;var m,h,p,q,t=1;do{l=k;var r=k=null;for(h=0;l;){h++;var n=l;for(m=p=0;mn!==r.next.y>n&&r.next.y!==r.y&&p<(r.next.x- -r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(h=!h),r=r.next;while(r!==l);r=h}l=r}if(l){a=bi(g,k);g=fe(g,g.next);a=fe(a,a.next);ge(g,b,c,d,e,f);ge(a,b,c,d,e,f);break a}k=k.next}g=g.next}while(g!==a)}break}}}}function Hk(a,b,c,d){var e=a.prev,f=a.next;if(0<=ta(e,a,f))return!1;var g=e.x>a.x?e.x>f.x?e.x:f.x:a.x>f.x?a.x:f.x,k=e.y>a.y?e.y>f.y?e.y:f.y:a.y>f.y?a.y:f.y,l=ug(e.x=l&&d&&d.z<= -b;){if(c!==a.prev&&c!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ta(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ta(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ta(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<=b;){if(d!==a.prev&&d!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ta(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function Ik(a,b){return a.x-b.x} -function Jk(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var k=c.x=c.x&&c.x>=g&&d!==c.x&&Xc(ek.x)&&he(c,a)&&(k=c,m=h)}c= -c.next}return k}function ug(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function Kk(a){var b=a,c=a;do{if(b.xta(a.prev,a,a.next)?0<=ta(a,b,a.next)&&0<=ta(a,a.prev,b):0>ta(a,b,a.prev)||0>ta(a,a.next,b)}function bi(a,b){var c=new vg(a.i,a.x,a.y),d=new vg(b.i,b.x,b.y),e=a.next,f=b.prev;a.next=b;b.prev=a;c.next=e;e.prev=c;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function $h(a,b,c,d){a=new vg(a, -b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function ee(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function vg(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function ci(a){var b=a.length;2Number.EPSILON){var l=Math.sqrt(k),m=Math.sqrt(f*f+g*g);k=b.x-e/l;b=b.y+d/l;g=((c.x-g/m-k)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=k+d*g-a.x;d=b+e*g-a.y;e=f*f+ -d*d;if(2>=e)return new x(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(k)):(f=d,d=e,e=Math.sqrt(k/2));return new x(f/e,d/e)}function k(a,b){for(J=a.length;0<=--J;){var c=J;var f=J-1;0>f&&(f=a.length-1);var g,k=B+2*C;for(g=0;gh;h++){var p=m[f[h]];var q=m[f[(h+1)%3]];d[0]=Math.min(p,q);d[1]=Math.max(p,q);p=d[0]+","+d[1];void 0===e[p]?e[p]={index1:d[0],index2:d[1],face1:k,face2:void 0}:e[p].face2=k}for(p in e)if(d=e[p],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<= -b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.setAttribute("position",new C(c,3))}function lc(a,b,c,d,e,f,g,k){M.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:k};this.fromBufferGeometry(new ub(a,b,c,d,e,f,g,k));this.mergeVertices()}function ub(a,b,c,d,e,f,g,k){function l(c){var e,f=new x,l=new n,v=0,u=!0===c?a:b,B=!0===c?1:-1;var y=r;for(e=1;e<=d;e++)p.push(0, -z*B,0),q.push(0,B,0),t.push(.5,.5),r++;var F=r;for(e=0;e<=d;e++){var C=e/d*k+g,G=Math.cos(C);C=Math.sin(C);l.x=u*C;l.y=z*B;l.z=u*G;p.push(l.x,l.y,l.z);q.push(0,B,0);f.x=.5*G+.5;f.y=.5*C*B+.5;t.push(f.x,f.y);r++}for(e=0;ef.matrixWorld.determinant(),l=h(a,c,e,f);Z.setMaterial(e,k);var m=!1;if(b!==d.id||da!==l.id||ha!==(!0===e.wireframe))b=d.id,da=l.id,ha=!0===e.wireframe,m=!0;if(e.morphTargets||e.morphNormals)Aa.update(f,d,e,l),m=!0;a=d.index;c=d.attributes.position;if(null===a){if(void 0===c||0===c.count)return}else if(0===a.count)return;var p=1;!0===e.wireframe&&(a=za.getWireframeAttribute(d),p=2); +k=Ba;if(null!==a){var v=ma.get(a);k=Da;k.setIndex(v)}if(m){if(!1!==Ha.isWebGL2||!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==sa.get("ANGLE_instanced_arrays")){Z.initAttributes();m=d.attributes;l=l.getAttributes();var q=e.defaultAttributeValues;for(x in l){var r=l[x];if(0<=r){var t=m[x];if(void 0!==t){var n=t.normalized,u=t.itemSize,z=ma.get(t);if(void 0!==z){var w=z.buffer,A=z.type;z=z.bytesPerElement;if(t.isInterleavedBufferAttribute){var B=t.data,U=B.stride;t=t.offset;B&&B.isInstancedInterleavedBuffer? +(Z.enableAttributeAndDivisor(r,B.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):Z.enableAttribute(r);H.bindBuffer(34962,w);H.vertexAttribPointer(r,u,A,n,U*z,t*z)}else t.isInstancedBufferAttribute?(Z.enableAttributeAndDivisor(r,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):Z.enableAttribute(r),H.bindBuffer(34962,w),H.vertexAttribPointer(r,u,A,n,0,0)}}else if("instanceMatrix"===x)z=ma.get(f.instanceMatrix), +void 0!==z&&(w=z.buffer,A=z.type,Z.enableAttributeAndDivisor(r+0,1),Z.enableAttributeAndDivisor(r+1,1),Z.enableAttributeAndDivisor(r+2,1),Z.enableAttributeAndDivisor(r+3,1),H.bindBuffer(34962,w),H.vertexAttribPointer(r+0,4,A,!1,64,0),H.vertexAttribPointer(r+1,4,A,!1,64,16),H.vertexAttribPointer(r+2,4,A,!1,64,32),H.vertexAttribPointer(r+3,4,A,!1,64,48));else if(void 0!==q&&(n=q[x],void 0!==n))switch(n.length){case 2:H.vertexAttrib2fv(r,n);break;case 3:H.vertexAttrib3fv(r,n);break;case 4:H.vertexAttrib4fv(r, +n);break;default:H.vertexAttrib1fv(r,n)}}}Z.disableUnusedAttributes()}null!==a&&H.bindBuffer(34963,v.buffer)}var x=d.drawRange.start*p;m=null!==g?g.start*p:0;v=Math.max(x,m);g=Math.max(0,Math.min(null!==a?a.count:c.count,x+d.drawRange.count*p,m+(null!==g?g.count*p:Infinity))-1-v+1);0!==g&&(f.isMesh?!0===e.wireframe?(Z.setLineWidth(e.wireframeLinewidth*(null===N?R:1)),k.setMode(1)):k.setMode(4):f.isLine?(e=e.linewidth,void 0===e&&(e=1),Z.setLineWidth(e*(null===N?R:1)),f.isLineSegments?k.setMode(1): +f.isLineLoop?k.setMode(2):k.setMode(3)):f.isPoints?k.setMode(0):f.isSprite&&k.setMode(4),f.isInstancedMesh?k.renderInstances(d,v,g,f.count):d.isInstancedBufferGeometry?k.renderInstances(d,v,g,d.maxInstancedCount):k.render(v,g))};this.compile=function(a,b){F=va.get(a,b);F.init();a.traverse(function(a){a.isLight&&(F.pushLight(a),a.castShadow&&F.pushShadow(a))});F.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=0;ce.far||f.push({distance:a,distanceToRay:Math.sqrt(k),point:c,index:b,face:null,object:g}))}function tg(a,b,c,d,e,f,g,k,l){T.call(this,a,b,c,d,e,f,g,k,l);this.format=void 0!==g?g:1022;this.minFilter=void 0!==f?f:1006;this.magFilter=void 0!==e? +e:1006;this.generateMipmaps=!1}function Pc(a,b,c,d,e,f,g,k,l,m,h,p){T.call(this,null,f,g,k,l,m,d,e,h,p);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Ud(a,b,c,d,e,f,g,k,l){T.call(this,a,b,c,d,e,f,g,k,l);this.needsUpdate=!0}function Vd(a,b,c,d,e,f,g,k,l,m){m=void 0!==m?m:1026;if(1026!==m&&1027!==m)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);T.call(this, +null,d,e,f,g,k,m,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==k?k:1003;this.generateMipmaps=this.flipY=!1}function Qc(a){G.call(this);this.type="WireframeGeometry";var b=[],c,d,e,f=[0,0],g={},k=["a","b","c"];if(a&&a.isGeometry){var l=a.faces;var m=0;for(d=l.length;mc;c++){var p=h[k[c]];var q=h[k[(c+1)%3]];f[0]=Math.min(p,q);f[1]=Math.max(p,q);p=f[0]+","+f[1];void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]})}}for(p in g)m=g[p], +k=a.vertices[m.index1],b.push(k.x,k.y,k.z),k=a.vertices[m.index2],b.push(k.x,k.y,k.z)}else if(a&&a.isBufferGeometry)if(k=new n,null!==a.index){l=a.attributes.position;h=a.index;var t=a.groups;0===t.length&&(t=[{start:0,count:h.count,materialIndex:0}]);a=0;for(e=t.length;ac;c++)p=h.getX(m+c),q=h.getX(m+(c+1)%3),f[0]=Math.min(p,q),f[1]=Math.max(p,q),p=f[0]+","+f[1],void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]});for(p in g)m=g[p],k.fromBufferAttribute(l, +m.index1),b.push(k.x,k.y,k.z),k.fromBufferAttribute(l,m.index2),b.push(k.x,k.y,k.z)}else for(l=a.attributes.position,m=0,d=l.count/3;mc;c++)g=3*m+c,k.fromBufferAttribute(l,g),b.push(k.x,k.y,k.z),g=3*m+(c+1)%3,k.fromBufferAttribute(l,g),b.push(k.x,k.y,k.z);this.setAttribute("position",new C(b,3))}function Wd(a,b,c){M.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Rc(a,b,c));this.mergeVertices()}function Rc(a,b,c){G.call(this); +this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],k=new n,l=new n,m=new n,h=new n,p=new n,q,t;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var r=b+1;for(q=0;q<=c;q++){var u=q/c;for(t=0;t<=b;t++){var z=t/b;a(z,u,l);e.push(l.x,l.y,l.z);0<=z-1E-5?(a(z-1E-5,u,m),h.subVectors(l,m)):(a(z+1E-5,u,m),h.subVectors(m,l));0<=u-1E-5?(a(z,u-1E-5,m),p.subVectors(l,m)):(a(z,u+1E-5,m),p.subVectors(m, +l));k.crossVectors(h,p).normalize();f.push(k.x,k.y,k.z);g.push(z,u)}}for(q=0;qd&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}G.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var k=[],l=[];(function(a){for(var c=new n,d=new n,g=new n,k=0;ke&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.setAttribute("position",new C(k,3));this.setAttribute("normal",new C(k.slice(),3));this.setAttribute("uv",new C(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Yd(a,b){M.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Sc(a,b));this.mergeVertices()}function Sc(a,b){Ga.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b); +this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Zd(a,b){M.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ec(a,b));this.mergeVertices()}function ec(a,b){Ga.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function $d(a,b){M.call(this);this.type="IcosahedronGeometry";this.parameters= +{radius:a,detail:b};this.fromBufferGeometry(new Tc(a,b));this.mergeVertices()}function Tc(a,b){var c=(1+Math.sqrt(5))/2;Ga.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function ae(a,b){M.call(this);this.type="DodecahedronGeometry";this.parameters= +{radius:a,detail:b};this.fromBufferGeometry(new Uc(a,b));this.mergeVertices()}function Uc(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;Ga.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11, +19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters={radius:a,detail:b}}function be(a,b,c,d,e,f){M.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new fc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function fc(a, +b,c,d,e){function f(e){h=a.getPointAt(e/b,h);var f=g.normals[e];e=g.binormals[e];for(q=0;q<=d;q++){var m=q/d*Math.PI*2,p=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+p*e.x;l.y=m*f.y+p*e.y;l.z=m*f.z+p*e.z;l.normalize();r.push(l.x,l.y,l.z);k.x=h.x+c*l.x;k.y=h.y+c*l.y;k.z=h.z+c*l.z;t.push(k.x,k.y,k.z)}}G.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents; +this.normals=g.normals;this.binormals=g.binormals;var k=new n,l=new n,m=new x,h=new n,p,q,t=[],r=[],u=[],z=[];for(p=0;p=b;e-=d)f=$h(e,a[e],a[e+1],f);f&&gc(f,f.next)&&(ee(f),f=f.next);return f}function fe(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!gc(a,a.next)&&0!==ta(a.prev,a,a.next))a=a.next;else{ee(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function ge(a,b,c,d,e,f,g){if(a){if(!g&&f){var k=a,l=k;do null===l.z&&(l.z=ug(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==k);l.prevZ.nextZ=null;l.prevZ=null;k=l;var m,h,p,q,t=1;do{l=k;var r=k=null;for(h=0;l;){h++; +var n=l;for(m=p=0;mn!==r.next.y>n&&r.next.y!==r.y&&p<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(h=!h),r=r.next;while(r!==l);r=h}l=r}if(l){a=bi(g,k);g=fe(g,g.next);a=fe(a,a.next);ge(g,b,c,d,e,f);ge(a,b,c,d,e,f);break a}k=k.next}g=g.next}while(g!==a)}break}}}}function Hk(a,b,c,d){var e=a.prev,f=a.next;if(0<=ta(e,a,f))return!1;var g=e.x>a.x?e.x>f.x?e.x:f.x:a.x>f.x?a.x:f.x,k=e.y>a.y?e.y>f.y?e.y:f.y:a.y>f.y?a.y:f.y,l=ug(e.x=l&&d&&d.z<=b;){if(c!==a.prev&&c!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ta(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ta(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ta(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<=b;){if(d!==a.prev&&d!==a.next&&Xc(e.x,e.y, +a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ta(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function Ik(a,b){return a.x-b.x}function Jk(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var k=c.x=c.x&&c.x>=g&&d!==c.x&&Xc(e< +l?d:f,e,g,l,ek.x)&&he(c,a)&&(k=c,m=h)}c=c.next}return k}function ug(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function Kk(a){var b=a,c=a;do{if(b.xta(a.prev,a,a.next)?0<=ta(a,b,a.next)&&0<=ta(a,a.prev,b):0>ta(a,b,a.prev)||0>ta(a,a.next,b)}function bi(a,b){var c=new vg(a.i,a.x,a.y),d=new vg(b.i,b.x,b.y),e=a.next,f=b.prev;a.next= +b;b.prev=a;c.next=e;e.prev=c;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function $h(a,b,c,d){a=new vg(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function ee(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function vg(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function ci(a){var b=a.length;2Number.EPSILON){var l=Math.sqrt(k), +m=Math.sqrt(f*f+g*g);k=b.x-e/l;b=b.y+d/l;g=((c.x-g/m-k)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=k+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new x(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(k)):(f=d,d=e,e=Math.sqrt(k/2));return new x(f/e,d/e)}function k(a,b){for(J=a.length;0<=--J;){var c=J;var f=J-1;0>f&&(f=a.length-1);var g,k=B+2*C;for(g=0;gh;h++){var p=m[f[h]];var q=m[f[(h+1)%3]];d[0]=Math.min(p,q);d[1]=Math.max(p,q);p=d[0]+","+d[1];void 0===e[p]?e[p]={index1:d[0],index2:d[1],face1:k,face2:void 0}:e[p].face2=k}for(p in e)if(d=e[p], +void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.setAttribute("position",new C(c,3))}function lc(a,b,c,d,e,f,g,k){M.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:k};this.fromBufferGeometry(new ub(a,b,c,d,e,f,g,k));this.mergeVertices()}function ub(a,b,c,d,e,f,g,k){function l(c){var e,f=new x,l=new n, +v=0,u=!0===c?a:b,B=!0===c?1:-1;var y=r;for(e=1;e<=d;e++)p.push(0,z*B,0),q.push(0,B,0),t.push(.5,.5),r++;var F=r;for(e=0;e<=d;e++){var C=e/d*k+g,G=Math.cos(C);C=Math.sin(C);l.x=u*C;l.y=z*B;l.z=u*G;p.push(l.x,l.y,l.z);q.push(0,B,0);f.x=.5*G+.5;f.y=.5*C*B+.5;t.push(f.x,f.y);r++}for(e=0;e