|
@@ -124,10 +124,10 @@ f.clipShadows&&0!==f.clippingPlanes.length&&(p=b.uuid,q=f.uuid,c=r[p],void 0===c
|
|
b.nearDistance=h,b.farDistance=l);return b}function g(c,d,e,l,n){if(!1!==c.visible){if(c.layers.test(d.layers)&&(c.isMesh||c.isLine||c.isPoints)&&(c.castShadow||c.receiveShadow&&3===n)&&(!c.frustumCulled||h.intersectsObject(c))){c.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,c.matrixWorld);var q=b.update(c),p=c.material;if(Array.isArray(p))for(var k=q.groups,A=0,r=k.length;A<r;A++){var t=k[A],m=p[t.materialIndex];m&&m.visible&&(m=f(c,q,m,l,e.near,e.far,n),a.renderBufferDirect(e,null,q,m,
|
|
b.nearDistance=h,b.farDistance=l);return b}function g(c,d,e,l,n){if(!1!==c.visible){if(c.layers.test(d.layers)&&(c.isMesh||c.isLine||c.isPoints)&&(c.castShadow||c.receiveShadow&&3===n)&&(!c.frustumCulled||h.intersectsObject(c))){c.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,c.matrixWorld);var q=b.update(c),p=c.material;if(Array.isArray(p))for(var k=q.groups,A=0,r=k.length;A<r;A++){var t=k[A],m=p[t.materialIndex];m&&m.visible&&(m=f(c,q,m,l,e.near,e.far,n),a.renderBufferDirect(e,null,q,m,
|
|
c,t))}else p.visible&&(p=f(c,q,p,l,e.near,e.far,n),a.renderBufferDirect(e,null,q,p,c,null))}c=c.children;q=0;for(p=c.length;q<p;q++)g(c[q],d,e,l,n)}}var h=new Fc,l=new u,n=new u,q=new ba,p=[],k=[],r={},t={0:1,1:0,2:2},m=new Ba({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:.125},uniforms:{shadow_pass:{value:null},resolution:{value:new u},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),
|
|
c,t))}else p.visible&&(p=f(c,q,p,l,e.near,e.far,n),a.renderBufferDirect(e,null,q,p,c,null))}c=c.children;q=0;for(p=c.length;q<p;q++)g(c[q],d,e,l,n)}}var h=new Fc,l=new u,n=new u,q=new ba,p=[],k=[],r={},t={0:1,1:0,2:2},m=new Ba({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:.125},uniforms:{shadow_pass:{value:null},resolution:{value:new u},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),
|
|
x=m.clone();x.defines.HORIZONAL_PASS=1;var z=new D;z.setAttribute("position",new F(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var w=new Z(z,m),ya=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,e,f){if(!1!==ya.enabled&&(!1!==ya.autoUpdate||!1!==ya.needsUpdate)&&0!==d.length){var p=a.getRenderTarget(),k=a.getActiveCubeFace(),A=a.getActiveMipmapLevel(),r=a.state;r.setBlending(0);r.buffers.color.setClear(1,1,1,1);r.buffers.depth.setTest(!0);r.setScissorTest(!1);
|
|
x=m.clone();x.defines.HORIZONAL_PASS=1;var z=new D;z.setAttribute("position",new F(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var w=new Z(z,m),ya=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,e,f){if(!1!==ya.enabled&&(!1!==ya.autoUpdate||!1!==ya.needsUpdate)&&0!==d.length){var p=a.getRenderTarget(),k=a.getActiveCubeFace(),A=a.getActiveMipmapLevel(),r=a.state;r.setBlending(0);r.buffers.color.setClear(1,1,1,1);r.buffers.depth.setTest(!0);r.setScissorTest(!1);
|
|
-for(var t=0,v=d.length;t<v;t++){var z=d[t],B=z.shadow;if(!1!==B.autoUpdate||!1!==B.needsUpdate)if(void 0===B)console.warn("THREE.WebGLShadowMap:",z,"has no shadow.");else{l.copy(B.mapSize);var u=B.getFrameExtents();l.multiply(u);n.copy(B.mapSize);if(l.x>c||l.y>c)l.x>c&&(n.x=Math.floor(c/u.x),l.x=n.x*u.x,B.mapSize.x=n.x),l.y>c&&(n.y=Math.floor(c/u.y),l.y=n.y*u.y,B.mapSize.y=n.y);null!==B.map||B.isPointLightShadow||3!==this.type||(u={minFilter:1006,magFilter:1006,format:1023},B.map=new Ea(l.x,l.y,u),
|
|
|
|
-B.map.texture.name=z.name+".shadowMap",B.mapPass=new Ea(l.x,l.y,u),B.camera.updateProjectionMatrix());null===B.map&&(B.map=new Ea(l.x,l.y,{minFilter:1003,magFilter:1003,format:1023}),B.map.texture.name=z.name+".shadowMap",B.camera.updateProjectionMatrix());a.setRenderTarget(B.map);a.clear();u=B.getViewportCount();for(var N=0;N<u;N++){var W=B.getViewport(N);q.set(n.x*W.x,n.y*W.y,n.x*W.z,n.y*W.w);r.viewport(q);B.updateMatrices(z,N);h=B.getFrustum();g(e,f,B.camera,z,this.type)}B.isPointLightShadow||
|
|
|
|
-3!==this.type||(z=B,u=f,N=b.update(w),m.uniforms.shadow_pass.value=z.map.texture,m.uniforms.resolution.value=z.mapSize,m.uniforms.radius.value=z.radius,a.setRenderTarget(z.mapPass),a.clear(),a.renderBufferDirect(u,null,N,m,w,null),x.uniforms.shadow_pass.value=z.mapPass.texture,x.uniforms.resolution.value=z.mapSize,x.uniforms.radius.value=z.radius,a.setRenderTarget(z.map),a.clear(),a.renderBufferDirect(u,null,N,x,w,null));B.needsUpdate=!1}}ya.needsUpdate=!1;a.setRenderTarget(p,k,A)}}}function zk(a,
|
|
|
|
-b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,10241,9728);a.texParameteri(b,10240,9728);for(b=0;b<d;b++)a.texImage2D(c+b,0,6408,1,1,0,6408,5121,e);return f}function e(b){!0!==t[b]&&(a.enable(b),t[b]=!0)}function f(b){!1!==t[b]&&(a.disable(b),t[b]=!1)}function g(b,c,d,g,h,l,n,q){if(0===b)x&&(f(3042),x=!1);else if(x||(e(3042),x=!0),5!==b){if(b!==z||q!==y){if(100!==w||100!==N)a.blendEquation(32774),N=w=100;if(q)switch(b){case 1:a.blendFuncSeparate(1,
|
|
|
|
|
|
+for(var t=0,v=d.length;t<v;t++){var z=d[t],B=z.shadow;if(!1!==B.autoUpdate||!1!==B.needsUpdate)if(void 0===B)console.warn("THREE.WebGLShadowMap:",z,"has no shadow.");else{l.copy(B.mapSize);var u=B.getFrameExtents();l.multiply(u);n.copy(B.mapSize);if(l.x>c||l.y>c)l.x>c&&(n.x=Math.floor(c/u.x),l.x=n.x*u.x,B.mapSize.x=n.x),l.y>c&&(n.y=Math.floor(c/u.y),l.y=n.y*u.y,B.mapSize.y=n.y);null!==B.map||B.isPointLightShadow||3!==this.type||(u={minFilter:1006,magFilter:1006,format:1023,stencilBuffer:!1},B.map=
|
|
|
|
+new Ea(l.x,l.y,u),B.map.texture.name=z.name+".shadowMap",B.mapPass=new Ea(l.x,l.y,u),B.camera.updateProjectionMatrix());null===B.map&&(B.map=new Ea(l.x,l.y,{minFilter:1003,magFilter:1003,format:1023,stencilBuffer:!1}),B.map.texture.name=z.name+".shadowMap",B.camera.updateProjectionMatrix());a.setRenderTarget(B.map);a.clear();u=B.getViewportCount();for(var N=0;N<u;N++){var W=B.getViewport(N);q.set(n.x*W.x,n.y*W.y,n.x*W.z,n.y*W.w);r.viewport(q);B.updateMatrices(z,N);h=B.getFrustum();g(e,f,B.camera,
|
|
|
|
+z,this.type)}B.isPointLightShadow||3!==this.type||(z=B,u=f,N=b.update(w),m.uniforms.shadow_pass.value=z.map.texture,m.uniforms.resolution.value=z.mapSize,m.uniforms.radius.value=z.radius,a.setRenderTarget(z.mapPass),a.clear(),a.renderBufferDirect(u,null,N,m,w,null),x.uniforms.shadow_pass.value=z.mapPass.texture,x.uniforms.resolution.value=z.mapSize,x.uniforms.radius.value=z.radius,a.setRenderTarget(z.map),a.clear(),a.renderBufferDirect(u,null,N,x,w,null));B.needsUpdate=!1}}ya.needsUpdate=!1;a.setRenderTarget(p,
|
|
|
|
+k,A)}}}function zk(a,b,c){function d(b,c,d){var e=new Uint8Array(4),f=a.createTexture();a.bindTexture(b,f);a.texParameteri(b,10241,9728);a.texParameteri(b,10240,9728);for(b=0;b<d;b++)a.texImage2D(c+b,0,6408,1,1,0,6408,5121,e);return f}function e(b){!0!==t[b]&&(a.enable(b),t[b]=!0)}function f(b){!1!==t[b]&&(a.disable(b),t[b]=!1)}function g(b,c,d,g,h,l,n,q){if(0===b)x&&(f(3042),x=!1);else if(x||(e(3042),x=!0),5!==b){if(b!==z||q!==y){if(100!==w||100!==N)a.blendEquation(32774),N=w=100;if(q)switch(b){case 1:a.blendFuncSeparate(1,
|
|
771,1,771);break;case 2:a.blendFunc(1,1);break;case 3:a.blendFuncSeparate(0,0,769,771);break;case 4:a.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",b)}else switch(b){case 1:a.blendFuncSeparate(770,771,1,771);break;case 2:a.blendFunc(770,1);break;case 3:a.blendFunc(0,769);break;case 4:a.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",b)}O=B=W=u=null;z=b;y=q}}else{h=h||c;l=l||d;n=n||g;if(c!==w||h!==N)a.blendEquationSeparate(bc[c],
|
|
771,1,771);break;case 2:a.blendFunc(1,1);break;case 3:a.blendFuncSeparate(0,0,769,771);break;case 4:a.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",b)}else switch(b){case 1:a.blendFuncSeparate(770,771,1,771);break;case 2:a.blendFunc(770,1);break;case 3:a.blendFunc(0,769);break;case 4:a.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",b)}O=B=W=u=null;z=b;y=q}}else{h=h||c;l=l||d;n=n||g;if(c!==w||h!==N)a.blendEquationSeparate(bc[c],
|
|
bc[h]),w=c,N=h;if(d!==u||g!==W||l!==B||n!==O)a.blendFuncSeparate(ca[d],ca[g],ca[l],ca[n]),u=d,W=g,B=l,O=n;z=b;y=null}}function h(b){E!==b&&(b?a.frontFace(2304):a.frontFace(2305),E=b)}function l(b){0!==b?(e(2884),b!==fa&&(1===b?a.cullFace(1029):2===b?a.cullFace(1028):a.cullFace(1032))):f(2884);fa=b}function n(b,c,d){if(b){if(e(32823),C!==c||G!==d)a.polygonOffset(c,d),C=c,G=d}else f(32823)}function q(b){void 0===b&&(b=33984+D-1);I!==b&&(a.activeTexture(b),I=b)}c=c.isWebGL2;var p=new function(){var b=
|
|
bc[h]),w=c,N=h;if(d!==u||g!==W||l!==B||n!==O)a.blendFuncSeparate(ca[d],ca[g],ca[l],ca[n]),u=d,W=g,B=l,O=n;z=b;y=null}}function h(b){E!==b&&(b?a.frontFace(2304):a.frontFace(2305),E=b)}function l(b){0!==b?(e(2884),b!==fa&&(1===b?a.cullFace(1029):2===b?a.cullFace(1028):a.cullFace(1032))):f(2884);fa=b}function n(b,c,d){if(b){if(e(32823),C!==c||G!==d)a.polygonOffset(c,d),C=c,G=d}else f(32823)}function q(b){void 0===b&&(b=33984+D-1);I!==b&&(a.activeTexture(b),I=b)}c=c.isWebGL2;var p=new function(){var b=
|
|
!1,c=new ba,d=null,e=new ba(0,0,0,0);return{setMask:function(c){d===c||b||(a.colorMask(c,c,c,c),d=c)},setLocked:function(a){b=a},setClear:function(b,d,f,g,h){!0===h&&(b*=g,d*=g,f*=g);c.set(b,d,f,g);!1===e.equals(c)&&(a.clearColor(b,d,f,g),e.copy(c))},reset:function(){b=!1;d=null;e.set(-1,0,0,0)}}},k=new function(){var b=!1,c=null,d=null,g=null;return{setTest:function(a){a?e(2929):f(2929)},setMask:function(d){c===d||b||(a.depthMask(d),c=d)},setFunc:function(b){if(d!==b){if(b)switch(b){case 0:a.depthFunc(512);
|
|
!1,c=new ba,d=null,e=new ba(0,0,0,0);return{setMask:function(c){d===c||b||(a.colorMask(c,c,c,c),d=c)},setLocked:function(a){b=a},setClear:function(b,d,f,g,h){!0===h&&(b*=g,d*=g,f*=g);c.set(b,d,f,g);!1===e.equals(c)&&(a.clearColor(b,d,f,g),e.copy(c))},reset:function(){b=!1;d=null;e.set(-1,0,0,0)}}},k=new function(){var b=!1,c=null,d=null,g=null;return{setTest:function(a){a?e(2929):f(2929)},setMask:function(d){c===d||b||(a.depthMask(d),c=d)},setFunc:function(b){if(d!==b){if(b)switch(b){case 0:a.depthFunc(512);
|
|
@@ -689,37 +689,37 @@ this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float
|
|
h=c[g.id];!1!==h.needsUpdate&&g.setValue(a,h.value,d)}};Bb.seqWithValue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var f=a[d];f.id in b&&c.push(f)}return c};var nk=0,ig=/^[ \t]*#include +<([\w\d./]+)>/gm,Oh=/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Nh=/#pragma unroll_loop_start[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g,xk=0;Cb.prototype=Object.create(K.prototype);Cb.prototype.constructor=
|
|
h=c[g.id];!1!==h.needsUpdate&&g.setValue(a,h.value,d)}};Bb.seqWithValue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var f=a[d];f.id in b&&c.push(f)}return c};var nk=0,ig=/^[ \t]*#include +<([\w\d./]+)>/gm,Oh=/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Nh=/#pragma unroll_loop_start[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g,xk=0;Cb.prototype=Object.create(K.prototype);Cb.prototype.constructor=
|
|
Cb;Cb.prototype.isMeshDepthMaterial=!0;Cb.prototype.copy=function(a){K.prototype.copy.call(this,a);this.depthPacking=a.depthPacking;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;return this};Db.prototype=Object.create(K.prototype);Db.prototype.constructor=
|
|
Cb;Cb.prototype.isMeshDepthMaterial=!0;Cb.prototype.copy=function(a){K.prototype.copy.call(this,a);this.depthPacking=a.depthPacking;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;return this};Db.prototype=Object.create(K.prototype);Db.prototype.constructor=
|
|
Db;Db.prototype.isMeshDistanceMaterial=!0;Db.prototype.copy=function(a){K.prototype.copy.call(this,a);this.referencePosition.copy(a.referencePosition);this.nearDistance=a.nearDistance;this.farDistance=a.farDistance;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;return this};Le.prototype=Object.assign(Object.create(ma.prototype),
|
|
Db;Db.prototype.isMeshDistanceMaterial=!0;Db.prototype.copy=function(a){K.prototype.copy.call(this,a);this.referencePosition.copy(a.referencePosition);this.nearDistance=a.nearDistance;this.farDistance=a.farDistance;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;return this};Le.prototype=Object.assign(Object.create(ma.prototype),
|
|
-{constructor:Le,isArrayCamera:!0});Fb.prototype=Object.assign(Object.create(y.prototype),{constructor:Fb,isGroup:!0});Object.assign(Jd.prototype,{constructor:Jd,getHandSpace:function(){if(null===this._hand&&(this._hand=new Fb,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(var a=0;a<=XRHand.LITTLE_PHALANX_TIP;a++){var b=new Fb;b.matrixAutoUpdate=!1;b.visible=!1;this._hand.joints.push(b);this._hand.add(b)}return this._hand},
|
|
|
|
|
|
+{constructor:Le,isArrayCamera:!0});Fb.prototype=Object.assign(Object.create(y.prototype),{constructor:Fb,isGroup:!0});Object.assign(Jd.prototype,{constructor:Jd,getHandSpace:function(){if(null===this._hand&&(this._hand=new Fb,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(var a=0;a<=window.XRHand.LITTLE_PHALANX_TIP;a++){var b=new Fb;b.matrixAutoUpdate=!1;b.visible=!1;this._hand.joints.push(b);this._hand.add(b)}return this._hand},
|
|
getTargetRaySpace:function(){null===this._targetRay&&(this._targetRay=new Fb,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1);return this._targetRay},getGripSpace:function(){null===this._grip&&(this._grip=new Fb,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1);return this._grip},dispatchEvent:function(a){null!==this._targetRay&&this._targetRay.dispatchEvent(a);null!==this._grip&&this._grip.dispatchEvent(a);null!==this._hand&&this._hand.dispatchEvent(a);return this},disconnect:function(a){this.dispatchEvent({type:"disconnected",
|
|
getTargetRaySpace:function(){null===this._targetRay&&(this._targetRay=new Fb,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1);return this._targetRay},getGripSpace:function(){null===this._grip&&(this._grip=new Fb,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1);return this._grip},dispatchEvent:function(a){null!==this._targetRay&&this._targetRay.dispatchEvent(a);null!==this._grip&&this._grip.dispatchEvent(a);null!==this._hand&&this._hand.dispatchEvent(a);return this},disconnect:function(a){this.dispatchEvent({type:"disconnected",
|
|
-data:a});null!==this._targetRay&&(this._targetRay.visible=!1);null!==this._grip&&(this._grip.visible=!1);null!==this._hand&&(this._hand.visible=!1);return this},update:function(a,b,c){var d=null,e=null,f=null,g=this._targetRay,h=this._grip,l=this._hand;if(a)if(a.hand){f=!0;for(var k=0;k<=XRHand.LITTLE_PHALANX_TIP;k++)if(a.hand[k]){var q=b.getJointPose(a.hand[k],c),p=l.joints[k];null!==q&&(p.matrix.fromArray(q.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=q.radius);
|
|
|
|
-p.visible=null!==q;q=l.joints[XRHand.INDEX_PHALANX_TIP].position.distanceTo(l.joints[XRHand.THUMB_PHALANX_TIP].position);l.inputState.pinching&&.025<q?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",target:this})):!l.inputState.pinching&&.015>=q&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",target:this}))}}else null!==g&&(d=b.getPose(a.targetRaySpace,c),null!==d&&(g.matrix.fromArray(d.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale))),null!==h&&
|
|
|
|
-a.gripSpace&&(e=b.getPose(a.gripSpace,c),null!==e&&(h.matrix.fromArray(e.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale)));null!==g&&(g.visible=null!==d);null!==h&&(h.visible=null!==e);null!==l&&(l.visible=null!==f);return this}});Object.assign(Uh.prototype,ra.prototype);mg.prototype=Object.assign(Object.create(Kd.prototype),{constructor:mg,isWebGL1Renderer:!0});Object.assign(Me.prototype,{isFogExp2:!0,clone:function(){return new Me(this.color,this.density)},toJSON:function(){return{type:"FogExp2",
|
|
|
|
-color:this.color.getHex(),density:this.density}}});Object.assign(Ne.prototype,{isFog:!0,clone:function(){return new Ne(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});Object.defineProperty(Ia.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(Ia.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(a){this.usage=a;return this},copy:function(a){this.array=new a.array.constructor(a.array);
|
|
|
|
-this.count=a.count;this.stride=a.stride;this.usage=a.usage;return this},copyAt:function(a,b,c){a*=this.stride;c*=b.stride;for(var d=0,e=this.stride;d<e;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},clone:function(a){void 0===a.arrayBuffers&&(a.arrayBuffers={});void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=P.generateUUID());void 0===a.arrayBuffers[this.array.buffer._uuid]&&(a.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);
|
|
|
|
-a=new this.array.constructor(a.arrayBuffers[this.array.buffer._uuid]);a=new Ia(a,this.stride);a.setUsage(this.usage);return a},onUpload:function(a){this.onUploadCallback=a;return this},toJSON:function(a){void 0===a.arrayBuffers&&(a.arrayBuffers={});void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=P.generateUUID());void 0===a.arrayBuffers[this.array.buffer._uuid]&&(a.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer)));return{uuid:this.uuid,
|
|
|
|
-buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});var sc=new m;Object.defineProperties(Gb.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(a){this.data.needsUpdate=a}}});Object.assign(Gb.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(a){for(var b=0,c=this.data.count;b<c;b++)sc.x=this.getX(b),sc.y=this.getY(b),sc.z=this.getZ(b),sc.applyMatrix4(a),this.setXYZ(b,sc.x,
|
|
|
|
-sc.y,sc.z);return this},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+0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+
|
|
|
|
-1]=c;this.data.array[a+2]=d;this.data.array[a+3]=e;return this},clone:function(a){if(void 0===a){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");a=[];for(var b=0;b<this.count;b++)for(var c=b*this.data.stride+this.offset,d=0;d<this.itemSize;d++)a.push(this.data.array[c+d]);return new F(new this.array.constructor(a),this.itemSize,this.normalized)}void 0===a.interleavedBuffers&&(a.interleavedBuffers={});void 0===a.interleavedBuffers[this.data.uuid]&&
|
|
|
|
-(a.interleavedBuffers[this.data.uuid]=this.data.clone(a));return new Gb(a.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(a){if(void 0===a){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");a=[];for(var b=0;b<this.count;b++)for(var c=b*this.data.stride+this.offset,d=0;d<this.itemSize;d++)a.push(this.data.array[c+d]);return{itemSize:this.itemSize,type:this.array.constructor.name,
|
|
|
|
-array:a,normalized:this.normalized}}void 0===a.interleavedBuffers&&(a.interleavedBuffers={});void 0===a.interleavedBuffers[this.data.uuid]&&(a.interleavedBuffers[this.data.uuid]=this.data.toJSON(a));return{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}});Hb.prototype=Object.create(K.prototype);Hb.prototype.constructor=Hb;Hb.prototype.isSpriteMaterial=!0;Hb.prototype.copy=function(a){K.prototype.copy.call(this,a);this.color.copy(a.color);
|
|
|
|
-this.map=a.map;this.alphaMap=a.alphaMap;this.rotation=a.rotation;this.sizeAttenuation=a.sizeAttenuation;return this};var Jc,ye=new m,td=new m,ud=new m,Kc=new u,Md=new u,Wh=new T,Jf=new m,ze=new m,Kf=new m,Di=new u,ih=new u,Ei=new u;Ld.prototype=Object.assign(Object.create(y.prototype),{constructor:Ld,isSprite:!0,raycast:function(a,b){null===a.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.');td.setFromMatrixScale(this.matrixWorld);Wh.copy(a.camera.matrixWorld);
|
|
|
|
-this.modelViewMatrix.multiplyMatrices(a.camera.matrixWorldInverse,this.matrixWorld);ud.setFromMatrixPosition(this.modelViewMatrix);a.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&td.multiplyScalar(-ud.z);var c=this.material.rotation;if(0!==c){var d=Math.cos(c);var e=Math.sin(c)}c=this.center;Oe(Jf.set(-.5,-.5,0),ud,c,td,e,d);Oe(ze.set(.5,-.5,0),ud,c,td,e,d);Oe(Kf.set(.5,.5,0),ud,c,td,e,d);Di.set(0,0);ih.set(1,0);Ei.set(1,1);var f=a.ray.intersectTriangle(Jf,ze,Kf,!1,ye);if(null===
|
|
|
|
-f&&(Oe(ze.set(-.5,.5,0),ud,c,td,e,d),ih.set(0,1),f=a.ray.intersectTriangle(Jf,Kf,ze,!1,ye),null===f))return;e=a.ray.origin.distanceTo(ye);e<a.near||e>a.far||b.push({distance:e,point:ye.clone(),uv:sa.getUV(ye,Jf,ze,Kf,Di,ih,Ei,new u),face:null,object:this})},copy:function(a){y.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);this.material=a.material;return this}});var Lf=new m,Fi=new m;Nd.prototype=Object.assign(Object.create(y.prototype),{constructor:Nd,isLOD:!0,copy:function(a){y.prototype.copy.call(this,
|
|
|
|
-a,!1);for(var b=a.levels,c=0,d=b.length;c<d;c++){var e=b[c];this.addLevel(e.object.clone(),e.distance)}this.autoUpdate=a.autoUpdate;return this},addLevel:function(a,b){void 0===b&&(b=0);b=Math.abs(b);var c=this.levels,d;for(d=0;d<c.length&&!(b<c[d].distance);d++);c.splice(d,0,{distance:b,object:a});this.add(a);return this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(a){var b=this.levels;if(0<b.length){var c;var d=1;for(c=b.length;d<c&&!(a<b[d].distance);d++);
|
|
|
|
-return b[d-1].object}return null},raycast:function(a,b){if(0<this.levels.length){Lf.setFromMatrixPosition(this.matrixWorld);var c=a.ray.origin.distanceTo(Lf);this.getObjectForDistance(c).raycast(a,b)}},update:function(a){var b=this.levels;if(1<b.length){Lf.setFromMatrixPosition(a.matrixWorld);Fi.setFromMatrixPosition(this.matrixWorld);a=Lf.distanceTo(Fi)/a.zoom;b[0].object.visible=!0;var c;var d=1;for(c=b.length;d<c;d++)if(a>=b[d].distance)b[d-1].object.visible=!1,b[d].object.visible=!0;else break;
|
|
|
|
-for(this._currentLevel=d-1;d<c;d++)b[d].object.visible=!1}},toJSON:function(a){a=y.prototype.toJSON.call(this,a);!1===this.autoUpdate&&(a.object.autoUpdate=!1);a.object.levels=[];for(var b=this.levels,c=0,d=b.length;c<d;c++){var e=b[c];a.object.levels.push({object:e.object.uuid,distance:e.distance})}return a}});Pe.prototype=Object.assign(Object.create(Z.prototype),{constructor:Pe,isSkinnedMesh:!0,copy:function(a){Z.prototype.copy.call(this,a);this.bindMode=a.bindMode;this.bindMatrix.copy(a.bindMatrix);
|
|
|
|
-this.bindMatrixInverse.copy(a.bindMatrixInverse);this.skeleton=a.skeleton;return this},bind:function(a,b){this.skeleton=a;void 0===b&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),b=this.matrixWorld);this.bindMatrix.copy(b);this.bindMatrixInverse.getInverse(b)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var a=new ba,b=this.geometry.attributes.skinWeight,c=0,d=b.count;c<d;c++){a.x=b.getX(c);a.y=b.getY(c);a.z=b.getZ(c);a.w=b.getW(c);var e=1/a.manhattanLength();
|
|
|
|
-Infinity!==e?a.multiplyScalar(e):a.set(1,0,0,0);b.setXYZW(c,a.x,a.y,a.z,a.w)}},updateMatrixWorld:function(a){Z.prototype.updateMatrixWorld.call(this,a);"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},boneTransform:function(){var a=new m,b=new ba,c=new ba,d=new m,e=new T;return function(f,g){var h=this.skeleton,l=this.geometry;
|
|
|
|
-b.fromBufferAttribute(l.attributes.skinIndex,f);c.fromBufferAttribute(l.attributes.skinWeight,f);a.fromBufferAttribute(l.attributes.position,f).applyMatrix4(this.bindMatrix);g.set(0,0,0);for(f=0;4>f;f++)if(l=c.getComponent(f),0!==l){var k=b.getComponent(f);e.multiplyMatrices(h.bones[k].matrixWorld,h.boneInverses[k]);g.addScaledVector(d.copy(a).applyMatrix4(e),l)}return g.applyMatrix4(this.bindMatrixInverse)}}()});var Gi=new T,Sk=new T;Object.assign(Qe.prototype,{calculateInverses:function(){this.boneInverses=
|
|
|
|
-[];for(var a=0,b=this.bones.length;a<b;a++){var c=new T;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}},pose:function(){for(var a=0,b=this.bones.length;a<b;a++){var c=this.bones[a];c&&c.matrixWorld.getInverse(this.boneInverses[a])}a=0;for(b=this.bones.length;a<b;a++)if(c=this.bones[a])c.parent&&c.parent.isBone?(c.matrix.getInverse(c.parent.matrixWorld),c.matrix.multiply(c.matrixWorld)):c.matrix.copy(c.matrixWorld),c.matrix.decompose(c.position,c.quaternion,c.scale)},
|
|
|
|
-update:function(){for(var a=this.bones,b=this.boneInverses,c=this.boneMatrices,d=this.boneTexture,e=0,f=a.length;e<f;e++)Gi.multiplyMatrices(a[e]?a[e].matrixWorld:Sk,b[e]),Gi.toArray(c,16*e);void 0!==d&&(d.needsUpdate=!0)},clone:function(){return new Qe(this.bones,this.boneInverses)},getBoneByName:function(a){for(var b=0,c=this.bones.length;b<c;b++){var d=this.bones[b];if(d.name===a)return d}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}});ng.prototype=
|
|
|
|
-Object.assign(Object.create(y.prototype),{constructor:ng,isBone:!0});var Hi=new T,Ii=new T,Mf=[],Ae=new Z;Re.prototype=Object.assign(Object.create(Z.prototype),{constructor:Re,isInstancedMesh:!0,copy:function(a){Z.prototype.copy.call(this,a);this.instanceMatrix.copy(a.instanceMatrix);this.count=a.count;return this},getMatrixAt:function(a,b){b.fromArray(this.instanceMatrix.array,16*a)},raycast:function(a,b){var c=this.matrixWorld,d=this.count;Ae.geometry=this.geometry;Ae.material=this.material;if(void 0!==
|
|
|
|
-Ae.material)for(var e=0;e<d;e++){this.getMatrixAt(e,Hi);Ii.multiplyMatrices(c,Hi);Ae.matrixWorld=Ii;Ae.raycast(a,Mf);for(var f=0,g=Mf.length;f<g;f++){var h=Mf[f];h.instanceId=e;h.object=this;b.push(h)}Mf.length=0}},setMatrixAt:function(a,b){b.toArray(this.instanceMatrix.array,16*a)},updateMorphTargets:function(){}});ia.prototype=Object.create(K.prototype);ia.prototype.constructor=ia;ia.prototype.isLineBasicMaterial=!0;ia.prototype.copy=function(a){K.prototype.copy.call(this,a);this.color.copy(a.color);
|
|
|
|
-this.linewidth=a.linewidth;this.linecap=a.linecap;this.linejoin=a.linejoin;this.morphTargets=a.morphTargets;return this};var Ji=new m,Ki=new m,Li=new T,Nf=new Wb,Be=new db;Ja.prototype=Object.assign(Object.create(y.prototype),{constructor:Ja,isLine:!0,copy:function(a){y.prototype.copy.call(this,a);this.material=a.material;this.geometry=a.geometry;return this},computeLineDistances:function(){var a=this.geometry;if(a.isBufferGeometry)if(null===a.index){for(var b=a.attributes.position,c=[0],d=1,e=b.count;d<
|
|
|
|
-e;d++)Ji.fromBufferAttribute(b,d-1),Ki.fromBufferAttribute(b,d),c[d]=c[d-1],c[d]+=Ji.distanceTo(Ki);a.setAttribute("lineDistance",new C(c,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(a.isGeometry)for(b=a.vertices,a=a.lineDistances,a[0]=0,c=1,d=b.length;c<d;c++)a[c]=a[c-1],a[c]+=b[c-1].distanceTo(b[c]);return this},raycast:function(a,b){var c=this.geometry,d=this.matrixWorld,e=a.params.Line.threshold;null===c.boundingSphere&&
|
|
|
|
-c.computeBoundingSphere();Be.copy(c.boundingSphere);Be.applyMatrix4(d);Be.radius+=e;if(!1!==a.ray.intersectsSphere(Be)){Li.getInverse(d);Nf.copy(a.ray).applyMatrix4(Li);d=e/((this.scale.x+this.scale.y+this.scale.z)/3);d*=d;var f=new m,g=new m;e=new m;var h=new m,l=this&&this.isLineSegments?2:1;if(c.isBufferGeometry){var k=c.index;c=c.attributes.position.array;if(null!==k){k=k.array;for(var q=0,p=k.length-1;q<p;q+=l){var A=k[q+1];f.fromArray(c,3*k[q]);g.fromArray(c,3*A);Nf.distanceSqToSegment(f,g,
|
|
|
|
-h,e)>d||(h.applyMatrix4(this.matrixWorld),A=a.ray.origin.distanceTo(h),A<a.near||A>a.far||b.push({distance:A,point:e.clone().applyMatrix4(this.matrixWorld),index:q,face:null,faceIndex:null,object:this}))}}else for(k=0,q=c.length/3-1;k<q;k+=l)f.fromArray(c,3*k),g.fromArray(c,3*k+3),Nf.distanceSqToSegment(f,g,h,e)>d||(h.applyMatrix4(this.matrixWorld),p=a.ray.origin.distanceTo(h),p<a.near||p>a.far||b.push({distance:p,point:e.clone().applyMatrix4(this.matrixWorld),index:k,face:null,faceIndex:null,object:this}))}else if(c.isGeometry)for(f=
|
|
|
|
|
|
+data:a});null!==this._targetRay&&(this._targetRay.visible=!1);null!==this._grip&&(this._grip.visible=!1);null!==this._hand&&(this._hand.visible=!1);return this},update:function(a,b,c){var d=null,e=null,f=null,g=this._targetRay,h=this._grip,l=this._hand;if(a)if(a.hand){f=!0;for(var k=0;k<=window.XRHand.LITTLE_PHALANX_TIP;k++)if(a.hand[k]){var q=b.getJointPose(a.hand[k],c),p=l.joints[k];null!==q&&(p.matrix.fromArray(q.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=
|
|
|
|
+q.radius);p.visible=null!==q;q=l.joints[window.XRHand.INDEX_PHALANX_TIP].position.distanceTo(l.joints[window.XRHand.THUMB_PHALANX_TIP].position);l.inputState.pinching&&.025<q?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",target:this})):!l.inputState.pinching&&.015>=q&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",target:this}))}}else null!==g&&(d=b.getPose(a.targetRaySpace,c),null!==d&&(g.matrix.fromArray(d.transform.matrix),g.matrix.decompose(g.position,g.rotation,
|
|
|
|
+g.scale))),null!==h&&a.gripSpace&&(e=b.getPose(a.gripSpace,c),null!==e&&(h.matrix.fromArray(e.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale)));null!==g&&(g.visible=null!==d);null!==h&&(h.visible=null!==e);null!==l&&(l.visible=null!==f);return this}});Object.assign(Uh.prototype,ra.prototype);mg.prototype=Object.assign(Object.create(Kd.prototype),{constructor:mg,isWebGL1Renderer:!0});Object.assign(Me.prototype,{isFogExp2:!0,clone:function(){return new Me(this.color,this.density)},
|
|
|
|
+toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}});Object.assign(Ne.prototype,{isFog:!0,clone:function(){return new Ne(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});Object.defineProperty(Ia.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(Ia.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(a){this.usage=a;return this},
|
|
|
|
+copy:function(a){this.array=new a.array.constructor(a.array);this.count=a.count;this.stride=a.stride;this.usage=a.usage;return this},copyAt:function(a,b,c){a*=this.stride;c*=b.stride;for(var d=0,e=this.stride;d<e;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},clone:function(a){void 0===a.arrayBuffers&&(a.arrayBuffers={});void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=P.generateUUID());void 0===a.arrayBuffers[this.array.buffer._uuid]&&
|
|
|
|
+(a.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);a=new this.array.constructor(a.arrayBuffers[this.array.buffer._uuid]);a=new Ia(a,this.stride);a.setUsage(this.usage);return a},onUpload:function(a){this.onUploadCallback=a;return this},toJSON:function(a){void 0===a.arrayBuffers&&(a.arrayBuffers={});void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=P.generateUUID());void 0===a.arrayBuffers[this.array.buffer._uuid]&&(a.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer)));
|
|
|
|
+return{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});var sc=new m;Object.defineProperties(Gb.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(a){this.data.needsUpdate=a}}});Object.assign(Gb.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(a){for(var b=0,c=this.data.count;b<c;b++)sc.x=this.getX(b),sc.y=this.getY(b),sc.z=this.getZ(b),sc.applyMatrix4(a),
|
|
|
|
+this.setXYZ(b,sc.x,sc.y,sc.z);return this},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+0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a=a*this.data.stride+this.offset;this.data.array[a+0]=
|
|
|
|
+b;this.data.array[a+1]=c;this.data.array[a+2]=d;this.data.array[a+3]=e;return this},clone:function(a){if(void 0===a){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");a=[];for(var b=0;b<this.count;b++)for(var c=b*this.data.stride+this.offset,d=0;d<this.itemSize;d++)a.push(this.data.array[c+d]);return new F(new this.array.constructor(a),this.itemSize,this.normalized)}void 0===a.interleavedBuffers&&(a.interleavedBuffers={});
|
|
|
|
+void 0===a.interleavedBuffers[this.data.uuid]&&(a.interleavedBuffers[this.data.uuid]=this.data.clone(a));return new Gb(a.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(a){if(void 0===a){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");a=[];for(var b=0;b<this.count;b++)for(var c=b*this.data.stride+this.offset,d=0;d<this.itemSize;d++)a.push(this.data.array[c+d]);return{itemSize:this.itemSize,
|
|
|
|
+type:this.array.constructor.name,array:a,normalized:this.normalized}}void 0===a.interleavedBuffers&&(a.interleavedBuffers={});void 0===a.interleavedBuffers[this.data.uuid]&&(a.interleavedBuffers[this.data.uuid]=this.data.toJSON(a));return{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}});Hb.prototype=Object.create(K.prototype);Hb.prototype.constructor=Hb;Hb.prototype.isSpriteMaterial=!0;Hb.prototype.copy=function(a){K.prototype.copy.call(this,
|
|
|
|
+a);this.color.copy(a.color);this.map=a.map;this.alphaMap=a.alphaMap;this.rotation=a.rotation;this.sizeAttenuation=a.sizeAttenuation;return this};var Jc,ye=new m,td=new m,ud=new m,Kc=new u,Md=new u,Wh=new T,Jf=new m,ze=new m,Kf=new m,Di=new u,ih=new u,Ei=new u;Ld.prototype=Object.assign(Object.create(y.prototype),{constructor:Ld,isSprite:!0,raycast:function(a,b){null===a.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.');td.setFromMatrixScale(this.matrixWorld);
|
|
|
|
+Wh.copy(a.camera.matrixWorld);this.modelViewMatrix.multiplyMatrices(a.camera.matrixWorldInverse,this.matrixWorld);ud.setFromMatrixPosition(this.modelViewMatrix);a.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&td.multiplyScalar(-ud.z);var c=this.material.rotation;if(0!==c){var d=Math.cos(c);var e=Math.sin(c)}c=this.center;Oe(Jf.set(-.5,-.5,0),ud,c,td,e,d);Oe(ze.set(.5,-.5,0),ud,c,td,e,d);Oe(Kf.set(.5,.5,0),ud,c,td,e,d);Di.set(0,0);ih.set(1,0);Ei.set(1,1);var f=a.ray.intersectTriangle(Jf,
|
|
|
|
+ze,Kf,!1,ye);if(null===f&&(Oe(ze.set(-.5,.5,0),ud,c,td,e,d),ih.set(0,1),f=a.ray.intersectTriangle(Jf,Kf,ze,!1,ye),null===f))return;e=a.ray.origin.distanceTo(ye);e<a.near||e>a.far||b.push({distance:e,point:ye.clone(),uv:sa.getUV(ye,Jf,ze,Kf,Di,ih,Ei,new u),face:null,object:this})},copy:function(a){y.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);this.material=a.material;return this}});var Lf=new m,Fi=new m;Nd.prototype=Object.assign(Object.create(y.prototype),{constructor:Nd,
|
|
|
|
+isLOD:!0,copy:function(a){y.prototype.copy.call(this,a,!1);for(var b=a.levels,c=0,d=b.length;c<d;c++){var e=b[c];this.addLevel(e.object.clone(),e.distance)}this.autoUpdate=a.autoUpdate;return this},addLevel:function(a,b){void 0===b&&(b=0);b=Math.abs(b);var c=this.levels,d;for(d=0;d<c.length&&!(b<c[d].distance);d++);c.splice(d,0,{distance:b,object:a});this.add(a);return this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(a){var b=this.levels;if(0<b.length){var c;
|
|
|
|
+var d=1;for(c=b.length;d<c&&!(a<b[d].distance);d++);return b[d-1].object}return null},raycast:function(a,b){if(0<this.levels.length){Lf.setFromMatrixPosition(this.matrixWorld);var c=a.ray.origin.distanceTo(Lf);this.getObjectForDistance(c).raycast(a,b)}},update:function(a){var b=this.levels;if(1<b.length){Lf.setFromMatrixPosition(a.matrixWorld);Fi.setFromMatrixPosition(this.matrixWorld);a=Lf.distanceTo(Fi)/a.zoom;b[0].object.visible=!0;var c;var d=1;for(c=b.length;d<c;d++)if(a>=b[d].distance)b[d-1].object.visible=
|
|
|
|
+!1,b[d].object.visible=!0;else break;for(this._currentLevel=d-1;d<c;d++)b[d].object.visible=!1}},toJSON:function(a){a=y.prototype.toJSON.call(this,a);!1===this.autoUpdate&&(a.object.autoUpdate=!1);a.object.levels=[];for(var b=this.levels,c=0,d=b.length;c<d;c++){var e=b[c];a.object.levels.push({object:e.object.uuid,distance:e.distance})}return a}});Pe.prototype=Object.assign(Object.create(Z.prototype),{constructor:Pe,isSkinnedMesh:!0,copy:function(a){Z.prototype.copy.call(this,a);this.bindMode=a.bindMode;
|
|
|
|
+this.bindMatrix.copy(a.bindMatrix);this.bindMatrixInverse.copy(a.bindMatrixInverse);this.skeleton=a.skeleton;return this},bind:function(a,b){this.skeleton=a;void 0===b&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),b=this.matrixWorld);this.bindMatrix.copy(b);this.bindMatrixInverse.getInverse(b)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var a=new ba,b=this.geometry.attributes.skinWeight,c=0,d=b.count;c<d;c++){a.x=b.getX(c);a.y=b.getY(c);a.z=b.getZ(c);
|
|
|
|
+a.w=b.getW(c);var e=1/a.manhattanLength();Infinity!==e?a.multiplyScalar(e):a.set(1,0,0,0);b.setXYZW(c,a.x,a.y,a.z,a.w)}},updateMatrixWorld:function(a){Z.prototype.updateMatrixWorld.call(this,a);"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},boneTransform:function(){var a=new m,b=new ba,c=new ba,d=new m,e=new T;return function(f,
|
|
|
|
+g){var h=this.skeleton,l=this.geometry;b.fromBufferAttribute(l.attributes.skinIndex,f);c.fromBufferAttribute(l.attributes.skinWeight,f);a.fromBufferAttribute(l.attributes.position,f).applyMatrix4(this.bindMatrix);g.set(0,0,0);for(f=0;4>f;f++)if(l=c.getComponent(f),0!==l){var k=b.getComponent(f);e.multiplyMatrices(h.bones[k].matrixWorld,h.boneInverses[k]);g.addScaledVector(d.copy(a).applyMatrix4(e),l)}return g.applyMatrix4(this.bindMatrixInverse)}}()});var Gi=new T,Sk=new T;Object.assign(Qe.prototype,
|
|
|
|
+{calculateInverses:function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new T;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}},pose:function(){for(var a=0,b=this.bones.length;a<b;a++){var c=this.bones[a];c&&c.matrixWorld.getInverse(this.boneInverses[a])}a=0;for(b=this.bones.length;a<b;a++)if(c=this.bones[a])c.parent&&c.parent.isBone?(c.matrix.getInverse(c.parent.matrixWorld),c.matrix.multiply(c.matrixWorld)):c.matrix.copy(c.matrixWorld),
|
|
|
|
+c.matrix.decompose(c.position,c.quaternion,c.scale)},update:function(){for(var a=this.bones,b=this.boneInverses,c=this.boneMatrices,d=this.boneTexture,e=0,f=a.length;e<f;e++)Gi.multiplyMatrices(a[e]?a[e].matrixWorld:Sk,b[e]),Gi.toArray(c,16*e);void 0!==d&&(d.needsUpdate=!0)},clone:function(){return new Qe(this.bones,this.boneInverses)},getBoneByName:function(a){for(var b=0,c=this.bones.length;b<c;b++){var d=this.bones[b];if(d.name===a)return d}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),
|
|
|
|
+this.boneTexture=void 0)}});ng.prototype=Object.assign(Object.create(y.prototype),{constructor:ng,isBone:!0});var Hi=new T,Ii=new T,Mf=[],Ae=new Z;Re.prototype=Object.assign(Object.create(Z.prototype),{constructor:Re,isInstancedMesh:!0,copy:function(a){Z.prototype.copy.call(this,a);this.instanceMatrix.copy(a.instanceMatrix);this.count=a.count;return this},getMatrixAt:function(a,b){b.fromArray(this.instanceMatrix.array,16*a)},raycast:function(a,b){var c=this.matrixWorld,d=this.count;Ae.geometry=this.geometry;
|
|
|
|
+Ae.material=this.material;if(void 0!==Ae.material)for(var e=0;e<d;e++){this.getMatrixAt(e,Hi);Ii.multiplyMatrices(c,Hi);Ae.matrixWorld=Ii;Ae.raycast(a,Mf);for(var f=0,g=Mf.length;f<g;f++){var h=Mf[f];h.instanceId=e;h.object=this;b.push(h)}Mf.length=0}},setMatrixAt:function(a,b){b.toArray(this.instanceMatrix.array,16*a)},updateMorphTargets:function(){}});ia.prototype=Object.create(K.prototype);ia.prototype.constructor=ia;ia.prototype.isLineBasicMaterial=!0;ia.prototype.copy=function(a){K.prototype.copy.call(this,
|
|
|
|
+a);this.color.copy(a.color);this.linewidth=a.linewidth;this.linecap=a.linecap;this.linejoin=a.linejoin;this.morphTargets=a.morphTargets;return this};var Ji=new m,Ki=new m,Li=new T,Nf=new Wb,Be=new db;Ja.prototype=Object.assign(Object.create(y.prototype),{constructor:Ja,isLine:!0,copy:function(a){y.prototype.copy.call(this,a);this.material=a.material;this.geometry=a.geometry;return this},computeLineDistances:function(){var a=this.geometry;if(a.isBufferGeometry)if(null===a.index){for(var b=a.attributes.position,
|
|
|
|
+c=[0],d=1,e=b.count;d<e;d++)Ji.fromBufferAttribute(b,d-1),Ki.fromBufferAttribute(b,d),c[d]=c[d-1],c[d]+=Ji.distanceTo(Ki);a.setAttribute("lineDistance",new C(c,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(a.isGeometry)for(b=a.vertices,a=a.lineDistances,a[0]=0,c=1,d=b.length;c<d;c++)a[c]=a[c-1],a[c]+=b[c-1].distanceTo(b[c]);return this},raycast:function(a,b){var c=this.geometry,d=this.matrixWorld,e=a.params.Line.threshold;
|
|
|
|
+null===c.boundingSphere&&c.computeBoundingSphere();Be.copy(c.boundingSphere);Be.applyMatrix4(d);Be.radius+=e;if(!1!==a.ray.intersectsSphere(Be)){Li.getInverse(d);Nf.copy(a.ray).applyMatrix4(Li);d=e/((this.scale.x+this.scale.y+this.scale.z)/3);d*=d;var f=new m,g=new m;e=new m;var h=new m,l=this&&this.isLineSegments?2:1;if(c.isBufferGeometry){var k=c.index;c=c.attributes.position.array;if(null!==k){k=k.array;for(var q=0,p=k.length-1;q<p;q+=l){var A=k[q+1];f.fromArray(c,3*k[q]);g.fromArray(c,3*A);Nf.distanceSqToSegment(f,
|
|
|
|
+g,h,e)>d||(h.applyMatrix4(this.matrixWorld),A=a.ray.origin.distanceTo(h),A<a.near||A>a.far||b.push({distance:A,point:e.clone().applyMatrix4(this.matrixWorld),index:q,face:null,faceIndex:null,object:this}))}}else for(k=0,q=c.length/3-1;k<q;k+=l)f.fromArray(c,3*k),g.fromArray(c,3*k+3),Nf.distanceSqToSegment(f,g,h,e)>d||(h.applyMatrix4(this.matrixWorld),p=a.ray.origin.distanceTo(h),p<a.near||p>a.far||b.push({distance:p,point:e.clone().applyMatrix4(this.matrixWorld),index:k,face:null,faceIndex:null,object:this}))}else if(c.isGeometry)for(f=
|
|
c.vertices,g=f.length,c=0;c<g-1;c+=l)Nf.distanceSqToSegment(f[c],f[c+1],h,e)>d||(h.applyMatrix4(this.matrixWorld),k=a.ray.origin.distanceTo(h),k<a.near||k>a.far||b.push({distance:k,point:e.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}))}},updateMorphTargets:function(){var a=this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var b=Object.keys(a);if(0<b.length&&(a=a[b[0]],void 0!==a)){this.morphTargetInfluences=[];this.morphTargetDictionary={};b=0;for(var c=
|
|
c.vertices,g=f.length,c=0;c<g-1;c+=l)Nf.distanceSqToSegment(f[c],f[c+1],h,e)>d||(h.applyMatrix4(this.matrixWorld),k=a.ray.origin.distanceTo(h),k<a.near||k>a.far||b.push({distance:k,point:e.clone().applyMatrix4(this.matrixWorld),index:c,face:null,faceIndex:null,object:this}))}},updateMorphTargets:function(){var a=this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var b=Object.keys(a);if(0<b.length&&(a=a[b[0]],void 0!==a)){this.morphTargetInfluences=[];this.morphTargetDictionary={};b=0;for(var c=
|
|
a.length;b<c;b++){var d=a[b].name||String(b);this.morphTargetInfluences.push(0);this.morphTargetDictionary[d]=b}}}else a=a.morphTargets,void 0!==a&&0<a.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}});var Of=new m,Pf=new m;ka.prototype=Object.assign(Object.create(Ja.prototype),{constructor:ka,isLineSegments:!0,computeLineDistances:function(){var a=this.geometry;if(a.isBufferGeometry)if(null===a.index){for(var b=a.attributes.position,
|
|
a.length;b<c;b++){var d=a[b].name||String(b);this.morphTargetInfluences.push(0);this.morphTargetDictionary[d]=b}}}else a=a.morphTargets,void 0!==a&&0<a.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}});var Of=new m,Pf=new m;ka.prototype=Object.assign(Object.create(Ja.prototype),{constructor:ka,isLineSegments:!0,computeLineDistances:function(){var a=this.geometry;if(a.isBufferGeometry)if(null===a.index){for(var b=a.attributes.position,
|
|
c=[],d=0,e=b.count;d<e;d+=2)Of.fromBufferAttribute(b,d),Pf.fromBufferAttribute(b,d+1),c[d]=0===d?0:c[d-1],c[d+1]=c[d]+Of.distanceTo(Pf);a.setAttribute("lineDistance",new C(c,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(a.isGeometry)for(b=a.vertices,a=a.lineDistances,c=0,d=b.length;c<d;c+=2)Of.copy(b[c]),Pf.copy(b[c+1]),a[c]=0===c?0:a[c-1],a[c+1]=a[c]+Of.distanceTo(Pf);return this}});Se.prototype=Object.assign(Object.create(Ja.prototype),
|
|
c=[],d=0,e=b.count;d<e;d+=2)Of.fromBufferAttribute(b,d),Pf.fromBufferAttribute(b,d+1),c[d]=0===d?0:c[d-1],c[d+1]=c[d]+Of.distanceTo(Pf);a.setAttribute("lineDistance",new C(c,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(a.isGeometry)for(b=a.vertices,a=a.lineDistances,c=0,d=b.length;c<d;c+=2)Of.copy(b[c]),Pf.copy(b[c+1]),a[c]=0===c?0:a[c-1],a[c+1]=a[c]+Of.distanceTo(Pf);return this}});Se.prototype=Object.assign(Object.create(Ja.prototype),
|