diff --git a/build/three.js b/build/three.js index 751f0a8de24d8636a229f1b0ea101ee213d75b38..ef8cbee250227dd295cf5732976775600b671fc0 100644 --- a/build/three.js +++ b/build/three.js @@ -22863,13 +22863,7 @@ var pose = null; var controllers = []; - var sortedInputSources = []; - - function isPresenting() { - - return session !== null && referenceSpace !== null; - - } + var inputSourcesMap = new Map(); // @@ -22889,6 +22883,8 @@ this.enabled = false; + this.isPresenting = false; + this.getController = function ( id ) { var controller = controllers[ id ]; @@ -22911,13 +22907,11 @@ function onSessionEvent( event ) { - for ( var i = 0; i < controllers.length; i ++ ) { + var controller = inputSourcesMap.get( event.inputSource ); - if ( sortedInputSources[ i ] === event.inputSource ) { + if ( controller ) { - controllers[ i ].dispatchEvent( { type: event.type } ); - - } + controller.dispatchEvent( { type: event.type } ); } @@ -22925,12 +22919,24 @@ function onSessionEnd() { + inputSourcesMap.forEach( function ( controller, inputSource ) { + + controller.dispatchEvent( { type: 'disconnected', data: inputSource } ); + + } ); + + inputSourcesMap.clear(); + + // + renderer.setFramebuffer( null ); renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830 animation.stop(); scope.dispatchEvent( { type: 'sessionend' } ); + scope.isPresenting = false; + } function onRequestReferenceSpace( value ) { @@ -22942,6 +22948,8 @@ scope.dispatchEvent( { type: 'sessionstart' } ); + scope.isPresenting = true; + } this.setFramebufferScaleFactor = function ( /* value */ ) { @@ -22996,33 +23004,52 @@ session.addEventListener( 'inputsourceschange', updateInputSources ); - updateInputSources(); - } }; - function updateInputSources() { + function updateInputSources( event ) { + + console.log( 'inputsourceschange', event, session.inputSources ); + + var inputSources = session.inputSources; + + // Assign inputSources to available controllers for ( var i = 0; i < controllers.length; i ++ ) { - sortedInputSources[ i ] = findInputSource( i ); + inputSourcesMap.set( inputSources[ i ], controllers[ i ] ); } - } + // Notify disconnected - function findInputSource( id ) { + for ( var i = 0; i < event.removed.length; i ++ ) { - var inputSources = session.inputSources; + var inputSource = event.removed[ i ]; + var controller = inputSourcesMap.get( inputSource ); - for ( var i = 0; i < inputSources.length; i ++ ) { + if ( controller ) { - var inputSource = inputSources[ i ]; - var handedness = inputSource.handedness; + controller.dispatchEvent( { type: 'disconnected', data: inputSource } ); + inputSourcesMap.delete( inputSource ); - if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) { return inputSource; } - if ( id === 1 && ( handedness === 'left' ) ) { return inputSource; } + } + + } + + // Notify connected + + for ( var i = 0; i < event.added.length; i ++ ) { + + var inputSource = event.added[ i ]; + var controller = inputSourcesMap.get( inputSource ); + + if ( controller ) { + + controller.dispatchEvent( { type: 'connected', data: inputSource } ); + + } } @@ -23137,8 +23164,6 @@ }; - this.isPresenting = isPresenting; - // Animation Loop var onAnimationFrameCallback = null; @@ -23177,11 +23202,13 @@ // + var inputSources = session.inputSources; + for ( var i = 0; i < controllers.length; i ++ ) { var controller = controllers[ i ]; - var inputSource = sortedInputSources[ i ]; + var inputSource = inputSources[ i ]; if ( inputSource ) { @@ -23191,12 +23218,7 @@ controller.matrix.fromArray( inputPose.transform.matrix ); controller.matrix.decompose( controller.position, controller.rotation, controller.scale ); - - if ( inputSource.targetRayMode === 'pointing' ) { - - controller.visible = true; - - } + controller.visible = true; continue; @@ -23567,7 +23589,7 @@ this.setSize = function ( width, height, updateStyle ) { - if ( xr.isPresenting() ) { + if ( xr.isPresenting ) { console.warn( 'THREE.WebGLRenderer: Can\'t change size while VR device is presenting.' ); return; @@ -24272,7 +24294,7 @@ function onAnimationFrame( time ) { - if ( xr.isPresenting() ) { return; } + if ( xr.isPresenting ) { return; } if ( onAnimationFrameCallback ) { onAnimationFrameCallback( time ); } } @@ -24336,7 +24358,7 @@ if ( camera.parent === null ) { camera.updateMatrixWorld(); } - if ( xr.enabled && xr.isPresenting() ) { + if ( xr.enabled && xr.isPresenting ) { camera = xr.getCamera( camera ); diff --git a/build/three.min.js b/build/three.min.js index 0811eee6b9ffdc75dd50dbc44bc997a178978ca7..da775e4f7ad8755d8cbbcc6b74210c8ac47576a1 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -1,52 +1,52 @@ // threejs.org/license -(function(h,Fa){"object"===typeof exports&&"undefined"!==typeof module?Fa(exports):"function"===typeof define&&define.amd?define(["exports"],Fa):(h=h||self,Fa(h.THREE={}))})(this,function(h){function Fa(){}function A(a,b){this.x=a||0;this.y=b||0}function Da(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function n(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}function ya(){this.elements=[1,0,0,0,1,0,0,0,1];0k)return!1}return!0}function qb(a,b){this.center=void 0!==a?a:new n;this.radius=void 0!==b?b:0}function Wb(a,b){this.origin=void 0!==a?a:new n;this.direction=void 0!==b?b:new n(0,0,-1)}function Ta(a,b){this.normal=void 0!==a?a:new n(1,0,0);this.constant=void 0!== -b?b:0}function na(a,b,c){this.a=void 0!==a?a:new n;this.b=void 0!==b?b:new n;this.c=void 0!==c?c:new n}function B(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function bg(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a}function cg(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function dg(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}function Dc(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d&& -d.isVector3?d:new n;this.vertexNormals=Array.isArray(d)?d:[];this.color=e&&e.isColor?e:new B;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=void 0!==f?f:0}function N(){Object.defineProperty(this,"id",{value:oj++});this.uuid=Q.generateUUID();this.name="";this.type="Material";this.fog=!0;this.blending=1;this.side=0;this.vertexTangents=this.flatShading=!1;this.vertexColors=0;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha= +b?b:0}function ma(a,b,c){this.a=void 0!==a?a:new n;this.b=void 0!==b?b:new n;this.c=void 0!==c?c:new n}function y(a,b,c){return void 0===b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function bg(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a}function cg(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function dg(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}function Dc(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d&& +d.isVector3?d:new n;this.vertexNormals=Array.isArray(d)?d:[];this.color=e&&e.isColor?e:new y;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex=void 0!==f?f:0}function L(){Object.defineProperty(this,"id",{value:oj++});this.uuid=O.generateUUID();this.name="";this.type="Material";this.fog=!0;this.blending=1;this.side=0;this.vertexTangents=this.flatShading=!1;this.vertexColors=0;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha= this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=3;this.depthWrite=this.depthTest=!0;this.stencilWriteMask=255;this.stencilFunc=519;this.stencilRef=0;this.stencilFuncMask=255;this.stencilZPass=this.stencilZFail=this.stencilFail=7680;this.stencilWrite=!1;this.clippingPlanes=null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.dithering=!1;this.alphaTest=0;this.premultipliedAlpha= -!1;this.toneMapped=this.visible=!0;this.userData={};this.version=0}function Oa(a){N.call(this);this.type="MeshBasicMaterial";this.color=new B(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.morphTargets=this.skinning=!1;this.setValues(a)} -function L(a,b,c){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="";this.array=a;this.itemSize=b;this.count=void 0!==a?a.length/b:0;this.normalized=!0===c;this.usage=35044;this.updateRange={offset:0,count:-1};this.version=0}function Ad(a,b,c){L.call(this,new Int8Array(a),b,c)}function Bd(a,b,c){L.call(this,new Uint8Array(a),b,c)}function Cd(a,b,c){L.call(this,new Uint8ClampedArray(a),b,c)}function Dd(a,b,c){L.call(this,new Int16Array(a), -b,c)}function Xb(a,b,c){L.call(this,new Uint16Array(a),b,c)}function Ed(a,b,c){L.call(this,new Int32Array(a),b,c)}function Yb(a,b,c){L.call(this,new Uint32Array(a),b,c)}function C(a,b,c){L.call(this,new Float32Array(a),b,c)}function Fd(a,b,c){L.call(this,new Float64Array(a),b,c)}function vh(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate= -this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function wh(a){if(0===a.length)return-Infinity;for(var b=a[0],c=1,d=a.length;cb&&(b=a[c]);return b}function F(){Object.defineProperty(this,"id",{value:pj+=2});this.uuid=Q.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=!1;this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity}; -this.userData={}}function ca(a,b){D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new F;this.material=void 0!==b?b:new Oa({color:16777215*Math.random()});this.updateMorphTargets()}function xh(a,b,c,d,e,f,g,k){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,k):d.intersectTriangle(e,f,g,2!==b.side,k)))return null;Je.copy(k);Je.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Je);return bc.far?null:{distance:b,point:Je.clone(),object:a}}function Ke(a,b,c,d,e,f,g,k,l,m,v,p){Zb.fromBufferAttribute(e, -m);$b.fromBufferAttribute(e,v);ac.fromBufferAttribute(e,p);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Le.set(0,0,0);Me.set(0,0,0);Ne.set(0,0,0);for(var r=0,t=f.length;rb&&(b=a[c]);return b}function G(){Object.defineProperty(this,"id",{value:pj+=2});this.uuid=O.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=!1;this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity}; +this.userData={}}function ca(a,b){D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new G;this.material=void 0!==b?b:new Oa({color:16777215*Math.random()});this.updateMorphTargets()}function xh(a,b,c,d,e,f,g,k){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,k):d.intersectTriangle(e,f,g,2!==b.side,k)))return null;Je.copy(k);Je.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Je);return bc.far?null:{distance:b,point:Je.clone(),object:a}}function Ke(a,b,c,d,e,f,g,k,l,m,v,p){Zb.fromBufferAttribute(e, +m);$b.fromBufferAttribute(e,v);ac.fromBufferAttribute(e,p);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Le.set(0,0,0);Me.set(0,0,0);Ne.set(0,0,0);for(var q=0,t=f.length;qg;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function Eb(a,b,c){wa.call(this,a,b,c)}function cc(a,b,c,d,e,f,g,k,l,m,v,p){V.call(this,null,f,g,k,l,m,d,e,v,p);this.image={data:a||null,width:b||1,height:c||1};this.magFilter=void 0!==l?l:1003;this.minFilter=void 0!==m?m:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1;this.needsUpdate=!0}function Hd(a,b,c,d,e,f){this.planes=[void 0!==a?a:new Ta,void 0!==b?b:new Ta,void 0!==c?c:new Ta,void 0!== +f=this.renderTarget,g=0;6>g;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function Eb(a,b,c){va.call(this,a,b,c)}function cc(a,b,c,d,e,f,g,k,l,m,v,p){T.call(this,null,f,g,k,l,m,d,e,v,p);this.image={data:a||null,width:b||1,height:c||1};this.magFilter=void 0!==l?l:1003;this.minFilter=void 0!==m?m:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1;this.needsUpdate=!0}function Hd(a,b,c,d,e,f){this.planes=[void 0!==a?a:new Ta,void 0!==b?b:new Ta,void 0!==c?c:new Ta,void 0!== d?d:new Ta,void 0!==e?e:new Ta,void 0!==f?f:new Ta]}function yh(){function a(e,f){!1!==c&&(d(e,f),b.requestAnimationFrame(a))}var b=null,c=!1,d=null;return{start:function(){!0!==c&&null!==d&&(b.requestAnimationFrame(a),c=!0)},stop:function(){c=!1},setAnimationLoop:function(a){d=a},setContext:function(a){b=a}}}function rj(a){function b(b,c){var d=b.array,e=b.usage,k=a.createBuffer();a.bindBuffer(c,k);a.bufferData(c,d,e);b.onUploadCallback();c=5126;d instanceof Float32Array?c=5126:d instanceof Float64Array? console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?c=5123:d instanceof Int16Array?c=5122:d instanceof Uint32Array?c=5125:d instanceof Int32Array?c=5124:d instanceof Int8Array?c=5120:d instanceof Uint8Array&&(c=5121);return{buffer:k,type:c,bytesPerElement:d.BYTES_PER_ELEMENT,version:b.version}}var c=new WeakMap;return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return c.get(a)},remove:function(b){b.isInterleavedBufferAttribute&& -(b=b.data);var d=c.get(b);d&&(a.deleteBuffer(d.buffer),c.delete(b))},update:function(d,e){d.isInterleavedBufferAttribute&&(d=d.data);var f=c.get(d);if(void 0===f)c.set(d,b(d,e));else if(f.versionm;m++){if(p=d[m])if(l=p[0],p=p[1]){v&&e.setAttribute("morphTarget"+m,v[l]);f&&e.setAttribute("morphNormal"+m,f[l]);c[m]=p;k+=p;continue}c[m]=0}e=e.morphTargetsRelative?1:1-k;g.getUniforms().setValue(a,"morphTargetBaseInfluence",e);g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function Cj(a,b,c,d){var e={};return{update:function(a){var f=d.render.frame,k=a.geometry,l=b.get(a,k);e[l.id]!==f&&(k.isGeometry&&l.updateFromObject(a),b.update(l),e[l.id]=f);a.isInstancedMesh&& -c.update(a.instanceMatrix,34962);return l},dispose:function(){e={}}}}function rb(a,b,c,d,e,f,g,k,l,m){a=void 0!==a?a:[];V.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,k,l,m);this.flipY=!1}function Ic(a,b,c,d){V.call(this,null);this.image={data:a||null,width:b||1,height:c||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Jc(a,b,c,d){V.call(this,null);this.image={data:a||null,width:b||1,height:c||1,depth:d||1}; +c.update(a.instanceMatrix,34962);return l},dispose:function(){e={}}}}function rb(a,b,c,d,e,f,g,k,l,m){a=void 0!==a?a:[];T.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,k,l,m);this.flipY=!1}function Ic(a,b,c,d){T.call(this,null);this.image={data:a||null,width:b||1,height:c||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Jc(a,b,c,d){T.call(this,null);this.image={data:a||null,width:b||1,height:c||1,depth:d||1}; this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0}function Kc(a,b,c){var d=a[0];if(0>=d||0");return a.replace(jg,ig)}function Oh(a,b,c,d){a="";for(b=parseInt(b);bc;c++)b.probe.push(new n);var d=new n,e=new R,f=new R;return{setup:function(c,k,l){for(var g=0,v=0,p=0,h=0;9>h;h++)b.probe[h].set(0,0,0);var t=k=0,q=0, -u=0,n=0,w=0,z=0,M=0;l=l.matrixWorldInverse;c.sort(Ak);h=0;for(var H=c.length;hra;ra++)b.probe[ra].addScaledVector(y.sh.coefficients[ra],la);else if(y.isDirectionalLight){var G=a.get(y);G.color.copy(y.color).multiplyScalar(y.intensity);G.direction.setFromMatrixPosition(y.matrixWorld);d.setFromMatrixPosition(y.target.matrixWorld); -G.direction.sub(d);G.direction.transformDirection(l);if(G.shadow=y.castShadow)la=y.shadow,G.shadowBias=la.bias,G.shadowRadius=la.radius,G.shadowMapSize=la.mapSize,b.directionalShadowMap[k]=ra,b.directionalShadowMatrix[k]=y.shadow.matrix,w++;b.directional[k]=G;k++}else if(y.isSpotLight){G=a.get(y);G.position.setFromMatrixPosition(y.matrixWorld);G.position.applyMatrix4(l);G.color.copy(za).multiplyScalar(la);G.distance=A;G.direction.setFromMatrixPosition(y.matrixWorld);d.setFromMatrixPosition(y.target.matrixWorld); -G.direction.sub(d);G.direction.transformDirection(l);G.coneCos=Math.cos(y.angle);G.penumbraCos=Math.cos(y.angle*(1-y.penumbra));G.decay=y.decay;if(G.shadow=y.castShadow)la=y.shadow,G.shadowBias=la.bias,G.shadowRadius=la.radius,G.shadowMapSize=la.mapSize,b.spotShadowMap[q]=ra,b.spotShadowMatrix[q]=y.shadow.matrix,M++;b.spot[q]=G;q++}else if(y.isRectAreaLight)G=a.get(y),G.color.copy(za).multiplyScalar(la),G.position.setFromMatrixPosition(y.matrixWorld),G.position.applyMatrix4(l),f.identity(),e.copy(y.matrixWorld), -e.premultiply(l),f.extractRotation(e),G.halfWidth.set(.5*y.width,0,0),G.halfHeight.set(0,.5*y.height,0),G.halfWidth.applyMatrix4(f),G.halfHeight.applyMatrix4(f),b.rectArea[u]=G,u++;else if(y.isPointLight){G=a.get(y);G.position.setFromMatrixPosition(y.matrixWorld);G.position.applyMatrix4(l);G.color.copy(y.color).multiplyScalar(y.intensity);G.distance=y.distance;G.decay=y.decay;if(G.shadow=y.castShadow)la=y.shadow,G.shadowBias=la.bias,G.shadowRadius=la.radius,G.shadowMapSize=la.mapSize,G.shadowCameraNear= -la.camera.near,G.shadowCameraFar=la.camera.far,b.pointShadowMap[t]=ra,b.pointShadowMatrix[t]=y.shadow.matrix,z++;b.point[t]=G;t++}else y.isHemisphereLight&&(G=a.get(y),G.direction.setFromMatrixPosition(y.matrixWorld),G.direction.transformDirection(l),G.direction.normalize(),G.skyColor.copy(y.color).multiplyScalar(la),G.groundColor.copy(y.groundColor).multiplyScalar(la),b.hemi[n]=G,n++)}b.ambient[0]=g;b.ambient[1]=v;b.ambient[2]=p;c=b.hash;if(c.directionalLength!==k||c.pointLength!==t||c.spotLength!== -q||c.rectAreaLength!==u||c.hemiLength!==n||c.numDirectionalShadows!==w||c.numPointShadows!==z||c.numSpotShadows!==M)b.directional.length=k,b.spot.length=q,b.rectArea.length=u,b.point.length=t,b.hemi.length=n,b.directionalShadowMap.length=w,b.pointShadowMap.length=z,b.spotShadowMap.length=M,b.directionalShadowMatrix.length=w,b.pointShadowMatrix.length=z,b.spotShadowMatrix.length=M,c.directionalLength=k,c.pointLength=t,c.spotLength=q,c.rectAreaLength=u,c.hemiLength=n,c.numDirectionalShadows=w,c.numPointShadows= -z,c.numSpotShadows=M,b.version=Ck++},state:b}}function Sh(){var a=new Bk,b=[],c=[];return{init:function(){b.length=0;c.length=0},state:{lightsArray:b,shadowsArray:c,lights:a},setupLights:function(d){a.setup(b,c,d)},pushLight:function(a){b.push(a)},pushShadow:function(a){c.push(a)}}}function Dk(){function a(c){c=c.target;c.removeEventListener("dispose",a);b.delete(c)}var b=new WeakMap;return{get:function(c,d){if(!1===b.has(c)){var e=new Sh;b.set(c,new WeakMap);b.get(c).set(d,e);c.addEventListener("dispose", -a)}else!1===b.get(c).has(d)?(e=new Sh,b.get(c).set(d,e)):e=b.get(c).get(d);return e},dispose:function(){b=new WeakMap}}}function Gb(a){N.call(this);this.type="MeshDepthMaterial";this.depthPacking=3200;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.fog=!1;this.setValues(a)}function Hb(a){N.call(this);this.type="MeshDistanceMaterial";this.referencePosition=new n;this.nearDistance= +a)}else f=e.get(d),void 0===f&&(f=new Rh,e.set(d,f));return f},dispose:function(){b=new WeakMap}}}function zk(){var a={};return{get:function(b){if(void 0!==a[b.id])return a[b.id];switch(b.type){case "DirectionalLight":var c={direction:new n,color:new y,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new x};break;case "SpotLight":c={position:new n,direction:new n,color:new y,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new x};break;case "PointLight":c= +{position:new n,color:new y,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new x,shadowCameraNear:1,shadowCameraFar:1E3};break;case "HemisphereLight":c={direction:new n,skyColor:new y,groundColor:new y};break;case "RectAreaLight":c={color:new y,position:new n,halfWidth:new n,halfHeight:new n}}return a[b.id]=c}}}function Ak(a,b){return(b.castShadow?1:0)-(a.castShadow?1:0)}function Bk(){for(var a=new zk,b={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1, +hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},c=0;9>c;c++)b.probe.push(new n);var d=new n,e=new P,f=new P;return{setup:function(c,k,l){for(var g=0,v=0,p=0,h=0;9>h;h++)b.probe[h].set(0,0,0);var t=k=0,r=0, +u=0,n=0,w=0,B=0,U=0;l=l.matrixWorldInverse;c.sort(Ak);h=0;for(var wa=c.length;hqa;qa++)b.probe[qa].addScaledVector(A.sh.coefficients[qa],xa);else if(A.isDirectionalLight){var F=a.get(A);F.color.copy(A.color).multiplyScalar(A.intensity);F.direction.setFromMatrixPosition(A.matrixWorld);d.setFromMatrixPosition(A.target.matrixWorld); +F.direction.sub(d);F.direction.transformDirection(l);if(F.shadow=A.castShadow)xa=A.shadow,F.shadowBias=xa.bias,F.shadowRadius=xa.radius,F.shadowMapSize=xa.mapSize,b.directionalShadowMap[k]=qa,b.directionalShadowMatrix[k]=A.shadow.matrix,w++;b.directional[k]=F;k++}else if(A.isSpotLight){F=a.get(A);F.position.setFromMatrixPosition(A.matrixWorld);F.position.applyMatrix4(l);F.color.copy(aa).multiplyScalar(xa);F.distance=x;F.direction.setFromMatrixPosition(A.matrixWorld);d.setFromMatrixPosition(A.target.matrixWorld); +F.direction.sub(d);F.direction.transformDirection(l);F.coneCos=Math.cos(A.angle);F.penumbraCos=Math.cos(A.angle*(1-A.penumbra));F.decay=A.decay;if(F.shadow=A.castShadow)xa=A.shadow,F.shadowBias=xa.bias,F.shadowRadius=xa.radius,F.shadowMapSize=xa.mapSize,b.spotShadowMap[r]=qa,b.spotShadowMatrix[r]=A.shadow.matrix,U++;b.spot[r]=F;r++}else if(A.isRectAreaLight)F=a.get(A),F.color.copy(aa).multiplyScalar(xa),F.position.setFromMatrixPosition(A.matrixWorld),F.position.applyMatrix4(l),f.identity(),e.copy(A.matrixWorld), +e.premultiply(l),f.extractRotation(e),F.halfWidth.set(.5*A.width,0,0),F.halfHeight.set(0,.5*A.height,0),F.halfWidth.applyMatrix4(f),F.halfHeight.applyMatrix4(f),b.rectArea[u]=F,u++;else if(A.isPointLight){F=a.get(A);F.position.setFromMatrixPosition(A.matrixWorld);F.position.applyMatrix4(l);F.color.copy(A.color).multiplyScalar(A.intensity);F.distance=A.distance;F.decay=A.decay;if(F.shadow=A.castShadow)xa=A.shadow,F.shadowBias=xa.bias,F.shadowRadius=xa.radius,F.shadowMapSize=xa.mapSize,F.shadowCameraNear= +xa.camera.near,F.shadowCameraFar=xa.camera.far,b.pointShadowMap[t]=qa,b.pointShadowMatrix[t]=A.shadow.matrix,B++;b.point[t]=F;t++}else A.isHemisphereLight&&(F=a.get(A),F.direction.setFromMatrixPosition(A.matrixWorld),F.direction.transformDirection(l),F.direction.normalize(),F.skyColor.copy(A.color).multiplyScalar(xa),F.groundColor.copy(A.groundColor).multiplyScalar(xa),b.hemi[n]=F,n++)}b.ambient[0]=g;b.ambient[1]=v;b.ambient[2]=p;c=b.hash;if(c.directionalLength!==k||c.pointLength!==t||c.spotLength!== +r||c.rectAreaLength!==u||c.hemiLength!==n||c.numDirectionalShadows!==w||c.numPointShadows!==B||c.numSpotShadows!==U)b.directional.length=k,b.spot.length=r,b.rectArea.length=u,b.point.length=t,b.hemi.length=n,b.directionalShadowMap.length=w,b.pointShadowMap.length=B,b.spotShadowMap.length=U,b.directionalShadowMatrix.length=w,b.pointShadowMatrix.length=B,b.spotShadowMatrix.length=U,c.directionalLength=k,c.pointLength=t,c.spotLength=r,c.rectAreaLength=u,c.hemiLength=n,c.numDirectionalShadows=w,c.numPointShadows= +B,c.numSpotShadows=U,b.version=Ck++},state:b}}function Sh(){var a=new Bk,b=[],c=[];return{init:function(){b.length=0;c.length=0},state:{lightsArray:b,shadowsArray:c,lights:a},setupLights:function(d){a.setup(b,c,d)},pushLight:function(a){b.push(a)},pushShadow:function(a){c.push(a)}}}function Dk(){function a(c){c=c.target;c.removeEventListener("dispose",a);b.delete(c)}var b=new WeakMap;return{get:function(c,d){if(!1===b.has(c)){var e=new Sh;b.set(c,new WeakMap);b.get(c).set(d,e);c.addEventListener("dispose", +a)}else!1===b.get(c).has(d)?(e=new Sh,b.get(c).set(d,e)):e=b.get(c).get(d);return e},dispose:function(){b=new WeakMap}}}function Gb(a){L.call(this);this.type="MeshDepthMaterial";this.depthPacking=3200;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.fog=!1;this.setValues(a)}function Hb(a){L.call(this);this.type="MeshDistanceMaterial";this.referencePosition=new n;this.nearDistance= 1;this.farDistance=1E3;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.fog=!1;this.setValues(a)}function Th(a,b,c){function d(a,b,c){c=a<<0|b<<1|c<<2;var d=p[c];void 0===d&&(d=new Gb({depthPacking:3201,morphTargets:a,skinning:b}),p[c]=d);return d}function e(a,b,c){c=a<<0|b<<1|c<<2;var d=h[c];void 0===d&&(d=new Hb({morphTargets:a,skinning:b}),h[c]=d);return d}function f(b,c,f,g,k,l){var m=b.geometry,p=d,v=b.customDepthMaterial; !0===f.isPointLight&&(p=e,v=b.customDistanceMaterial);void 0===v?(v=!1,!0===c.morphTargets&&(!0===m.isBufferGeometry?v=m.morphAttributes&&m.morphAttributes.position&&0\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}"}), -n=u.clone();n.defines.HORIZONAL_PASS=1;var w=new F;w.setAttribute("position",new L(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var z=new ca(w,u),M=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,e,f){if(!1!==M.enabled&&(!1!==M.autoUpdate||!1!==M.needsUpdate)&&0!==d.length){var p=a.getRenderTarget(),h=a.getActiveCubeFace(),r=a.getActiveMipmapLevel(),q=a.state;q.setBlending(0);q.buffers.color.setClear(1,1,1,1);q.buffers.depth.setTest(!0);q.setScissorTest(!1); -for(var t=0,x=d.length;tc||l.y>c)console.warn("THREE.WebGLShadowMap:",w,"has shadow exceeding max texture size, reducing"),l.x>c&&(m.x=Math.floor(c/H.x),l.x=m.x*H.x,y.mapSize.x=m.x),l.y>c&&(m.y=Math.floor(c/H.y),l.y=m.y*H.y,y.mapSize.y=m.y);null!==y.map||y.isPointLightShadow||3!==this.type||(H={minFilter:1006,magFilter:1006, -format:1023},y.map=new wa(l.x,l.y,H),y.map.texture.name=w.name+".shadowMap",y.mapPass=new wa(l.x,l.y,H),y.camera.updateProjectionMatrix());null===y.map&&(H={minFilter:1003,magFilter:1003,format:1023},y.map=new wa(l.x,l.y,H),y.map.texture.name=w.name+".shadowMap",y.camera.updateProjectionMatrix());a.setRenderTarget(y.map);a.clear();H=y.getViewportCount();for(var za=0;za\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}"}), +n=u.clone();n.defines.HORIZONAL_PASS=1;var w=new G;w.setAttribute("position",new K(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var B=new ca(w,u),U=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,e,f){if(!1!==U.enabled&&(!1!==U.autoUpdate||!1!==U.needsUpdate)&&0!==d.length){var p=a.getRenderTarget(),h=a.getActiveCubeFace(),q=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,z=d.length;tc||l.y>c)console.warn("THREE.WebGLShadowMap:",w,"has shadow exceeding max texture size, reducing"),l.x>c&&(m.x=Math.floor(c/aa.x),l.x=m.x*aa.x,A.mapSize.x=m.x),l.y>c&&(m.y=Math.floor(c/aa.y),l.y=m.y*aa.y,A.mapSize.y=m.y);null!==A.map||A.isPointLightShadow||3!==this.type||(aa={minFilter:1006, +magFilter:1006,format:1023},A.map=new va(l.x,l.y,aa),A.map.texture.name=w.name+".shadowMap",A.mapPass=new va(l.x,l.y,aa),A.camera.updateProjectionMatrix());null===A.map&&(aa={minFilter:1003,magFilter:1003,format:1023},A.map=new va(l.x,l.y,aa),A.map.texture.name=w.name+".shadowMap",A.camera.updateProjectionMatrix());a.setRenderTarget(A.map);a.clear();aa=A.getViewportCount();for(var wa=0;wad||a.height>d)e=d/Math.max(a.width,a.height);if(1>e||!0===b){if("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap)return d=b?Q.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height),void 0===J&&(J=k(b,e)),c=c?k(b,e):J,c.width=b,c.height=e, -c.getContext("2d").drawImage(a,0,0,b,e),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+b+"x"+e+")."),c;"data"in a&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").")}return a}function m(a){return Q.isPowerOfTwo(a.width)&&Q.isPowerOfTwo(a.height)}function v(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function p(b,c,e,f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e, -f))*Math.LOG2E}function h(c,d,e){if(!1===ra)return d;if(null!==c){if(void 0!==a[c])return a[c];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+c+"'")}c=d;6403===d&&(5126===e&&(c=33326),5131===e&&(c=33325),5121===e&&(c=33321));6407===d&&(5126===e&&(c=34837),5131===e&&(c=34843),5121===e&&(c=32849));6408===d&&(5126===e&&(c=34836),5131===e&&(c=34842),5121===e&&(c=32856));33325===c||33326===c||34842===c||34836===c?b.get("EXT_color_buffer_float"):(34843===c||34837=== -c)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead.");return c}function t(a){return 1003===a||1004===a||1005===a?9728:9729}function q(b){b=b.target;b.removeEventListener("dispose",q);var c=d.get(b);void 0!==c.__webglInit&&(a.deleteTexture(c.__webglTexture),d.remove(b));b.isVideoTexture&&F.delete(b);g.memory.textures--}function u(b){b=b.target;b.removeEventListener("dispose",u);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&& +v=b)},reset:function(){b=!1;v=p=m=l=k=e=d=c=null}}};c=a.getParameter(34921);var n=new Uint8Array(c),w=new Uint8Array(c),B=new Uint8Array(c),U={},wa=null,A=null,aa=null,x=null,C=null,qa=null,F=null,E=null,D=null,y=!1,G=null,I=null,L=null,K=null,M=null,da=a.getParameter(35661),ha=!1;c=0;c=a.getParameter(7938);-1!==c.indexOf("WebGL")?(c=parseFloat(/^WebGL ([0-9])/.exec(c)[1]),ha=1<=c):-1!==c.indexOf("OpenGL ES")&&(c=parseFloat(/^OpenGL ES ([0-9])/.exec(c)[1]),ha=2<=c);var O=null,Nd={},fb=new S,Uh=new S, +ng={};ng[3553]=d(3553,3553,1);ng[34067]=d(34067,34069,6);t.setClear(0,0,0,1);r.setClear(1);u.setClear(0);f(2929);r.setFunc(3);l(!1);m(1);f(2884);k(0);var Lc={100:32774,101:32778,102:32779};h?(Lc[103]=32775,Lc[104]=32776):(c=b.get("EXT_blend_minmax"),null!==c&&(Lc[103]=c.MIN_EXT,Lc[104]=c.MAX_EXT));var J={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};return{buffers:{color:t,depth:r,stencil:u},initAttributes:function(){for(var a=0,b=n.length;ad||a.height>d)e=d/Math.max(a.width,a.height);if(1>e||!0===b){if("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap)return d=b?O.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height),void 0===I&&(I=k(b,e)),c=c?k(b,e):I,c.width=b,c.height=e, +c.getContext("2d").drawImage(a,0,0,b,e),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+b+"x"+e+")."),c;"data"in a&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").")}return a}function m(a){return O.isPowerOfTwo(a.width)&&O.isPowerOfTwo(a.height)}function v(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function p(b,c,e,f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e, +f))*Math.LOG2E}function h(c,d,e){if(!1===qa)return d;if(null!==c){if(void 0!==a[c])return a[c];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+c+"'")}c=d;6403===d&&(5126===e&&(c=33326),5131===e&&(c=33325),5121===e&&(c=33321));6407===d&&(5126===e&&(c=34837),5131===e&&(c=34843),5121===e&&(c=32849));6408===d&&(5126===e&&(c=34836),5131===e&&(c=34842),5121===e&&(c=32856));33325===c||33326===c||34842===c||34836===c?b.get("EXT_color_buffer_float"):(34843===c||34837=== +c)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead.");return c}function t(a){return 1003===a||1004===a||1005===a?9728:9729}function r(b){b=b.target;b.removeEventListener("dispose",r);var c=d.get(b);void 0!==c.__webglInit&&(a.deleteTexture(c.__webglTexture),d.remove(b));b.isVideoTexture&&G.delete(b);g.memory.textures--}function u(b){b=b.target;b.removeEventListener("dispose",u);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&& a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e=0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);if(b.isWebGLMultiviewRenderTarget){a.deleteTexture(c.__webglColorTexture);a.deleteTexture(c.__webglDepthStencilTexture);g.memory.textures-=2;e=0;for(var f=c.__webglViewFramebuffers.length;e< -f;e++)a.deleteFramebuffer(c.__webglViewFramebuffers[e])}d.remove(b.texture);d.remove(b)}g.memory.textures--}function n(a,b){var e=d.get(a);if(a.isVideoTexture){var f=g.render.frame;F.get(a)!==f&&(F.set(a,f),a.update())}if(0q;q++)r[q]=k||e?e?b.image[q].image:b.image[q]:l(b.image[q],!1,!0,E);var t=r[0],u=m(t)||ra,n=f.convert(b.format),y=f.convert(b.type),w=h(b.internalFormat,n,y);M(34067,b,u);if(k){for(q= -0;6>q;q++){var x=r[q].mipmaps;for(k=0;kq;q++)if(e)for(c.texImage2D(34069+q,0,w,r[q].width,r[q].height,0,n,y,r[q].data),k=0;k=G&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+G);L+=1;return a};this.resetTextureUnits=function(){L=0};this.setTexture2D=n;this.setTexture2DArray=function(a,b){var e= -d.get(a);0y;y++)k.__webglFramebuffer[y]=a.createFramebuffer()}else if(k.__webglFramebuffer=a.createFramebuffer(),r)if(ra){k.__webglMultisampledFramebuffer=a.createFramebuffer();k.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,k.__webglColorRenderbuffer);r=f.convert(e.texture.format);var w=f.convert(e.texture.type);r=h(e.texture.internalFormat,r,w);w= -C(e);a.renderbufferStorageMultisample(36161,w,r,e.width,e.height);a.bindFramebuffer(36160,k.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,k.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);e.depthBuffer&&(k.__webglDepthRenderbuffer=a.createRenderbuffer(),la(k.__webglDepthRenderbuffer,e,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(t){y=e.width;var z=e.height;r=e.numViews; -a.bindFramebuffer(36160,k.__webglFramebuffer);var H=b.get("OVR_multiview2");g.memory.textures+=2;w=a.createTexture();a.bindTexture(35866,w);a.texParameteri(35866,10240,9728);a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,32856,y,z,r,0,6408,5121,null);H.framebufferTextureMultiviewOVR(36160,36064,w,0,0,r);var za=a.createTexture();a.bindTexture(35866,za);a.texParameteri(35866,10240,9728);a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,35056,y,z,r,0,34041,34042,null);H.framebufferTextureMultiviewOVR(36160, -33306,za,0,0,r);z=Array(r);for(y=0;yy;y++)A(k.__webglFramebuffer[y],e,36064,34069+y);v(e.texture,x)&&p(34067,e.texture,e.width,e.height);c.bindTexture(34067,null)}else t||(c.bindTexture(3553, -l.__webglTexture),M(3553,e.texture,x),A(k.__webglFramebuffer,e,36064,3553),v(e.texture,x)&&p(3553,e.texture,e.width,e.height),c.bindTexture(3553,null));if(e.depthBuffer){k=d.get(e);l=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(l)throw Error("target.depthTexture not supported in Cube render targets");if(e&&e.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");a.bindFramebuffer(36160,k.__webglFramebuffer);if(!e.depthTexture||!e.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); +f;e++)a.deleteFramebuffer(c.__webglViewFramebuffers[e])}d.remove(b.texture);d.remove(b)}g.memory.textures--}function n(a,b){var e=d.get(a);if(a.isVideoTexture){var f=g.render.frame;G.get(a)!==f&&(G.set(a,f),a.update())}if(0q;q++)r[q]=k||e?e?b.image[q].image:b.image[q]:l(b.image[q],!1,!0,E);var t=r[0],u=m(t)||qa,n=f.convert(b.format),A=f.convert(b.type),w=h(b.internalFormat,n,A);U(34067,b,u);if(k){for(q= +0;6>q;q++){var z=r[q].mipmaps;for(k=0;kq;q++)if(e)for(c.texImage2D(34069+q,0,w,r[q].width,r[q].height,0,n,A,r[q].data),k=0;k=F&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+F);K+=1;return a};this.resetTextureUnits=function(){K=0};this.setTexture2D=n;this.setTexture2DArray=function(a,b){var e= +d.get(a);0A;A++)k.__webglFramebuffer[A]=a.createFramebuffer()}else if(k.__webglFramebuffer=a.createFramebuffer(),r)if(qa){k.__webglMultisampledFramebuffer=a.createFramebuffer();k.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,k.__webglColorRenderbuffer);r=f.convert(e.texture.format);var w=f.convert(e.texture.type);r=h(e.texture.internalFormat,r,w);w= +C(e);a.renderbufferStorageMultisample(36161,w,r,e.width,e.height);a.bindFramebuffer(36160,k.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,k.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);e.depthBuffer&&(k.__webglDepthRenderbuffer=a.createRenderbuffer(),x(k.__webglDepthRenderbuffer,e,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(t){A=e.width;var B=e.height;r=e.numViews; +a.bindFramebuffer(36160,k.__webglFramebuffer);var wa=b.get("OVR_multiview2");g.memory.textures+=2;w=a.createTexture();a.bindTexture(35866,w);a.texParameteri(35866,10240,9728);a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,32856,A,B,r,0,6408,5121,null);wa.framebufferTextureMultiviewOVR(36160,36064,w,0,0,r);var F=a.createTexture();a.bindTexture(35866,F);a.texParameteri(35866,10240,9728);a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,35056,A,B,r,0,34041,34042,null);wa.framebufferTextureMultiviewOVR(36160, +33306,F,0,0,r);B=Array(r);for(A=0;AA;A++)aa(k.__webglFramebuffer[A],e,36064,34069+A);v(e.texture,z)&&p(34067,e.texture,e.width,e.height);c.bindTexture(34067,null)}else t||(c.bindTexture(3553, +l.__webglTexture),U(3553,e.texture,z),aa(k.__webglFramebuffer,e,36064,3553),v(e.texture,z)&&p(3553,e.texture,e.width,e.height),c.bindTexture(3553,null));if(e.depthBuffer){k=d.get(e);l=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(l)throw Error("target.depthTexture not supported in Cube render targets");if(e&&e.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");a.bindFramebuffer(36160,k.__webglFramebuffer);if(!e.depthTexture||!e.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); d.get(e.depthTexture).__webglTexture&&e.depthTexture.image.width===e.width&&e.depthTexture.image.height===e.height||(e.depthTexture.image.width=e.width,e.depthTexture.image.height=e.height,e.depthTexture.needsUpdate=!0);n(e.depthTexture,0);k=d.get(e.depthTexture).__webglTexture;if(1026===e.depthTexture.format)a.framebufferTexture2D(36160,36096,3553,k,0);else if(1027===e.depthTexture.format)a.framebufferTexture2D(36160,33306,3553,k,0);else throw Error("Unknown depthTexture format");}else if(l)for(k.__webglDepthbuffer= -[],l=0;6>l;l++)a.bindFramebuffer(36160,k.__webglFramebuffer[l]),k.__webglDepthbuffer[l]=a.createRenderbuffer(),la(k.__webglDepthbuffer[l],e);else a.bindFramebuffer(36160,k.__webglFramebuffer),k.__webglDepthbuffer=a.createRenderbuffer(),la(k.__webglDepthbuffer,e);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture,e=m(a)||ra;if(v(b,e)){e=a.isWebGLRenderTargetCube?34067:3553;var f=d.get(b).__webglTexture;c.bindTexture(e,f);p(e,b,a.width,a.height);c.bindTexture(e, -null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(ra){var c=d.get(b);a.bindFramebuffer(36008,c.__webglMultisampledFramebuffer);a.bindFramebuffer(36009,c.__webglFramebuffer);c=b.width;var e=b.height,f=16384;b.depthBuffer&&(f|=256);b.stencilBuffer&&(f|=1024);a.blitFramebuffer(0,0,c,e,0,0,c,e,f,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")};this.safeSetTexture2D=function(a,b){a&&a.isWebGLRenderTarget&& -(!1===ha&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),ha=!0),a=a.texture);n(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLRenderTargetCube&&(!1===R&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),R=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?w(a,b):z(a,b)}}function Vh(a,b,c){var d= +[],l=0;6>l;l++)a.bindFramebuffer(36160,k.__webglFramebuffer[l]),k.__webglDepthbuffer[l]=a.createRenderbuffer(),x(k.__webglDepthbuffer[l],e);else a.bindFramebuffer(36160,k.__webglFramebuffer),k.__webglDepthbuffer=a.createRenderbuffer(),x(k.__webglDepthbuffer,e);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture,e=m(a)||qa;if(v(b,e)){e=a.isWebGLRenderTargetCube?34067:3553;var f=d.get(b).__webglTexture;c.bindTexture(e,f);p(e,b,a.width,a.height);c.bindTexture(e, +null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(qa){var c=d.get(b);a.bindFramebuffer(36008,c.__webglMultisampledFramebuffer);a.bindFramebuffer(36009,c.__webglFramebuffer);c=b.width;var e=b.height,f=16384;b.depthBuffer&&(f|=256);b.stencilBuffer&&(f|=1024);a.blitFramebuffer(0,0,c,e,0,0,c,e,f,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")};this.safeSetTexture2D=function(a,b){a&&a.isWebGLRenderTarget&& +(!1===ha&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),ha=!0),a=a.texture);n(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLRenderTargetCube&&(!1===P&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),P=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?w(a,b):B(a,b)}}function Vh(a,b,c){var d= c.isWebGL2;return{convert:function(a){if(1009===a)return 5121;if(1017===a)return 32819;if(1018===a)return 32820;if(1019===a)return 33635;if(1010===a)return 5120;if(1011===a)return 5122;if(1012===a)return 5123;if(1013===a)return 5124;if(1014===a)return 5125;if(1015===a)return 5126;if(1016===a){if(d)return 5131;var c=b.get("OES_texture_half_float");return null!==c?c.HALF_FLOAT_OES:null}if(1021===a)return 6406;if(1022===a)return 6407;if(1023===a)return 6408;if(1024===a)return 6409;if(1025===a)return 6410; if(1026===a)return 6402;if(1027===a)return 34041;if(1028===a)return 6403;if(1029===a)return 36244;if(1030===a)return 33319;if(1031===a)return 33320;if(1032===a)return 36248;if(1033===a)return 36249;if(33776===a||33777===a||33778===a||33779===a)if(c=b.get("WEBGL_compressed_texture_s3tc"),null!==c){if(33776===a)return c.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===a)return c.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===a)return c.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===a)return c.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null; if(35840===a||35841===a||35842===a||35843===a)if(c=b.get("WEBGL_compressed_texture_pvrtc"),null!==c){if(35840===a)return c.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===a)return c.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===a)return c.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===a)return c.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(36196===a)return c=b.get("WEBGL_compressed_texture_etc1"),null!==c?c.COMPRESSED_RGB_ETC1_WEBGL:null;if(37808===a||37809===a||37810===a||37811===a||37812===a||37813=== -a||37814===a||37815===a||37816===a||37817===a||37818===a||37819===a||37820===a||37821===a)return c=b.get("WEBGL_compressed_texture_astc"),null!==c?a:null;if(1020===a){if(d)return 34042;c=b.get("WEBGL_depth_texture");return null!==c?c.UNSIGNED_INT_24_8_WEBGL:null}}}}function og(a,b,c,d){wa.call(this,a,b,d);this.stencilBuffer=this.depthBuffer=!1;this.numViews=c}function Gk(a,b){function c(a){if(a.isArrayCamera)return a.cameras;v[0]=a;return v}function d(a){if(void 0===a.isArrayCamera)return!0;a=a.cameras; -if(a.length>t)return!1;for(var b=1,c=a.length;bf.matrixWorld.determinant(),l=h(a,c,e,f);aa.setMaterial(e,k);var m=!1;if(b!==d.id||da!==l.id||ha!==(!0===e.wireframe))b=d.id,da=l.id,ha=!0===e.wireframe,m=!0;if(e.morphTargets||e.morphNormals)Aa.update(f,d,e,l),m=!0;a=d.index;c=d.attributes.position;if(null===a){if(void 0===c||0===c.count)return}else if(0===a.count)return;var p=1;!0===e.wireframe&&(a=ya.getWireframeAttribute(d),p=2);k=Ba;if(null!==a){var v=na.get(a); -k=Da;k.setIndex(v)}if(m){if(!1!==Ha.isWebGL2||!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==ta.get("ANGLE_instanced_arrays")){aa.initAttributes();m=d.attributes;l=l.getAttributes();var r=e.defaultAttributeValues;for(H in l){var q=l[H];if(0<=q){var t=m[H];if(void 0!==t){var n=t.normalized,u=t.itemSize,x=na.get(t);if(void 0!==x){var w=x.buffer,y=x.type;x=x.bytesPerElement;if(t.isInterleavedBufferAttribute){var z=t.data,M=z.stride;t=t.offset;z&&z.isInstancedInterleavedBuffer?(aa.enableAttributeAndDivisor(q, -z.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=z.meshPerAttribute*z.count)):aa.enableAttribute(q);I.bindBuffer(34962,w);I.vertexAttribPointer(q,u,y,n,M*x,t*x)}else t.isInstancedBufferAttribute?(aa.enableAttributeAndDivisor(q,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):aa.enableAttribute(q),I.bindBuffer(34962,w),I.vertexAttribPointer(q,u,y,n,0,0)}}else if("instanceMatrix"===H)x=na.get(f.instanceMatrix),void 0!==x&&(w=x.buffer, -y=x.type,aa.enableAttributeAndDivisor(q+0,1),aa.enableAttributeAndDivisor(q+1,1),aa.enableAttributeAndDivisor(q+2,1),aa.enableAttributeAndDivisor(q+3,1),I.bindBuffer(34962,w),I.vertexAttribPointer(q+0,4,y,!1,64,0),I.vertexAttribPointer(q+1,4,y,!1,64,16),I.vertexAttribPointer(q+2,4,y,!1,64,32),I.vertexAttribPointer(q+3,4,y,!1,64,48));else if(void 0!==r&&(n=r[H],void 0!==n))switch(n.length){case 2:I.vertexAttrib2fv(q,n);break;case 3:I.vertexAttrib3fv(q,n);break;case 4:I.vertexAttrib4fv(q,n);break;default:I.vertexAttrib1fv(q, -n)}}}aa.disableUnusedAttributes()}null!==a&&I.bindBuffer(34963,v.buffer)}var H=d.drawRange.start*p;m=null!==g?g.start*p:0;v=Math.max(H,m);g=Math.max(0,Math.min(null!==a?a.count:c.count,H+d.drawRange.count*p,m+(null!==g?g.count*p:Infinity))-1-v+1);0!==g&&(f.isMesh?!0===e.wireframe?(aa.setLineWidth(e.wireframeLinewidth*(null===P?T:1)),k.setMode(1)):k.setMode(4):f.isLine?(e=e.linewidth,void 0===e&&(e=1),aa.setLineWidth(e*(null===P?T:1)),f.isLineSegments?k.setMode(1):f.isLineLoop?k.setMode(2):k.setMode(3)): -f.isPoints?k.setMode(0):f.isSprite&&k.setMode(4),f.isInstancedMesh?k.renderInstances(d,v,g,f.count):d.isInstancedBufferGeometry?k.renderInstances(d,v,g,d.maxInstancedCount):k.render(v,g))};this.compile=function(a,b){G=wa.get(a,b);G.init();a.traverse(function(a){a.isLight&&(G.pushLight(a),a.castShadow&&G.pushShadow(a))});G.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=0;ce.far||f.push({distance:a,distanceToRay:Math.sqrt(k),point:c,index:b,face:null,object:g}))}function tg(a,b,c,d,e,f,g,k,l){V.call(this,a,b,c,d,e,f,g,k,l);this.format=void 0!==g?g:1022;this.minFilter=void 0!==f?f:1006;this.magFilter=void 0!==e? -e:1006;this.generateMipmaps=!1}function Pc(a,b,c,d,e,f,g,k,l,m,h,p){V.call(this,null,f,g,k,l,m,d,e,h,p);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Ud(a,b,c,d,e,f,g,k,l){V.call(this,a,b,c,d,e,f,g,k,l);this.needsUpdate=!0}function Vd(a,b,c,d,e,f,g,k,l,m){m=void 0!==m?m:1026;if(1026!==m&&1027!==m)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);V.call(this, -null,d,e,f,g,k,m,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==k?k:1003;this.generateMipmaps=this.flipY=!1}function Qc(a){F.call(this);this.type="WireframeGeometry";var b=[],c,d,e,f=[0,0],g={},k=["a","b","c"];if(a&&a.isGeometry){var l=a.faces;var m=0;for(d=l.length;mc;c++){var p=h[k[c]];var r=h[k[(c+1)%3]];f[0]=Math.min(p,r);f[1]=Math.max(p,r);p=f[0]+","+f[1];void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]})}}for(p in g)m=g[p], -k=a.vertices[m.index1],b.push(k.x,k.y,k.z),k=a.vertices[m.index2],b.push(k.x,k.y,k.z)}else if(a&&a.isBufferGeometry)if(k=new n,null!==a.index){l=a.attributes.position;h=a.index;var t=a.groups;0===t.length&&(t=[{start:0,count:h.count,materialIndex:0}]);a=0;for(e=t.length;ac;c++)p=h.getX(m+c),r=h.getX(m+(c+1)%3),f[0]=Math.min(p,r),f[1]=Math.max(p,r),p=f[0]+","+f[1],void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]});for(p in g)m=g[p],k.fromBufferAttribute(l, -m.index1),b.push(k.x,k.y,k.z),k.fromBufferAttribute(l,m.index2),b.push(k.x,k.y,k.z)}else for(l=a.attributes.position,m=0,d=l.count/3;mc;c++)g=3*m+c,k.fromBufferAttribute(l,g),b.push(k.x,k.y,k.z),g=3*m+(c+1)%3,k.fromBufferAttribute(l,g),b.push(k.x,k.y,k.z);this.setAttribute("position",new C(b,3))}function Wd(a,b,c){O.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Rc(a,b,c));this.mergeVertices()}function Rc(a,b,c){F.call(this); -this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],k=new n,l=new n,m=new n,h=new n,p=new n,r,t;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var q=b+1;for(r=0;r<=c;r++){var u=r/c;for(t=0;t<=b;t++){var x=t/b;a(x,u,l);e.push(l.x,l.y,l.z);0<=x-1E-5?(a(x-1E-5,u,m),h.subVectors(l,m)):(a(x+1E-5,u,m),h.subVectors(m,l));0<=u-1E-5?(a(x,u-1E-5,m),p.subVectors(l,m)):(a(x,u+1E-5,m),p.subVectors(m, -l));k.crossVectors(h,p).normalize();f.push(k.x,k.y,k.z);g.push(x,u)}}for(r=0;rd&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}F.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var k=[],l=[];(function(a){for(var c=new n,d=new n,g=new n,k=0;ke&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.setAttribute("position",new C(k,3));this.setAttribute("normal",new C(k.slice(),3));this.setAttribute("uv",new C(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Yd(a,b){O.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Sc(a,b));this.mergeVertices()}function Sc(a,b){Ga.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b); -this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Zd(a,b){O.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ec(a,b));this.mergeVertices()}function ec(a,b){Ga.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function $d(a,b){O.call(this);this.type="IcosahedronGeometry";this.parameters= -{radius:a,detail:b};this.fromBufferGeometry(new Tc(a,b));this.mergeVertices()}function Tc(a,b){var c=(1+Math.sqrt(5))/2;Ga.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function ae(a,b){O.call(this);this.type="DodecahedronGeometry";this.parameters= +a||37814===a||37815===a||37816===a||37817===a||37818===a||37819===a||37820===a||37821===a)return c=b.get("WEBGL_compressed_texture_astc"),null!==c?a:null;if(1020===a){if(d)return 34042;c=b.get("WEBGL_depth_texture");return null!==c?c.UNSIGNED_INT_24_8_WEBGL:null}}}}function og(a,b,c,d){va.call(this,a,b,d);this.stencilBuffer=this.depthBuffer=!1;this.numViews=c}function Gk(a,b){function c(a){if(a.isArrayCamera)return a.cameras;v[0]=a;return v}function d(a){if(void 0===a.isArrayCamera)return!0;a=a.cameras; +if(a.length>t)return!1;for(var b=1,c=a.length;bf.matrixWorld.determinant(),l=h(a,c,e,f);Z.setMaterial(e,k);var m=!1;if(b!==d.id||da!==l.id||ha!==(!0===e.wireframe))b=d.id,da=l.id,ha=!0===e.wireframe,m=!0;if(e.morphTargets||e.morphNormals)Aa.update(f,d,e,l),m=!0;a=d.index;c=d.attributes.position;if(null===a){if(void 0===c||0===c.count)return}else if(0===a.count)return;var p=1;!0===e.wireframe&&(a=za.getWireframeAttribute(d),p=2); +k=Ba;if(null!==a){var v=ma.get(a);k=Da;k.setIndex(v)}if(m){if(!1!==Ha.isWebGL2||!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==sa.get("ANGLE_instanced_arrays")){Z.initAttributes();m=d.attributes;l=l.getAttributes();var q=e.defaultAttributeValues;for(x in l){var r=l[x];if(0<=r){var t=m[x];if(void 0!==t){var n=t.normalized,u=t.itemSize,z=ma.get(t);if(void 0!==z){var w=z.buffer,A=z.type;z=z.bytesPerElement;if(t.isInterleavedBufferAttribute){var B=t.data,U=B.stride;t=t.offset;B&&B.isInstancedInterleavedBuffer? +(Z.enableAttributeAndDivisor(r,B.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):Z.enableAttribute(r);H.bindBuffer(34962,w);H.vertexAttribPointer(r,u,A,n,U*z,t*z)}else t.isInstancedBufferAttribute?(Z.enableAttributeAndDivisor(r,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):Z.enableAttribute(r),H.bindBuffer(34962,w),H.vertexAttribPointer(r,u,A,n,0,0)}}else if("instanceMatrix"===x)z=ma.get(f.instanceMatrix), +void 0!==z&&(w=z.buffer,A=z.type,Z.enableAttributeAndDivisor(r+0,1),Z.enableAttributeAndDivisor(r+1,1),Z.enableAttributeAndDivisor(r+2,1),Z.enableAttributeAndDivisor(r+3,1),H.bindBuffer(34962,w),H.vertexAttribPointer(r+0,4,A,!1,64,0),H.vertexAttribPointer(r+1,4,A,!1,64,16),H.vertexAttribPointer(r+2,4,A,!1,64,32),H.vertexAttribPointer(r+3,4,A,!1,64,48));else if(void 0!==q&&(n=q[x],void 0!==n))switch(n.length){case 2:H.vertexAttrib2fv(r,n);break;case 3:H.vertexAttrib3fv(r,n);break;case 4:H.vertexAttrib4fv(r, +n);break;default:H.vertexAttrib1fv(r,n)}}}Z.disableUnusedAttributes()}null!==a&&H.bindBuffer(34963,v.buffer)}var x=d.drawRange.start*p;m=null!==g?g.start*p:0;v=Math.max(x,m);g=Math.max(0,Math.min(null!==a?a.count:c.count,x+d.drawRange.count*p,m+(null!==g?g.count*p:Infinity))-1-v+1);0!==g&&(f.isMesh?!0===e.wireframe?(Z.setLineWidth(e.wireframeLinewidth*(null===N?R:1)),k.setMode(1)):k.setMode(4):f.isLine?(e=e.linewidth,void 0===e&&(e=1),Z.setLineWidth(e*(null===N?R:1)),f.isLineSegments?k.setMode(1): +f.isLineLoop?k.setMode(2):k.setMode(3)):f.isPoints?k.setMode(0):f.isSprite&&k.setMode(4),f.isInstancedMesh?k.renderInstances(d,v,g,f.count):d.isInstancedBufferGeometry?k.renderInstances(d,v,g,d.maxInstancedCount):k.render(v,g))};this.compile=function(a,b){F=va.get(a,b);F.init();a.traverse(function(a){a.isLight&&(F.pushLight(a),a.castShadow&&F.pushShadow(a))});F.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=0;ce.far||f.push({distance:a,distanceToRay:Math.sqrt(k),point:c,index:b,face:null,object:g}))}function tg(a,b,c,d,e,f,g,k,l){T.call(this,a,b,c,d,e,f,g,k,l);this.format=void 0!==g?g:1022;this.minFilter=void 0!==f?f:1006;this.magFilter=void 0!==e? +e:1006;this.generateMipmaps=!1}function Pc(a,b,c,d,e,f,g,k,l,m,h,p){T.call(this,null,f,g,k,l,m,d,e,h,p);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Ud(a,b,c,d,e,f,g,k,l){T.call(this,a,b,c,d,e,f,g,k,l);this.needsUpdate=!0}function Vd(a,b,c,d,e,f,g,k,l,m){m=void 0!==m?m:1026;if(1026!==m&&1027!==m)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);T.call(this, +null,d,e,f,g,k,m,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==k?k:1003;this.generateMipmaps=this.flipY=!1}function Qc(a){G.call(this);this.type="WireframeGeometry";var b=[],c,d,e,f=[0,0],g={},k=["a","b","c"];if(a&&a.isGeometry){var l=a.faces;var m=0;for(d=l.length;mc;c++){var p=h[k[c]];var q=h[k[(c+1)%3]];f[0]=Math.min(p,q);f[1]=Math.max(p,q);p=f[0]+","+f[1];void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]})}}for(p in g)m=g[p], +k=a.vertices[m.index1],b.push(k.x,k.y,k.z),k=a.vertices[m.index2],b.push(k.x,k.y,k.z)}else if(a&&a.isBufferGeometry)if(k=new n,null!==a.index){l=a.attributes.position;h=a.index;var t=a.groups;0===t.length&&(t=[{start:0,count:h.count,materialIndex:0}]);a=0;for(e=t.length;ac;c++)p=h.getX(m+c),q=h.getX(m+(c+1)%3),f[0]=Math.min(p,q),f[1]=Math.max(p,q),p=f[0]+","+f[1],void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]});for(p in g)m=g[p],k.fromBufferAttribute(l, +m.index1),b.push(k.x,k.y,k.z),k.fromBufferAttribute(l,m.index2),b.push(k.x,k.y,k.z)}else for(l=a.attributes.position,m=0,d=l.count/3;mc;c++)g=3*m+c,k.fromBufferAttribute(l,g),b.push(k.x,k.y,k.z),g=3*m+(c+1)%3,k.fromBufferAttribute(l,g),b.push(k.x,k.y,k.z);this.setAttribute("position",new C(b,3))}function Wd(a,b,c){M.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Rc(a,b,c));this.mergeVertices()}function Rc(a,b,c){G.call(this); +this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],k=new n,l=new n,m=new n,h=new n,p=new n,q,t;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var r=b+1;for(q=0;q<=c;q++){var u=q/c;for(t=0;t<=b;t++){var z=t/b;a(z,u,l);e.push(l.x,l.y,l.z);0<=z-1E-5?(a(z-1E-5,u,m),h.subVectors(l,m)):(a(z+1E-5,u,m),h.subVectors(m,l));0<=u-1E-5?(a(z,u-1E-5,m),p.subVectors(l,m)):(a(z,u+1E-5,m),p.subVectors(m, +l));k.crossVectors(h,p).normalize();f.push(k.x,k.y,k.z);g.push(z,u)}}for(q=0;qd&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}G.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var k=[],l=[];(function(a){for(var c=new n,d=new n,g=new n,k=0;ke&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.setAttribute("position",new C(k,3));this.setAttribute("normal",new C(k.slice(),3));this.setAttribute("uv",new C(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Yd(a,b){M.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Sc(a,b));this.mergeVertices()}function Sc(a,b){Ga.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b); +this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Zd(a,b){M.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ec(a,b));this.mergeVertices()}function ec(a,b){Ga.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function $d(a,b){M.call(this);this.type="IcosahedronGeometry";this.parameters= +{radius:a,detail:b};this.fromBufferGeometry(new Tc(a,b));this.mergeVertices()}function Tc(a,b){var c=(1+Math.sqrt(5))/2;Ga.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function ae(a,b){M.call(this);this.type="DodecahedronGeometry";this.parameters= {radius:a,detail:b};this.fromBufferGeometry(new Uc(a,b));this.mergeVertices()}function Uc(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;Ga.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11, -19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters={radius:a,detail:b}}function be(a,b,c,d,e,f){O.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new fc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function fc(a, -b,c,d,e){function f(e){h=a.getPointAt(e/b,h);var f=g.normals[e];e=g.binormals[e];for(r=0;r<=d;r++){var m=r/d*Math.PI*2,p=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+p*e.x;l.y=m*f.y+p*e.y;l.z=m*f.z+p*e.z;l.normalize();q.push(l.x,l.y,l.z);k.x=h.x+c*l.x;k.y=h.y+c*l.y;k.z=h.z+c*l.z;t.push(k.x,k.y,k.z)}}F.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents; -this.normals=g.normals;this.binormals=g.binormals;var k=new n,l=new n,m=new A,h=new n,p,r,t=[],q=[],u=[],x=[];for(p=0;p=b;e-=d)f=$h(e,a[e],a[e+1],f);f&&gc(f,f.next)&&(ee(f),f=f.next);return f}function fe(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!gc(a,a.next)&&0!==ua(a.prev,a,a.next))a=a.next;else{ee(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function ge(a,b,c,d,e,f,g){if(a){if(!g&&f){var k=a,l=k;do null===l.z&&(l.z=ug(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==k);l.prevZ.nextZ=null;l.prevZ=null;k=l;var m,h,p,r,t=1;do{l=k;var q=k=null;for(h=0;l;){h++; -var n=l;for(m=p=0;mn!==q.next.y>n&&q.next.y!==q.y&&p<(q.next.x-q.x)*(n-q.y)/(q.next.y-q.y)+q.x&&(h=!h),q=q.next;while(q!==l);q=h}l=q}if(l){a=bi(g,k);g=fe(g,g.next);a=fe(a,a.next);ge(g,b,c,d,e,f);ge(a,b,c,d,e,f);break a}k=k.next}g=g.next}while(g!==a)}break}}}}function Hk(a,b,c,d){var e=a.prev,f=a.next;if(0<=ua(e,a,f))return!1;var g=e.x>a.x?e.x>f.x?e.x:f.x:a.x>f.x?a.x:f.x,k=e.y>a.y?e.y>f.y?e.y:f.y:a.y>f.y?a.y:f.y,l=ug(e.x=l&&d&&d.z<=b;){if(c!==a.prev&&c!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ua(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ua(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ua(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<=b;){if(d!==a.prev&&d!==a.next&&Xc(e.x,e.y, -a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ua(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function Ik(a,b){return a.x-b.x}function Jk(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var k=c.x=c.x&&c.x>=g&&d!==c.x&&Xc(e< +19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters={radius:a,detail:b}}function be(a,b,c,d,e,f){M.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new fc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function fc(a, +b,c,d,e){function f(e){h=a.getPointAt(e/b,h);var f=g.normals[e];e=g.binormals[e];for(q=0;q<=d;q++){var m=q/d*Math.PI*2,p=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+p*e.x;l.y=m*f.y+p*e.y;l.z=m*f.z+p*e.z;l.normalize();r.push(l.x,l.y,l.z);k.x=h.x+c*l.x;k.y=h.y+c*l.y;k.z=h.z+c*l.z;t.push(k.x,k.y,k.z)}}G.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents; +this.normals=g.normals;this.binormals=g.binormals;var k=new n,l=new n,m=new x,h=new n,p,q,t=[],r=[],u=[],z=[];for(p=0;p=b;e-=d)f=$h(e,a[e],a[e+1],f);f&&gc(f,f.next)&&(ee(f),f=f.next);return f}function fe(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!gc(a,a.next)&&0!==ta(a.prev,a,a.next))a=a.next;else{ee(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function ge(a,b,c,d,e,f,g){if(a){if(!g&&f){var k=a,l=k;do null===l.z&&(l.z=ug(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==k);l.prevZ.nextZ=null;l.prevZ=null;k=l;var m,h,p,q,t=1;do{l=k;var r=k=null;for(h=0;l;){h++; +var n=l;for(m=p=0;mn!==r.next.y>n&&r.next.y!==r.y&&p<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(h=!h),r=r.next;while(r!==l);r=h}l=r}if(l){a=bi(g,k);g=fe(g,g.next);a=fe(a,a.next);ge(g,b,c,d,e,f);ge(a,b,c,d,e,f);break a}k=k.next}g=g.next}while(g!==a)}break}}}}function Hk(a,b,c,d){var e=a.prev,f=a.next;if(0<=ta(e,a,f))return!1;var g=e.x>a.x?e.x>f.x?e.x:f.x:a.x>f.x?a.x:f.x,k=e.y>a.y?e.y>f.y?e.y:f.y:a.y>f.y?a.y:f.y,l=ug(e.x=l&&d&&d.z<=b;){if(c!==a.prev&&c!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ta(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ta(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&Xc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ta(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<=b;){if(d!==a.prev&&d!==a.next&&Xc(e.x,e.y, +a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ta(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function Ik(a,b){return a.x-b.x}function Jk(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var k=c.x=c.x&&c.x>=g&&d!==c.x&&Xc(e< l?d:f,e,g,l,ek.x)&&he(c,a)&&(k=c,m=h)}c=c.next}return k}function ug(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function Kk(a){var b=a,c=a;do{if(b.xua(a.prev,a,a.next)?0<=ua(a,b,a.next)&&0<=ua(a,a.prev,b):0>ua(a,b,a.prev)||0>ua(a,a.next,b)}function bi(a,b){var c=new vg(a.i,a.x,a.y),d=new vg(b.i,b.x,b.y),e=a.next,f=b.prev;a.next= +g)*(f-k)&&0<=(a-g)*(d-k)-(c-g)*(b-k)&&0<=(c-g)*(f-k)-(e-g)*(d-k)}function ta(a,b,c){return(b.y-a.y)*(c.x-b.x)-(b.x-a.x)*(c.y-b.y)}function gc(a,b){return a.x===b.x&&a.y===b.y}function ai(a,b,c,d){return gc(a,c)&&gc(b,d)||gc(a,d)&&gc(c,b)?!0:0ta(a.prev,a,a.next)?0<=ta(a,b,a.next)&&0<=ta(a,a.prev,b):0>ta(a,b,a.prev)||0>ta(a,a.next,b)}function bi(a,b){var c=new vg(a.i,a.x,a.y),d=new vg(b.i,b.x,b.y),e=a.next,f=b.prev;a.next= b;b.prev=a;c.next=e;e.prev=c;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function $h(a,b,c,d){a=new vg(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function ee(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function vg(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function ci(a){var b=a.length;2Number.EPSILON){var l=Math.sqrt(k), -m=Math.sqrt(f*f+g*g);k=b.x-e/l;b=b.y+d/l;g=((c.x-g/m-k)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=k+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new A(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(k)):(f=d,d=e,e=Math.sqrt(k/2));return new A(f/e,d/e)}function k(a,b){for(K=a.length;0<=--K;){var c=K;var f=K-1;0>f&&(f=a.length-1);var g,k=z+2*C;for(g=0;gh;h++){var p=m[f[h]];var r=m[f[(h+1)%3]];d[0]=Math.min(p,r);d[1]=Math.max(p,r);p=d[0]+","+d[1];void 0===e[p]?e[p]={index1:d[0],index2:d[1],face1:k,face2:void 0}:e[p].face2=k}for(p in e)if(d=e[p], -void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.setAttribute("position",new C(c,3))}function lc(a,b,c,d,e,f,g,k){O.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:k};this.fromBufferGeometry(new ub(a,b,c,d,e,f,g,k));this.mergeVertices()}function ub(a,b,c,d,e,f,g,k){function l(c){var e,f=new A,l=new n, -v=0,u=!0===c?a:b,z=!0===c?1:-1;var B=q;for(e=1;e<=d;e++)p.push(0,x*z,0),r.push(0,z,0),t.push(.5,.5),q++;var G=q;for(e=0;e<=d;e++){var C=e/d*k+g,F=Math.cos(C);C=Math.sin(C);l.x=u*C;l.y=x*z;l.z=u*F;p.push(l.x,l.y,l.z);r.push(0,z,0);f.x=.5*F+.5;f.y=.5*C*z+.5;t.push(f.x,f.y);q++}for(e=0;ethis.duration&&this.resetDuration()}function Mk(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return cd;case "vector":case "vector2":case "vector3":case "vector4":return dd;case "color":return Ze;case "quaternion":return qe;case "bool":case "boolean":return Ye;case "string":return af}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function Nk(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse"); +b){for(var c=0;cNumber.EPSILON){var l=Math.sqrt(k), +m=Math.sqrt(f*f+g*g);k=b.x-e/l;b=b.y+d/l;g=((c.x-g/m-k)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=k+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new x(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(k)):(f=d,d=e,e=Math.sqrt(k/2));return new x(f/e,d/e)}function k(a,b){for(J=a.length;0<=--J;){var c=J;var f=J-1;0>f&&(f=a.length-1);var g,k=B+2*C;for(g=0;gh;h++){var p=m[f[h]];var q=m[f[(h+1)%3]];d[0]=Math.min(p,q);d[1]=Math.max(p,q);p=d[0]+","+d[1];void 0===e[p]?e[p]={index1:d[0],index2:d[1],face1:k,face2:void 0}:e[p].face2=k}for(p in e)if(d=e[p], +void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.setAttribute("position",new C(c,3))}function lc(a,b,c,d,e,f,g,k){M.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:k};this.fromBufferGeometry(new ub(a,b,c,d,e,f,g,k));this.mergeVertices()}function ub(a,b,c,d,e,f,g,k){function l(c){var e,f=new x,l=new n, +v=0,u=!0===c?a:b,B=!0===c?1:-1;var y=r;for(e=1;e<=d;e++)p.push(0,z*B,0),q.push(0,B,0),t.push(.5,.5),r++;var F=r;for(e=0;e<=d;e++){var C=e/d*k+g,G=Math.cos(C);C=Math.sin(C);l.x=u*C;l.y=z*B;l.z=u*G;p.push(l.x,l.y,l.z);q.push(0,B,0);f.x=.5*G+.5;f.y=.5*C*B+.5;t.push(f.x,f.y);r++}for(e=0;ethis.duration&&this.resetDuration()}function Mk(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return cd;case "vector":case "vector2":case "vector3":case "vector4":return dd;case "color":return Ze;case "quaternion":return qe;case "bool":case "boolean":return Ye;case "string":return af}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function Nk(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse"); var b=Mk(a.type);if(void 0===a.times){var c=[],d=[];ea.flattenJSON(a.keys,c,d,"value");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)}function wg(a,b,c){var d=this,e=!1,f=0,g=0,k=void 0,l=[];this.onStart=void 0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()}; -this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return k?k(a):a};this.setURLModifier=function(a){k=a;return this};this.addHandler=function(a,b){l.push(a,b);return this};this.removeHandler=function(a){a=l.indexOf(a);-1!==a&&l.splice(a,2);return this};this.getHandler=function(a){for(var b=0,c=l.length;ba;a++)this.coefficients.push(new n)}function ab(a,b){ba.call(this,void 0,b);this.sh=void 0!==a?a:new tf}function Fg(a,b,c){ab.call(this,void 0,c);a=(new B).set(a);c=(new B).set(b);b=new n(a.r,a.g,a.b);a=new n(c.r,c.g,c.b);c=Math.sqrt(Math.PI);var d=c*Math.sqrt(.75);this.sh.coefficients[0].copy(b).add(a).multiplyScalar(c);this.sh.coefficients[1].copy(b).sub(a).multiplyScalar(d)}function Gg(a,b){ab.call(this,void 0,b);a=(new B).set(a);this.sh.coefficients[0].set(a.r,a.g,a.b).multiplyScalar(2*Math.sqrt(Math.PI))} -function ii(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new qa;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new qa;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1;this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Hg(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function Ig(){D.call(this);this.type="AudioListener";this.context=Jg.getContext(); +function mf(a,b,c,d){ba.call(this,a,b);this.type="RectAreaLight";this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function nf(a){Q.call(this,a);this.textures={}}function of(){G.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0}function pf(a,b,c,d){"number"===typeof c&&(d=c,c=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument."));K.call(this,a,b,c);this.meshPerAttribute=d||1}function qf(a){Q.call(this,a)}function rf(a){Q.call(this, +a)}function Bg(a){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported.");Q.call(this,a);this.options=void 0}function Cg(){this.type="ShapePath";this.color=new y;this.subPaths=[];this.currentPath=null}function Dg(a){this.type="Font";this.data=a}function Eg(a){Q.call(this,a)}function sf(a){Q.call(this,a)}function tf(){this.coefficients=[];for(var a= +0;9>a;a++)this.coefficients.push(new n)}function ab(a,b){ba.call(this,void 0,b);this.sh=void 0!==a?a:new tf}function Fg(a,b,c){ab.call(this,void 0,c);a=(new y).set(a);c=(new y).set(b);b=new n(a.r,a.g,a.b);a=new n(c.r,c.g,c.b);c=Math.sqrt(Math.PI);var d=c*Math.sqrt(.75);this.sh.coefficients[0].copy(b).add(a).multiplyScalar(c);this.sh.coefficients[1].copy(b).sub(a).multiplyScalar(d)}function Gg(a,b){ab.call(this,void 0,b);a=(new y).set(a);this.sh.coefficients[0].set(a.r,a.g,a.b).multiplyScalar(2*Math.sqrt(Math.PI))} +function ii(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new pa;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new pa;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1;this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Hg(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function Ig(){D.call(this);this.type="AudioListener";this.context=Jg.getContext(); this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0;this._clock=new Hg}function hd(a){D.call(this);this.type="Audio";this.listener=a;this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset=this.loopEnd=this.loopStart=0;this.duration=void 0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this._pausedAt= this._startedAt=0;this.filters=[]}function Kg(a){hd.call(this,a);this.panner=this.context.createPanner();this.panner.panningModel="HRTF";this.panner.connect(this.gain)}function Lg(a,b){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function Mg(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case "quaternion":b=this._slerp;break;case "string":case "bool":a= -Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function ji(a,b,c){c=c||Ba.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function Ba(a,b,c){this.path=b;this.parsedPath=c||Ba.parseTrackName(b);this.node=Ba.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function ki(){this.uuid=Q.generateUUID();this._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_= +Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function ji(a,b,c){c=c||Ba.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function Ba(a,b,c){this.path=b;this.parsedPath=c||Ba.parseTrackName(b);this.node=Ba.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function ki(){this.uuid=O.generateUUID();this._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_= 0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function li(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400,endingEnd:2400}, e=0;e!==b;++e){var f=a[e].createInterpolant(null);c[e]=f;f.settings=d}this._interpolantSettings=d;this._interpolants=c;this._propertyBindings=Array(b);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null;this.loop=2201;this._loopCount=-1;this._startTime=null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd=this.zeroSlopeAtStart= !0}function Ng(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function uf(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b);this.value=a}function Og(a,b,c){sb.call(this,a,b);this.meshPerAttribute=c||1}function mi(a,b,c,d){this.ray=new Wb(a,b);this.near=c||0;this.far=d||Infinity;this.camera=null;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."); -return this.Points}}})}function ni(a,b){return a.distance-b.distance}function Pg(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.children;d=0;for(var e=a.length;dc;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.setAttribute("position", -new C(b,3));b=new ja({fog:!1});this.cone=new ma(a,b);this.add(this.cone);this.update()}function qi(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;cq;++q)e=q/h,e=Math.exp(-e*e/2),r.push(e),0==q?n+=e:qc;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.setAttribute("position", +new C(b,3));b=new ja({fog:!1});this.cone=new la(a,b);this.add(this.cone);this.update()}function qi(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;cr;++r)e=r/h,e=Math.exp(-e*e/2),q.push(e),0==r?n+=e:ra?-1:0ze;ze++)xa[ze]=(16>ze?"0":"")+ze.toString(16);var Q={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var a=4294967295*Math.random()|0,b=4294967295*Math.random()|0,c=4294967295*Math.random()| -0,d=4294967295*Math.random()|0;return(xa[a&255]+xa[a>>8&255]+xa[a>>16&255]+xa[a>>24&255]+"-"+xa[b&255]+xa[b>>8&255]+"-"+xa[b>>16&15|64]+xa[b>>24&255]+"-"+xa[c&63|128]+xa[c>>8&255]+"-"+xa[c>>16&255]+xa[c>>24&255]+xa[d&255]+xa[d>>8&255]+xa[d>>16&255]+xa[d>>24&255]).toUpperCase()},clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a, -b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(a){return a*Q.DEG2RAD},radToDeg:function(a){return a*Q.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2, -Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(A.prototype,{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(A.prototype,{isVector2:!0,set:function(a,b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this}, +b){void 0!==this._listeners&&(a=this._listeners[a],void 0!==a&&(b=a.indexOf(b),-1!==b&&a.splice(b,1)))},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;b=b.slice(0);for(var c=0,d=b.length;cze;ze++)ya[ze]=(16>ze?"0":"")+ze.toString(16);var O={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var a=4294967295*Math.random()|0,b=4294967295*Math.random()|0,c=4294967295*Math.random()| +0,d=4294967295*Math.random()|0;return(ya[a&255]+ya[a>>8&255]+ya[a>>16&255]+ya[a>>24&255]+"-"+ya[b&255]+ya[b>>8&255]+"-"+ya[b>>16&15|64]+ya[b>>24&255]+"-"+ya[c&63|128]+ya[c>>8&255]+"-"+ya[c>>16&255]+ya[c>>24&255]+ya[d&255]+ya[d>>8&255]+ya[d>>16&255]+ya[d>>24&255]).toUpperCase()},clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a, +b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(a){return a*O.DEG2RAD},radToDeg:function(a){return a*O.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2, +Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(x.prototype,{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(x.prototype,{isVector2:!0,set:function(a,b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this}, setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this}, subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},applyMatrix3:function(a){var b=this.x,c=this.y;a=a.elements;this.x=a[0]*b+a[3]*c+a[6];this.y=a[1]*b+a[4]*c+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this}, @@ -352,12 +352,12 @@ return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);r this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var a=Math.atan2(this.y,this.x);0>a&&(a+=2*Math.PI);return a},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+ Math.abs(this.y-a.y)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromBufferAttribute:function(a, b,c){void 0!==c&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);return this},rotateAround:function(a,b){var c=Math.cos(b);b=Math.sin(b);var d=this.x-a.x,e=this.y-a.y;this.x=d*c-e*b+a.x;this.y=d*b+e*c+a.y;return this}});Object.assign(Da,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var k=c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var h=e[f+1],p=e[f+2];e=e[f+3];if(c!==e||k!==d||l!==h||m!== -p){f=1-g;var r=k*d+l*h+m*p+c*e,n=0<=r?1:-1,q=1-r*r;q>Number.EPSILON&&(q=Math.sqrt(q),r=Math.atan2(q,r*n),f=Math.sin(f*r)/q,g=Math.sin(g*r)/q);n*=g;k=k*f+d*n;l=l*f+h*n;m=m*f+p*n;c=c*f+e*n;f===1-g&&(g=1/Math.sqrt(k*k+l*l+m*m+c*c),k*=g,l*=g,m*=g,c*=g)}a[b]=k;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(Da.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this._onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this._onChangeCallback()}},z:{get:function(){return this._z}, +p){f=1-g;var q=k*d+l*h+m*p+c*e,n=0<=q?1:-1,r=1-q*q;r>Number.EPSILON&&(r=Math.sqrt(r),q=Math.atan2(r,q*n),f=Math.sin(f*q)/r,g=Math.sin(g*q)/r);n*=g;k=k*f+d*n;l=l*f+h*n;m=m*f+p*n;c=c*f+e*n;f===1-g&&(g=1/Math.sqrt(k*k+l*l+m*m+c*c),k*=g,l*=g,m*=g,c*=g)}a[b]=k;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(Da.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this._onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this._onChangeCallback()}},z:{get:function(){return this._z}, set:function(a){this._z=a;this._onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this._onChangeCallback()}}});Object.assign(Da.prototype,{isQuaternion:!0,set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this._onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this._onChangeCallback();return this},setFromEuler:function(a,b){if(!a|| !a.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var c=a._x,d=a._y,e=a._z;a=a.order;var f=Math.cos,g=Math.sin,k=f(c/2),l=f(d/2);f=f(e/2);c=g(c/2);d=g(d/2);e=g(e/2);"XYZ"===a?(this._x=c*l*f+k*d*e,this._y=k*d*f-c*l*e,this._z=k*l*e+c*d*f,this._w=k*l*f-c*d*e):"YXZ"===a?(this._x=c*l*f+k*d*e,this._y=k*d*f-c*l*e,this._z=k*l*e-c*d*f,this._w=k*l*f+c*d*e):"ZXY"===a?(this._x=c*l*f-k*d*e,this._y=k*d*f+c*l*e,this._z=k*l*e+c*d*f,this._w= k*l*f-c*d*e):"ZYX"===a?(this._x=c*l*f-k*d*e,this._y=k*d*f+c*l*e,this._z=k*l*e-c*d*f,this._w=k*l*f+c*d*e):"YZX"===a?(this._x=c*l*f+k*d*e,this._y=k*d*f+c*l*e,this._z=k*l*e-c*d*f,this._w=k*l*f-c*d*e):"XZY"===a&&(this._x=c*l*f-k*d*e,this._y=k*d*f-c*l*e,this._z=k*l*e+c*d*f,this._w=k*l*f+c*d*e);!1!==b&&this._onChangeCallback();return this},setFromAxisAngle:function(a,b){b/=2;var c=Math.sin(b);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=Math.cos(b);this._onChangeCallback();return this},setFromRotationMatrix:function(a){var b= a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],k=b[2],l=b[6];b=b[10];var m=c+f+b;0f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(l-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+k)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-k)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+l)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+k)/c,this._y=(g+l)/c,this._z=.25*c);this._onChangeCallback();return this},setFromUnitVectors:function(a, -b){var c=a.dot(b)+1;1E-6>c?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x=a.y*b.z-a.z*b.y,this._y=a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x);this._w=c;return this.normalize()},angleTo:function(a){return 2*Math.acos(Math.abs(Q.clamp(this.dot(a),-1,1)))},rotateTowards:function(a,b){var c=this.angleTo(a);if(0===c)return this;this.slerp(a,Math.min(1,b/c));return this},inverse:function(){return this.conjugate()},conjugate:function(){this._x*= +b){var c=a.dot(b)+1;1E-6>c?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x=a.y*b.z-a.z*b.y,this._y=a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x);this._w=c;return this.normalize()},angleTo:function(a){return 2*Math.acos(Math.abs(O.clamp(this.dot(a),-1,1)))},rotateTowards:function(a,b){var c=this.angleTo(a);if(0===c)return this;this.slerp(a,Math.min(1,b/c));return this},inverse:function(){return this.conjugate()},conjugate:function(){this._x*= -1;this._y*=-1;this._z*=-1;this._onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this._onChangeCallback();return this}, multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z;a=a._w;var f=b._x,g=b._y,k=b._z;b=b._w;this._x=c*b+a*f+d*k-e*g;this._y=d*b+a*g+e*f-c*k;this._z=e*b+a*k+c*g-d*f;this._w=a*b-c*f-d*g-e*k;this._onChangeCallback(); return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;a=1-g*g;if(a<=Number.EPSILON)return g=1-b,this._w=g*f+b*this._w,this._x=g*c+b*this._x,this._y=g*d+b*this._y,this._z=g*e+b*this._z,this.normalize(),this._onChangeCallback(),this;a=Math.sqrt(a);var k=Math.atan2(a, @@ -373,23 +373,23 @@ a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(th 1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z= 0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)}, lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},cross:function(a,b){return void 0!==b?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b)):this.crossVectors(this,a)},crossVectors:function(a,b){var c=a.x,d=a.y;a=a.z;var e=b.x,f=b.y;b=b.z;this.x=d*b-a*f;this.y=a*e-c*b;this.z=c*f-d*e;return this}, -projectOnVector:function(a){var b=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(a){$g.copy(this).projectOnVector(a);return this.sub($g)},reflect:function(a){return this.sub($g.copy(a).multiplyScalar(2*this.dot(a)))},angleTo:function(a){var b=Math.sqrt(this.lengthSq()*a.lengthSq());0===b&&console.error("THREE.Vector3: angleTo() can't handle zero length vectors.");a=this.dot(a)/b;return Math.acos(Q.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))}, +projectOnVector:function(a){var b=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(a){$g.copy(this).projectOnVector(a);return this.sub($g)},reflect:function(a){return this.sub($g.copy(a).multiplyScalar(2*this.dot(a)))},angleTo:function(a){var b=Math.sqrt(this.lengthSq()*a.lengthSq());0===b&&console.error("THREE.Vector3: angleTo() can't handle zero length vectors.");a=this.dot(a)/b;return Math.acos(O.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))}, distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z-a.z)},setFromSpherical:function(a){return this.setFromSphericalCoords(a.radius,a.phi,a.theta)},setFromSphericalCoords:function(a,b,c){var d=Math.sin(b)*a;this.x=d*Math.sin(c);this.y=Math.cos(b)*a;this.z=d*Math.cos(c);return this},setFromCylindrical:function(a){return this.setFromCylindricalCoords(a.radius,a.theta, a.y)},setFromCylindricalCoords:function(a,b,c){this.x=a*Math.sin(b);this.y=c;this.z=a*Math.cos(b);return this},setFromMatrixPosition:function(a){a=a.elements;this.x=a[12];this.y=a[13];this.z=a[14];return this},setFromMatrixScale:function(a){var b=this.setFromMatrixColumn(a,0).length(),c=this.setFromMatrixColumn(a,1).length();a=this.setFromMatrixColumn(a,2).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){return this.fromArray(a.elements,4*b)},equals:function(a){return a.x=== -this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this}});var tc=new n;Object.assign(ya.prototype,{isMatrix3:!0,set:function(a, +this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this}});var tc=new n;Object.assign(za.prototype,{isMatrix3:!0,set:function(a, b,c,d,e,f,g,k,l){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=k;m[6]=c;m[7]=f;m[8]=l;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this}, -applyToBufferAttribute:function(a){for(var b=0,c=a.count;bc;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}});var nd,Mb={getDataURL:function(a){if("undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===nd&&(nd=document.createElementNS("http://www.w3.org/1999/xhtml", -"canvas"));nd.width=a.width;nd.height=a.height;var b=nd.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height);a=nd}return 2048a.x||1a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0> -a.y||1a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y);return a}});Object.defineProperty(V.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.defineProperties(U.prototype,{width:{get:function(){return this.z},set:function(a){this.z=a}},height:{get:function(){return this.w},set:function(a){this.w=a}}});Object.assign(U.prototype, +a.y||1a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y);return a}});Object.defineProperty(T.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.defineProperties(S.prototype,{width:{get:function(){return this.z},set:function(a){this.z=a}},height:{get:function(){return this.w},set:function(a){this.w=a}}});Object.assign(S.prototype, {isVector4:!0,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x; case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this}, addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-= @@ -401,33 +401,33 @@ this.y));this.z=Math.max(a,Math.min(b,this.z));this.w=Math.max(a,Math.min(b,this Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z* a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z- this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."); -this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}});wa.prototype=Object.assign(Object.create(Fa.prototype),{constructor:wa,isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.texture.image.width=a,this.texture.image.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport); -this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Zf.prototype=Object.assign(Object.create(wa.prototype),{constructor:Zf,isWebGLMultisampleRenderTarget:!0,copy:function(a){wa.prototype.copy.call(this,a);this.samples=a.samples;return this}});var Ma=new n,X=new R,Ok=new n(0,0,0),Pk=new n(1,1,1),Nb=new n,Cf=new n,ka=new n;Object.assign(R.prototype,{isMatrix4:!0, -set:function(a,b,c,d,e,f,g,k,l,m,h,p,r,n,q,u){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=k;v[2]=l;v[6]=m;v[10]=h;v[14]=p;v[3]=r;v[7]=n;v[11]=q;v[15]=u;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new R).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11]; +this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}});va.prototype=Object.assign(Object.create(Fa.prototype),{constructor:va,isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.texture.image.width=a,this.texture.image.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport); +this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Zf.prototype=Object.assign(Object.create(va.prototype),{constructor:Zf,isWebGLMultisampleRenderTarget:!0,copy:function(a){va.prototype.copy.call(this,a);this.samples=a.samples;return this}});var Ma=new n,W=new P,Ok=new n(0,0,0),Pk=new n(1,1,1),Nb=new n,Cf=new n,ka=new n;Object.assign(P.prototype,{isMatrix4:!0, +set:function(a,b,c,d,e,f,g,k,l,m,h,p,q,n,r,u){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=f;v[9]=g;v[13]=k;v[2]=l;v[6]=m;v[10]=h;v[14]=p;v[3]=q;v[7]=n;v[11]=r;v[15]=u;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new P).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11]; b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return this},copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){a.setFromMatrixColumn(this,0);b.setFromMatrixColumn(this,1);c.setFromMatrixColumn(this,2);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(a){var b=this.elements,c=a.elements,d=1/Ma.setFromMatrixColumn(a,0).length(), e=1/Ma.setFromMatrixColumn(a,1).length();a=1/Ma.setFromMatrixColumn(a,2).length();b[0]=c[0]*d;b[1]=c[1]*d;b[2]=c[2]*d;b[3]=0;b[4]=c[4]*e;b[5]=c[5]*e;b[6]=c[6]*e;b[7]=0;b[8]=c[8]*a;b[9]=c[9]*a;b[10]=c[10]*a;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromEuler:function(a){a&&a.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c);c=Math.sin(c);var g=Math.cos(d); d=Math.sin(d);var k=Math.cos(e);e=Math.sin(e);if("XYZ"===a.order){a=f*k;var l=f*e,m=c*k,h=c*e;b[0]=g*k;b[4]=-g*e;b[8]=d;b[1]=l+m*d;b[5]=a-h*d;b[9]=-c*g;b[2]=h-a*d;b[6]=m+l*d;b[10]=f*g}else"YXZ"===a.order?(a=g*k,l=g*e,m=d*k,h=d*e,b[0]=a+h*c,b[4]=m*c-l,b[8]=f*d,b[1]=f*e,b[5]=f*k,b[9]=-c,b[2]=l*c-m,b[6]=h+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*k,l=g*e,m=d*k,h=d*e,b[0]=a-h*c,b[4]=-f*e,b[8]=m+l*c,b[1]=l+m*c,b[5]=f*k,b[9]=h-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*k,l=f*e,m=c*k,h=c*e,b[0]=g*k, b[4]=m*d-l,b[8]=a*d+h,b[1]=g*e,b[5]=h*d+a,b[9]=l*d-m,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,l=f*d,m=c*g,h=c*d,b[0]=g*k,b[4]=h-a*e,b[8]=m*e+l,b[1]=e,b[5]=f*k,b[9]=-c*k,b[2]=-d*k,b[6]=l*e+m,b[10]=a-h*e):"XZY"===a.order&&(a=f*g,l=f*d,m=c*g,h=c*d,b[0]=g*k,b[4]=-e,b[8]=d*k,b[1]=a*e+h,b[5]=f*k,b[9]=l*e-m,b[2]=m*e-l,b[6]=c*k,b[10]=h*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(a){return this.compose(Ok,a,Pk)},lookAt:function(a,b, c){var d=this.elements;ka.subVectors(a,b);0===ka.lengthSq()&&(ka.z=1);ka.normalize();Nb.crossVectors(c,ka);0===Nb.lengthSq()&&(1===Math.abs(c.z)?ka.x+=1E-4:ka.z+=1E-4,ka.normalize(),Nb.crossVectors(c,ka));Nb.normalize();Cf.crossVectors(ka,Nb);d[0]=Nb.x;d[4]=Cf.x;d[8]=ka.x;d[1]=Nb.y;d[5]=Cf.y;d[9]=ka.y;d[2]=Nb.z;d[6]=Cf.z;d[10]=ka.z;return this},multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), -this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;b=this.elements;a=c[0];var e=c[4],f=c[8],g=c[12],k=c[1],l=c[5],m=c[9],h=c[13],p=c[2],r=c[6],n=c[10],q=c[14],u=c[3],x=c[7],w=c[11];c=c[15];var z=d[0],A=d[4],H=d[8],y=d[12],B=d[1],C=d[5],F=d[9],D=d[13],G=d[2],E=d[6],J=d[10],L=d[14],N=d[3],O=d[7],P=d[11];d=d[15];b[0]=a*z+e*B+f*G+g*N;b[4]=a*A+e*C+f*E+g*O;b[8]=a*H+e*F+f*J+ -g*P;b[12]=a*y+e*D+f*L+g*d;b[1]=k*z+l*B+m*G+h*N;b[5]=k*A+l*C+m*E+h*O;b[9]=k*H+l*F+m*J+h*P;b[13]=k*y+l*D+m*L+h*d;b[2]=p*z+r*B+n*G+q*N;b[6]=p*A+r*C+n*E+q*O;b[10]=p*H+r*F+n*J+q*P;b[14]=p*y+r*D+n*L+q*d;b[3]=u*z+x*B+w*G+c*N;b[7]=u*A+x*C+w*E+c*O;b[11]=u*H+x*F+w*J+c*P;b[15]=u*y+x*D+w*L+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applyToBufferAttribute:function(a){for(var b= -0,c=a.count;bthis.determinant()&&(e=-e);a.x=d[12];a.y=d[13];a.z=d[14];X.copy(this);a=1/e;d=1/f;var k=1/g;X.elements[0]*=a;X.elements[1]*=a;X.elements[2]*=a;X.elements[4]*=d;X.elements[5]*=d;X.elements[6]*=d;X.elements[8]*=k;X.elements[9]*=k;X.elements[10]*=k;b.setFromRotationMatrix(X);c.x=e;c.y=f;c.z=g;return this},makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); +b,c){this.set(1,b,c,0,a,1,c,0,a,b,1,0,0,0,0,1);return this},compose:function(a,b,c){var d=this.elements,e=b._x,f=b._y,g=b._z,k=b._w,l=e+e,m=f+f,h=g+g;b=e*l;var p=e*m;e*=h;var q=f*m;f*=h;g*=h;l*=k;m*=k;k*=h;h=c.x;var n=c.y;c=c.z;d[0]=(1-(q+g))*h;d[1]=(p+k)*h;d[2]=(e-m)*h;d[3]=0;d[4]=(p-k)*n;d[5]=(1-(b+g))*n;d[6]=(f+l)*n;d[7]=0;d[8]=(e+m)*c;d[9]=(f-l)*c;d[10]=(1-(b+q))*c;d[11]=0;d[12]=a.x;d[13]=a.y;d[14]=a.z;d[15]=1;return this},decompose:function(a,b,c){var d=this.elements,e=Ma.set(d[0],d[1],d[2]).length(), +f=Ma.set(d[4],d[5],d[6]).length(),g=Ma.set(d[8],d[9],d[10]).length();0>this.determinant()&&(e=-e);a.x=d[12];a.y=d[13];a.z=d[14];W.copy(this);a=1/e;d=1/f;var k=1/g;W.elements[0]*=a;W.elements[1]*=a;W.elements[2]*=a;W.elements[4]*=d;W.elements[5]*=d;W.elements[6]*=d;W.elements[8]*=k;W.elements[9]*=k;W.elements[10]*=k;b.setFromRotationMatrix(W);c.x=e;c.y=f;c.z=g;return this},makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(c-d);g[9]=(c+d)/(c-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,k=1/(b-a),l=1/(c-d),m=1/(f-e);g[0]=2*k;g[4]=0;g[8]=0;g[12]=-((b+a)*k);g[1]=0;g[5]=2*l;g[9]=0;g[13]=-((c+d)*l);g[2]=0;g[6]=0;g[10]=-2*m;g[14]=-((f+e)*m);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements; -a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});var Fi=new R,Gi=new Da;Ub.RotationOrders= +a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});var Fi=new P,Gi=new Da;Ub.RotationOrders= "XYZ YZX ZXY XZY YXZ ZYX".split(" ");Ub.DefaultOrder="XYZ";Object.defineProperties(Ub.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this._onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this._onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this._onChangeCallback()}},order:{get:function(){return this._order},set:function(a){this._order=a;this._onChangeCallback()}}});Object.assign(Ub.prototype,{isEuler:!0,set:function(a, -b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this._onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this._onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=Q.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],k=e[1],l=e[5],m=e[9],h=e[2],p=e[6];e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.9999999>Math.abs(g)? +b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this._onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this._onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=O.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],k=e[1],l=e[5],m=e[9],h=e[2],p=e[6];e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.9999999>Math.abs(g)? (this._x=Math.atan2(-m,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(m,-1,1)),.9999999>Math.abs(m)?(this._y=Math.atan2(g,e),this._z=Math.atan2(k,l)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.9999999>Math.abs(p)?(this._y=Math.atan2(-h,e),this._z=Math.atan2(-f,l)):(this._y=0,this._z=Math.atan2(k,a))):"ZYX"===b?(this._y=Math.asin(-d(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(p,e),this._z=Math.atan2(k,a)): (this._x=0,this._z=Math.atan2(-f,l))):"YZX"===b?(this._z=Math.asin(d(k,-1,1)),.9999999>Math.abs(k)?(this._x=Math.atan2(-m,l),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=Math.asin(-d(f,-1,1)),.9999999>Math.abs(f)?(this._x=Math.atan2(p,l),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-m,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;!1!==c&&this._onChangeCallback();return this},setFromQuaternion:function(a, b,c){Fi.makeRotationFromQuaternion(a);return this.setFromRotationMatrix(Fi,b,c)},setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(a){Gi.setFromEuler(this);return this.setFromQuaternion(Gi,a)},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this._onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a= []);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new n(this._x,this._y,this._z)},_onChange:function(a){this._onChangeCallback=a;return this},_onChangeCallback:function(){}});Object.assign($f.prototype,{set:function(a){this.mask=1<a.normal.dot(this.direction)*b?!0:!1},intersectBox:function(a,b){var c=1/this.direction.x;var d=1/this.direction.y;var e=1/this.direction.z, f=this.origin;if(0<=c){var g=(a.min.x-f.x)*c;c*=a.max.x-f.x}else g=(a.max.x-f.x)*c,c*=a.min.x-f.x;if(0<=d){var k=(a.min.y-f.y)*d;d*=a.max.y-f.y}else k=(a.max.y-f.y)*d,d*=a.min.y-f.y;if(g>d||k>c)return null;if(k>g||g!==g)g=k;if(da||k>c)return null;if(k>g||g!==g)g=k;if(ac?null:this.at(0<=g?g:c,b)},intersectsBox:function(a){return null!==this.intersectBox(a,Bb)},intersectTriangle:function(a, b,c,d,e){bh.subVectors(b,a);If.subVectors(c,a);ch.crossVectors(bh,If);b=this.direction.dot(ch);if(0b)d=-1,b=-b;else return null;Qb.subVectors(this.origin,a);a=d*this.direction.dot(If.crossVectors(Qb,If));if(0>a)return null;c=d*this.direction.dot(bh.cross(Qb));if(0>c||a+c>b)return null;a=-d*Qb.dot(ch);return 0>a?null:this.at(a/b,e)},applyMatrix4:function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&& -a.direction.equals(this.direction)}});var dh=new n,Vk=new n,Wk=new ya;Object.assign(Ta.prototype,{isPlane:!0,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(a,b,c){b=dh.subVectors(c,b).cross(Vk.subVectors(a,b)).normalize();this.setFromNormalAndCoplanarPoint(b, +a.direction.equals(this.direction)}});var dh=new n,Vk=new n,Wk=new za;Object.assign(Ta.prototype,{isPlane:!0,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(a,b,c){b=dh.subVectors(c,b).cross(Vk.subVectors(a,b)).normalize();this.setFromNormalAndCoplanarPoint(b, a);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a, b){void 0===b&&(console.warn("THREE.Plane: .projectPoint() target is now required"),b=new n);return b.copy(this.normal).multiplyScalar(-this.distanceToPoint(a)).add(a)},intersectLine:function(a,b){void 0===b&&(console.warn("THREE.Plane: .intersectLine() target is now required"),b=new n);var c=a.delta(dh),d=this.normal.dot(c);if(0===d){if(0===this.distanceToPoint(a.start))return b.copy(a.start)}else if(d=-(a.start.dot(this.normal)+this.constant)/d,!(0>d||1b&&0a&&0=Db.x+Db.y},getUV:function(a,b,c,d,e,f,g,k){this.getBarycoord(a,b,c,d,Db);k.set(0,0);k.addScaledVector(e,Db.x);k.addScaledVector(f,Db.y);k.addScaledVector(g,Db.z);return k},isFrontFacing:function(a,b,c,d){bb.subVectors(c,b);Cb.subVectors(a,b);return 0>bb.cross(Cb).dot(d)?!0:!1}});Object.assign(na.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]); -return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){bb.subVectors(this.c,this.b);Cb.subVectors(this.a,this.b);return.5*bb.cross(Cb).length()},getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),a=new n);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return na.getNormal(this.a,this.b, -this.c,a)},getPlane:function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new Ta);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return na.getBarycoord(a,this.a,this.b,this.c,b)},getUV:function(a,b,c,d,e){return na.getUV(a,this.a,this.b,this.c,b,c,d,e)},containsPoint:function(a){return na.containsPoint(a,this.a,this.b,this.c)},isFrontFacing:function(a){return na.isFrontFacing(this.a,this.b,this.c,a)},intersectsBox:function(a){return a.intersectsTriangle(this)}, +b=this.normal.applyMatrix3(b).normalize();this.constant=-a.dot(b);return this},translate:function(a){this.constant-=a.dot(this.normal);return this},equals:function(a){return a.normal.equals(this.normal)&&a.constant===this.constant}});var bb=new n,Cb=new n,eh=new n,Db=new n,sd=new n,td=new n,Li=new n,fh=new n,gh=new n,hh=new n;Object.assign(ma,{getNormal:function(a,b,c,d){void 0===d&&(console.warn("THREE.Triangle: .getNormal() target is now required"),d=new n);d.subVectors(c,b);bb.subVectors(a,b); +d.cross(bb);a=d.lengthSq();return 0=Db.x+Db.y},getUV:function(a,b,c,d,e,f,g,k){this.getBarycoord(a,b,c,d,Db);k.set(0,0);k.addScaledVector(e,Db.x);k.addScaledVector(f,Db.y);k.addScaledVector(g,Db.z);return k},isFrontFacing:function(a,b,c,d){bb.subVectors(c,b);Cb.subVectors(a,b);return 0>bb.cross(Cb).dot(d)?!0:!1}});Object.assign(ma.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]); +return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){bb.subVectors(this.c,this.b);Cb.subVectors(this.a,this.b);return.5*bb.cross(Cb).length()},getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),a=new n);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return ma.getNormal(this.a,this.b, +this.c,a)},getPlane:function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new Ta);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return ma.getBarycoord(a,this.a,this.b,this.c,b)},getUV:function(a,b,c,d,e){return ma.getUV(a,this.a,this.b,this.c,b,c,d,e)},containsPoint:function(a){return ma.containsPoint(a,this.a,this.b,this.c)},isFrontFacing:function(a){return ma.isFrontFacing(this.a,this.b,this.c,a)},intersectsBox:function(a){return a.intersectsTriangle(this)}, closestPointToPoint:function(a,b){void 0===b&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),b=new n);var c=this.a,d=this.b,e=this.c;sd.subVectors(d,c);td.subVectors(e,c);fh.subVectors(a,c);var f=sd.dot(fh),g=td.dot(fh);if(0>=f&&0>=g)return b.copy(c);gh.subVectors(a,d);var k=sd.dot(gh),l=td.dot(gh);if(0<=k&&l<=k)return b.copy(d);var h=f*l-k*g;if(0>=h&&0<=f&&0>=k)return d=f/(f-k),b.copy(c).addScaledVector(sd,d);hh.subVectors(a,e);a=sd.dot(hh);var v=td.dot(hh);if(0<= v&&a<=v)return b.copy(e);f=a*g-f*v;if(0>=f&&0<=g&&0>=v)return h=g/(g-v),b.copy(c).addScaledVector(td,h);g=k*v-a*l;if(0>=g&&0<=l-k&&0<=a-v)return Li.subVectors(e,d),h=(l-k)/(l-k+(a-v)),b.copy(d).addScaledVector(Li,h);e=1/(g+f+h);d=f*e;h*=e;return b.copy(c).addScaledVector(sd,d).addScaledVector(td,h)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});var Mi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244, black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347, @@ -481,17 +481,17 @@ darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:96995 lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683, mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910, purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074}, -Ca={h:0,s:0,l:0},Jf={h:0,s:0,l:0};Object.assign(B.prototype,{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){a=Q.euclideanModulo(a,1);b=Q.clamp(b, -0,1);c=Q.clamp(c,0,1);0===b?this.r=this.g=this.b=c:(b=.5>=c?c*(1+b):c+b-c*b,c=2*c-b,this.r=bg(c,b,a+1/3),this.g=bg(c,b,a),this.b=bg(c,b,a-1/3));return this},setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+a+" will be ignored.")}var c;if(c=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var d=c[2];switch(c[1]){case "rgb":case "rgba":if(c=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(255,parseInt(c[1], +Ca={h:0,s:0,l:0},Jf={h:0,s:0,l:0};Object.assign(y.prototype,{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){a=O.euclideanModulo(a,1);b=O.clamp(b, +0,1);c=O.clamp(c,0,1);0===b?this.r=this.g=this.b=c:(b=.5>=c?c*(1+b):c+b-c*b,c=2*c-b,this.r=bg(c,b,a+1/3),this.g=bg(c,b,a),this.b=bg(c,b,a-1/3));return this},setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+a+" will be ignored.")}var c;if(c=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var d=c[2];switch(c[1]){case "rgb":case "rgba":if(c=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(255,parseInt(c[1], 10))/255,this.g=Math.min(255,parseInt(c[2],10))/255,this.b=Math.min(255,parseInt(c[3],10))/255,b(c[5]),this;if(c=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(100,parseInt(c[1],10))/100,this.g=Math.min(100,parseInt(c[2],10))/100,this.b=Math.min(100,parseInt(c[3],10))/100,b(c[5]),this;break;case "hsl":case "hsla":if(c=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)){d=parseFloat(c[1])/360;var e=parseInt(c[2], 10)/100,f=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,f)}}}else if(c=/^#([A-Fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===d)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return a&&0=k?l/(e+f):l/(2-e-f);switch(e){case b:g=(c-d)/l+(cg;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\n\t#include \n}", +this.view));a.object.filmGauge=this.filmGauge;a.object.filmOffset=this.filmOffset;return a}});Hc.prototype=Object.create(D.prototype);Hc.prototype.constructor=Hc;Eb.prototype=Object.create(va.prototype);Eb.prototype.constructor=Eb;Eb.prototype.isWebGLRenderTargetCube=!0;Eb.prototype.fromEquirectangularTexture=function(a,b){this.texture.type=b.type;this.texture.format=b.format;this.texture.encoding=b.encoding;var c=new pb,d=new oa({type:"CubemapFromEquirect",uniforms:bc({tEquirect:{value:null}}),vertexShader:"varying vec3 vWorldDirection;\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}", fragmentShader:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}",side:1,blending:0});d.uniforms.tEquirect.value=b;b=new ca(new Jd(5, -5,5),d);c.add(b);d=new Hc(1,10,1);d.renderTarget=this;d.renderTarget.texture.name="CubeCameraTexture";d.update(a,c);b.geometry.dispose();b.material.dispose();return this};cc.prototype=Object.create(V.prototype);cc.prototype.constructor=cc;cc.prototype.isDataTexture=!0;var vd=new qb,Lf=new n;Object.assign(Hd.prototype,{set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},clone:function(){return(new this.constructor).copy(this)}, -copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],k=c[5],h=c[6],m=c[7],n=c[8],p=c[9],r=c[10],t=c[11],q=c[12],u=c[13],x=c[14];c=c[15];b[0].setComponents(f-a,m-g,t-n,c-q).normalize();b[1].setComponents(f+a,m+g,t+n,c+q).normalize();b[2].setComponents(f+d,m+k,t+p,c+u).normalize();b[3].setComponents(f-d,m-k,t-p,c-u).normalize();b[4].setComponents(f-e,m-h,t-r,c-x).normalize(); -b[5].setComponents(f+e,m+h,t+r,c+x).normalize();return this},intersectsObject:function(a){var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere();vd.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(vd)},intersectsSprite:function(a){vd.center.set(0,0,0);vd.radius=.7071067811865476;vd.applyMatrix4(a.matrixWorld);return this.intersectsSphere(vd)},intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)< -a)return!1;return!0},intersectsBox:function(a){for(var b=this.planes,c=0;6>c;c++){var d=b[c];Lf.x=0d.distanceToPoint(Lf))return!1}return!0},containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});var P={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif", +5,5),d);c.add(b);d=new Hc(1,10,1);d.renderTarget=this;d.renderTarget.texture.name="CubeCameraTexture";d.update(a,c);b.geometry.dispose();b.material.dispose();return this};cc.prototype=Object.create(T.prototype);cc.prototype.constructor=cc;cc.prototype.isDataTexture=!0;var vd=new qb,Lf=new n;Object.assign(Hd.prototype,{set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},clone:function(){return(new this.constructor).copy(this)}, +copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],k=c[5],h=c[6],m=c[7],n=c[8],p=c[9],q=c[10],t=c[11],r=c[12],u=c[13],z=c[14];c=c[15];b[0].setComponents(f-a,m-g,t-n,c-r).normalize();b[1].setComponents(f+a,m+g,t+n,c+r).normalize();b[2].setComponents(f+d,m+k,t+p,c+u).normalize();b[3].setComponents(f-d,m-k,t-p,c-u).normalize();b[4].setComponents(f-e,m-h,t-q,c-z).normalize(); +b[5].setComponents(f+e,m+h,t+q,c+z).normalize();return this},intersectsObject:function(a){var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere();vd.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(vd)},intersectsSprite:function(a){vd.center.set(0,0,0);vd.radius=.7071067811865476;vd.applyMatrix4(a.matrixWorld);return this.intersectsSphere(vd)},intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)< +a)return!1;return!0},intersectsBox:function(a){for(var b=this.planes,c=0;6>c;c++){var d=b[c];Lf.x=0d.distanceToPoint(Lf))return!1}return!0},containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});var N={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif", alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif", aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif", bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif", @@ -658,144 +658,144 @@ points_vert:"uniform float size;\nuniform float scale;\n#include \n#incl shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}", sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"}, -E={common:{diffuse:{value:new B(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ya},uv2Transform:{value:new ya},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null}, -bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new A(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:2.5E-4},fogNear:{value:1},fogFar:{value:2E3},fogColor:{value:new B(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{}, +E={common:{diffuse:{value:new y(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new za},uv2Transform:{value:new za},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null}, +bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new x(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:2.5E-4},fogNear:{value:1},fogFar:{value:2E3},fogColor:{value:new y(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{}, color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{}, -shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new B(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ya}},sprite:{diffuse:{value:new B(15658734)},opacity:{value:1},center:{value:new A(.5,.5)},rotation:{value:0},map:{value:null}, -alphaMap:{value:null},uvTransform:{value:new ya}}},eb={basic:{uniforms:oa([E.common,E.specularmap,E.envmap,E.aomap,E.lightmap,E.fog]),vertexShader:P.meshbasic_vert,fragmentShader:P.meshbasic_frag},lambert:{uniforms:oa([E.common,E.specularmap,E.envmap,E.aomap,E.lightmap,E.emissivemap,E.fog,E.lights,{emissive:{value:new B(0)}}]),vertexShader:P.meshlambert_vert,fragmentShader:P.meshlambert_frag},phong:{uniforms:oa([E.common,E.specularmap,E.envmap,E.aomap,E.lightmap,E.emissivemap,E.bumpmap,E.normalmap, -E.displacementmap,E.fog,E.lights,{emissive:{value:new B(0)},specular:{value:new B(1118481)},shininess:{value:30}}]),vertexShader:P.meshphong_vert,fragmentShader:P.meshphong_frag},standard:{uniforms:oa([E.common,E.envmap,E.aomap,E.lightmap,E.emissivemap,E.bumpmap,E.normalmap,E.displacementmap,E.roughnessmap,E.metalnessmap,E.fog,E.lights,{emissive:{value:new B(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:P.meshphysical_vert,fragmentShader:P.meshphysical_frag}, -toon:{uniforms:oa([E.common,E.specularmap,E.aomap,E.lightmap,E.emissivemap,E.bumpmap,E.normalmap,E.displacementmap,E.gradientmap,E.fog,E.lights,{emissive:{value:new B(0)},specular:{value:new B(1118481)},shininess:{value:30}}]),vertexShader:P.meshtoon_vert,fragmentShader:P.meshtoon_frag},matcap:{uniforms:oa([E.common,E.bumpmap,E.normalmap,E.displacementmap,E.fog,{matcap:{value:null}}]),vertexShader:P.meshmatcap_vert,fragmentShader:P.meshmatcap_frag},points:{uniforms:oa([E.points,E.fog]),vertexShader:P.points_vert, -fragmentShader:P.points_frag},dashed:{uniforms:oa([E.common,E.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:P.linedashed_vert,fragmentShader:P.linedashed_frag},depth:{uniforms:oa([E.common,E.displacementmap]),vertexShader:P.depth_vert,fragmentShader:P.depth_frag},normal:{uniforms:oa([E.common,E.bumpmap,E.normalmap,E.displacementmap,{opacity:{value:1}}]),vertexShader:P.normal_vert,fragmentShader:P.normal_frag},sprite:{uniforms:oa([E.sprite,E.fog]),vertexShader:P.sprite_vert, -fragmentShader:P.sprite_frag},background:{uniforms:{uvTransform:{value:new ya},t2D:{value:null}},vertexShader:P.background_vert,fragmentShader:P.background_frag},cube:{uniforms:oa([E.envmap,{opacity:{value:1}}]),vertexShader:P.cube_vert,fragmentShader:P.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:P.equirect_vert,fragmentShader:P.equirect_frag},distanceRGBA:{uniforms:oa([E.common,E.displacementmap,{referencePosition:{value:new n},nearDistance:{value:1},farDistance:{value:1E3}}]), -vertexShader:P.distanceRGBA_vert,fragmentShader:P.distanceRGBA_frag},shadow:{uniforms:oa([E.lights,E.fog,{color:{value:new B(0)},opacity:{value:1}}]),vertexShader:P.shadow_vert,fragmentShader:P.shadow_frag}};eb.physical={uniforms:oa([eb.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new B(0)},clearcoatNormalScale:{value:new A(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:P.meshphysical_vert,fragmentShader:P.meshphysical_frag};Id.prototype= -Object.create(O.prototype);Id.prototype.constructor=Id;dc.prototype=Object.create(F.prototype);dc.prototype.constructor=dc;rb.prototype=Object.create(V.prototype);rb.prototype.constructor=rb;rb.prototype.isCubeTexture=!0;Object.defineProperty(rb.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});Ic.prototype=Object.create(V.prototype);Ic.prototype.constructor=Ic;Ic.prototype.isDataTexture2DArray=!0;Jc.prototype=Object.create(V.prototype);Jc.prototype.constructor= -Jc;Jc.prototype.isDataTexture3D=!0;var Fh=new V,Mj=new Ic,Oj=new Jc,Gh=new rb,zh=[],Bh=[],Eh=new Float32Array(16),Dh=new Float32Array(9),Ch=new Float32Array(4);Hh.prototype.updateCache=function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));Ia(b,a)};Ih.prototype.setValue=function(a,b,c){for(var d=this.seq,e=0,f=d.length;e!==f;++e){var g=d[e];g.setValue(a,b[g.id],c)}};var hg=/([\w\d_]+)(\])?(\[|\.)?/g;Fb.prototype.setValue=function(a,b,c, +shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new y(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new za}},sprite:{diffuse:{value:new y(15658734)},opacity:{value:1},center:{value:new x(.5,.5)},rotation:{value:0},map:{value:null}, +alphaMap:{value:null},uvTransform:{value:new za}}},eb={basic:{uniforms:na([E.common,E.specularmap,E.envmap,E.aomap,E.lightmap,E.fog]),vertexShader:N.meshbasic_vert,fragmentShader:N.meshbasic_frag},lambert:{uniforms:na([E.common,E.specularmap,E.envmap,E.aomap,E.lightmap,E.emissivemap,E.fog,E.lights,{emissive:{value:new y(0)}}]),vertexShader:N.meshlambert_vert,fragmentShader:N.meshlambert_frag},phong:{uniforms:na([E.common,E.specularmap,E.envmap,E.aomap,E.lightmap,E.emissivemap,E.bumpmap,E.normalmap, +E.displacementmap,E.fog,E.lights,{emissive:{value:new y(0)},specular:{value:new y(1118481)},shininess:{value:30}}]),vertexShader:N.meshphong_vert,fragmentShader:N.meshphong_frag},standard:{uniforms:na([E.common,E.envmap,E.aomap,E.lightmap,E.emissivemap,E.bumpmap,E.normalmap,E.displacementmap,E.roughnessmap,E.metalnessmap,E.fog,E.lights,{emissive:{value:new y(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:N.meshphysical_vert,fragmentShader:N.meshphysical_frag}, +toon:{uniforms:na([E.common,E.specularmap,E.aomap,E.lightmap,E.emissivemap,E.bumpmap,E.normalmap,E.displacementmap,E.gradientmap,E.fog,E.lights,{emissive:{value:new y(0)},specular:{value:new y(1118481)},shininess:{value:30}}]),vertexShader:N.meshtoon_vert,fragmentShader:N.meshtoon_frag},matcap:{uniforms:na([E.common,E.bumpmap,E.normalmap,E.displacementmap,E.fog,{matcap:{value:null}}]),vertexShader:N.meshmatcap_vert,fragmentShader:N.meshmatcap_frag},points:{uniforms:na([E.points,E.fog]),vertexShader:N.points_vert, +fragmentShader:N.points_frag},dashed:{uniforms:na([E.common,E.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:N.linedashed_vert,fragmentShader:N.linedashed_frag},depth:{uniforms:na([E.common,E.displacementmap]),vertexShader:N.depth_vert,fragmentShader:N.depth_frag},normal:{uniforms:na([E.common,E.bumpmap,E.normalmap,E.displacementmap,{opacity:{value:1}}]),vertexShader:N.normal_vert,fragmentShader:N.normal_frag},sprite:{uniforms:na([E.sprite,E.fog]),vertexShader:N.sprite_vert, +fragmentShader:N.sprite_frag},background:{uniforms:{uvTransform:{value:new za},t2D:{value:null}},vertexShader:N.background_vert,fragmentShader:N.background_frag},cube:{uniforms:na([E.envmap,{opacity:{value:1}}]),vertexShader:N.cube_vert,fragmentShader:N.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:N.equirect_vert,fragmentShader:N.equirect_frag},distanceRGBA:{uniforms:na([E.common,E.displacementmap,{referencePosition:{value:new n},nearDistance:{value:1},farDistance:{value:1E3}}]), +vertexShader:N.distanceRGBA_vert,fragmentShader:N.distanceRGBA_frag},shadow:{uniforms:na([E.lights,E.fog,{color:{value:new y(0)},opacity:{value:1}}]),vertexShader:N.shadow_vert,fragmentShader:N.shadow_frag}};eb.physical={uniforms:na([eb.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new y(0)},clearcoatNormalScale:{value:new x(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:N.meshphysical_vert,fragmentShader:N.meshphysical_frag};Id.prototype= +Object.create(M.prototype);Id.prototype.constructor=Id;dc.prototype=Object.create(G.prototype);dc.prototype.constructor=dc;rb.prototype=Object.create(T.prototype);rb.prototype.constructor=rb;rb.prototype.isCubeTexture=!0;Object.defineProperty(rb.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});Ic.prototype=Object.create(T.prototype);Ic.prototype.constructor=Ic;Ic.prototype.isDataTexture2DArray=!0;Jc.prototype=Object.create(T.prototype);Jc.prototype.constructor= +Jc;Jc.prototype.isDataTexture3D=!0;var Fh=new T,Mj=new Ic,Oj=new Jc,Gh=new rb,zh=[],Bh=[],Eh=new Float32Array(16),Dh=new Float32Array(9),Ch=new Float32Array(4);Hh.prototype.updateCache=function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));Ia(b,a)};Ih.prototype.setValue=function(a,b,c){for(var d=this.seq,e=0,f=d.length;e!==f;++e){var g=d[e];g.setValue(a,b[g.id],c)}};var hg=/([\w\d_]+)(\])?(\[|\.)?/g;Fb.prototype.setValue=function(a,b,c, d){b=this.map[b];void 0!==b&&b.setValue(a,c,d)};Fb.prototype.setOptional=function(a,b,c){b=b[c];void 0!==b&&this.setValue(a,c,b)};Fb.upload=function(a,b,c,d){for(var e=0,f=b.length;e!==f;++e){var g=b[e],k=c[g.id];!1!==k.needsUpdate&&g.setValue(a,k.value,d)}};Fb.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 tk=0,jg=/^[ \t]*#include +<([\w\d./]+)>/gm,Qh=/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g, -Ck=0;Gb.prototype=Object.create(N.prototype);Gb.prototype.constructor=Gb;Gb.prototype.isMeshDepthMaterial=!0;Gb.prototype.copy=function(a){N.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}; -Hb.prototype=Object.create(N.prototype);Hb.prototype.constructor=Hb;Hb.prototype.isMeshDistanceMaterial=!0;Hb.prototype.copy=function(a){N.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};og.prototype=Object.assign(Object.create(wa.prototype),{constructor:og,isWebGLMultiviewRenderTarget:!0,copy:function(a){wa.prototype.copy.call(this,a);this.numViews=a.numViews;return this},setNumViews:function(a){this.numViews!==a&&(this.numViews=a,this.dispose());return this}});Pe.prototype=Object.assign(Object.create(qa.prototype),{constructor:Pe,isArrayCamera:!0});Od.prototype=Object.assign(Object.create(D.prototype),{constructor:Od,isGroup:!0});Object.assign(Wh.prototype,Fa.prototype); +Ck=0;Gb.prototype=Object.create(L.prototype);Gb.prototype.constructor=Gb;Gb.prototype.isMeshDepthMaterial=!0;Gb.prototype.copy=function(a){L.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}; +Hb.prototype=Object.create(L.prototype);Hb.prototype.constructor=Hb;Hb.prototype.isMeshDistanceMaterial=!0;Hb.prototype.copy=function(a){L.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};og.prototype=Object.assign(Object.create(va.prototype),{constructor:og,isWebGLMultiviewRenderTarget:!0,copy:function(a){va.prototype.copy.call(this,a);this.numViews=a.numViews;return this},setNumViews:function(a){this.numViews!==a&&(this.numViews=a,this.dispose());return this}});Pe.prototype=Object.assign(Object.create(pa.prototype),{constructor:Pe,isArrayCamera:!0});Od.prototype=Object.assign(Object.create(D.prototype),{constructor:Od,isGroup:!0});Object.assign(Wh.prototype,Fa.prototype); Object.assign(Qe.prototype,{isFogExp2:!0,clone:function(){return new Qe(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}});Object.assign(Re.prototype,{isFog:!0,clone:function(){return new Re(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});Object.defineProperty(sb.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(sb.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;da.far||b.push({distance:e,point:Ee.clone(),uv:na.getUV(Ee,Mf,Fe,Nf,Oi,mh,Pi,new A),face:null,object:this})},clone:function(){return(new this.constructor(this.material)).copy(this)},copy:function(a){D.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}}); +0);Pi.set(1,1);var f=a.ray.intersectTriangle(Mf,Fe,Nf,!1,Ee);if(null===f&&(Se(Fe.set(-.5,.5,0),xd,c,wd,e,d),mh.set(0,1),f=a.ray.intersectTriangle(Mf,Nf,Fe,!1,Ee),null===f))return;e=a.ray.origin.distanceTo(Ee);ea.far||b.push({distance:e,point:Ee.clone(),uv:ma.getUV(Ee,Mf,Fe,Nf,Oi,mh,Pi,new x),face:null,object:this})},clone:function(){return(new this.constructor(this.material)).copy(this)},copy:function(a){D.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}}); var Of=new n,Qi=new n;Sd.prototype=Object.assign(Object.create(D.prototype),{constructor:Sd,isLOD:!0,copy:function(a){D.prototype.copy.call(this,a,!1);for(var b=a.levels,c=0,d=b.length;c=b[c].distance)b[c- 1].object.visible=!1,b[c].object.visible=!0;else break;for(;cc||(k.applyMatrix4(this.matrixWorld),r=a.ray.origin.distanceTo(k),ra.far||b.push({distance:r,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}}else for(d=0,p=v.length/3-1;dc||(k.applyMatrix4(this.matrixWorld),r=a.ray.origin.distanceTo(k),ra.far||b.push({distance:r,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null, -object:this}))}else if(d.isGeometry)for(f=d.vertices,g=f.length,d=0;dc||(k.applyMatrix4(this.matrixWorld),r=a.ray.origin.distanceTo(k),ra.far||b.push({distance:r,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}},clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});var Qf=new n,Rf=new n;ma.prototype=Object.assign(Object.create(Ja.prototype),{constructor:ma, +d.boundingSphere&&d.computeBoundingSphere();He.copy(d.boundingSphere);He.applyMatrix4(e);He.radius+=c;if(!1!==a.ray.intersectsSphere(He)){Wi.getInverse(e);Pf.copy(a.ray).applyMatrix4(Wi);c/=(this.scale.x+this.scale.y+this.scale.z)/3;c*=c;var f=new n,g=new n;e=new n;var k=new n,h=this&&this.isLineSegments?2:1;if(d.isBufferGeometry){var m=d.index,v=d.attributes.position.array;if(null!==m){m=m.array;d=0;for(var p=m.length-1;dc||(k.applyMatrix4(this.matrixWorld),q=a.ray.origin.distanceTo(k),qa.far||b.push({distance:q,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}}else for(d=0,p=v.length/3-1;dc||(k.applyMatrix4(this.matrixWorld),q=a.ray.origin.distanceTo(k),qa.far||b.push({distance:q,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null, +object:this}))}else if(d.isGeometry)for(f=d.vertices,g=f.length,d=0;dc||(k.applyMatrix4(this.matrixWorld),q=a.ray.origin.distanceTo(k),qa.far||b.push({distance:q,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}},clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});var Qf=new n,Rf=new n;la.prototype=Object.assign(Object.create(Ja.prototype),{constructor:la, 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= -a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Pc.prototype=Object.create(V.prototype);Pc.prototype.constructor=Pc;Pc.prototype.isCompressedTexture=!0;Ud.prototype=Object.create(V.prototype);Ud.prototype.constructor=Ud;Ud.prototype.isCanvasTexture=!0;Vd.prototype=Object.create(V.prototype);Vd.prototype.constructor=Vd;Vd.prototype.isDepthTexture=!0;Qc.prototype=Object.create(F.prototype);Qc.prototype.constructor=Qc;Wd.prototype=Object.create(O.prototype);Wd.prototype.constructor=Wd;Rc.prototype=Object.create(F.prototype); -Rc.prototype.constructor=Rc;Xd.prototype=Object.create(O.prototype);Xd.prototype.constructor=Xd;Ga.prototype=Object.create(F.prototype);Ga.prototype.constructor=Ga;Yd.prototype=Object.create(O.prototype);Yd.prototype.constructor=Yd;Sc.prototype=Object.create(Ga.prototype);Sc.prototype.constructor=Sc;Zd.prototype=Object.create(O.prototype);Zd.prototype.constructor=Zd;ec.prototype=Object.create(Ga.prototype);ec.prototype.constructor=ec;$d.prototype=Object.create(O.prototype);$d.prototype.constructor= -$d;Tc.prototype=Object.create(Ga.prototype);Tc.prototype.constructor=Tc;ae.prototype=Object.create(O.prototype);ae.prototype.constructor=ae;Uc.prototype=Object.create(Ga.prototype);Uc.prototype.constructor=Uc;be.prototype=Object.create(O.prototype);be.prototype.constructor=be;fc.prototype=Object.create(F.prototype);fc.prototype.constructor=fc;fc.prototype.toJSON=function(){var a=F.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};ce.prototype=Object.create(O.prototype);ce.prototype.constructor= -ce;Vc.prototype=Object.create(F.prototype);Vc.prototype.constructor=Vc;de.prototype=Object.create(O.prototype);de.prototype.constructor=de;Wc.prototype=Object.create(F.prototype);Wc.prototype.constructor=Wc;var Zk={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,f=Zh(a,0,e,c,!0),g=[];if(!f||f.next===f.prev)return g;var k;if(d){var h=c;d=[];var m;var n=0;for(m=b.length;n80*c){var t=k=a[0];var q=d=a[1];for(h=c;hk&&(k=n),b>d&&(d=b);k=Math.max(k-t,d-q);k=0!==k?1/k:0}ge(f,g,c,t,q,k);return g}},tb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;etb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];ci(a);di(c,a);var f=a.length;b.forEach(ci); -for(a=0;aMath.abs(g-h)?[new A(a,1-c),new A(k,1-d),new A(m,1-e),new A(p,1-b)]:[new A(g,1-c),new A(h,1-d),new A(n,1-e),new A(r,1-b)]}};ie.prototype=Object.create(O.prototype); -ie.prototype.constructor=ie;Yc.prototype=Object.create(gb.prototype);Yc.prototype.constructor=Yc;je.prototype=Object.create(O.prototype);je.prototype.constructor=je;ic.prototype=Object.create(F.prototype);ic.prototype.constructor=ic;ke.prototype=Object.create(O.prototype);ke.prototype.constructor=ke;Zc.prototype=Object.create(F.prototype);Zc.prototype.constructor=Zc;le.prototype=Object.create(O.prototype);le.prototype.constructor=le;$c.prototype=Object.create(F.prototype);$c.prototype.constructor= -$c;jc.prototype=Object.create(O.prototype);jc.prototype.constructor=jc;jc.prototype.toJSON=function(){var a=O.prototype.toJSON.call(this);return fi(this.parameters.shapes,a)};kc.prototype=Object.create(F.prototype);kc.prototype.constructor=kc;kc.prototype.toJSON=function(){var a=F.prototype.toJSON.call(this);return fi(this.parameters.shapes,a)};ad.prototype=Object.create(F.prototype);ad.prototype.constructor=ad;lc.prototype=Object.create(O.prototype);lc.prototype.constructor=lc;ub.prototype=Object.create(F.prototype); -ub.prototype.constructor=ub;me.prototype=Object.create(lc.prototype);me.prototype.constructor=me;ne.prototype=Object.create(ub.prototype);ne.prototype.constructor=ne;oe.prototype=Object.create(O.prototype);oe.prototype.constructor=oe;bd.prototype=Object.create(F.prototype);bd.prototype.constructor=bd;var va=Object.freeze({__proto__:null,WireframeGeometry:Qc,ParametricGeometry:Wd,ParametricBufferGeometry:Rc,TetrahedronGeometry:Yd,TetrahedronBufferGeometry:Sc,OctahedronGeometry:Zd,OctahedronBufferGeometry:ec, +{},a=0,b=c.length;a= +a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Pc.prototype=Object.create(T.prototype);Pc.prototype.constructor=Pc;Pc.prototype.isCompressedTexture=!0;Ud.prototype=Object.create(T.prototype);Ud.prototype.constructor=Ud;Ud.prototype.isCanvasTexture=!0;Vd.prototype=Object.create(T.prototype);Vd.prototype.constructor=Vd;Vd.prototype.isDepthTexture=!0;Qc.prototype=Object.create(G.prototype);Qc.prototype.constructor=Qc;Wd.prototype=Object.create(M.prototype);Wd.prototype.constructor=Wd;Rc.prototype=Object.create(G.prototype); +Rc.prototype.constructor=Rc;Xd.prototype=Object.create(M.prototype);Xd.prototype.constructor=Xd;Ga.prototype=Object.create(G.prototype);Ga.prototype.constructor=Ga;Yd.prototype=Object.create(M.prototype);Yd.prototype.constructor=Yd;Sc.prototype=Object.create(Ga.prototype);Sc.prototype.constructor=Sc;Zd.prototype=Object.create(M.prototype);Zd.prototype.constructor=Zd;ec.prototype=Object.create(Ga.prototype);ec.prototype.constructor=ec;$d.prototype=Object.create(M.prototype);$d.prototype.constructor= +$d;Tc.prototype=Object.create(Ga.prototype);Tc.prototype.constructor=Tc;ae.prototype=Object.create(M.prototype);ae.prototype.constructor=ae;Uc.prototype=Object.create(Ga.prototype);Uc.prototype.constructor=Uc;be.prototype=Object.create(M.prototype);be.prototype.constructor=be;fc.prototype=Object.create(G.prototype);fc.prototype.constructor=fc;fc.prototype.toJSON=function(){var a=G.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};ce.prototype=Object.create(M.prototype);ce.prototype.constructor= +ce;Vc.prototype=Object.create(G.prototype);Vc.prototype.constructor=Vc;de.prototype=Object.create(M.prototype);de.prototype.constructor=de;Wc.prototype=Object.create(G.prototype);Wc.prototype.constructor=Wc;var Zk={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,f=Zh(a,0,e,c,!0),g=[];if(!f||f.next===f.prev)return g;var k;if(d){var h=c;d=[];var m;var n=0;for(m=b.length;n80*c){var t=k=a[0];var r=d=a[1];for(h=c;hk&&(k=n),b>d&&(d=b);k=Math.max(k-t,d-r);k=0!==k?1/k:0}ge(f,g,c,t,r,k);return g}},tb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;etb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];ci(a);di(c,a);var f=a.length;b.forEach(ci); +for(a=0;aMath.abs(g-h)?[new x(a,1-c),new x(k,1-d),new x(m,1-e),new x(p,1-b)]:[new x(g,1-c),new x(h,1-d),new x(n,1-e),new x(q,1-b)]}};ie.prototype=Object.create(M.prototype); +ie.prototype.constructor=ie;Yc.prototype=Object.create(gb.prototype);Yc.prototype.constructor=Yc;je.prototype=Object.create(M.prototype);je.prototype.constructor=je;ic.prototype=Object.create(G.prototype);ic.prototype.constructor=ic;ke.prototype=Object.create(M.prototype);ke.prototype.constructor=ke;Zc.prototype=Object.create(G.prototype);Zc.prototype.constructor=Zc;le.prototype=Object.create(M.prototype);le.prototype.constructor=le;$c.prototype=Object.create(G.prototype);$c.prototype.constructor= +$c;jc.prototype=Object.create(M.prototype);jc.prototype.constructor=jc;jc.prototype.toJSON=function(){var a=M.prototype.toJSON.call(this);return fi(this.parameters.shapes,a)};kc.prototype=Object.create(G.prototype);kc.prototype.constructor=kc;kc.prototype.toJSON=function(){var a=G.prototype.toJSON.call(this);return fi(this.parameters.shapes,a)};ad.prototype=Object.create(G.prototype);ad.prototype.constructor=ad;lc.prototype=Object.create(M.prototype);lc.prototype.constructor=lc;ub.prototype=Object.create(G.prototype); +ub.prototype.constructor=ub;me.prototype=Object.create(lc.prototype);me.prototype.constructor=me;ne.prototype=Object.create(ub.prototype);ne.prototype.constructor=ne;oe.prototype=Object.create(M.prototype);oe.prototype.constructor=oe;bd.prototype=Object.create(G.prototype);bd.prototype.constructor=bd;var ua=Object.freeze({__proto__:null,WireframeGeometry:Qc,ParametricGeometry:Wd,ParametricBufferGeometry:Rc,TetrahedronGeometry:Yd,TetrahedronBufferGeometry:Sc,OctahedronGeometry:Zd,OctahedronBufferGeometry:ec, IcosahedronGeometry:$d,IcosahedronBufferGeometry:Tc,DodecahedronGeometry:ae,DodecahedronBufferGeometry:Uc,PolyhedronGeometry:Xd,PolyhedronBufferGeometry:Ga,TubeGeometry:be,TubeBufferGeometry:fc,TorusKnotGeometry:ce,TorusKnotBufferGeometry:Vc,TorusGeometry:de,TorusBufferGeometry:Wc,TextGeometry:ie,TextBufferGeometry:Yc,SphereGeometry:je,SphereBufferGeometry:ic,RingGeometry:ke,RingBufferGeometry:Zc,PlaneGeometry:Id,PlaneBufferGeometry:dc,LatheGeometry:le,LatheBufferGeometry:$c,ShapeGeometry:jc,ShapeBufferGeometry:kc, -ExtrudeGeometry:hc,ExtrudeBufferGeometry:gb,EdgesGeometry:ad,ConeGeometry:me,ConeBufferGeometry:ne,CylinderGeometry:lc,CylinderBufferGeometry:ub,CircleGeometry:oe,CircleBufferGeometry:bd,BoxGeometry:lh,BoxBufferGeometry:Jd});mc.prototype=Object.create(N.prototype);mc.prototype.constructor=mc;mc.prototype.isShadowMaterial=!0;mc.prototype.copy=function(a){N.prototype.copy.call(this,a);this.color.copy(a.color);return this};vb.prototype=Object.create(pa.prototype);vb.prototype.constructor=vb;vb.prototype.isRawShaderMaterial= -!0;hb.prototype=Object.create(N.prototype);hb.prototype.constructor=hb;hb.prototype.isMeshStandardMaterial=!0;hb.prototype.copy=function(a){N.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity; +ExtrudeGeometry:hc,ExtrudeBufferGeometry:gb,EdgesGeometry:ad,ConeGeometry:me,ConeBufferGeometry:ne,CylinderGeometry:lc,CylinderBufferGeometry:ub,CircleGeometry:oe,CircleBufferGeometry:bd,BoxGeometry:lh,BoxBufferGeometry:Jd});mc.prototype=Object.create(L.prototype);mc.prototype.constructor=mc;mc.prototype.isShadowMaterial=!0;mc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);return this};vb.prototype=Object.create(oa.prototype);vb.prototype.constructor=vb;vb.prototype.isRawShaderMaterial= +!0;hb.prototype=Object.create(L.prototype);hb.prototype.constructor=hb;hb.prototype.isMeshStandardMaterial=!0;hb.prototype.copy=function(a){L.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity; this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.roughnessMap=a.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth= a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};nc.prototype=Object.create(hb.prototype);nc.prototype.constructor=nc;nc.prototype.isMeshPhysicalMaterial=!0;nc.prototype.copy=function(a){hb.prototype.copy.call(this,a);this.defines={STANDARD:"",PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearcoat=a.clearcoat;this.clearcoatRoughness= -a.clearcoatRoughness;this.sheen=a.sheen?(this.sheen||new B).copy(a.sheen):null;this.clearcoatNormalMap=a.clearcoatNormalMap;this.clearcoatNormalScale.copy(a.clearcoatNormalScale);this.transparency=a.transparency;return this};Kb.prototype=Object.create(N.prototype);Kb.prototype.constructor=Kb;Kb.prototype.isMeshPhongMaterial=!0;Kb.prototype.copy=function(a){N.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap= +a.clearcoatRoughness;this.sheen=a.sheen?(this.sheen||new y).copy(a.sheen):null;this.clearcoatNormalMap=a.clearcoatNormalMap;this.clearcoatNormalScale.copy(a.clearcoatNormalScale);this.transparency=a.transparency;return this};Kb.prototype=Object.create(L.prototype);Kb.prototype.constructor=Kb;Kb.prototype.isMeshPhongMaterial=!0;Kb.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap= a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.specularMap= -a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};oc.prototype=Object.create(N.prototype);oc.prototype.constructor=oc;oc.prototype.isMeshToonMaterial= -!0;oc.prototype.copy=function(a){N.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.gradientMap=a.gradientMap;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType= +a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};oc.prototype=Object.create(L.prototype);oc.prototype.constructor=oc;oc.prototype.isMeshToonMaterial= +!0;oc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.gradientMap=a.gradientMap;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType= a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};pc.prototype= -Object.create(N.prototype);pc.prototype.constructor=pc;pc.prototype.isMeshNormalMaterial=!0;pc.prototype.copy=function(a){N.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.skinning= -a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};qc.prototype=Object.create(N.prototype);qc.prototype.constructor=qc;qc.prototype.isMeshLambertMaterial=!0;qc.prototype.copy=function(a){N.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity= -a.emissiveIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};rc.prototype=Object.create(N.prototype);rc.prototype.constructor= -rc;rc.prototype.isMeshMatcapMaterial=!0;rc.prototype.copy=function(a){N.prototype.copy.call(this,a);this.defines={MATCAP:""};this.color.copy(a.color);this.matcap=a.matcap;this.map=a.map;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.alphaMap=a.alphaMap;this.skinning=a.skinning; -this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};sc.prototype=Object.create(ja.prototype);sc.prototype.constructor=sc;sc.prototype.isLineDashedMaterial=!0;sc.prototype.copy=function(a){ja.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var $k=Object.freeze({__proto__:null,ShadowMaterial:mc,SpriteMaterial:Jb,RawShaderMaterial:vb,ShaderMaterial:pa,PointsMaterial:Va,MeshPhysicalMaterial:nc,MeshStandardMaterial:hb, -MeshPhongMaterial:Kb,MeshToonMaterial:oc,MeshNormalMaterial:pc,MeshLambertMaterial:qc,MeshDepthMaterial:Gb,MeshDistanceMaterial:Hb,MeshBasicMaterial:Oa,MeshMatcapMaterial:rc,LineDashedMaterial:sc,LineBasicMaterial:ja,Material:N}),ea={arraySlice:function(a,b,c){return ea.isTypedArray(a)?new a.constructor(a.subarray(b,void 0!==c?c:a.length)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:"number"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&& +Object.create(L.prototype);pc.prototype.constructor=pc;pc.prototype.isMeshNormalMaterial=!0;pc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.skinning= +a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};qc.prototype=Object.create(L.prototype);qc.prototype.constructor=qc;qc.prototype.isMeshLambertMaterial=!0;qc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity= +a.emissiveIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};rc.prototype=Object.create(L.prototype);rc.prototype.constructor= +rc;rc.prototype.isMeshMatcapMaterial=!0;rc.prototype.copy=function(a){L.prototype.copy.call(this,a);this.defines={MATCAP:""};this.color.copy(a.color);this.matcap=a.matcap;this.map=a.map;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.alphaMap=a.alphaMap;this.skinning=a.skinning; +this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};sc.prototype=Object.create(ja.prototype);sc.prototype.constructor=sc;sc.prototype.isLineDashedMaterial=!0;sc.prototype.copy=function(a){ja.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var $k=Object.freeze({__proto__:null,ShadowMaterial:mc,SpriteMaterial:Jb,RawShaderMaterial:vb,ShaderMaterial:oa,PointsMaterial:Va,MeshPhysicalMaterial:nc,MeshStandardMaterial:hb, +MeshPhongMaterial:Kb,MeshToonMaterial:oc,MeshNormalMaterial:pc,MeshLambertMaterial:qc,MeshDepthMaterial:Gb,MeshDistanceMaterial:Hb,MeshBasicMaterial:Oa,MeshMatcapMaterial:rc,LineDashedMaterial:sc,LineBasicMaterial:ja,Material:L}),ea={arraySlice:function(a,b,c){return ea.isTypedArray(a)?new a.constructor(a.subarray(b,void 0!==c?c:a.length)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:"number"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&& !(a instanceof DataView)},getKeyframeOrder:function(a){for(var b=a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a,b,c){for(var d=a.length,e=new a.constructor(d),f=0,g=0;g!==d;++f)for(var k=c[f]*b,h=0;h!==b;++h)e[g++]=a[k+h];return e},flattenJSON:function(a,b,c,d){for(var e=1,f=a[0];void 0!==f&&void 0===f[d];)f=a[e++];if(void 0!==f){var g=f[d];if(void 0!==g)if(Array.isArray(g)){do g=f[d],void 0!==g&&(b.push(f.time),c.push.apply(c,g)), f=a[e++];while(void 0!==f)}else if(void 0!==g.toArray){do g=f[d],void 0!==g&&(b.push(f.time),g.toArray(c,c.length)),f=a[e++];while(void 0!==f)}else{do g=f[d],void 0!==g&&(b.push(f.time),c.push(g)),f=a[e++];while(void 0!==f)}}},subclip:function(a,b,c,d,e){e=e||30;a=a.clone();a.name=b;var f=[];for(b=0;b=d))for(h.push(g.times[n]),p=0;pa.tracks[b].times[0]&&(c=a.tracks[b].times[0]);for(b=0;b=e)break a;else{f=b[1];a=e)break b}d=c;c=0}}for(;c>>1,ab;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=ea.arraySlice(c,e,f),this.values=ea.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var c=this.times;b=this.values;var d=c.length;0===d&&(console.error("THREE.KeyframeTrack: Track is empty.", 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&&ea.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;gg)e=a+1;else if(0b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(Q.clamp(d[h-1].dot(d[h]),-1,1)),e[h].applyMatrix4(k.makeRotationAxis(g,c))),f[h].crossVectors(d[h],e[h]);if(!0===b)for(c=Math.acos(Q.clamp(e[0].dot(e[a]),-1,1)),c/=a,0d;)d+=c;for(;d>c;)d-=c;db&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(O.clamp(d[h-1].dot(d[h]),-1,1)),e[h].applyMatrix4(k.makeRotationAxis(g,c))),f[h].crossVectors(d[h],e[h]);if(!0===b)for(c=Math.acos(O.clamp(e[0].dot(e[a]),-1,1)),c/=a,0d;)d+=c;for(;d>c;)d-=c;de&&(e=1);1E-4>d&&(d=e);1E-4>l&&(l=e);nh.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,l);oh.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,l);ph.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,l)}else"catmullrom"===this.curveType&&(nh.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),oh.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),ph.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(nh.calc(a),oh.calc(a),ph.calc(a));return b};Aa.prototype.copy=function(a){J.prototype.copy.call(this, -a);this.points=[];for(var b=0,c=a.points.length;bc.length-2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(hi(d,e.x,f.x,g.x,c.x),hi(d,e.y,f.y,g.y,c.y));return b};Za.prototype.copy=function(a){J.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;be&&(e=1);1E-4>d&&(d=e);1E-4>l&&(l=e);nh.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,l);oh.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,l);ph.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,l)}else"catmullrom"===this.curveType&&(nh.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),oh.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),ph.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(nh.calc(a),oh.calc(a),ph.calc(a));return b};Aa.prototype.copy=function(a){I.prototype.copy.call(this, +a);this.points=[];for(var b=0,c=a.points.length;bc.length-2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(hi(d,e.x,f.x,g.x,c.x),hi(d,e.y,f.y,g.y,c.y));return b};Za.prototype.copy=function(a){I.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.length-1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()}, getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[],b=0,c=0,d=this.curves.length;cNumber.EPSILON){if(0>l&&(g=b[f],k=-k,h=b[e],l=-l),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=l*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d} -var e=tb.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new Lb;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints());l=a?!l:l;h=[];var m=[],n=[],p=0;m[p]=void 0;n[p]=[];for(var r=0,t=f.length;rb;b++)this.coefficients[b].copy(a[b]);return this},zero:function(){for(var a=0;9>a;a++)this.coefficients[a].set(0,0,0);return this},getAt:function(a,b){var c=a.x,d=a.y;a=a.z;var e=this.coefficients;b.copy(e[0]).multiplyScalar(.282095); b.addScale(e[1],.488603*d);b.addScale(e[2],.488603*a);b.addScale(e[3],.488603*c);b.addScale(e[4],1.092548*c*d);b.addScale(e[5],1.092548*d*a);b.addScale(e[6],.315392*(3*a*a-1));b.addScale(e[7],1.092548*c*a);b.addScale(e[8],.546274*(c*c-d*d));return b},getIrradianceAt:function(a,b){var c=a.x,d=a.y;a=a.z;var e=this.coefficients;b.copy(e[0]).multiplyScalar(.886227);b.addScale(e[1],1.023328*d);b.addScale(e[2],1.023328*a);b.addScale(e[3],1.023328*c);b.addScale(e[4],.858086*c*d);b.addScale(e[5],.858086* d*a);b.addScale(e[6],.743125*a*a-.247708);b.addScale(e[7],.858086*c*a);b.addScale(e[8],.429043*(c*c-d*d));return b},add:function(a){for(var b=0;9>b;b++)this.coefficients[b].add(a.coefficients[b]);return this},scale:function(a){for(var b=0;9>b;b++)this.coefficients[b].multiplyScalar(a);return this},lerp:function(a,b){for(var c=0;9>c;c++)this.coefficients[c].lerp(a.coefficients[c],b);return this},equals:function(a){for(var b=0;9>b;b++)if(!this.coefficients[b].equals(a.coefficients[b]))return!1;return!0}, copy:function(a){return this.set(a.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(a,b){void 0===b&&(b=0);for(var c=this.coefficients,d=0;9>d;d++)c[d].fromArray(a,b+3*d);return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);for(var c=this.coefficients,d=0;9>d;d++)c[d].toArray(a,b+3*d);return a}});Object.assign(tf,{getBasisAt:function(a,b){var c=a.x,d=a.y;a=a.z;b[0]=.282095;b[1]=.488603*d;b[2]=.488603*a;b[3]=.488603*c;b[4]=1.092548*c*d; b[5]=1.092548*d*a;b[6]=.315392*(3*a*a-1);b[7]=1.092548*c*a;b[8]=.546274*(c*c-d*d)}});ab.prototype=Object.assign(Object.create(ba.prototype),{constructor:ab,isLightProbe:!0,copy:function(a){ba.prototype.copy.call(this,a);this.sh.copy(a.sh);this.intensity=a.intensity;return this},toJSON:function(a){return ba.prototype.toJSON.call(this,a)}});Fg.prototype=Object.assign(Object.create(ab.prototype),{constructor:Fg,isHemisphereLightProbe:!0,copy:function(a){ab.prototype.copy.call(this,a);return this},toJSON:function(a){return ab.prototype.toJSON.call(this, -a)}});Gg.prototype=Object.assign(Object.create(ab.prototype),{constructor:Gg,isAmbientLightProbe:!0,copy:function(a){ab.prototype.copy.call(this,a);return this},toJSON:function(a){return ab.prototype.toJSON.call(this,a)}});var $i=new R,aj=new R;Object.assign(ii.prototype,{update:function(a){var b=this._cache;if(b.focus!==a.focus||b.fov!==a.fov||b.aspect!==a.aspect*this.aspect||b.near!==a.near||b.far!==a.far||b.zoom!==a.zoom||b.eyeSep!==this.eyeSep){b.focus=a.focus;b.fov=a.fov;b.aspect=a.aspect*this.aspect; -b.near=a.near;b.far=a.far;b.zoom=a.zoom;b.eyeSep=this.eyeSep;var c=a.projectionMatrix.clone(),d=b.eyeSep/2,e=d*b.near/b.focus,f=b.near*Math.tan(Q.DEG2RAD*b.fov*.5)/b.zoom;aj.elements[12]=-d;$i.elements[12]=d;d=-f*b.aspect+e;var g=f*b.aspect+e;c.elements[0]=2*b.near/(g-d);c.elements[8]=(g+d)/(g-d);this.cameraL.projectionMatrix.copy(c);d=-f*b.aspect-e;g=f*b.aspect-e;c.elements[0]=2*b.near/(g-d);c.elements[8]=(g+d)/(g-d);this.cameraR.projectionMatrix.copy(c)}this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(aj); +a)}});Gg.prototype=Object.assign(Object.create(ab.prototype),{constructor:Gg,isAmbientLightProbe:!0,copy:function(a){ab.prototype.copy.call(this,a);return this},toJSON:function(a){return ab.prototype.toJSON.call(this,a)}});var $i=new P,aj=new P;Object.assign(ii.prototype,{update:function(a){var b=this._cache;if(b.focus!==a.focus||b.fov!==a.fov||b.aspect!==a.aspect*this.aspect||b.near!==a.near||b.far!==a.far||b.zoom!==a.zoom||b.eyeSep!==this.eyeSep){b.focus=a.focus;b.fov=a.fov;b.aspect=a.aspect*this.aspect; +b.near=a.near;b.far=a.far;b.zoom=a.zoom;b.eyeSep=this.eyeSep;var c=a.projectionMatrix.clone(),d=b.eyeSep/2,e=d*b.near/b.focus,f=b.near*Math.tan(O.DEG2RAD*b.fov*.5)/b.zoom;aj.elements[12]=-d;$i.elements[12]=d;d=-f*b.aspect+e;var g=f*b.aspect+e;c.elements[0]=2*b.near/(g-d);c.elements[8]=(g+d)/(g-d);this.cameraL.projectionMatrix.copy(c);d=-f*b.aspect-e;g=f*b.aspect-e;c.elements[0]=2*b.near/(g-d);c.elements[8]=(g+d)/(g-d);this.cameraR.projectionMatrix.copy(c)}this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(aj); this.cameraR.matrixWorld.copy(a.matrixWorld).multiply($i)}});Object.assign(Hg.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0},stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=("undefined"===typeof performance? Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});var yc=new n,bj=new Da,bl=new n,zc=new n;Ig.prototype=Object.assign(Object.create(D.prototype),{constructor:Ig,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null);return this},getFilter:function(){return this.filter},setFilter:function(a){null!== this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination);this.filter=a;this.gain.connect(this.filter);this.filter.connect(this.context.destination);return this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this},updateMatrixWorld:function(a){D.prototype.updateMatrixWorld.call(this,a);a=this.context.listener; @@ -885,9 +885,9 @@ this,a);return}a=a[f]}}f=a[d];if(void 0===f)console.error("THREE.PropertyBinding this);return}if(a.geometry.isBufferGeometry){if(!a.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}for(c=0;c=b){var n=b++,p=a[n];c[p.uuid]=m;a[m]=p;c[l]=n;a[n]=h;h=0;for(l=e;h!==l;++h){p=d[h];var r=p[m];p[m]=p[n];p[n]=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,m=d[l];if(void 0!==m)if(delete d[l],m=b){var n=b++,p=a[n];c[p.uuid]=m;a[m]=p;c[l]=n;a[n]=h;h=0;for(l=e;h!==l;++h){p=d[h];var q=p[m];p[m]=p[n];p[n]=q}}}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,m=d[l];if(void 0!==m)if(delete d[l],mthis.max.x||a.ythis.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 A);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.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new A);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){return dj.copy(a).clamp(this.min,this.max).sub(a).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.min.x||this.max.ythis.max.x||a.ythis.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 x);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.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new x);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){return dj.copy(a).clamp(this.min,this.max).sub(a).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)}});var ej=new n,Vf=new n;Object.assign(Rg.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},getCenter:function(a){void 0===a&&(console.warn("THREE.Line3: .getCenter() target is now required"), a=new n);return a.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){void 0===a&&(console.warn("THREE.Line3: .delta() target is now required"),a=new n);return a.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,b){void 0===b&&(console.warn("THREE.Line3: .at() target is now required"),b=new n);return this.delta(b).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(a, -b){ej.subVectors(a,this.start);Vf.subVectors(this.end,this.start);a=Vf.dot(Vf);a=Vf.dot(ej)/a;b&&(a=Q.clamp(a,0,1));return a},closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);void 0===c&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),c=new n);return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a);this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}}); +b){ej.subVectors(a,this.start);Vf.subVectors(this.end,this.start);a=Vf.dot(Vf);a=Vf.dot(ej)/a;b&&(a=O.clamp(a,0,1));return a},closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);void 0===c&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),c=new n);return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a);this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}}); te.prototype=Object.create(D.prototype);te.prototype.constructor=te;te.prototype.isImmediateRenderObject=!0;var fj=new n;id.prototype=Object.create(D.prototype);id.prototype.constructor=id;id.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};id.prototype.update=function(){this.light.updateMatrixWorld();var a=this.light.distance?this.light.distance:1E3,b=a*Math.tan(this.light.angle);this.cone.scale.set(b,b,a);fj.setFromMatrixPosition(this.light.target.matrixWorld); -this.cone.lookAt(fj);void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var Rb=new n,Wf=new R,th=new R;jd.prototype=Object.create(ma.prototype);jd.prototype.constructor=jd;jd.prototype.updateMatrixWorld=function(a){var b=this.bones,c=this.geometry,d=c.getAttribute("position");th.getInverse(this.root.matrixWorld);for(var e=0,f=0;eMath.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);D.prototype.updateMatrixWorld.call(this,a)};var kj=new n,yf,Sg;yb.prototype=Object.create(D.prototype);yb.prototype.constructor=yb;yb.prototype.setDirection=function(a){.99999a.y?this.quaternion.set(1,0,0,0):(kj.set(a.z, 0,-a.x).normalize(),this.quaternion.setFromAxisAngle(kj,Math.acos(a.y)))};yb.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(1E-4,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};yb.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};yb.prototype.copy=function(a){D.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone); -return this};yb.prototype.clone=function(){return(new this.constructor).copy(this)};xe.prototype=Object.create(ma.prototype);xe.prototype.constructor=xe;var lb=Math.pow(2,8),lj=[.125,.215,.35,.446,.526,.582],vi=5+lj.length,mb={3E3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},Vg=new gd,zf=function(a){var b=new Float32Array(a),c=new n(0,1,0);a=new vb({defines:{n:a},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:b},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:c}, +return this};yb.prototype.clone=function(){return(new this.constructor).copy(this)};xe.prototype=Object.create(la.prototype);xe.prototype.constructor=xe;var lb=Math.pow(2,8),lj=[.125,.215,.35,.446,.526,.582],vi=5+lj.length,mb={3E3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},Vg=new gd,zf=function(a){var b=new Float32Array(a),c=new n(0,1,0);a=new vb({defines:{n:a},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:b},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:c}, inputEncoding:{value:mb[3E3]},outputEncoding:{value:mb[3E3]}},vertexShader:Xg(),fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n"+Yg()+"\n\n#define ENVMAP_TYPE_CUBE_UV\n#include \n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t", blending:0,depthTest:!1,depthWrite:!1});a.type="SphericalGaussianBlur";return a}(20),Sb=null,Tb=null,uh=function(){for(var a=[],b=[],c=[],d=8,e=0;em;m++){var n=m%3*2/3-1,p=2p;p++)r=p%3,0==r?(c.up.set(0,d[p],0),c.lookAt(f[p],0,0)):1==r?(c.up.set(0,0,d[p]),c.lookAt(0,f[p],0)):(c.up.set(0,d[p],0),c.lookAt(0,0,f[p])),Wg(r*lb,2p;p++)q=p%3,0==q?(c.up.set(0,d[p],0),c.lookAt(f[p],0,0)):1==q?(c.up.set(0,0,d[p]),c.lookAt(0,f[p],0)):(c.up.set(0,d[p],0),c.lookAt(0,0,f[p])),Wg(q*lb,2