|
@@ -129,8 +129,8 @@ n.height);q.__version=b.version;if(b.onUpdate)b.onUpdate(b);return}c.activeTextu
|
|
|
1015===g.type&&null===b.get("OES_texture_float_linear")||1016===g.type&&null===b.get("OES_texture_half_float_linear")||!(1<g.anisotropy||d.get(g).__currentAnisotropy)||(a.texParameterf(c,h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,e.getMaxAnisotropy())),d.get(g).__currentAnisotropy=g.anisotropy)}function p(b,e,g,h){var l=f.convert(e.texture.format),m=f.convert(e.texture.type);c.texImage2D(h,0,l,e.width,e.height,0,l,m,null);a.bindFramebuffer(a.FRAMEBUFFER,b);a.framebufferTexture2D(a.FRAMEBUFFER,
|
|
|
g,h,d.get(e.texture).__webglTexture,0);a.bindFramebuffer(a.FRAMEBUFFER,null)}function x(b,c){a.bindRenderbuffer(a.RENDERBUFFER,b);c.depthBuffer&&!c.stencilBuffer?(a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_COMPONENT16,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,b)):c.depthBuffer&&c.stencilBuffer?(a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,c.width,c.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,
|
|
|
b)):a.renderbufferStorage(a.RENDERBUFFER,a.RGBA4,c.width,c.height);a.bindRenderbuffer(a.RENDERBUFFER,null)}var w="undefined"!==typeof WebGL2RenderingContext&&a instanceof WebGL2RenderingContext,H={},C;this.setTexture2D=k;this.setTextureCube=function(b,n){var q=d.get(b);if(6===b.image.length)if(0<b.version&&q.__version!==b.version){q.__image__webglTextureCube||(b.addEventListener("dispose",r),q.__image__webglTextureCube=a.createTexture(),g.memory.textures++);c.activeTexture(a.TEXTURE0+n);c.bindTexture(a.TEXTURE_CUBE_MAP,
|
|
|
-q.__image__webglTextureCube);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY);n=b&&b.isCompressedTexture;for(var k=b.image[0]&&b.image[0].isDataTexture,t=[],p=0;6>p;p++)t[p]=n||k?k?b.image[p].image:b.image[p]:h(b.image[p],e.maxCubemapSize);var w=t[0],z=l(w),x=f.convert(b.format),V=f.convert(b.type);u(a.TEXTURE_CUBE_MAP,b,z);for(p=0;6>p;p++)if(n)for(var H,C=t[p].mipmaps,Q=0,y=C.length;Q<y;Q++)H=C[Q],1023!==b.format&&1022!==b.format?-1<c.getCompressedTextureFormats().indexOf(x)?c.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+
|
|
|
-p,Q,x,H.width,H.height,0,H.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,Q,x,H.width,H.height,0,x,V,H.data);else k?c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,x,t[p].width,t[p].height,0,x,V,t[p].data):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,x,x,V,t[p]);q.__maxMipLevel=n?C.length-1:0;m(b,z)&&v(a.TEXTURE_CUBE_MAP,b,w.width,w.height);q.__version=b.version;if(b.onUpdate)b.onUpdate(b)}else c.activeTexture(a.TEXTURE0+
|
|
|
+q.__image__webglTextureCube);a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b.flipY);n=b&&b.isCompressedTexture;for(var k=b.image[0]&&b.image[0].isDataTexture,t=[],p=0;6>p;p++)t[p]=n||k?k?b.image[p].image:b.image[p]:h(b.image[p],e.maxCubemapSize);var w=t[0],z=l(w),x=f.convert(b.format),V=f.convert(b.type);u(a.TEXTURE_CUBE_MAP,b,z);for(p=0;6>p;p++)if(n)for(var C,H=t[p].mipmaps,Q=0,y=H.length;Q<y;Q++)C=H[Q],1023!==b.format&&1022!==b.format?-1<c.getCompressedTextureFormats().indexOf(x)?c.compressedTexImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+
|
|
|
+p,Q,x,C.width,C.height,0,C.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,Q,x,C.width,C.height,0,x,V,C.data);else k?c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,x,t[p].width,t[p].height,0,x,V,t[p].data):c.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,x,x,V,t[p]);q.__maxMipLevel=n?H.length-1:0;m(b,z)&&v(a.TEXTURE_CUBE_MAP,b,w.width,w.height);q.__version=b.version;if(b.onUpdate)b.onUpdate(b)}else c.activeTexture(a.TEXTURE0+
|
|
|
n),c.bindTexture(a.TEXTURE_CUBE_MAP,q.__image__webglTextureCube)};this.setTextureCubeDynamic=function(b,e){c.activeTexture(a.TEXTURE0+e);c.bindTexture(a.TEXTURE_CUBE_MAP,d.get(b).__webglTexture)};this.setupRenderTarget=function(b){var e=d.get(b),f=d.get(b.texture);b.addEventListener("dispose",q);f.__webglTexture=a.createTexture();g.memory.textures++;var h=!0===b.isWebGLRenderTargetCube,n=l(b);if(h){e.__webglFramebuffer=[];for(var r=0;6>r;r++)e.__webglFramebuffer[r]=a.createFramebuffer()}else e.__webglFramebuffer=
|
|
|
a.createFramebuffer();if(h){c.bindTexture(a.TEXTURE_CUBE_MAP,f.__webglTexture);u(a.TEXTURE_CUBE_MAP,b.texture,n);for(r=0;6>r;r++)p(e.__webglFramebuffer[r],b,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+r);m(b.texture,n)&&v(a.TEXTURE_CUBE_MAP,b.texture,b.width,b.height);c.bindTexture(a.TEXTURE_CUBE_MAP,null)}else c.bindTexture(a.TEXTURE_2D,f.__webglTexture),u(a.TEXTURE_2D,b.texture,n),p(e.__webglFramebuffer,b,a.COLOR_ATTACHMENT0,a.TEXTURE_2D),m(b.texture,n)&&v(a.TEXTURE_2D,b.texture,b.width,b.height),
|
|
|
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&&
|
|
@@ -149,9 +149,9 @@ q.matrixWorldInverse.fromArray(f.rightViewMatrix);l.getInverse(h);r.matrixWorldI
|
|
|
a.length&&(a=a[0],null!==a.leftBounds&&4===a.leftBounds.length&&r.bounds.fromArray(a.leftBounds),null!==a.rightBounds&&4===a.rightBounds.length&&q.bounds.fromArray(a.rightBounds));return k};this.getStandingMatrix=function(){return h};this.isPresenting=b;var x=new Td;this.setAnimationLoop=function(a){x.setAnimationLoop(a)};this.submitFrame=function(){b()&&e.submitFrame()};this.dispose=function(){"undefined"!==typeof window&&window.removeEventListener("vrdisplaypresentchange",c)}}function Lg(a){function b(){return null!==
|
|
|
f&&null!==g}function c(a,b){null===b?a.matrixWorld.copy(a.matrix):a.matrixWorld.multiplyMatrices(b.matrixWorld,a.matrix);a.matrixWorldInverse.getInverse(a.matrixWorld)}var d=a.context,e=null,f=null,g=null,h=null,l=new X;l.layers.enable(1);l.viewport=new U;var m=new X;m.layers.enable(2);m.viewport=new U;var v=new Ec([l,m]);v.layers.enable(1);v.layers.enable(2);this.enabled=!1;this.getDevice=function(){return e};this.setDevice=function(a){void 0!==a&&(e=a);d.setCompatibleXRDevice(a)};this.setSession=
|
|
|
function(b,c){f=b;null!==f&&(f.addEventListener("end",function(){a.setFramebuffer(null);r.stop()}),f.baseLayer=new XRWebGLLayer(f,d),f.requestFrameOfReference(c.frameOfReferenceType).then(function(b){g=b;a.setFramebuffer(f.baseLayer.framebuffer);r.setContext(f);r.start()}))};this.getCamera=function(a){if(b()){var d=a.parent,e=v.cameras;c(v,d);for(var f=0;f<e.length;f++)c(e[f],d);a.matrixWorld.copy(v.matrixWorld);a=a.children;f=0;for(d=a.length;f<d;f++)a[f].updateMatrixWorld(!0);return v}return a};
|
|
|
-this.isPresenting=b;var n=null,r=new Td;r.setAnimationLoop(function(a,b){h=b.getDevicePose(g);a=f.baseLayer;b=b.views;for(var c=0;c<b.length;c++){var d=b[c],e=a.getViewport(d),l=h.getViewMatrix(d),m=v.cameras[c];m.matrix.fromArray(l).getInverse(m.matrix);m.projectionMatrix.fromArray(d.projectionMatrix);m.viewport.set(e.x,e.y,e.width,e.height);0===c&&(v.matrix.copy(m.matrix),v.projectionMatrix.copy(m.projectionMatrix))}n&&n()});this.setAnimationLoop=function(a){n=a};this.dispose=function(){};this.getStandingMatrix=
|
|
|
-function(){console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed.");return new THREE.Matrix4};this.submitFrame=function(){}}function Zd(a){function b(){la=new Nf(D);la.get("WEBGL_depth_texture");la.get("OES_texture_float");la.get("OES_texture_float_linear");la.get("OES_texture_half_float");la.get("OES_texture_half_float_linear");la.get("OES_standard_derivatives");la.get("OES_element_index_uint");la.get("ANGLE_instanced_arrays");ha=new Ze(D,la);Ra=new Lf(D,la,a);Z=new Jg(D,la,ha);
|
|
|
-Z.scissor(T.copy(N).multiplyScalar(Y));Z.viewport(S.copy(ba).multiplyScalar(Y));gb=new Qf(D);Ba=new yg;hb=new Kg(D,la,Z,Ba,Ra,ha,gb);ra=new Ef(D);sa=new Of(D,ra,gb);oa=new Tf(sa,gb);va=new Sf(D);na=new xg(A,la,Ra);ta=new Cg;pa=new Hg;ma=new Jf(A,Z,oa,C);wa=new Kf(D,la,gb);ya=new Pf(D,la,gb);za=new Ig(A,D,Z,hb,Ra);gb.programs=na.programs;A.context=D;A.capabilities=Ra;A.extensions=la;A.properties=Ba;A.renderLists=ta;A.state=Z;A.info=gb}function c(a){a.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");
|
|
|
+this.isPresenting=b;var n=null,r=new Td;r.setAnimationLoop(function(a,b){h=b.getDevicePose(g);var c=f.baseLayer;b=b.views;for(var d=0;d<b.length;d++){var e=b[d],l=c.getViewport(e),m=h.getViewMatrix(e),r=v.cameras[d];r.matrix.fromArray(m).getInverse(r.matrix);r.projectionMatrix.fromArray(e.projectionMatrix);r.viewport.set(l.x,l.y,l.width,l.height);0===d&&(v.matrix.copy(r.matrix),v.projectionMatrix.copy(r.projectionMatrix))}n&&n(a)});this.setAnimationLoop=function(a){n=a};this.dispose=function(){};
|
|
|
+this.getStandingMatrix=function(){console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed.");return new THREE.Matrix4};this.submitFrame=function(){}}function Zd(a){function b(){la=new Nf(D);la.get("WEBGL_depth_texture");la.get("OES_texture_float");la.get("OES_texture_float_linear");la.get("OES_texture_half_float");la.get("OES_texture_half_float_linear");la.get("OES_standard_derivatives");la.get("OES_element_index_uint");la.get("ANGLE_instanced_arrays");ha=new Ze(D,la);Ra=new Lf(D,
|
|
|
+la,a);Z=new Jg(D,la,ha);Z.scissor(T.copy(N).multiplyScalar(Y));Z.viewport(S.copy(ba).multiplyScalar(Y));gb=new Qf(D);Ba=new yg;hb=new Kg(D,la,Z,Ba,Ra,ha,gb);ra=new Ef(D);sa=new Of(D,ra,gb);oa=new Tf(sa,gb);va=new Sf(D);na=new xg(A,la,Ra);ta=new Cg;pa=new Hg;ma=new Jf(A,Z,oa,C);wa=new Kf(D,la,gb);ya=new Pf(D,la,gb);za=new Ig(A,D,Z,hb,Ra);gb.programs=na.programs;A.context=D;A.capabilities=Ra;A.extensions=la;A.properties=Ba;A.renderLists=ta;A.state=Z;A.info=gb}function c(a){a.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");
|
|
|
B=!0}function d(){console.log("THREE.WebGLRenderer: Context Restored.");B=!1;b()}function e(a){a=a.target;a.removeEventListener("dispose",e);f(a);Ba.remove(a)}function f(a){var b=Ba.get(a).program;a.program=void 0;void 0!==b&&na.releaseProgram(b)}function g(a,b,c){a.render(function(a){A.renderBufferImmediate(a,b,c)})}function h(a,b,c){if(!1!==a.visible){if(a.layers.test(b.layers))if(a.isLight)y.pushLight(a),a.castShadow&&y.pushShadow(a);else if(a.isSprite)a.frustumCulled&&!ea.intersectsSprite(a)||
|
|
|
y.pushSprite(a);else if(a.isImmediateRenderObject)c&&Rb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(fa),E.push(a,null,a.material,Rb.z,null);else if(a.isMesh||a.isLine||a.isPoints)if(a.isSkinnedMesh&&a.skeleton.update(),!a.frustumCulled||ea.intersectsObject(a)){c&&Rb.setFromMatrixPosition(a.matrixWorld).applyMatrix4(fa);var d=oa.update(a),e=a.material;if(Array.isArray(e))for(var f=d.groups,g=0,l=f.length;g<l;g++){var m=f[g],n=e[m.materialIndex];n&&n.visible&&E.push(a,d,n,Rb.z,m)}else e.visible&&
|
|
|
E.push(a,d,e,Rb.z,null)}a=a.children;g=0;for(l=a.length;g<l;g++)h(a[g],b,c)}}function l(a,b,c,d){for(var e=0,f=a.length;e<f;e++){var g=a[e],h=g.object,l=g.geometry,n=void 0===d?g.material:d;g=g.group;if(c.isArrayCamera){W=c;for(var v=c.cameras,r=0,k=v.length;r<k;r++){var q=v[r];if(h.layers.test(q.layers)){if("viewport"in q)Z.viewport(S.copy(q.viewport));else{var t=q.bounds;Z.viewport(S.set(t.x*Ya,t.y*R,t.z*Ya,t.w*R).multiplyScalar(Y))}m(h,b,q,l,n,g)}}}else W=null,m(h,b,c,l,n,g)}}function m(a,b,c,
|
|
@@ -184,11 +184,11 @@ a.hasNormals&&!d.normal&&(d.normal=D.createBuffer());a.hasUvs&&!d.uv&&(d.uv=D.cr
|
|
|
c.flatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,l=(g[e+1]+g[e+4]+g[e+7])/3,m=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=l;g[e+2]=m;g[e+3]=h;g[e+4]=l;g[e+5]=m;g[e+6]=h;g[e+7]=l;g[e+8]=m}D.bufferData(D.ARRAY_BUFFER,a.normalArray,D.DYNAMIC_DRAW);Z.enableAttribute(b.normal);D.vertexAttribPointer(b.normal,3,D.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(D.bindBuffer(D.ARRAY_BUFFER,d.uv),D.bufferData(D.ARRAY_BUFFER,a.uvArray,D.DYNAMIC_DRAW),Z.enableAttribute(b.uv),D.vertexAttribPointer(b.uv,
|
|
|
2,D.FLOAT,!1,0,0));a.hasColors&&0!==c.vertexColors&&(D.bindBuffer(D.ARRAY_BUFFER,d.color),D.bufferData(D.ARRAY_BUFFER,a.colorArray,D.DYNAMIC_DRAW),Z.enableAttribute(b.color),D.vertexAttribPointer(b.color,3,D.FLOAT,!1,0,0));Z.disableUnusedAttributes();D.drawArrays(D.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){var g=e.isMesh&&0>e.matrixWorld.determinant();Z.setMaterial(d,g);var h=n(a,b,d,e);a=c.id+"_"+h.id+"_"+(!0===d.wireframe);var l=!1;a!==O&&(O=a,l=!0);e.morphTargetInfluences&&
|
|
|
(va.update(e,c,d,h),l=!0);g=c.index;var m=c.attributes.position;b=1;!0===d.wireframe&&(g=sa.getWireframeAttribute(c),b=2);a=wa;if(null!==g){var v=ra.get(g);a=ya;a.setIndex(v)}if(l){if(c&&c.isInstancedBufferGeometry&&null===la.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{Z.initAttributes();l=c.attributes;h=h.getAttributes();var r=d.defaultAttributeValues;
|
|
|
-for(C in h){var k=h[C];if(0<=k){var q=l[C];if(void 0!==q){var t=q.normalized,u=q.itemSize,p=ra.get(q);if(void 0!==p){var z=p.buffer,w=p.type;p=p.bytesPerElement;if(q.isInterleavedBufferAttribute){var x=q.data,H=x.stride;q=q.offset;x&&x.isInstancedInterleavedBuffer?(Z.enableAttributeAndDivisor(k,x.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=x.meshPerAttribute*x.count)):Z.enableAttribute(k);D.bindBuffer(D.ARRAY_BUFFER,z);D.vertexAttribPointer(k,u,w,t,H*p,q*p)}else q.isInstancedBufferAttribute?
|
|
|
-(Z.enableAttributeAndDivisor(k,q.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=q.meshPerAttribute*q.count)):Z.enableAttribute(k),D.bindBuffer(D.ARRAY_BUFFER,z),D.vertexAttribPointer(k,u,w,t,0,0)}}else if(void 0!==r&&(t=r[C],void 0!==t))switch(t.length){case 2:D.vertexAttrib2fv(k,t);break;case 3:D.vertexAttrib3fv(k,t);break;case 4:D.vertexAttrib4fv(k,t);break;default:D.vertexAttrib1fv(k,t)}}}Z.disableUnusedAttributes()}null!==g&&D.bindBuffer(D.ELEMENT_ARRAY_BUFFER,v.buffer)}v=
|
|
|
-Infinity;null!==g?v=g.count:void 0!==m&&(v=m.count);g=c.drawRange.start*b;m=null!==f?f.start*b:0;var C=Math.max(g,m);f=Math.max(0,Math.min(v,g+c.drawRange.count*b,m+(null!==f?f.count*b:Infinity))-1-C+1);if(0!==f){if(e.isMesh)if(!0===d.wireframe)Z.setLineWidth(d.wireframeLinewidth*(null===G?Y:1)),a.setMode(D.LINES);else switch(e.drawMode){case 0:a.setMode(D.TRIANGLES);break;case 1:a.setMode(D.TRIANGLE_STRIP);break;case 2:a.setMode(D.TRIANGLE_FAN)}else e.isLine?(d=d.linewidth,void 0===d&&(d=1),Z.setLineWidth(d*
|
|
|
-(null===G?Y:1)),e.isLineSegments?a.setMode(D.LINES):e.isLineLoop?a.setMode(D.LINE_LOOP):a.setMode(D.LINE_STRIP)):e.isPoints&&a.setMode(D.POINTS);c&&c.isInstancedBufferGeometry?0<c.maxInstancedCount&&a.renderInstances(c,C,f):a.render(C,f)}};this.compile=function(a,b){y=pa.get(a,b);y.init();a.traverse(function(a){a.isLight&&(y.pushLight(a),a.castShadow&&y.pushShadow(a))});y.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=0;c<b.material.length;c++)v(b.material[c],
|
|
|
-a.fog,b);else v(b.material,a.fog,b)})};var xa=null,ua=new Td;ua.setAnimationLoop(function(){ka.isPresenting()||xa&&xa()});"undefined"!==typeof window&&ua.setContext(window);this.setAnimationLoop=function(a){xa=a;ka.setAnimationLoop(a);ua.start()};this.render=function(a,b,c,d){if(!b||!b.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else if(!B){O="";J=-1;L=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();ka.enabled&&
|
|
|
+for(H in h){var k=h[H];if(0<=k){var q=l[H];if(void 0!==q){var t=q.normalized,u=q.itemSize,p=ra.get(q);if(void 0!==p){var z=p.buffer,w=p.type;p=p.bytesPerElement;if(q.isInterleavedBufferAttribute){var x=q.data,C=x.stride;q=q.offset;x&&x.isInstancedInterleavedBuffer?(Z.enableAttributeAndDivisor(k,x.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=x.meshPerAttribute*x.count)):Z.enableAttribute(k);D.bindBuffer(D.ARRAY_BUFFER,z);D.vertexAttribPointer(k,u,w,t,C*p,q*p)}else q.isInstancedBufferAttribute?
|
|
|
+(Z.enableAttributeAndDivisor(k,q.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=q.meshPerAttribute*q.count)):Z.enableAttribute(k),D.bindBuffer(D.ARRAY_BUFFER,z),D.vertexAttribPointer(k,u,w,t,0,0)}}else if(void 0!==r&&(t=r[H],void 0!==t))switch(t.length){case 2:D.vertexAttrib2fv(k,t);break;case 3:D.vertexAttrib3fv(k,t);break;case 4:D.vertexAttrib4fv(k,t);break;default:D.vertexAttrib1fv(k,t)}}}Z.disableUnusedAttributes()}null!==g&&D.bindBuffer(D.ELEMENT_ARRAY_BUFFER,v.buffer)}v=
|
|
|
+Infinity;null!==g?v=g.count:void 0!==m&&(v=m.count);g=c.drawRange.start*b;m=null!==f?f.start*b:0;var H=Math.max(g,m);f=Math.max(0,Math.min(v,g+c.drawRange.count*b,m+(null!==f?f.count*b:Infinity))-1-H+1);if(0!==f){if(e.isMesh)if(!0===d.wireframe)Z.setLineWidth(d.wireframeLinewidth*(null===G?Y:1)),a.setMode(D.LINES);else switch(e.drawMode){case 0:a.setMode(D.TRIANGLES);break;case 1:a.setMode(D.TRIANGLE_STRIP);break;case 2:a.setMode(D.TRIANGLE_FAN)}else e.isLine?(d=d.linewidth,void 0===d&&(d=1),Z.setLineWidth(d*
|
|
|
+(null===G?Y:1)),e.isLineSegments?a.setMode(D.LINES):e.isLineLoop?a.setMode(D.LINE_LOOP):a.setMode(D.LINE_STRIP)):e.isPoints&&a.setMode(D.POINTS);c&&c.isInstancedBufferGeometry?0<c.maxInstancedCount&&a.renderInstances(c,H,f):a.render(H,f)}};this.compile=function(a,b){y=pa.get(a,b);y.init();a.traverse(function(a){a.isLight&&(y.pushLight(a),a.castShadow&&y.pushShadow(a))});y.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=0;c<b.material.length;c++)v(b.material[c],
|
|
|
+a.fog,b);else v(b.material,a.fog,b)})};var xa=null,ua=new Td;ua.setAnimationLoop(function(a){ka.isPresenting()||xa&&xa(a)});"undefined"!==typeof window&&ua.setContext(window);this.setAnimationLoop=function(a){xa=a;ka.setAnimationLoop(a);ua.start()};this.render=function(a,b,c,d){if(!b||!b.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else if(!B){O="";J=-1;L=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();ka.enabled&&
|
|
|
(b=ka.getCamera(b));y=pa.get(a,b);y.init();a.onBeforeRender(A,a,b,c);fa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);ea.setFromMatrix(fa);qa=this.localClippingEnabled;ja=X.init(this.clippingPlanes,qa,b);E=ta.get(a,b);E.init();h(a,b,A.sortObjects);!0===A.sortObjects&&E.sort();ja&&X.beginShadows();Aa.render(y.state.shadowsArray,a,b);y.setupLights(b);ja&&X.endShadows();this.info.autoReset&&this.info.reset();void 0===c&&(c=null);this.setRenderTarget(c);ma.render(E,a,b,d);d=E.opaque;var e=
|
|
|
E.transparent;if(a.overrideMaterial){var f=a.overrideMaterial;d.length&&l(d,a,b,f);e.length&&l(e,a,b,f)}else d.length&&l(d,a,b),e.length&&l(e,a,b);za.render(y.state.spritesArray,a,b);c&&hb.updateRenderTargetMipmap(c);Z.buffers.depth.setTest(!0);Z.buffers.depth.setMask(!0);Z.buffers.color.setMask(!0);Z.setPolygonOffset(!1);a.onAfterRender(A,a,b);ka.enabled&&ka.submitFrame();y=E=null}};this.allocTextureUnit=function(){var a=ca;a>=Ra.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+a+
|
|
|
" texture units while this GPU supports only "+Ra.maxTextures);ca+=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);hb.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);hb.setTexture2D(b,
|
|
@@ -530,9 +530,9 @@ l[a];var u=g.vertexNormals;r=g.vertexColors;n=new Xa(g.a+e,g.b+e,g.c+e);n.normal
|
|
|
a)},mergeMesh:function(a){a&&a.isMesh?(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a)},mergeVertices:function(){var a={},b=[],c=[],d=Math.pow(10,4),e;var f=0;for(e=this.vertices.length;f<e;f++){var g=this.vertices[f];g=Math.round(g.x*d)+"_"+Math.round(g.y*d)+"_"+Math.round(g.z*d);void 0===a[g]?(a[g]=f,b.push(this.vertices[f]),c[f]=b.length-1):c[f]=c[a[g]]}a=[];f=0;for(e=this.faces.length;f<e;f++)for(d=
|
|
|
this.faces[f],d.a=c[d.a],d.b=c[d.b],d.c=c[d.c],d=[d.a,d.b,d.c],g=0;3>g;g++)if(d[g]===d[(g+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(d=a[f],this.faces.splice(d,1),c=0,e=this.faceVertexUvs.length;c<e;c++)this.faceVertexUvs[c].splice(d,1);f=this.vertices.length-b.length;this.vertices=b;return f},setFromPoints:function(a){this.vertices=[];for(var b=0,c=a.length;b<c;b++){var d=a[b];this.vertices.push(new p(d.x,d.y,d.z||0))}return this},sortFacesByMaterialIndex:function(){for(var a=this.faces,
|
|
|
b=a.length,c=0;c<b;c++)a[c]._id=c;a.sort(function(a,b){return a.materialIndex-b.materialIndex});var d=this.faceVertexUvs[0],e=this.faceVertexUvs[1],f,g;d&&d.length===b&&(f=[]);e&&e.length===b&&(g=[]);for(c=0;c<b;c++){var h=a[c]._id;f&&f.push(d[h]);g&&g.push(e[h])}f&&(this.faceVertexUvs[0]=f);g&&(this.faceVertexUvs[1]=g)},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==m[b])return m[b];m[b]=l.length/3;l.push(a.x,
|
|
|
-a.y,a.z);return m[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==n[b])return n[b];n[b]=k.length;k.push(a.getHex());return n[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=p.length/2;p.push(a.x,a.y);return q[b]}var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&
|
|
|
-(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}h=[];var l=[],m={},k=[],n={},p=[],q={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],u=void 0!==this.faceVertexUvs[0][g],z=0<t.normal.length(),x=0<t.vertexNormals.length,w=1!==t.color.r||1!==t.color.g||1!==t.color.b,y=0<t.vertexColors.length,C=0;C=a(C,0,0);C=a(C,1,!0);C=a(C,2,!1);C=a(C,3,u);C=a(C,4,z);C=a(C,5,x);C=a(C,6,w);C=a(C,7,y);h.push(C);h.push(t.a,t.b,t.c);h.push(t.materialIndex);
|
|
|
-u&&(u=this.faceVertexUvs[0][g],h.push(d(u[0]),d(u[1]),d(u[2])));z&&h.push(b(t.normal));x&&(z=t.vertexNormals,h.push(b(z[0]),b(z[1]),b(z[2])));w&&h.push(c(t.color));y&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=l;0<k.length&&(e.data.colors=k);0<p.length&&(e.data.uvs=[p]);e.data.faces=h;return e},clone:function(){return(new J).copy(this)},copy:function(a){var b,c,d;this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=
|
|
|
+a.y,a.z);return m[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==n[b])return n[b];n[b]=k.length;k.push(a.getHex());return n[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==p[b])return p[b];p[b]=r.length/2;r.push(a.x,a.y);return p[b]}var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&
|
|
|
+(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var h=this.vertices[g];f.push(h.x,h.y,h.z)}h=[];var l=[],m={},k=[],n={},r=[],p={};for(g=0;g<this.faces.length;g++){var t=this.faces[g],u=void 0!==this.faceVertexUvs[0][g],z=0<t.normal.length(),x=0<t.vertexNormals.length,w=1!==t.color.r||1!==t.color.g||1!==t.color.b,y=0<t.vertexColors.length,C=0;C=a(C,0,0);C=a(C,1,!0);C=a(C,2,!1);C=a(C,3,u);C=a(C,4,z);C=a(C,5,x);C=a(C,6,w);C=a(C,7,y);h.push(C);h.push(t.a,t.b,t.c);h.push(t.materialIndex);
|
|
|
+u&&(u=this.faceVertexUvs[0][g],h.push(d(u[0]),d(u[1]),d(u[2])));z&&h.push(b(t.normal));x&&(z=t.vertexNormals,h.push(b(z[0]),b(z[1]),b(z[2])));w&&h.push(c(t.color));y&&(t=t.vertexColors,h.push(c(t[0]),c(t[1]),c(t[2])))}e.data={};e.data.vertices=f;e.data.normals=l;0<k.length&&(e.data.colors=k);0<r.length&&(e.data.uvs=[r]);e.data.faces=h;return e},clone:function(){return(new J).copy(this)},copy:function(a){var b,c,d;this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=
|
|
|
[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.name=a.name;var e=a.vertices;var f=0;for(b=e.length;f<b;f++)this.vertices.push(e[f].clone());e=a.colors;f=0;for(b=e.length;f<b;f++)this.colors.push(e[f].clone());e=a.faces;f=0;for(b=e.length;f<b;f++)this.faces.push(e[f].clone());f=0;for(b=a.faceVertexUvs.length;f<b;f++){var g=a.faceVertexUvs[f];void 0===this.faceVertexUvs[f]&&(this.faceVertexUvs[f]=[]);e=0;for(c=g.length;e<
|
|
|
c;e++){var h=g[e],l=[];var m=0;for(d=h.length;m<d;m++)l.push(h[m].clone());this.faceVertexUvs[f].push(l)}}m=a.morphTargets;f=0;for(b=m.length;f<b;f++){d={};d.name=m[f].name;if(void 0!==m[f].vertices)for(d.vertices=[],e=0,c=m[f].vertices.length;e<c;e++)d.vertices.push(m[f].vertices[e].clone());if(void 0!==m[f].normals)for(d.normals=[],e=0,c=m[f].normals.length;e<c;e++)d.normals.push(m[f].normals[e].clone());this.morphTargets.push(d)}m=a.morphNormals;f=0;for(b=m.length;f<b;f++){d={};if(void 0!==m[f].vertexNormals)for(d.vertexNormals=
|
|
|
[],e=0,c=m[f].vertexNormals.length;e<c;e++)g=m[f].vertexNormals[e],h={},h.a=g.a.clone(),h.b=g.b.clone(),h.c=g.c.clone(),d.vertexNormals.push(h);if(void 0!==m[f].faceNormals)for(d.faceNormals=[],e=0,c=m[f].faceNormals.length;e<c;e++)d.faceNormals.push(m[f].faceNormals[e].clone());this.morphNormals.push(d)}e=a.skinWeights;f=0;for(b=e.length;f<b;f++)this.skinWeights.push(e[f].clone());e=a.skinIndices;f=0;for(b=e.length;f<b;f++)this.skinIndices.push(e[f].clone());e=a.lineDistances;f=0;for(b=e.length;f<
|
|
@@ -544,9 +544,9 @@ this.array,c=0,d=0,e=a.length;d<e;d++){var f=a[d];void 0===f&&(console.warn("THR
|
|
|
getZ:function(a){return this.array[a*this.itemSize+2]},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},getW:function(a){return this.array[a*this.itemSize+3]},setW:function(a,b){this.array[a*this.itemSize+3]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a+0]=b;this.array[a+
|
|
|
1]=c;this.array[a+2]=d;this.array[a+3]=e;return this},onUpload:function(a){this.onUploadCallback=a;return this},clone:function(){return(new this.constructor(this.array,this.itemSize)).copy(this)}});vc.prototype=Object.create(O.prototype);vc.prototype.constructor=vc;wc.prototype=Object.create(O.prototype);wc.prototype.constructor=wc;xc.prototype=Object.create(O.prototype);xc.prototype.constructor=xc;yc.prototype=Object.create(O.prototype);yc.prototype.constructor=yc;nb.prototype=Object.create(O.prototype);
|
|
|
nb.prototype.constructor=nb;zc.prototype=Object.create(O.prototype);zc.prototype.constructor=zc;ob.prototype=Object.create(O.prototype);ob.prototype.constructor=ob;A.prototype=Object.create(O.prototype);A.prototype.constructor=A;Ac.prototype=Object.create(O.prototype);Ac.prototype.constructor=Ac;Object.assign(Ee.prototype,{computeGroups:function(a){var b=[],c=void 0;a=a.faces;for(var d=0;d<a.length;d++){var e=a[d];if(e.materialIndex!==c){c=e.materialIndex;void 0!==f&&(f.count=3*d-f.start,b.push(f));
|
|
|
-var f={start:3*d,materialIndex:c}}}void 0!==f&&(f.count=3*d-f.start,b.push(f));this.groups=b},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,h=g.length;if(0<h){var l=[];for(var m=0;m<h;m++)l[m]=[];this.morphTargets.position=l}var k=a.morphNormals,n=k.length;if(0<n){var p=[];for(m=0;m<n;m++)p[m]=[];this.morphTargets.normal=p}var q=a.skinIndices,t=a.skinWeights,u=q.length===c.length,z=t.length===c.length;0<c.length&&
|
|
|
+var f={start:3*d,materialIndex:c}}}void 0!==f&&(f.count=3*d-f.start,b.push(f));this.groups=b},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,h=g.length;if(0<h){var l=[];for(var m=0;m<h;m++)l[m]=[];this.morphTargets.position=l}var k=a.morphNormals,n=k.length;if(0<n){var r=[];for(m=0;m<n;m++)r[m]=[];this.morphTargets.normal=r}var p=a.skinIndices,t=a.skinWeights,u=p.length===c.length,z=t.length===c.length;0<c.length&&
|
|
|
0===b.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(m=0;m<b.length;m++){var x=b[m];this.vertices.push(c[x.a],c[x.b],c[x.c]);var w=x.vertexNormals;3===w.length?this.normals.push(w[0],w[1],w[2]):(w=x.normal,this.normals.push(w,w,w));w=x.vertexColors;3===w.length?this.colors.push(w[0],w[1],w[2]):(w=x.color,this.colors.push(w,w,w));!0===e&&(w=d[0][m],void 0!==w?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",
|
|
|
-m),this.uvs.push(new y,new y,new y)));!0===f&&(w=d[1][m],void 0!==w?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",m),this.uvs2.push(new y,new y,new y)));for(w=0;w<h;w++){var A=g[w].vertices;l[w].push(A[x.a],A[x.b],A[x.c])}for(w=0;w<n;w++)A=k[w].vertexNormals[m],p[w].push(A.a,A.b,A.c);u&&this.skinIndices.push(q[x.a],q[x.b],q[x.c]);z&&this.skinWeights.push(t[x.a],t[x.b],t[x.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;
|
|
|
+m),this.uvs.push(new y,new y,new y)));!0===f&&(w=d[1][m],void 0!==w?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",m),this.uvs2.push(new y,new y,new y)));for(w=0;w<h;w++){var A=g[w].vertices;l[w].push(A[x.a],A[x.b],A[x.c])}for(w=0;w<n;w++)A=k[w].vertexNormals[m],r[w].push(A.a,A.b,A.c);u&&this.skinIndices.push(p[x.a],p[x.b],p[x.c]);z&&this.skinWeights.push(t[x.a],t[x.b],t[x.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;
|
|
|
this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this}});var Hf=1;G.prototype=Object.assign(Object.create(ha.prototype),{constructor:G,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(a){Array.isArray(a)?this.index=new (65535<Fe(a)?ob:nb)(a,1):this.index=a},addAttribute:function(a,b,c){if(!(b&&b.isBufferAttribute||b&&b.isInterleavedBufferAttribute))return console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
|
|
|
this.addAttribute(a,new O(b,c));if("index"===a)return console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(b),this;this.attributes[a]=b;return this},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a];return this},addGroup:function(a,b,c){this.groups.push({start:a,count:b,materialIndex:void 0!==c?c:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(a,b){this.drawRange.start=a;this.drawRange.count=
|
|
|
b},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToBufferAttribute(b),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new ta).getNormalMatrix(a).applyToBufferAttribute(b),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();return this},rotateX:function(){var a=new F;return function(b){a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new F;return function(b){a.makeRotationY(b);
|
|
@@ -721,9 +721,9 @@ trim:function(a,b){for(var c=this.times,d=c.length,e=0,f=d-1;e!==d&&c[e]<a;)++e;
|
|
|
this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&sa.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values,
|
|
|
c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;g<f;++g){var h=!1,l=a[g];if(l!==a[g+1]&&(1!==g||l!==l[0]))if(d)h=!0;else{var m=g*c,k=m-c,n=m+c;for(l=0;l!==c;++l){var p=b[m+l];if(p!==b[k+l]||p!==b[n+l]){h=!0;break}}}if(h){if(g!==e)for(a[e]=a[g],h=g*c,m=e*c,l=0;l!==c;++l)b[m+l]=b[h+l];++e}}if(0<f){a[e]=a[f];h=f*c;m=e*c;for(l=0;l!==c;++l)b[m+l]=b[h+l];++e}e!==a.length&&(this.times=sa.arraySlice(a,0,e),this.values=sa.arraySlice(b,0,e*c));return this}});lc.prototype=Object.assign(Object.create(ja.prototype),
|
|
|
{constructor:lc,ValueTypeName:"vector"});Object.assign(Fa,{parse:function(a){for(var b=[],c=a.tracks,d=1/(a.fps||1),e=0,f=c.length;e!==f;++e)b.push(ja.parse(c[e]).scale(d));return new Fa(a.name,a.duration,b)},toJSON:function(a){var b=[],c=a.tracks;a={name:a.name,duration:a.duration,tracks:b,uuid:a.uuid};for(var d=0,e=c.length;d!==e;++d)b.push(ja.toJSON(c[d]));return a},CreateFromMorphTargetSequence:function(a,b,c,d){for(var e=b.length,f=[],g=0;g<e;g++){var h=[],l=[];h.push((g+e-1)%e,g,(g+1)%e);l.push(0,
|
|
|
-1,0);var m=sa.getKeyframeOrder(h);h=sa.sortedArray(h,1,m);l=sa.sortedArray(l,1,m);d||0!==h[0]||(h.push(e),l.push(l[0]));f.push((new kc(".morphTargetInfluences["+b[g].name+"]",h,l)).scale(1/c))}return new Fa(a,-1,f)},findByName:function(a,b){var c=a;Array.isArray(a)||(c=a.geometry&&a.geometry.animations||a.animations);for(a=0;a<c.length;a++)if(c[a].name===b)return c[a];return null},CreateClipsFromMorphTargetSequences:function(a,b,c){for(var d={},e=/^([\w-]*?)([\d]+)$/,f=0,g=a.length;f<g;f++){var h=
|
|
|
-a[f],l=h.name.match(e);if(l&&1<l.length){var m=l[1];(l=d[m])||(d[m]=l=[]);l.push(h)}}a=[];for(m in d)a.push(Fa.CreateFromMorphTargetSequence(m,d[m],b,c));return a},parseAnimation:function(a,b){if(!a)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;var c=function(a,b,c,d,e){if(0!==c.length){var f=[],g=[];sa.flattenJSON(c,f,g,d);0!==f.length&&e.push(new a(b,f,g))}},d=[],e=a.name||"default",f=a.length||-1,g=a.fps||30;a=a.hierarchy||[];for(var h=0;h<a.length;h++){var l=
|
|
|
-a[h].keys;if(l&&0!==l.length)if(l[0].morphTargets){f={};for(var m=0;m<l.length;m++)if(l[m].morphTargets)for(var k=0;k<l[m].morphTargets.length;k++)f[l[m].morphTargets[k]]=-1;for(var n in f){var p=[],q=[];for(k=0;k!==l[m].morphTargets.length;++k){var t=l[m];p.push(t.time);q.push(t.morphTarget===n?1:0)}d.push(new kc(".morphTargetInfluence["+n+"]",p,q))}f=f.length*(g||1)}else m=".bones["+b[h].name+"]",c(lc,m+".position",l,"pos",d),c(fd,m+".quaternion",l,"rot",d),c(lc,m+".scale",l,"scl",d)}return 0===
|
|
|
+1,0);var k=sa.getKeyframeOrder(h);h=sa.sortedArray(h,1,k);l=sa.sortedArray(l,1,k);d||0!==h[0]||(h.push(e),l.push(l[0]));f.push((new kc(".morphTargetInfluences["+b[g].name+"]",h,l)).scale(1/c))}return new Fa(a,-1,f)},findByName:function(a,b){var c=a;Array.isArray(a)||(c=a.geometry&&a.geometry.animations||a.animations);for(a=0;a<c.length;a++)if(c[a].name===b)return c[a];return null},CreateClipsFromMorphTargetSequences:function(a,b,c){for(var d={},e=/^([\w-]*?)([\d]+)$/,f=0,g=a.length;f<g;f++){var h=
|
|
|
+a[f],l=h.name.match(e);if(l&&1<l.length){var k=l[1];(l=d[k])||(d[k]=l=[]);l.push(h)}}a=[];for(k in d)a.push(Fa.CreateFromMorphTargetSequence(k,d[k],b,c));return a},parseAnimation:function(a,b){if(!a)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;var c=function(a,b,c,d,e){if(0!==c.length){var f=[],g=[];sa.flattenJSON(c,f,g,d);0!==f.length&&e.push(new a(b,f,g))}},d=[],e=a.name||"default",f=a.length||-1,g=a.fps||30;a=a.hierarchy||[];for(var h=0;h<a.length;h++){var l=
|
|
|
+a[h].keys;if(l&&0!==l.length)if(l[0].morphTargets){f={};for(var k=0;k<l.length;k++)if(l[k].morphTargets)for(var p=0;p<l[k].morphTargets.length;p++)f[l[k].morphTargets[p]]=-1;for(var n in f){var r=[],q=[];for(p=0;p!==l[k].morphTargets.length;++p){var t=l[k];r.push(t.time);q.push(t.morphTarget===n?1:0)}d.push(new kc(".morphTargetInfluence["+n+"]",r,q))}f=f.length*(g||1)}else k=".bones["+b[h].name+"]",c(lc,k+".position",l,"pos",d),c(fd,k+".quaternion",l,"rot",d),c(lc,k+".scale",l,"scl",d)}return 0===
|
|
|
d.length?null:new Fa(e,f,d)}});Object.assign(Fa.prototype,{resetDuration:function(){for(var a=0,b=0,c=this.tracks.length;b!==c;++b){var d=this.tracks[b];a=Math.max(a,d.times[d.times.length-1])}this.duration=a},trim:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].trim(0,this.duration);return this},optimize:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].optimize();return this}});Object.assign(Nd.prototype,{load:function(a,b,c,d){var e=this;(new Ka(e.manager)).load(a,function(a){b(e.parse(JSON.parse(a)))},
|
|
|
c,d)},setTextures:function(a){this.textures=a},parse:function(a){function b(a){void 0===c[a]&&console.warn("THREE.MaterialLoader: Undefined texture",a);return c[a]}var c=this.textures,d=new Tg[a.type];void 0!==a.uuid&&(d.uuid=a.uuid);void 0!==a.name&&(d.name=a.name);void 0!==a.color&&d.color.setHex(a.color);void 0!==a.roughness&&(d.roughness=a.roughness);void 0!==a.metalness&&(d.metalness=a.metalness);void 0!==a.emissive&&d.emissive.setHex(a.emissive);void 0!==a.specular&&d.specular.setHex(a.specular);
|
|
|
void 0!==a.shininess&&(d.shininess=a.shininess);void 0!==a.clearCoat&&(d.clearCoat=a.clearCoat);void 0!==a.clearCoatRoughness&&(d.clearCoatRoughness=a.clearCoatRoughness);void 0!==a.uniforms&&(d.uniforms=a.uniforms);void 0!==a.vertexShader&&(d.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(d.fragmentShader=a.fragmentShader);void 0!==a.vertexColors&&(d.vertexColors=a.vertexColors);void 0!==a.fog&&(d.fog=a.fog);void 0!==a.flatShading&&(d.flatShading=a.flatShading);void 0!==a.blending&&(d.blending=
|
|
@@ -809,8 +809,8 @@ this);return}for(c=0;c<this.node.geometry.morphTargets.length;c++)if(a.geometry.
|
|
|
this.path+" but it wasn't found.")},unbind:function(){this.node=null;this.getValue=this._getValue_unbound;this.setValue=this._setValue_unbound}});Object.assign(oa.prototype,{_getValue_unbound:oa.prototype.getValue,_setValue_unbound:oa.prototype.setValue});Object.assign(pf.prototype,{isAnimationObjectGroup:!0,add:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._paths,f=this._parsedPaths,g=this._bindings,h=g.length,l=void 0,k=0,p=arguments.length;k!==
|
|
|
p;++k){var n=arguments[k],r=n.uuid,q=d[r];if(void 0===q){q=b++;d[r]=q;a.push(n);r=0;for(var t=h;r!==t;++r)g[r].push(new oa(n,e[r],f[r]))}else if(q<c){l=a[q];var u=--c;t=a[u];d[t.uuid]=q;a[q]=t;d[r]=u;a[u]=n;r=0;for(t=h;r!==t;++r){var y=g[r],x=y[q];y[q]=y[u];void 0===x&&(x=new oa(n,e[r],f[r]));y[u]=x}}else a[q]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=
|
|
|
c},remove:function(){for(var a=this._objects,b=this.nCachedObjects_,c=this._indicesByUUID,d=this._bindings,e=d.length,f=0,g=arguments.length;f!==g;++f){var h=arguments[f],l=h.uuid,k=c[l];if(void 0!==k&&k>=b){var p=b++,n=a[p];c[n.uuid]=k;a[k]=n;c[l]=p;a[p]=h;h=0;for(l=e;h!==l;++h){n=d[h];var r=n[k];n[k]=n[p];n[p]=r}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var l=
|
|
|
-arguments[g].uuid,k=d[l];if(void 0!==k)if(delete d[l],k<c){l=--c;var p=a[l],n=--b,r=a[n];d[p.uuid]=k;a[k]=p;d[r.uuid]=l;a[l]=r;a.pop();p=0;for(r=f;p!==r;++p){var q=e[p],t=q[n];q[k]=q[l];q[l]=t;q.pop()}}else for(n=--b,r=a[n],d[r.uuid]=k,a[k]=r,a.pop(),p=0,r=f;p!==r;++p)q=e[p],q[k]=q[n],q.pop()}this.nCachedObjects_=c},subscribe_:function(a,b){var c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];var f=this._paths,g=this._parsedPaths,h=this._objects,l=this.nCachedObjects_,
|
|
|
-k=Array(h.length);d=e.length;c[a]=d;f.push(a);g.push(b);e.push(k);c=l;for(d=h.length;c!==d;++c)k[c]=new oa(h[c],a,b);return k},unsubscribe_:function(a){var b=this._bindingsIndicesByPath,c=b[a];if(void 0!==c){var d=this._paths,e=this._parsedPaths,f=this._bindings,g=f.length-1,h=f[g];b[a[g]]=c;f[c]=h;f.pop();e[c]=e[g];e.pop();d[c]=d[g];d.pop()}}});Object.assign(qf.prototype,{play:function(){this._mixer._activateAction(this);return this},stop:function(){this._mixer._deactivateAction(this);return this.reset()},
|
|
|
+arguments[g].uuid,k=d[l];if(void 0!==k)if(delete d[l],k<c){l=--c;var p=a[l],n=--b,r=a[n];d[p.uuid]=k;a[k]=p;d[r.uuid]=l;a[l]=r;a.pop();p=0;for(r=f;p!==r;++p){var q=e[p],t=q[n];q[k]=q[l];q[l]=t;q.pop()}}else for(n=--b,r=a[n],d[r.uuid]=k,a[k]=r,a.pop(),p=0,r=f;p!==r;++p)q=e[p],q[k]=q[n],q.pop()}this.nCachedObjects_=c},subscribe_:function(a,b){var c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];var f=this._paths,g=this._parsedPaths,h=this._objects,k=this.nCachedObjects_,
|
|
|
+m=Array(h.length);d=e.length;c[a]=d;f.push(a);g.push(b);e.push(m);c=k;for(d=h.length;c!==d;++c)m[c]=new oa(h[c],a,b);return m},unsubscribe_:function(a){var b=this._bindingsIndicesByPath,c=b[a];if(void 0!==c){var d=this._paths,e=this._parsedPaths,f=this._bindings,g=f.length-1,h=f[g];b[a[g]]=c;f[c]=h;f.pop();e[c]=e[g];e.pop();d[c]=d[g];d.pop()}}});Object.assign(qf.prototype,{play:function(){this._mixer._activateAction(this);return this},stop:function(){this._mixer._deactivateAction(this);return this.reset()},
|
|
|
reset:function(){this.paused=!1;this.enabled=!0;this.time=0;this._loopCount=-1;this._startTime=null;return this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(a){this._startTime=a;return this},setLoop:function(a,b){this.loop=a;this.repetitions=b;return this},setEffectiveWeight:function(a){this.weight=a;
|
|
|
this._effectiveWeight=this.enabled?a:0;return this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(a){return this._scheduleFading(a,0,1)},fadeOut:function(a){return this._scheduleFading(a,1,0)},crossFadeFrom:function(a,b,c){a.fadeOut(b);this.fadeIn(b);if(c){c=this._clip.duration;var d=a._clip.duration,e=c/d;a.warp(1,d/c,b);this.warp(e,1,b)}return this},crossFadeTo:function(a,b,c){return a.crossFadeFrom(this,b,c)},stopFading:function(){var a=this._weightInterpolant;
|
|
|
null!==a&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},setEffectiveTimeScale:function(a){this.timeScale=a;this._effectiveTimeScale=this.paused?0:a;return this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(a){this.timeScale=this._clip.duration/a;return this.stopWarping()},syncWith:function(a){this.time=a.time;this.timeScale=a.timeScale;return this.stopWarping()},halt:function(a){return this.warp(this._effectiveTimeScale,
|
|
@@ -819,8 +819,8 @@ this._mixer._root},_update:function(a,b,c,d){if(this.enabled){var e=this._startT
|
|
|
b*=d;a>c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight=b},_updateTimeScale:function(a){var b=0;if(!this.paused){b=this.timeScale;var c=this._timeScaleInterpolant;if(null!==c){var d=c.evaluate(a)[0];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-=c*f;e+=Math.abs(f);var g=this.repetitions-e;0>=g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=
|
|
|
0<a?c:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<a?1:-1})):(1===g?(a=0>a,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}});re.prototype=Object.assign(Object.create(ha.prototype),{constructor:re,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,l=h[g];void 0===l&&(l={},h[g]=l);for(h=0;h!==e;++h){var k=
|
|
|
-d[h],p=k.name,n=l[p];if(void 0===n){n=f[h];if(void 0!==n){null===n._cacheIndex&&(++n.referenceCount,this._addInactiveBinding(n,g,p));continue}n=new qe(oa.create(c,p,b&&b._propertyBindings[h].binding.parsedPath),k.ValueTypeName,k.getValueSize());++n.referenceCount;this._addInactiveBinding(n,g,p)}f[h]=n;a[h].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,
|
|
|
+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}});re.prototype=Object.assign(Object.create(ha.prototype),{constructor:re,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var m=
|
|
|
+d[h],p=m.name,n=k[p];if(void 0===n){n=f[h];if(void 0!==n){null===n._cacheIndex&&(++n.referenceCount,this._addInactiveBinding(n,g,p));continue}n=new qe(oa.create(c,p,b&&b._propertyBindings[h].binding.parsedPath),m.ValueTypeName,m.getValueSize());++n.referenceCount;this._addInactiveBinding(n,g,p)}f[h]=n;a[h].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<this._nActiveActions},_addInactiveAction:function(a,b,c){var d=this._actions,e=this._actionsByClip,f=e[b];void 0===f?(f={knownActions:[a],actionByRoot:{}},a._byClipCacheIndex=0,e[b]=f):(b=f.knownActions,a._byClipCacheIndex=b.length,b.push(a));a._cacheIndex=d.length;d.push(a);f.actionByRoot[c]=a},_removeInactiveAction:function(a){var b=this._actions,c=b[b.length-1],d=a._cacheIndex;c._cacheIndex=d;b[d]=c;b.pop();a._cacheIndex=null;b=a._clip.uuid;c=this._actionsByClip;d=c[b];var e=
|
|
@@ -830,7 +830,7 @@ g._cacheIndex=a;b[a]=g;b.pop();delete f[c];a:{for(var h in f)break a;delete e[d]
|
|
|
new Float32Array(2),1,this._controlInterpolantsResultBuffer),c.__cacheIndex=b,a[b]=c);return c},_takeBackControlInterpolant:function(a){var b=this._controlInterpolants,c=a.__cacheIndex,d=--this._nActiveControlInterpolants,e=b[d];a.__cacheIndex=d;b[d]=a;e.__cacheIndex=c;b[c]=e},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(a,b){var c=b||this._root,d=c.uuid;c="string"===typeof a?Fa.findByName(c,a):a;a=null!==c?c.uuid:a;var e=this._actionsByClip[a],f=null;if(void 0!==e){f=
|
|
|
e.actionByRoot[d];if(void 0!==f)return f;f=e.knownActions[0];null===c&&(c=f._clip)}if(null===c)return null;b=new qf(this,c,b);this._bindAction(b,f);this._addInactiveAction(b,a,d);return b},existingAction:function(a,b){var c=b||this._root;b=c.uuid;c="string"===typeof a?Fa.findByName(c,a):a;a=this._actionsByClip[c?c.uuid:a];return void 0!==a?a.actionByRoot[b]||null:null},stopAllAction:function(){for(var a=this._actions,b=this._nActiveActions,c=this._bindings,d=this._nActiveBindings,e=this._nActiveBindings=
|
|
|
this._nActiveActions=0;e!==b;++e)a[e].reset();for(e=0;e!==d;++e)c[e].useCount=0;return this},update:function(a){a*=this.timeScale;for(var b=this._actions,c=this._nActiveActions,d=this.time+=a,e=Math.sign(a),f=this._accuIndex^=1,g=0;g!==c;++g)b[g]._update(d,a,e,f);a=this._bindings;b=this._nActiveBindings;for(g=0;g!==b;++g)a[g].apply(f);return this},getRoot:function(){return this._root},uncacheClip:function(a){var b=this._actions;a=a.uuid;var c=this._actionsByClip,d=c[a];if(void 0!==d){d=d.knownActions;
|
|
|
-for(var e=0,f=d.length;e!==f;++e){var g=d[e];this._deactivateAction(g);var h=g._cacheIndex,l=b[b.length-1];g._cacheIndex=null;g._byClipCacheIndex=null;l._cacheIndex=h;b[h]=l;b.pop();this._removeInactiveBindingsForAction(g)}delete c[a]}},uncacheRoot:function(a){a=a.uuid;var b=this._actionsByClip;for(d in b){var c=b[d].actionByRoot[a];void 0!==c&&(this._deactivateAction(c),this._removeInactiveAction(c))}var d=this._bindingsByRootAndName[a];if(void 0!==d)for(var e in d)a=d[e],a.restoreOriginalState(),
|
|
|
+for(var e=0,f=d.length;e!==f;++e){var g=d[e];this._deactivateAction(g);var h=g._cacheIndex,k=b[b.length-1];g._cacheIndex=null;g._byClipCacheIndex=null;k._cacheIndex=h;b[h]=k;b.pop();this._removeInactiveBindingsForAction(g)}delete c[a]}},uncacheRoot:function(a){a=a.uuid;var b=this._actionsByClip;for(d in b){var c=b[d].actionByRoot[a];void 0!==c&&(this._deactivateAction(c),this._removeInactiveAction(c))}var d=this._bindingsByRootAndName[a];if(void 0!==d)for(var e in d)a=d[e],a.restoreOriginalState(),
|
|
|
this._removeInactiveBinding(a)},uncacheAction:function(a,b){a=this.existingAction(a,b);null!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}});Od.prototype.clone=function(){return new Od(void 0===this.value.clone?this.value:this.value.clone())};se.prototype=Object.assign(Object.create(G.prototype),{constructor:se,isInstancedBufferGeometry:!0,copy:function(a){G.prototype.copy.call(this,a);this.maxInstancedCount=a.maxInstancedCount;return this},clone:function(){return(new this.constructor).copy(this)}});
|
|
|
Object.defineProperties(te.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}});Object.assign(te.prototype,{isInterleavedBufferAttribute:!0,setX:function(a,b){this.data.array[a*this.data.stride+this.offset]=b;return this},setY:function(a,b){this.data.array[a*this.data.stride+this.offset+1]=b;return this},setZ:function(a,b){this.data.array[a*this.data.stride+this.offset+2]=b;return this},setW:function(a,b){this.data.array[a*this.data.stride+this.offset+
|
|
|
3]=b;return this},getX:function(a){return this.data.array[a*this.data.stride+this.offset]},getY:function(a){return this.data.array[a*this.data.stride+this.offset+1]},getZ:function(a){return this.data.array[a*this.data.stride+this.offset+2]},getW:function(a){return this.data.array[a*this.data.stride+this.offset+3]},setXY:function(a,b,c){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data.array[a+
|
|
@@ -846,7 +846,7 @@ copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpt
|
|
|
a=new y);return this.isEmpty()?a.set(0,0):a.subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=
|
|
|
this.max.y},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box2: .getParameter() target is now required"),b=new y);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new y);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=
|
|
|
new y;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});id.prototype=Object.create(B.prototype);id.prototype.constructor=id;id.prototype.isImmediateRenderObject=!0;jd.prototype=Object.create(aa.prototype);
|
|
|
-jd.prototype.constructor=jd;jd.prototype.update=function(){var a=new p,b=new p,c=new ta;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,l=g.faces,k=g=0,p=l.length;k<p;k++)for(var n=l[k],r=0,q=n.vertexNormals.length;r<q;r++){var t=n.vertexNormals[r];a.copy(h[n[d[r]]]).applyMatrix4(e);b.copy(t).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);
|
|
|
+jd.prototype.constructor=jd;jd.prototype.update=function(){var a=new p,b=new p,c=new ta;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<p;m++)for(var n=k[m],r=0,q=n.vertexNormals.length;r<q;r++){var t=n.vertexNormals[r];a.copy(h[n[d[r]]]).applyMatrix4(e);b.copy(t).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);
|
|
|
f.setXYZ(g,a.x,a.y,a.z);g+=1;f.setXYZ(g,b.x,b.y,b.z);g+=1}else if(g&&g.isBufferGeometry)for(d=g.attributes.position,h=g.attributes.normal,r=g=0,q=d.count;r<q;r++)a.set(d.getX(r),d.getY(r),d.getZ(r)).applyMatrix4(e),b.set(h.getX(r),h.getY(r),h.getZ(r)),b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a),f.setXYZ(g,a.x,a.y,a.z),g+=1,f.setXYZ(g,b.x,b.y,b.z),g+=1;f.needsUpdate=!0}}();pc.prototype=Object.create(B.prototype);pc.prototype.constructor=pc;pc.prototype.dispose=function(){this.cone.geometry.dispose();
|
|
|
this.cone.material.dispose()};pc.prototype.update=function(){var a=new p,b=new p;return function(){this.light.updateMatrixWorld();var c=this.light.distance?this.light.distance:1E3,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}();qc.prototype=Object.create(aa.prototype);
|
|
|
qc.prototype.constructor=qc;qc.prototype.updateMatrixWorld=function(){var a=new p,b=new F,c=new F;return function(d){var e=this.bones,f=this.geometry,g=f.getAttribute("position");c.getInverse(this.root.matrixWorld);for(var h=0,k=0;h<e.length;h++){var m=e[h];m.parent&&m.parent.isBone&&(b.multiplyMatrices(c,m.matrixWorld),a.setFromMatrixPosition(b),g.setXYZ(k,a.x,a.y,a.z),b.multiplyMatrices(c,m.parent.matrixWorld),a.setFromMatrixPosition(b),g.setXYZ(k+1,a.x,a.y,a.z),k+=2)}f.getAttribute("position").needsUpdate=
|