diff --git a/build/three.js b/build/three.js index a0da8be18dd57de082c14f506b8762d33cf95fde..705c3221f55f6d64370d579e3637639b9ed2fe9b 100644 --- a/build/three.js +++ b/build/three.js @@ -11002,27 +11002,43 @@ // - if ( this.geometry !== undefined ) { + function serialise( library, element ) { - if ( meta.geometries[ this.geometry.uuid ] === undefined ) { + if ( library[ element.uuid ] === undefined ) { - meta.geometries[ this.geometry.uuid ] = this.geometry.toJSON( meta ); + library[ element.uuid ] = element.toJSON( meta ); } - object.geometry = this.geometry.uuid; + return element.uuid; + + } + + if ( this.geometry !== undefined ) { + + object.geometry = serialise( meta.geometries, this.geometry ); } if ( this.material !== undefined ) { - if ( meta.materials[ this.material.uuid ] === undefined ) { + if ( Array.isArray( this.material ) ) { - meta.materials[ this.material.uuid ] = this.material.toJSON( meta ); + var uuids = []; - } + for ( var i = 0, l = this.material.length; i < l; i ++ ) { + + uuids.push( serialise( meta.materials, this.material[ i ] ) ); - object.material = this.material.uuid; + } + + object.material = uuids; + + } else { + + object.material = serialise( meta.materials, this.material ); + + } } @@ -33762,6 +33778,28 @@ if ( name === undefined ) return undefined; + if ( Array.isArray( name ) ) { + + var array = []; + + for ( var i = 0, l = name.length; i < l; i ++ ) { + + var uuid = name[ i ]; + + if ( materials[ uuid ] === undefined ) { + + console.warn( 'THREE.ObjectLoader: Undefined material', uuid ); + + } + + array.push( materials[ uuid ] ); + + } + + return array; + + } + if ( materials[ name ] === undefined ) { console.warn( 'THREE.ObjectLoader: Undefined material', name ); diff --git a/build/three.min.js b/build/three.min.js index 11496633104d4fcfe56c07c00c62e0eafec574c1..32f83bb938024198960d1b516d36b85fe896b439 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -10,36 +10,36 @@ b){a.uniform4iv(this.addr,b)}function nf(a){switch(a){case 5126:return cf;case 3 this.size,2))}function rf(a,b){a.uniform3fv(this.addr,Cb(b,this.size,3))}function sf(a,b){a.uniform4fv(this.addr,Cb(b,this.size,4))}function tf(a,b){a.uniformMatrix2fv(this.addr,!1,Cb(b,this.size,4))}function uf(a,b){a.uniformMatrix3fv(this.addr,!1,Cb(b,this.size,9))}function vf(a,b){a.uniformMatrix4fv(this.addr,!1,Cb(b,this.size,16))}function wf(a,b,c){var d=b.length,e=we(c,d);a.uniform1iv(this.addr,e);for(a=0;a!==d;++a)c.setTexture2D(b[a]||Ae,e[a])}function xf(a,b,c){var d=b.length,e=we(c,d);a.uniform1iv(this.addr, e);for(a=0;a!==d;++a)c.setTextureCube(b[a]||Be,e[a])}function yf(a){switch(a){case 5126:return of;case 35664:return qf;case 35665:return rf;case 35666:return sf;case 35674:return tf;case 35675:return uf;case 35676:return vf;case 35678:return wf;case 35680:return xf;case 5124:case 35670:return pf;case 35667:case 35671:return Ce;case 35668:case 35672:return De;case 35669:case 35673:return Ee}}function zf(a,b,c){this.id=a;this.addr=c;this.setValue=nf(b.type)}function Af(a,b,c){this.id=a;this.addr=c; this.size=b.size;this.setValue=yf(b.type)}function Fe(a){this.id=a;this.seq=[];this.map={}}function db(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")); v.compileShader(Q);v.compileShader(N);v.attachShader(ga,Q);v.attachShader(ga,N);v.linkProgram(ga);H=ga;y=v.getAttribLocation(H,"position");w=v.getAttribLocation(H,"uv");c=v.getUniformLocation(H,"uvOffset");d=v.getUniformLocation(H,"uvScale");e=v.getUniformLocation(H,"rotation");f=v.getUniformLocation(H,"scale");g=v.getUniformLocation(H,"color");h=v.getUniformLocation(H,"map");l=v.getUniformLocation(H,"opacity");m=v.getUniformLocation(H,"modelViewMatrix");u=v.getUniformLocation(H,"projectionMatrix"); -q=v.getUniformLocation(H,"fogType");n=v.getUniformLocation(H,"fogDensity");r=v.getUniformLocation(H,"fogNear");k=v.getUniformLocation(H,"fogFar");t=v.getUniformLocation(H,"fogColor");x=v.getUniformLocation(H,"alphaTest");ga=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");ga.width=8;ga.height=8;Q=ga.getContext("2d");Q.fillStyle="white";Q.fillRect(0,0,8,8);Z=new ba(ga);Z.needsUpdate=!0}v.useProgram(H);O.initAttributes();O.enableAttribute(y);O.enableAttribute(w);O.disableUnusedAttributes(); -O.disable(v.CULL_FACE);O.enable(v.BLEND);v.bindBuffer(v.ARRAY_BUFFER,C);v.vertexAttribPointer(y,2,v.FLOAT,!1,16,0);v.vertexAttribPointer(w,2,v.FLOAT,!1,16,8);v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,F);v.uniformMatrix4fv(u,!1,D.projectionMatrix.elements);O.activeTexture(v.TEXTURE0);v.uniform1i(h,0);Q=ga=0;(N=p.fog)?(v.uniform3f(t,N.color.r,N.color.g,N.color.b),N.isFog?(v.uniform1f(r,N.near),v.uniform1f(k,N.far),v.uniform1i(q,1),Q=ga=1):N.isFogExp2&&(v.uniform1f(n,N.density),v.uniform1i(q,2),Q=ga=2)):(v.uniform1i(q, +q=v.getUniformLocation(H,"fogType");n=v.getUniformLocation(H,"fogDensity");t=v.getUniformLocation(H,"fogNear");k=v.getUniformLocation(H,"fogFar");r=v.getUniformLocation(H,"fogColor");x=v.getUniformLocation(H,"alphaTest");ga=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");ga.width=8;ga.height=8;Q=ga.getContext("2d");Q.fillStyle="white";Q.fillRect(0,0,8,8);Z=new ba(ga);Z.needsUpdate=!0}v.useProgram(H);O.initAttributes();O.enableAttribute(y);O.enableAttribute(w);O.disableUnusedAttributes(); +O.disable(v.CULL_FACE);O.enable(v.BLEND);v.bindBuffer(v.ARRAY_BUFFER,C);v.vertexAttribPointer(y,2,v.FLOAT,!1,16,0);v.vertexAttribPointer(w,2,v.FLOAT,!1,16,8);v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,F);v.uniformMatrix4fv(u,!1,D.projectionMatrix.elements);O.activeTexture(v.TEXTURE0);v.uniform1i(h,0);Q=ga=0;(N=p.fog)?(v.uniform3f(r,N.color.r,N.color.g,N.color.b),N.isFog?(v.uniform1f(t,N.near),v.uniform1f(k,N.far),v.uniform1i(q,1),Q=ga=1):N.isFogExp2&&(v.uniform1f(n,N.density),v.uniform1i(q,2),Q=ga=2)):(v.uniform1i(q, 0),Q=ga=0);for(var N=0,W=b.length;Nb&&(b=a[c]);return b}function T(){Object.defineProperty(this,"id",{value:Od++});this.uuid=Y.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate= this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function I(){Object.defineProperty(this,"id",{value:Od++});this.uuid=Y.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity}}function wa(a,b){A.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new I;this.material=void 0!==b? b:new Ha({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function Eb(a,b,c,d,e,f){T.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.fromBufferGeometry(new ib(a,b,c,d,e,f));this.mergeVertices()}function ib(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,k,C,F,H){var Z=f/C,aa=g/F,pa=f/2,J=g/2,D=k/2;g=C+1;var E=F+1,A=f=0,Q,N,W=new p;for(N=0;N/gm,function(a,c){var d=S[c]; if(void 0===d)throw Error("Can not resolve #include <"+c+">");return Qd(d)})}function Le(a){return a.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(a,c,d,e){a="";for(c=parseInt(c);cb||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+ a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function l(a){return Y.isPowerOfTwo(a.width)&&Y.isPowerOfTwo(a.height)}function m(b){return 1003===b||1004===b||1005===b?a.NEAREST:a.LINEAR}function u(b){b=b.target;b.removeEventListener("dispose",u);a:{var c=d.get(b);if(b.image&&c.__image__webglTextureCube)a.deleteTexture(c.__image__webglTextureCube);else{if(void 0===c.__webglInit)break a;a.deleteTexture(c.__webglTexture)}d.remove(b)}g.textures--}function q(b){b=b.target; b.removeEventListener("dispose",q);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&&a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e=0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d.remove(b.texture);d.remove(b)}g.textures--}function n(b, m){var n=d.get(b);if(0z;z++)t[z]=q||k?k?b.image[z].image:b.image[z]:h(b.image[z],e.maxCubemapSize);var p=l(t[0]),x=f(b.format),aa=f(b.type);r(a.TEXTURE_CUBE_MAP,b,p);for(z=0;6>z;z++)if(q)for(var pa,J=t[z].mipmaps,D=0,E=J.length;Du;u++)e.__webglFramebuffer[u]=a.createFramebuffer()}else e.__webglFramebuffer=a.createFramebuffer();if(h){c.bindTexture(a.TEXTURE_CUBE_MAP,f.__webglTexture);r(a.TEXTURE_CUBE_MAP,b.texture,m);for(u=0;6>u;u++)k(e.__webglFramebuffer[u], -b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+u);b.texture.generateMipmaps&&m&&a.generateMipmap(a.TEXTURE_CUBE_MAP);c.bindTexture(a.TEXTURE_CUBE_MAP,null)}else c.bindTexture(a.TEXTURE_2D,f.__webglTexture),r(a.TEXTURE_2D,b.texture,m),k(e.__webglFramebuffer,b,a.COLOR_ATTACHMENT0,a.TEXTURE_2D),b.texture.generateMipmaps&&m&&a.generateMipmap(a.TEXTURE_2D),c.bindTexture(a.TEXTURE_2D,null);if(b.depthBuffer){e=d.get(b);f=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(f)throw Error("target.depthTexture not supported in Cube render targets"); +b.flipY);for(var q=b&&b.isCompressedTexture,k=b.image[0]&&b.image[0].isDataTexture,r=[],z=0;6>z;z++)r[z]=q||k?k?b.image[z].image:b.image[z]:h(b.image[z],e.maxCubemapSize);var p=l(r[0]),x=f(b.format),aa=f(b.type);t(a.TEXTURE_CUBE_MAP,b,p);for(z=0;6>z;z++)if(q)for(var pa,J=r[z].mipmaps,D=0,E=J.length;Du;u++)e.__webglFramebuffer[u]=a.createFramebuffer()}else e.__webglFramebuffer=a.createFramebuffer();if(h){c.bindTexture(a.TEXTURE_CUBE_MAP,f.__webglTexture);t(a.TEXTURE_CUBE_MAP,b.texture,m);for(u=0;6>u;u++)k(e.__webglFramebuffer[u], +b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+u);b.texture.generateMipmaps&&m&&a.generateMipmap(a.TEXTURE_CUBE_MAP);c.bindTexture(a.TEXTURE_CUBE_MAP,null)}else c.bindTexture(a.TEXTURE_2D,f.__webglTexture),t(a.TEXTURE_2D,b.texture,m),k(e.__webglFramebuffer,b,a.COLOR_ATTACHMENT0,a.TEXTURE_2D),b.texture.generateMipmaps&&m&&a.generateMipmap(a.TEXTURE_2D),c.bindTexture(a.TEXTURE_2D,null);if(b.depthBuffer){e=d.get(b);f=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(f)throw Error("target.depthTexture not supported in Cube render targets"); if(b&&b.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported!");a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");d.get(b.depthTexture).__webglTexture&&b.depthTexture.image.width===b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate= -!0);n(b.depthTexture,0);e=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,e,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,e,0);else throw Error("Unknown depthTexture format");}else if(f)for(e.__webglDepthbuffer=[],f=0;6>f;f++)a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer[f]),e.__webglDepthbuffer[f]=a.createRenderbuffer(),t(e.__webglDepthbuffer[f], -b);else a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=a.createRenderbuffer(),t(e.__webglDepthbuffer,b);a.bindFramebuffer(a.FRAMEBUFFER,null)}};this.updateRenderTargetMipmap=function(b){var e=b.texture;e.generateMipmaps&&l(b)&&1003!==e.minFilter&&1006!==e.minFilter&&(b=b&&b.isWebGLRenderTargetCube?a.TEXTURE_CUBE_MAP:a.TEXTURE_2D,e=d.get(e).__webglTexture,c.bindTexture(b,e),a.generateMipmap(b),c.bindTexture(b,null))}}function Yf(){var a={};return{get:function(b){b=b.uuid; +!0);n(b.depthTexture,0);e=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.TEXTURE_2D,e,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.TEXTURE_2D,e,0);else throw Error("Unknown depthTexture format");}else if(f)for(e.__webglDepthbuffer=[],f=0;6>f;f++)a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer[f]),e.__webglDepthbuffer[f]=a.createRenderbuffer(),r(e.__webglDepthbuffer[f], +b);else a.bindFramebuffer(a.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=a.createRenderbuffer(),r(e.__webglDepthbuffer,b);a.bindFramebuffer(a.FRAMEBUFFER,null)}};this.updateRenderTargetMipmap=function(b){var e=b.texture;e.generateMipmaps&&l(b)&&1003!==e.minFilter&&1006!==e.minFilter&&(b=b&&b.isWebGLRenderTargetCube?a.TEXTURE_CUBE_MAP:a.TEXTURE_2D,e=d.get(e).__webglTexture,c.bindTexture(b,e),a.generateMipmap(b),c.bindTexture(b,null))}}function Yf(){var a={};return{get:function(b){b=b.uuid; var c=a[b];void 0===c&&(c={},a[b]=c);return c},remove:function(b){delete a[b.uuid]},clear:function(){a={}}}}function Zf(a,b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(b,a.TEXTURE_MAG_FILTER,a.NEAREST);for(b=0;bd;d++)l=n[u[d]],m=n[u[(d+1)%3]],g[0]=Math.min(l,m),g[1]=Math.max(l,m),l=g[0]+","+g[1],void 0===h[l]&&(h[l]={index1:g[0],index2:g[1]})}for(l in h)c=h[l],u=a.vertices[c.index1],b.push(u.x,u.y,u.z),u=a.vertices[c.index2],b.push(u.x,u.y,u.z)}else if(a&&a.isBufferGeometry){var k,u=new p;if(null!==a.index){q=a.attributes.position;n=a.index;k=a.groups;0===k.length&&(k=[{start:0, count:n.count,materialIndex:0}]);a=0;for(f=k.length;ad;d++)l=n.getX(c+d),m=n.getX(c+(d+1)%3),g[0]=Math.min(l,m),g[1]=Math.max(l,m),l=g[0]+","+g[1],void 0===h[l]&&(h[l]={index1:g[0],index2:g[1]});for(l in h)c=h[l],u.fromBufferAttribute(q,c.index1),b.push(u.x,u.y,u.z),u.fromBufferAttribute(q,c.index2),b.push(u.x,u.y,u.z)}else for(q=a.attributes.position,c=0,e=q.count/3;cd;d++)h=3*c+d,u.fromBufferAttribute(q,h),b.push(u.x, -u.y,u.z),h=3*c+(d+1)%3,u.fromBufferAttribute(q,h),b.push(u.x,u.y,u.z)}this.addAttribute("position",new E(b,3))}function Bc(a,b,c){T.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Lb(a,b,c));this.mergeVertices()}function Lb(a,b,c){I.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new p,l=new p,m=new p,u=new p,q=new p,n,k,z=b+1;for(n=0;n<=c;n++){var t=n/c;for(k=0;k<= -b;k++){var x=k/b,l=a(x,t,l);e.push(l.x,l.y,l.z);0<=x-1E-5?(m=a(x-1E-5,t,m),u.subVectors(l,m)):(m=a(x+1E-5,t,m),u.subVectors(m,l));0<=t-1E-5?(m=a(x,t-1E-5,m),q.subVectors(l,m)):(m=a(x,t+1E-5,m),q.subVectors(m,l));h.crossVectors(u,q).normalize();f.push(h.x,h.y,h.z);g.push(x,t)}}for(n=0;nd&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}I.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c|| 1;var h=[],l=[];(function(a){for(var c=new p,d=new p,g=new p,h=0;hp;p++)g=r[l[p]],h=r[l[(p+1)%3]],e[0]=Math.min(g,h),e[1]=Math.max(g,h),g=e[0]+","+e[1],void 0===f[g]?f[g]={index1:e[0],index2:e[1],face1:k,face2:void 0}:f[g].face2=k;for(g in f)if(e=f[g],void 0===e.face2||m[e.face1].normal.dot(m[e.face2].normal)<=d)l=u[e.index1],c.push(l.x,l.y,l.z),l=u[e.index2],c.push(l.x,l.y,l.z);this.addAttribute("position",new E(c,3))}function mb(a,b,c,d,e,f,g,h){T.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 Ua(a,b,c,d,e,f,g,h));this.mergeVertices()}function Ua(a,b,c,d,e,f,g,h){function l(c){var e,f,l,t=new D,F=new p,H=0,Z=!0===c?a:b,aa=!0===c?1:-1;f=z;for(e=1;e<=d;e++)k.push(0,x*aa,0),n.push(0,aa,0),r.push(.5,.5),z++;l=z;for(e=0;e<=d;e++){var E=e/d*h+g,J=Math.cos(E),E=Math.sin(E);F.x=Z*E;F.y=x*aa;F.z=Z*J;k.push(F.x,F.y,F.z);n.push(0,aa,0);t.x=.5*J+.5;t.y=.5*E*aa+.5;r.push(t.x,t.y);z++}for(e= -0;ep;p++)g=t[l[p]],h=t[l[(p+1)%3]],e[0]=Math.min(g,h),e[1]=Math.max(g,h),g=e[0]+","+e[1],void 0===f[g]?f[g]={index1:e[0],index2:e[1],face1:k,face2:void 0}:f[g].face2=k;for(g in f)if(e=f[g],void 0===e.face2||m[e.face1].normal.dot(m[e.face2].normal)<=d)l=u[e.index1],c.push(l.x,l.y,l.z),l=u[e.index2],c.push(l.x,l.y,l.z);this.addAttribute("position",new E(c,3))}function mb(a,b,c,d,e,f,g,h){T.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 Ua(a,b,c,d,e,f,g,h));this.mergeVertices()}function Ua(a,b,c,d,e,f,g,h){function l(c){var e,f,l,r=new D,F=new p,H=0,Z=!0===c?a:b,aa=!0===c?1:-1;f=z;for(e=1;e<=d;e++)k.push(0,x*aa,0),n.push(0,aa,0),t.push(.5,.5),z++;l=z;for(e=0;e<=d;e++){var E=e/d*h+g,J=Math.cos(E),E=Math.sin(E);F.x=Z*E;F.y=x*aa;F.z=Z*J;k.push(F.x,F.y,F.z);n.push(0,aa,0);r.x=.5*J+.5;r.y=.5*E*aa+.5;t.push(r.x,r.y);z++}for(e= +0;ethis.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(t lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.multiplyScalar(a/this.length())},lerp: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},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&& a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}});Object.assign(Ab.prototype,ra.prototype, {isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport);this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}}); -Bb.prototype=Object.create(Ab.prototype);Bb.prototype.constructor=Bb;Bb.prototype.isWebGLRenderTargetCube=!0;Object.assign(oa,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h=c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],q=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||m!==q){f=1-g;var n=h*d+l*k+m*q+c*e,r=0<=n?1:-1,p=1-n*n;p>Number.EPSILON&&(p=Math.sqrt(p),n=Math.atan2(p,n*r),f=Math.sin(f*n)/p,g=Math.sin(g*n)/p);r*=g;h=h*f+d*r;l=l*f+k*r;m=m*f+q*r;c= -c*f+e*r;f===1-g&&(g=1/Math.sqrt(h*h+l*l+m*m+c*c),h*=g,l*=g,m*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(oa.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this.onChangeCallback()}}});Object.assign(oa.prototype, +Bb.prototype=Object.create(Ab.prototype);Bb.prototype.constructor=Bb;Bb.prototype.isWebGLRenderTargetCube=!0;Object.assign(oa,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h=c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],q=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||m!==q){f=1-g;var n=h*d+l*k+m*q+c*e,t=0<=n?1:-1,p=1-n*n;p>Number.EPSILON&&(p=Math.sqrt(p),n=Math.atan2(p,n*t),f=Math.sin(f*n)/p,g=Math.sin(g*n)/p);t*=g;h=h*f+d*t;l=l*f+k*t;m=m*f+q*t;c= +c*f+e*t;f===1-g&&(g=1/Math.sqrt(h*h+l*l+m*m+c*c),h*=g,l*=g,m*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(oa.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this.onChangeCallback()}}});Object.assign(oa.prototype, {set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,b){if(!1===(a&&a.isEuler))throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var c=a._x,d=a._y,e=a._z,f=a.order,g=Math.cos,h=Math.sin,l= g(c/2),m=g(d/2),g=g(e/2),c=h(c/2),d=h(d/2),e=h(e/2);"XYZ"===f?(this._x=c*m*g+l*d*e,this._y=l*d*g-c*m*e,this._z=l*m*e+c*d*g,this._w=l*m*g-c*d*e):"YXZ"===f?(this._x=c*m*g+l*d*e,this._y=l*d*g-c*m*e,this._z=l*m*e-c*d*g,this._w=l*m*g+c*d*e):"ZXY"===f?(this._x=c*m*g-l*d*e,this._y=l*d*g+c*m*e,this._z=l*m*e+c*d*g,this._w=l*m*g-c*d*e):"ZYX"===f?(this._x=c*m*g-l*d*e,this._y=l*d*g+c*m*e,this._z=l*m*e-c*d*g,this._w=l*m*g+c*d*e):"YZX"===f?(this._x=c*m*g+l*d*e,this._y=l*d*g+c*m*e,this._z=l*m*e-c*d*g,this._w=l* m*g-c*d*e):"XZY"===f&&(this._x=c*m*g-l*d*e,this._y=l*d*g-c*m*e,this._z=l*m*e+c*d*g,this._w=l*m*g+c*d*e);if(!1!==b)this.onChangeCallback();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);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],l=b[6],b=b[10],m=c+f+b;0this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.copy(this);c=1/g;var f=1/h,m=1/l;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=m;b.elements[9]*=m;b.elements[10]*=m;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=l;return this}}(),makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); @@ -450,21 +450,21 @@ d.distanceToSquared(b[f]));this.radius=Math.sqrt(e);return this}}(),clone:functi b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(this.center.dot(a.normal)-a.constant)<=this.radius},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new p;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new Ra;a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a); this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}});Object.assign(Fa.prototype,{isMatrix3:!0,set:function(a,b,c,d,e,f,g,h,l){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=h;m[6]=c;m[7]=f;m[8]=l;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(a){var b= this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this},applyToBufferAttribute:function(){var a=new p;return function(b){for(var c=0,d=b.count;cc;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]= c[8];return a}});Object.assign(va.prototype,{set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new p,b=new p;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,c);return this}}(),clone:function(){return(new this.constructor).copy(this)}, copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a, b){var c=this.distanceToPoint(a);return(b||new p).copy(this.normal).multiplyScalar(c)},intersectLine:function(){var a=new p;return function(b,c){var d=c||new p,e=b.delta(a),f=this.normal.dot(e);if(0===f){if(0===this.distanceToPoint(b.start))return d.copy(b.start)}else return f=-(b.start.dot(this.normal)+this.constant)/f,0>f||1b&&0a&&0c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],m=c[7],k=c[8],q=c[9],n=c[10],r=c[11],p=c[12],t=c[13], -x=c[14],c=c[15];b[0].setComponents(f-a,m-g,r-k,c-p).normalize();b[1].setComponents(f+a,m+g,r+k,c+p).normalize();b[2].setComponents(f+d,m+h,r+q,c+t).normalize();b[3].setComponents(f-d,m-h,r-q,c-t).normalize();b[4].setComponents(f-e,m-l,r-n,c-x).normalize();b[5].setComponents(f+e,m+l,r+n,c+x).normalize();return this},intersectsObject:function(){var a=new Ba;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(), +a.constant===this.constant}});Object.assign(fd.prototype,{set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],m=c[7],k=c[8],q=c[9],n=c[10],t=c[11],p=c[12],r=c[13], +x=c[14],c=c[15];b[0].setComponents(f-a,m-g,t-k,c-p).normalize();b[1].setComponents(f+a,m+g,t+k,c+p).normalize();b[2].setComponents(f+d,m+h,t+q,c+r).normalize();b[3].setComponents(f-d,m-h,t-q,c-r).normalize();b[4].setComponents(f-e,m-l,t-n,c-x).normalize();b[5].setComponents(f+e,m+l,t+n,c+x).normalize();return this},intersectsObject:function(){var a=new Ba;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(), intersectsSprite:function(){var a=new Ba;return function(b){a.center.set(0,0,0);a.radius=.7071067811865476;a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});Object.assign(fb.prototype,{set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.origin.copy(a.origin); this.direction.copy(a.direction);return this},at:function(a,b){return(b||new p).copy(this.direction).multiplyScalar(a).add(this.origin)},lookAt:function(a){this.direction.copy(a).sub(this.origin).normalize();return this},recast:function(){var a=new p;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new p;c.subVectors(a,this.origin);var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)}, distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new p;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(),distanceSqToSegment:function(){var a=new p,b=new p,c=new p;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a); -var h=.5*d.distanceTo(e),l=-this.direction.dot(b),m=c.dot(this.direction),k=-c.dot(b),q=c.lengthSq(),n=Math.abs(1-l*l),r;0=-r?e<=r?(h=1/n,d*=h,e*=h,l=d*(d+l*e+2*m)+e*(l*d+e+2*k)+q):(e=h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+q):(e=-h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+q):e<=-r?(d=Math.max(0,-(-l*h+m)),e=0=-t?e<=t?(h=1/n,d*=h,e*=h,l=d*(d+l*e+2*m)+e*(l*d+e+2*k)+q):(e=h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+q):(e=-h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+q):e<=-t?(d=Math.max(0,-(-l*h+m)),e=0f)return null;f=Math.sqrt(f-e);e=d-f;d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),intersectsSphere:function(a){return this.distanceToPoint(a.center)<= a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},intersectsPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z; var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(fg||e>d)return null;if(e>c||c!==c)c=e;if(gd?null:this.at(0<=c?c:d,b)},intersectsBox:function(){var a=new p;return function(b){return null!==this.intersectBox(b,a)}}(),intersectTriangle:function(){var a= @@ -483,14 +483,14 @@ a&&a.isObject3D?(null!==a.parent&&a.parent.remove(a),a.parent=this,a.dispatchEve a)},getObjectByProperty:function(a,b){if(this[a]===b)return this;for(var c=0,d=this.children.length;c=b.x+b.y}}()});Object.assign(Sa.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},clone:function(){return(new this.constructor).copy(this)}, +this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=this.children,c=0,d=b.length;c=b.x+b.y}}()});Object.assign(Sa.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},clone:function(){return(new this.constructor).copy(this)}, copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new p,b=new p;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a||new p).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return Sa.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new va).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return Sa.barycoordFromPoint(a, this.a,this.b,this.c,b)},containsPoint:function(a){return Sa.containsPoint(a,this.a,this.b,this.c)},closestPointToPoint:function(){var a=new va,b=[new Db,new Db,new Db],c=new p,d=new p;return function(e,f){var g=f||new p,h=Infinity;a.setFromCoplanarPoints(this.a,this.b,this.c);a.projectPoint(e,c);if(!0===this.containsPoint(c))g.copy(c);else{b[0].set(this.a,this.b);b[1].set(this.b,this.c);b[2].set(this.c,this.a);for(var l=0;ld;d++)if(e[d]===e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;cb.far?null:{distance:c,point:y.clone(),object:a}}function c(c,d,e,f,m,k,u,q){g.fromBufferAttribute(f,k);h.fromBufferAttribute(f,u);l.fromBufferAttribute(f,q);if(c=b(c,d,e,g,h,l,x))m&&(n.fromBufferAttribute(m,k),r.fromBufferAttribute(m,u),z.fromBufferAttribute(m,q),c.uv=a(x,g,h,l,n,r,z)),c.face=new Ta(k,u,q,Sa.normal(g, -h,l)),c.faceIndex=k;return c}var d=new L,e=new fb,f=new Ba,g=new p,h=new p,l=new p,m=new p,k=new p,q=new p,n=new D,r=new D,z=new D,t=new p,x=new p,y=new p;return function(p,t){var v=this.geometry,y=this.material,C=this.matrixWorld;if(void 0!==y&&(null===v.boundingSphere&&v.computeBoundingSphere(),f.copy(v.boundingSphere),f.applyMatrix4(C),!1!==p.ray.intersectsSphere(f)&&(d.getInverse(C),e.copy(p.ray).applyMatrix4(d),null===v.boundingBox||!1!==e.intersectsBox(v.boundingBox)))){var F;if(v.isBufferGeometry){var H, -D,y=v.index,E=v.attributes.position,C=v.attributes.uv,A,J;if(null!==y)for(A=0,J=y.count;Ab.far?null:{distance:c,point:y.clone(),object:a}}function c(c,d,e,f,m,k,u,q){g.fromBufferAttribute(f,k);h.fromBufferAttribute(f,u);l.fromBufferAttribute(f,q);if(c=b(c,d,e,g,h,l,x))m&&(n.fromBufferAttribute(m,k),t.fromBufferAttribute(m,u),z.fromBufferAttribute(m,q),c.uv=a(x,g,h,l,n,t,z)),c.face=new Ta(k,u,q,Sa.normal(g, +h,l)),c.faceIndex=k;return c}var d=new L,e=new fb,f=new Ba,g=new p,h=new p,l=new p,m=new p,k=new p,q=new p,n=new D,t=new D,z=new D,r=new p,x=new p,y=new p;return function(p,r){var v=this.geometry,y=this.material,C=this.matrixWorld;if(void 0!==y&&(null===v.boundingSphere&&v.computeBoundingSphere(),f.copy(v.boundingSphere),f.applyMatrix4(C),!1!==p.ray.intersectsSphere(f)&&(d.getInverse(C),e.copy(p.ray).applyMatrix4(d),null===v.boundingBox||!1!==e.intersectsBox(v.boundingBox)))){var F;if(v.isBufferGeometry){var H, +D,y=v.index,E=v.attributes.position,C=v.attributes.uv,A,J;if(null!==y)for(A=0,J=y.count;Af||(k.applyMatrix4(this.matrixWorld),t=d.ray.origin.distanceTo(k),td.far||e.push({distance:t,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else for(g=0,z=r.length/3-1;gf||(k.applyMatrix4(this.matrixWorld),t=d.ray.origin.distanceTo(k),td.far||e.push({distance:t,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g.isGeometry)for(l=g.vertices,m=l.length,g=0;gf||(k.applyMatrix4(this.matrixWorld),t=d.ray.origin.distanceTo(k),td.far||e.push({distance:t,point:h.clone().applyMatrix4(this.matrixWorld), +k=new p,q=this&&this.isLineSegments?2:1;if(g.isBufferGeometry){var n=g.index,t=g.attributes.position.array;if(null!==n)for(var n=n.array,g=0,z=n.length-1;gf||(k.applyMatrix4(this.matrixWorld),r=d.ray.origin.distanceTo(k),rd.far||e.push({distance:r,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else for(g=0,z=t.length/3-1;gf||(k.applyMatrix4(this.matrixWorld),r=d.ray.origin.distanceTo(k),rd.far||e.push({distance:r,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g.isGeometry)for(l=g.vertices,m=l.length,g=0;gf||(k.applyMatrix4(this.matrixWorld),r=d.ray.origin.distanceTo(k),rd.far||e.push({distance:r,point:h.clone().applyMatrix4(this.matrixWorld), index:g,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});ca.prototype=Object.assign(Object.create(Ja.prototype),{constructor:ca,isLineSegments:!0});kd.prototype=Object.assign(Object.create(Ja.prototype),{constructor:kd,isLineLoop:!0});Ka.prototype=Object.create(X.prototype);Ka.prototype.constructor=Ka;Ka.prototype.isPointsMaterial=!0;Ka.prototype.copy=function(a){X.prototype.copy.call(this,a);this.color.copy(a.color); this.map=a.map;this.size=a.size;this.sizeAttenuation=a.sizeAttenuation;return this};Ib.prototype=Object.assign(Object.create(A.prototype),{constructor:Ib,isPoints:!0,raycast:function(){var a=new L,b=new fb,c=new Ba;return function(d,e){function f(a,c){var f=b.distanceSqToPoint(a);if(fd.far||e.push({distance:m,distanceToRay:Math.sqrt(f),point:h.clone(),index:c,face:null,object:g})}}var g=this,h=this.geometry, -l=this.matrixWorld,m=d.params.Points.threshold;null===h.boundingSphere&&h.computeBoundingSphere();c.copy(h.boundingSphere);c.applyMatrix4(l);c.radius+=m;if(!1!==d.ray.intersectsSphere(c)){a.getInverse(l);b.copy(d.ray).applyMatrix4(a);var m=m/((this.scale.x+this.scale.y+this.scale.z)/3),k=m*m,m=new p;if(h.isBufferGeometry){var q=h.index,h=h.attributes.position.array;if(null!==q)for(var n=q.array,q=0,r=n.length;qc)return null;var d=[],e=[],f=[],g,h,l;if(0=m--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}g=h;c<=g&&(g=0);h=g+1;c<=h&&(h=0);l=h+1;c<=l&&(l=0);var k;a:{var q,n,r,p,t,x,y,w;q=a[e[g]].x;n=a[e[g]].y;r=a[e[h]].x;p=a[e[h]].y;t=a[e[l]].x;x=a[e[l]].y;if(0>=(r-q)*(x-n)-(p-n)*(t-q))k=!1;else{var G,v,O,C,F,H,D,E,A,J;G=t-r;v=x-p;O=q-t;C=n-x;F=r-q;H=p-n; -for(k=0;k=-Number.EPSILON&&E>=-Number.EPSILON&&D>=-Number.EPSILON)){k=!1;break a}k=!0}}if(k){d.push([a[e[g]],a[e[h]],a[e[l]]]);f.push([e[g],e[h],e[l]]);g=h;for(l=h+1;lNumber.EPSILON){if(0p||p>q)return[];l=m*k-l*n;if(0>l||l>q)return[]}else{if(0c)return null;var d=[],e=[],f=[],g,h,l;if(0=m--){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}g=h;c<=g&&(g=0);h=g+1;c<=h&&(h=0);l=h+1;c<=l&&(l=0);var k;a:{var q,n,t,p,r,x,y,w;q=a[e[g]].x;n=a[e[g]].y;t=a[e[h]].x;p=a[e[h]].y;r=a[e[l]].x;x=a[e[l]].y;if(0>=(t-q)*(x-n)-(p-n)*(r-q))k=!1;else{var G,v,O,C,F,H,D,E,A,J;G=r-t;v=x-p;O=q-r;C=n-x;F=t-q;H=p-n; +for(k=0;k=-Number.EPSILON&&E>=-Number.EPSILON&&D>=-Number.EPSILON)){k=!1;break a}k=!0}}if(k){d.push([a[e[g]],a[e[h]],a[e[l]]]);f.push([e[g],e[h],e[l]]);g=h;for(l=h+1;lNumber.EPSILON){if(0u||u>q)return[];l=m*k-l*n;if(0>l||l>q)return[]}else{if(0c?[]:l===c?f?[]:[g]:a<=c?[g,h]:[g,m]}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,0e&&(e=d);var g=a+1;g>d&&(g=0);d=f(h[a],h[e],h[g],l[b]);if(!d)return!1;d=l.length- -1;e=b-1;0>e&&(e=d);g=b+1;g>d&&(g=0);return(d=f(l[b],l[e],l[g],h[a]))?!0:!1}function d(a,b){var c,f;for(c=0;cP){console.log("Infinite Loop! Holes left:"+ -m.length+", Probably Hole outside Shape!");break}for(n=E;nl;l++)k=m[l].x+":"+m[l].y,k=q[k],void 0!== +1;e=b-1;0>e&&(e=d);g=b+1;g>d&&(g=0);return(d=f(l[b],l[e],l[g],h[a]))?!0:!1}function d(a,b){var c,f;for(c=0;cP){console.log("Infinite Loop! Holes left:"+ +m.length+", Probably Hole outside Shape!");break}for(n=E;nl;l++)k=m[l].x+":"+m[l].y,k=q[k],void 0!== k&&(m[l]=k);return n.concat()},isClockWise:function(a){return 0>ya.area(a)}};bb.prototype=Object.create(T.prototype);bb.prototype.constructor=bb;Ea.prototype=Object.create(I.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 l= Math.sqrt(h),m=Math.sqrt(d*d+g*g),h=b.x-f/l;b=b.y+e/l;g=((c.x-g/m-h)*g-(c.y+d/m-b)*d)/(e*g-f*d);d=h+e*g-a.x;e=b+f*g-a.y;f=d*d+e*e;if(2>=f)return new D(d,e);f=Math.sqrt(f/2)}else a=!1,e>Number.EPSILON?d>Number.EPSILON&&(a=!0):e<-Number.EPSILON?d<-Number.EPSILON&&(a=!0):Math.sign(f)===Math.sign(g)&&(a=!0),a?(d=-f,f=Math.sqrt(h)):(d=e,e=f,f=Math.sqrt(h/2));return new D(d/f,e/f)}function e(a,b){var c,d;for(M=a.length;0<=--M;){c=M;d=M-1;0>d&&(d=a.length-1);var e,f=G+2*x;for(e=0;eMath.abs(g-l)?[new D(a, 1-c),new D(h,1-d),new D(m,1-e),new D(q,1-b)]:[new D(g,1-c),new D(l,1-d),new D(k,1-e),new D(n,1-b)]}};Kc.prototype=Object.create(T.prototype);Kc.prototype.constructor=Kc;Sb.prototype=Object.create(Ea.prototype);Sb.prototype.constructor=Sb;Lc.prototype=Object.create(T.prototype);Lc.prototype.constructor=Lc;lb.prototype=Object.create(I.prototype);lb.prototype.constructor=lb;Mc.prototype=Object.create(T.prototype);Mc.prototype.constructor=Mc;Tb.prototype=Object.create(I.prototype);Tb.prototype.constructor= @@ -652,7 +652,7 @@ b.toJSON(a);else{var b={name:a.name,times:ua.convertArray(a.times,Array),values: case "string":return zd}throw Error("Unsupported typeName: "+a);}});Object.assign(Aa,{parse:function(a){for(var b=[],c=a.tracks,d=1/(a.fps||1),e=0,f=c.length;e!==f;++e)b.push(ub.parse(c[e]).scale(d));return new Aa(a.name,a.duration,b)},toJSON:function(a){var b=[],c=a.tracks;a={name:a.name,duration:a.duration,tracks:b};for(var d=0,e=c.length;d!==e;++d)b.push(ub.toJSON(c[d]));return a},CreateFromMorphTargetSequence:function(a,b,c,d){for(var e=b.length,f=[],g=0;gm.opacity&&(m.transparent=!0);d.setTextures(l);return d.parse(m)}}()});Object.assign($d.prototype,{load:function(a,b,c,d){var e=this,f=this.texturePath&&"string"===typeof this.texturePath?this.texturePath:cc.prototype.extractUrlBase(a),g=new ta(this.manager);g.setResponseType("json");g.setWithCredentials(this.withCredentials);g.load(a,function(c){var d=c.metadata;if(void 0!==d&&(d=d.type,void 0!==d)){if("object"===d.toLowerCase()){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.ObjectLoader instead."); -return}if("scene"===d.toLowerCase()){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,f);b(c.geometry,c.materials)},c,d)},setTexturePath:function(a){this.texturePath=a},parse:function(){return function(a,b){void 0!==a.data&&(a=a.data);a.scale=void 0!==a.scale?1/a.scale:1;var c=new T,d=a,e,f,g,h,l,m,k,q,n,r,z,t,x,y,w=d.faces;n=d.vertices;var A=d.normals,v=d.colors;m=d.scale;var E=0;if(void 0!==d.uvs){for(e=0;ef;f++)q=w[h++],y=x[2*q],q=x[2*q+1],y= -new D(y,q),2!==f&&c.faceVertexUvs[e][g].push(y),0!==f&&c.faceVertexUvs[e][g+1].push(y);k&&(k=3*w[h++],r.normal.set(A[k++],A[k++],A[k]),t.normal.copy(r.normal));if(z)for(e=0;4>e;e++)k=3*w[h++],z=new p(A[k++],A[k++],A[k]),2!==e&&r.vertexNormals.push(z),0!==e&&t.vertexNormals.push(z);m&&(m=w[h++],m=v[m],r.color.setHex(m),t.color.setHex(m));if(n)for(e=0;4>e;e++)m=w[h++],m=v[m],2!==e&&r.vertexColors.push(new K(m)),0!==e&&t.vertexColors.push(new K(m));c.faces.push(r);c.faces.push(t)}else{r=new Ta;r.a=w[h++]; -r.b=w[h++];r.c=w[h++];g&&(g=w[h++],r.materialIndex=g);g=c.faces.length;if(e)for(e=0;ef;f++)q=w[h++],y=x[2*q],q=x[2*q+1],y=new D(y,q),c.faceVertexUvs[e][g].push(y);k&&(k=3*w[h++],r.normal.set(A[k++],A[k++],A[k]));if(z)for(e=0;3>e;e++)k=3*w[h++],z=new p(A[k++],A[k++],A[k]),r.vertexNormals.push(z);m&&(m=w[h++],r.color.setHex(v[m]));if(n)for(e=0;3>e;e++)m=w[h++],r.vertexColors.push(new K(v[m]));c.faces.push(r)}d=a;h=void 0!==d.influencesPerVertex?d.influencesPerVertex: +return}if("scene"===d.toLowerCase()){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.SceneLoader instead.");return}}c=e.parse(c,f);b(c.geometry,c.materials)},c,d)},setTexturePath:function(a){this.texturePath=a},parse:function(){return function(a,b){void 0!==a.data&&(a=a.data);a.scale=void 0!==a.scale?1/a.scale:1;var c=new T,d=a,e,f,g,h,l,m,k,q,n,t,z,r,x,y,w=d.faces;n=d.vertices;var A=d.normals,v=d.colors;m=d.scale;var E=0;if(void 0!==d.uvs){for(e=0;ef;f++)q=w[h++],y=x[2*q],q=x[2*q+1],y= +new D(y,q),2!==f&&c.faceVertexUvs[e][g].push(y),0!==f&&c.faceVertexUvs[e][g+1].push(y);k&&(k=3*w[h++],t.normal.set(A[k++],A[k++],A[k]),r.normal.copy(t.normal));if(z)for(e=0;4>e;e++)k=3*w[h++],z=new p(A[k++],A[k++],A[k]),2!==e&&t.vertexNormals.push(z),0!==e&&r.vertexNormals.push(z);m&&(m=w[h++],m=v[m],t.color.setHex(m),r.color.setHex(m));if(n)for(e=0;4>e;e++)m=w[h++],m=v[m],2!==e&&t.vertexColors.push(new K(m)),0!==e&&r.vertexColors.push(new K(m));c.faces.push(t);c.faces.push(r)}else{t=new Ta;t.a=w[h++]; +t.b=w[h++];t.c=w[h++];g&&(g=w[h++],t.materialIndex=g);g=c.faces.length;if(e)for(e=0;ef;f++)q=w[h++],y=x[2*q],q=x[2*q+1],y=new D(y,q),c.faceVertexUvs[e][g].push(y);k&&(k=3*w[h++],t.normal.set(A[k++],A[k++],A[k]));if(z)for(e=0;3>e;e++)k=3*w[h++],z=new p(A[k++],A[k++],A[k]),t.vertexNormals.push(z);m&&(m=w[h++],t.color.setHex(v[m]));if(n)for(e=0;3>e;e++)m=w[h++],t.vertexColors.push(new K(v[m]));c.faces.push(t)}d=a;h=void 0!==d.influencesPerVertex?d.influencesPerVertex: 2;if(d.skinWeights)for(l=0,w=d.skinWeights.length;ll)g=d+1;else if(0< -l)h=d-1;else{h=d;break}d=h;if(c[d]===f)return d/(e-1);g=c[d];return(d+(f-g)/(c[d+1]-g))/(e-1)},getTangent:function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(Y.clamp(d[l-1].dot(d[l]),-1,1)),e[l].applyMatrix4(h.makeRotationAxis(g,c))),f[l].crossVectors(d[l],e[l]);if(!0===b)for(c=Math.acos(Y.clamp(e[0].dot(e[a]),-1,1)), -c/=a,0=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null}, -getLength:function(){var a=this.getCurveLengths();return a[a.length-1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[],b=0,c=0,d=this.curves.length;cc;)c+=b;for(;c>b;)c-=b;cb.length-2?b.length-1:a+1],b=b[a>b.length-3?b.length- -1:a+2];return new D(Oe(c,d.x,e.x,f.x,b.x),Oe(c,d.y,e.y,f.y,b.y))};dc.prototype=Object.create(ja.prototype);dc.prototype.constructor=dc;dc.prototype.getPoint=function(a){var b=this.v0,c=this.v1,d=this.v2,e=this.v3;return new D(wb(a,b.x,c.x,d.x,e.x),wb(a,b.y,c.y,d.y,e.y))};ec.prototype=Object.create(ja.prototype);ec.prototype.constructor=ec;ec.prototype.getPoint=function(a){var b=this.v0,c=this.v1,d=this.v2;return new D(vb(a,b.x,c.x,d.x),vb(a,b.y,c.y,d.y))};var re=Object.assign(Object.create(Uc.prototype), -{fromPoints:function(a){this.moveTo(a[0].x,a[0].y);for(var b=1,c=a.length;bNumber.EPSILON){if(0>k&&(g=b[f],l=-l,h=b[e],k=-k),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=k*(a.x-g.x)-l*(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=ya.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);var g,h,l,k=[];if(1===f.length)return h= -f[0],l=new yb,l.curves=h.curves,k.push(l),k;var p=!e(f[0].getPoints()),p=a?!p:p;l=[];var q=[],n=[],r=0,z;q[r]=void 0;n[r]=[];for(var t=0,x=f.length;td&&this._mixBufferRegion(c,a,3*b,1-d,b);for(var d=b,f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a= -this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a,b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){oa.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f=1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});Object.assign(Re.prototype,{getValue:function(a,b){this.bind();var c=this._bindings[this._targetGroup.nCachedObjects_]; -void 0!==c&&c.getValue(a,b)},setValue:function(a,b){for(var c=this._bindings,d=this._targetGroup.nCachedObjects_,e=c.length;d!==e;++d)c[d].setValue(a,b)},bind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(la,{Composite:Re,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new la.Composite(a,b,c):new la(a, -b,c)},parseTrackName:function(){var a=new RegExp("^"+/((?:[\w-]+[\/:])*)/.source+/([\w-\.]+)?/.source+/(?:\.([\w-]+)(?:\[(.+)\])?)?/.source+/\.([\w-]+)(?:\[(.+)\])?/.source+"$"),b=["material","materials","bones"];return function(c){var d=a.exec(c);if(!d)throw Error("PropertyBinding: Cannot parse trackName: "+c);var d={nodeName:d[2],objectName:d[3],objectIndex:d[4],propertyName:d[5],propertyIndex:d[6]},e=d.nodeName&&d.nodeName.lastIndexOf(".");if(void 0!==e&&-1!==e){var f=d.nodeName.substring(e+1); --1!==b.indexOf(f)&&(d.nodeName=d.nodeName.substring(0,e),d.objectName=f)}if(null===d.propertyName||0===d.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+c);return d}}(),findNode:function(a,b){if(!b||""===b||"root"===b||"."===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){var c=function(a){for(var c=0;c=c){var q=c++,n=b[q];d[n.uuid]=p;b[p]=n;d[k]=q;b[q]=l;l=0;for(k=f;l!==k;++l){var n=e[l],r=n[p];n[p]=n[q];n[q]=r}}}this.nCachedObjects_=c},uncache:function(a){for(var b=this._objects,c=b.length,d=this.nCachedObjects_,e=this._indicesByUUID,f=this._bindings,g=f.length,h=0,k=arguments.length;h!==k;++h){var m=arguments[h].uuid,p=e[m];if(void 0!==p)if(delete e[m],pb||0===c)return;this._startTime=null;b*=c}b*=this._updateTimeScale(a);c=this._updateTime(b);a=this._updateWeight(a);if(0c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight= -b},_updateTimeScale:function(a){var b=0;if(!this.paused){var b=this.timeScale,c=this._timeScaleInterpolant;if(null!==c){var d=c.evaluate(a)[0],b=b*d;a>c.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a;if(0===a)return b;var c=this._clip.duration,d=this.loop,e=this._loopCount;if(2200===d)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else break a;this.clampWhenFinished? -this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:"finished",action:this,direction:0>a?-1:1})}else{d=2202===d;-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,d)):this._setEndings(0===this.repetitions,!0,d));if(b>=c||0>b){var f=Math.floor(b/c),b=b-c*f,e=e+Math.abs(f),g=this.repetitions-e;0>g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=0a,this._setEndings(a,!a,d)):this._setEndings(!1, -!1,d),this._loopCount=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:f}))}if(d&&1===(e&1))return this.time=b,c-b}return this.time=b},_setEndings:function(a,b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,b,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant()); -d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}});Object.assign(Ue.prototype,ra.prototype,{_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings,g=a._interpolants,h=c.uuid,k=this._bindingsByRootAndName,m=k[h];void 0===m&&(m={},k[h]=m);for(k=0;k!==e;++k){var p=d[k],q=p.name,n=m[q];if(void 0===n){n=f[k];if(void 0!==n){null===n._cacheIndex&&(++n.referenceCount,this._addInactiveBinding(n,h,q));continue}n=new ie(la.create(c, -q,b&&b._propertyBindings[k].binding.parsedPath),p.ValueTypeName,p.getValueSize());++n.referenceCount;this._addInactiveBinding(n,h,q)}f[k]=n;g[k].resultBuffer=n.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e), -e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a= -this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&al)g=d+1;else if(0b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(Y.clamp(d[l- +1].dot(d[l]),-1,1)),e[l].applyMatrix4(h.makeRotationAxis(g,c))),f[l].crossVectors(d[l],e[l]);if(!0===b)for(c=Math.acos(Y.clamp(e[0].dot(e[a]),-1,1)),c/=a,0=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.length-1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[],b=0,c=0,d=this.curves.length;cc;)c+=b;for(;c>b;)c-=b;cb.length-2?b.length-1:a+1],b=b[a>b.length-3?b.length-1:a+2];return new D(Oe(c,d.x,e.x,f.x,b.x),Oe(c,d.y,e.y,f.y,b.y))};dc.prototype=Object.create(ja.prototype);dc.prototype.constructor=dc;dc.prototype.getPoint=function(a){var b=this.v0,c=this.v1,d=this.v2,e=this.v3;return new D(wb(a,b.x,c.x,d.x,e.x),wb(a,b.y,c.y,d.y,e.y))};ec.prototype=Object.create(ja.prototype);ec.prototype.constructor=ec;ec.prototype.getPoint= +function(a){var b=this.v0,c=this.v1,d=this.v2;return new D(vb(a,b.x,c.x,d.x),vb(a,b.y,c.y,d.y))};var re=Object.assign(Object.create(Uc.prototype),{fromPoints:function(a){this.moveTo(a[0].x,a[0].y);for(var b=1,c=a.length;bNumber.EPSILON){if(0>k&&(g=b[f],l=-l,h=b[e],k=-k),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=k*(a.x-g.x)-l*(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=ya.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);var g,h,l,k=[];if(1===f.length)return h=f[0],l=new yb,l.curves=h.curves,k.push(l),k;var p=!e(f[0].getPoints()),p=a?!p:p;l=[];var q=[],n=[],t=0,z;q[t]=void 0;n[t]=[];for(var r=0,x=f.length;rd&& +this._mixBufferRegion(c,a,3*b,1-d,b);for(var d=b,f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a=this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a,b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){oa.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f= +1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});Object.assign(Re.prototype,{getValue:function(a,b){this.bind();var c=this._bindings[this._targetGroup.nCachedObjects_];void 0!==c&&c.getValue(a,b)},setValue:function(a,b){for(var c=this._bindings,d=this._targetGroup.nCachedObjects_,e=c.length;d!==e;++d)c[d].setValue(a,b)},bind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_, +c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(la,{Composite:Re,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new la.Composite(a,b,c):new la(a,b,c)},parseTrackName:function(){var a=new RegExp("^"+/((?:[\w-]+[\/:])*)/.source+/([\w-\.]+)?/.source+/(?:\.([\w-]+)(?:\[(.+)\])?)?/.source+/\.([\w-]+)(?:\[(.+)\])?/.source+"$"),b=["material","materials","bones"];return function(c){var d=a.exec(c);if(!d)throw Error("PropertyBinding: Cannot parse trackName: "+c);var d={nodeName:d[2],objectName:d[3], +objectIndex:d[4],propertyName:d[5],propertyIndex:d[6]},e=d.nodeName&&d.nodeName.lastIndexOf(".");if(void 0!==e&&-1!==e){var f=d.nodeName.substring(e+1);-1!==b.indexOf(f)&&(d.nodeName=d.nodeName.substring(0,e),d.objectName=f)}if(null===d.propertyName||0===d.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+c);return d}}(),findNode:function(a,b){if(!b||""===b||"root"===b||"."===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){var c=function(a){for(var c= +0;c=c){var q=c++,n=b[q];d[n.uuid]=p;b[p]=n;d[m]=q;b[q]=k;k=0;for(m=f;k!==m;++k){var n=e[k],t=n[p];n[p]=n[q];n[q]=t}}}this.nCachedObjects_=c},uncache:function(a){for(var b=this._objects,c=b.length,d=this.nCachedObjects_,e=this._indicesByUUID,f=this._bindings,g=f.length,h=0,k=arguments.length;h!==k;++h){var m=arguments[h].uuid,p=e[m];if(void 0!== +p)if(delete e[m],pb||0===c)return;this._startTime=null;b*=c}b*=this._updateTimeScale(a);c=this._updateTime(b);a=this._updateWeight(a);if(0c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight=b},_updateTimeScale:function(a){var b=0;if(!this.paused){var b=this.timeScale,c=this._timeScaleInterpolant;if(null!==c){var d=c.evaluate(a)[0],b=b*d;a>c.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a;if(0===a)return b;var c=this._clip.duration,d=this.loop,e=this._loopCount;if(2200=== +d)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else break a;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:"finished",action:this,direction:0>a?-1:1})}else{d=2202===d;-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,d)):this._setEndings(0===this.repetitions,!0,d));if(b>=c||0>b){var f=Math.floor(b/c),b=b-c*f,e=e+Math.abs(f),g=this.repetitions-e;0>g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=0a,this._setEndings(a,!a,d)):this._setEndings(!1,!1,d),this._loopCount=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:f}))}if(d&&1===(e&1))return this.time=b,c-b}return this.time=b},_setEndings:function(a,b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a, +b,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}});Object.assign(Ue.prototype,ra.prototype,{_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings,g=a._interpolants,h=c.uuid,k=this._bindingsByRootAndName,m=k[h];void 0===m&&(m={},k[h]=m);for(k=0;k!==e;++k){var p=d[k],q=p.name,n=m[q];if(void 0=== +n){n=f[k];if(void 0!==n){null===n._cacheIndex&&(++n.referenceCount,this._addInactiveBinding(n,h,q));continue}n=new ie(la.create(c,q,b&&b._propertyBindings[k].binding.parsedPath),p.ValueTypeName,p.getValueSize());++n.referenceCount;this._addInactiveBinding(n,h,q)}f[k]=n;g[k].resultBuffer=n.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a, +c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings= +0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&a d.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.start+Y.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);d.currentFrame!== d.lastFrame?(this.morphTargetInfluences[d.currentFrame]=e*g,this.morphTargetInfluences[d.lastFrame]=(1-e)*g):this.morphTargetInfluences[d.currentFrame]=g}}};Wc.prototype=Object.create(A.prototype);Wc.prototype.constructor=Wc;Wc.prototype.isImmediateRenderObject=!0;Xc.prototype=Object.create(ca.prototype);Xc.prototype.constructor=Xc;Xc.prototype.update=function(){var a=new p,b=new p,c=new Fa;return function(){var d=["a","b","c"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld); -var e=this.object.matrixWorld,f=this.geometry.attributes.position,g=this.object.geometry;if(g&&g.isGeometry)for(var h=g.vertices,k=g.faces,m=g=0,p=k.length;m