diff --git a/build/three.js b/build/three.js index 9e7a95500510fa27b229d2022f6d540e13317dd1..77eaf439441bf5d89be50feaa7493e231f9ea5e4 100644 --- a/build/three.js +++ b/build/three.js @@ -21886,6 +21886,7 @@ if ( isAnimating ) return; ( vr.getDevice() || window ).requestAnimationFrame( loop ); + isAnimating = true; } @@ -43341,7 +43342,7 @@ set: function ( value ) { console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); - this.flatShading = ( value === THREE.FlatShading ) ? true : false; + this.flatShading = ( value === FlatShading ); } } diff --git a/build/three.min.js b/build/three.min.js index 4dc64d78722dbb0d07fc1c87f1dd0ae945cb5d61..ad3b019290caaeb172bb21bd6e59255453165da8 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -10,23 +10,23 @@ b)}function wf(a){switch(a){case 5126:return mf;case 35664:return of;case 35665: b){a.uniform3fv(this.addr,Cb(b,this.size,3))}function Bf(a,b){a.uniform4fv(this.addr,Cb(b,this.size,4))}function Cf(a,b){a.uniformMatrix2fv(this.addr,!1,Cb(b,this.size,4))}function Df(a,b){a.uniformMatrix3fv(this.addr,!1,Cb(b,this.size,9))}function Ef(a,b){a.uniformMatrix4fv(this.addr,!1,Cb(b,this.size,16))}function Ff(a,b,c){var d=b.length,e=ze(c,d);a.uniform1iv(this.addr,e);for(a=0;a!==d;++a)c.setTexture2D(b[a]||De,e[a])}function Gf(a,b,c){var d=b.length,e=ze(c,d);a.uniform1iv(this.addr,e);for(a= 0;a!==d;++a)c.setTextureCube(b[a]||Ee,e[a])}function Hf(a){switch(a){case 5126:return xf;case 35664:return zf;case 35665:return Af;case 35666:return Bf;case 35674:return Cf;case 35675:return Df;case 35676:return Ef;case 35678:return Ff;case 35680:return Gf;case 5124:case 35670:return yf;case 35667:case 35671:return Fe;case 35668:case 35672:return Ge;case 35669:case 35673:return He}}function If(a,b,c){this.id=a;this.addr=c;this.setValue=wf(b.type)}function Jf(a,b,c){this.id=a;this.addr=c;this.size= b.size;this.setValue=Hf(b.type)}function Ie(a){this.id=a;this.seq=[];this.map={}}function cb(a,b,c){this.seq=[];this.map={};this.renderer=c;c=a.getProgramParameter(b,a.ACTIVE_UNIFORMS);for(var d=0;d 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); b.compileShader(z);b.compileShader(w);b.attachShader(M,z);b.attachShader(M,w);b.linkProgram(M);ba=M;B=b.getAttribLocation(ba,"position");H=b.getAttribLocation(ba,"uv");f=b.getUniformLocation(ba,"uvOffset");g=b.getUniformLocation(ba,"uvScale");h=b.getUniformLocation(ba,"rotation");k=b.getUniformLocation(ba,"scale");l=b.getUniformLocation(ba,"color");q=b.getUniformLocation(ba,"map");p=b.getUniformLocation(ba,"opacity");t=b.getUniformLocation(ba,"modelViewMatrix");r=b.getUniformLocation(ba,"projectionMatrix"); m=b.getUniformLocation(ba,"fogType");u=b.getUniformLocation(ba,"fogDensity");x=b.getUniformLocation(ba,"fogNear");y=b.getUniformLocation(ba,"fogFar");A=b.getUniformLocation(ba,"fogColor");I=b.getUniformLocation(ba,"alphaTest");M=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");M.width=8;M.height=8;z=M.getContext("2d");z.fillStyle="white";z.fillRect(0,0,8,8);Je=new oc(M)}c.useProgram(ba);c.initAttributes();c.enableAttribute(B);c.enableAttribute(H);c.disableUnusedAttributes();c.disable(b.CULL_FACE); c.enable(b.BLEND);b.bindBuffer(b.ARRAY_BUFFER,xa);b.vertexAttribPointer(B,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(H,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,la);b.uniformMatrix4fv(r,!1,T.projectionMatrix.elements);c.activeTexture(b.TEXTURE0);b.uniform1i(q,0);z=M=0;(w=n.fog)?(b.uniform3f(A,w.color.r,w.color.g,w.color.b),w.isFog?(b.uniform1f(x,w.near),b.uniform1f(y,w.far),b.uniform1i(m,1),z=M=1):w.isFogExp2&&(b.uniform1f(u,w.density),b.uniform1i(m,2),z=M=2)):(b.uniform1i(m,0),z=M=0); -for(var D=0,C=v.length;D=ea.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+a+" texture units while this GPU supports only "+ +0;c=ea.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+a+" texture units while this GPU supports only "+ ea.maxTextures);G+=1;return a};this.setTexture2D=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTarget&&(a||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),a=!0),b=b.texture);fa.setTexture2D(b,c)}}();this.setTexture=function(){var a=!1;return function(b,c){a||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),a=!0);fa.setTexture2D(b,c)}}();this.setTextureCube=function(){var a= !1;return function(b,c){b&&b.isWebGLRenderTargetCube&&(a||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),a=!0),b=b.texture);b&&b.isCubeTexture||Array.isArray(b.image)&&6===b.image.length?fa.setTextureCube(b,c):fa.setTextureCubeDynamic(b,c)}}();this.getRenderTarget=function(){return ga};this.setRenderTarget=function(a){(ga=a)&&void 0===da.get(a).__webglFramebuffer&&fa.setupRenderTarget(a);var b=null,c=!1;a?(b=da.get(a).__webglFramebuffer, a.isWebGLRenderTargetCube&&(b=b[a.activeCubeFace],c=!0),V.copy(a.viewport),W.copy(a.scissor),X=a.scissorTest):(V.copy(aa).multiplyScalar(N),W.copy(ia).multiplyScalar(N),X=ha);M!==b&&(E.bindFramebuffer(E.FRAMEBUFFER,b),M=b);Z.viewport(V);Z.scissor(W);Z.setScissorTest(X);c&&(c=da.get(a.texture),E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,c.__webglTexture,a.activeMipMapLevel))};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(a&&a.isWebGLRenderTarget){var g= @@ -227,7 +227,7 @@ outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f};a=a||20; f,q);this.setIndex(g);this.addAttribute("position",new z(h,3));this.addAttribute("normal",new z(k,3));this.addAttribute("uv",new z(l,2))}function Oc(a,b,c,d){Q.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};this.fromBufferGeometry(new Vb(a,b,c,d));this.mergeVertices()}function Vb(a,b,c,d){F.call(this);this.type="LatheBufferGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=Math.floor(b)||12;c=c||0;d=d||2*Math.PI;d=R.clamp(d, 0,2*Math.PI);var e=[],f=[],g=[],h=1/b,k=new n,l=new D,q;for(q=0;q<=b;q++){var p=c+q*h*d;var t=Math.sin(p),m=Math.cos(p);for(p=0;p<=a.length-1;p++)k.x=a[p].x*t,k.y=a[p].y,k.z=a[p].x*m,f.push(k.x,k.y,k.z),l.x=q/b,l.y=p/(a.length-1),g.push(l.x,l.y)}for(q=0;qq;q++){var p=l[f[q]];var t=l[f[(q+1)%3]];d[0]=Math.min(p,t);d[1]=Math.max(p,t);p=d[0]+","+d[1];void 0===e[p]?e[p]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[p].face2=h}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.addAttribute("position", new z(c,3))}function lb(a,b,c,d,e,f,g,h){Q.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new Ta(a,b,c,d,e,f,g,h));this.mergeVertices()}function Ta(a,b,c,d,e,f,g,h){function k(c){var e,f=new D,k=new n,r=0,u=!0===c?a:b,A=!0===c?1:-1;var w=v;for(e=1;e<=d;e++)p.push(0,x*A,0),t.push(0,A,0),m.push(.5,.5),v++;var z=v;for(e=0;e<=d;e++){var C=e/d*h+g,J=Math.cos(C), @@ -237,9 +237,9 @@ w,0);y+=w})();!1===f&&(0c)return null;var d=[],e=[],f=[],g;if(0=h--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}var k=g;c<=k&&(k=0);g=k+ +Kc;Sb.prototype=Object.create(F.prototype);Sb.prototype.constructor=Sb;var Fa={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;ec)return null;var d=[],e=[],f=[],g;if(0=h--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}var k=g;c<=k&&(k=0);g=k+ 1;c<=g&&(g=0);var l=g+1;c<=l&&(l=0);a:{var m;var p=a[e[k]].x;var t=a[e[k]].y;var n=a[e[g]].x;var v=a[e[g]].y;var u=a[e[l]].x;var x=a[e[l]].y;if(0>=(n-p)*(x-t)-(v-t)*(u-p))var y=!1;else{var A=u-n;var w=x-v;var B=p-u;var z=t-x;var D=n-p;y=v-t;for(m=0;m=-Number.EPSILON&&C>=-Number.EPSILON&&L>=-Number.EPSILON){y=!1;break a}}}y=!0}}if(y){d.push([a[e[k]], a[e[g]],a[e[l]]]);f.push([e[k],e[g],e[l]]);k=g;for(l=g+1;lNumber.EPSILON){if(0n||n>p)return[];k=l*m-k* q;if(0>k||k>p)return[]}else{if(0c?[]:k===c?f?[]:[g]:a<=c?[g,h]:[g,l]}function f(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return Math.abs(a)>Number.EPSILON?(b=g*c-d*b,0d&&(d=c);var e=a+1;e>c&&(e=0);c=f(h[a],h[d],h[e],D[b]);if(!c)return!1;c=D.length-1;d=b-1;0>d&&(d=c);e=b+1;e>c&&(e=0);return(c=f(D[b],D[d],D[e],h[a]))?!0:!1}function d(a,b){var c;for(c=0;ct){console.log('THREE.ShapeUtils: Infinite Loop! Holes left:" + indepHoles.length + ", Probably Hole outside Shape!');break}for(m=n;ma;a++)m=b[a].x+":"+b[a].y,m=h[m],void 0!==m&&(b[a]=m);return k.concat()},isClockWise:function(a){return 0>Aa.area(a)}};$a.prototype=Object.create(Q.prototype);$a.prototype.constructor=$a;Ea.prototype=Object.create(F.prototype); +D[q],c(m,q)&&!d(w,z)&&!g(w,z)){l=q;k.splice(p,1);n=h.slice(0,m+1);z=h.slice(m);q=D.slice(l);var F=D.slice(0,l+1);h=n.concat(q).concat(F).concat(z);n=m;break}if(0<=l)break;a[C]=!0}}if(0<=l)break}}return h}(a,b);k=Fa.triangulate(l,!1);l=0;for(g=k.length;la;a++)m=b[a].x+":"+b[a].y,m=h[m],void 0!==m&&(b[a]=m);return k.concat()},isClockWise:function(a){return 0>Fa.area(a)}};$a.prototype=Object.create(Q.prototype);$a.prototype.constructor=$a;Ea.prototype=Object.create(F.prototype); Ea.prototype.constructor=Ea;Ea.prototype.getArrays=function(){var a=this.getAttribute("position"),a=a?Array.prototype.slice.call(a.array):[],b=this.getAttribute("uv"),b=b?Array.prototype.slice.call(b.array):[],c=this.index,c=c?Array.prototype.slice.call(c.array):[];return{position:a,uv:b,index:c}};Ea.prototype.addShapeList=function(a,b){var c=a.length;b.arrays=this.getArrays();for(var d=0;dNumber.EPSILON){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;g=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new D(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(h)):(f=d,d=e,e=Math.sqrt(h/2));return new D(f/e,d/e)}function e(a,b){for(G=a.length;0<=--G;){var c=G;var d=G-1;0>d&&(d=a.length-1);var e,f=w+2*x;for(e=0;eNumber.EPSILON){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<= -a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=Aa.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new xb;h.curves=g.curves;b.push(h);return b}var k=!e(f[0].getPoints()),k=a?!k:k;h=[];var l=[],m=[],p=0;l[p]=void 0;m[p]=[];for(var n=0,r=f.length;n