From 3a3d2b1e591ced02b5742c6f4dd5d62f457a760c Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Thu, 3 Oct 2019 11:16:10 +0200 Subject: [PATCH] Update builds. --- build/three.js | 96 ++++-- build/three.min.js | 709 +++++++++++++++++++++--------------------- build/three.module.js | 89 ++++-- 3 files changed, 497 insertions(+), 397 deletions(-) diff --git a/build/three.js b/build/three.js index 5ffcbf87c9..4af6a79769 100644 --- a/build/three.js +++ b/build/three.js @@ -266,6 +266,16 @@ var GreaterEqualStencilFunc = 518; var AlwaysStencilFunc = 519; + var StaticDrawUsage = 35044; + var DynamicDrawUsage = 35048; + var StreamDrawUsage = 35040; + var StaticReadUsage = 35045; + var DynamicReadUsage = 35049; + var StreamReadUsage = 35041; + var StaticCopyUsage = 35046; + var DynamicCopyUsage = 35050; + var StreamCopyUsage = 35042; + /** * https://github.com/mrdoob/eventdispatcher.js/ */ @@ -8858,7 +8868,7 @@ this.count = array !== undefined ? array.length / itemSize : 0; this.normalized = normalized === true; - this.dynamic = false; + this.usage = StaticDrawUsage; this.updateRange = { offset: 0, count: - 1 }; this.version = 0; @@ -8881,9 +8891,9 @@ onUploadCallback: function () {}, - setDynamic: function ( value ) { + setUsage: function ( value ) { - this.dynamic = value; + this.usage = value; return this; @@ -8897,7 +8907,7 @@ this.count = source.count; this.normalized = source.normalized; - this.dynamic = source.dynamic; + this.usage = source.usage; return this; @@ -14940,7 +14950,7 @@ function createBuffer( attribute, bufferType ) { var array = attribute.array; - var usage = attribute.dynamic ? 35048 : 35044; + var usage = attribute.usage; var buffer = gl.createBuffer(); @@ -15001,20 +15011,12 @@ gl.bindBuffer( bufferType, buffer ); - if ( attribute.dynamic === false ) { - - gl.bufferData( bufferType, array, 35044 ); - - } else if ( updateRange.count === - 1 ) { + if ( updateRange.count === - 1 ) { // Not using update ranges gl.bufferSubData( bufferType, 0, array ); - } else if ( updateRange.count === 0 ) { - - console.error( 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.' ); - } else { gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, @@ -25338,7 +25340,7 @@ if ( material.isShaderMaterial ) { - material.uniformsNeedUpdate = false; + material.uniformsNeedUpdate = false; // #15581 } @@ -26143,7 +26145,7 @@ this.stride = stride; this.count = array !== undefined ? array.length / stride : 0; - this.dynamic = false; + this.usage = StaticDrawUsage; this.updateRange = { offset: 0, count: - 1 }; this.version = 0; @@ -26166,9 +26168,9 @@ onUploadCallback: function () {}, - setDynamic: function ( value ) { + setUsage: function ( value ) { - this.dynamic = value; + this.usage = value; return this; @@ -26179,7 +26181,7 @@ this.array = new source.array.constructor( source.array ); this.count = source.count; this.stride = source.stride; - this.dynamic = source.dynamic; + this.usage = source.usage; return this; @@ -48368,13 +48370,33 @@ console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' ); return this.array.length; + } + }, + dynamic: { + get: function () { + + console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' ); + return this.usage === DynamicDrawUsage; + + }, + set: function ( value ) { + + console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' ); + this.setUsage( value ); + } } } ); Object.assign( BufferAttribute.prototype, { + setDynamic: function ( value ) { + console.warn( 'THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.' ); + this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage ); + return this; + + }, copyIndicesArray: function ( /* indices */ ) { console.error( 'THREE.BufferAttribute: .copyIndicesArray() has been removed.' ); @@ -48390,7 +48412,6 @@ return this; } - } ); Object.assign( BufferGeometry.prototype, { @@ -48452,8 +48473,33 @@ } ); + Object.defineProperties( InterleavedBuffer.prototype, { + + dynamic: { + get: function () { + + console.warn( 'THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.' ); + return this.usage === DynamicDrawUsage; + + }, + set: function ( value ) { + + console.warn( 'THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.' ); + this.setUsage( value ); + + } + } + + } ); + Object.assign( InterleavedBuffer.prototype, { + setDynamic: function ( value ) { + + console.warn( 'THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.' ); + this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage ); + return this; + }, setArray: function ( array ) { console.warn( 'THREE.InterleavedBuffer: .setArray has been deprecated. Use BufferGeometry .setAttribute to replace/resize attribute buffers' ); @@ -48464,7 +48510,6 @@ return this; } - } ); // @@ -49319,6 +49364,9 @@ exports.DstAlphaFactor = DstAlphaFactor; exports.DstColorFactor = DstColorFactor; exports.DynamicBufferAttribute = DynamicBufferAttribute; + exports.DynamicCopyUsage = DynamicCopyUsage; + exports.DynamicDrawUsage = DynamicDrawUsage; + exports.DynamicReadUsage = DynamicReadUsage; exports.EdgesGeometry = EdgesGeometry; exports.EdgesHelper = EdgesHelper; exports.EllipseCurve = EllipseCurve; @@ -49590,7 +49638,13 @@ exports.SrcAlphaFactor = SrcAlphaFactor; exports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor; exports.SrcColorFactor = SrcColorFactor; + exports.StaticCopyUsage = StaticCopyUsage; + exports.StaticDrawUsage = StaticDrawUsage; + exports.StaticReadUsage = StaticReadUsage; exports.StereoCamera = StereoCamera; + exports.StreamCopyUsage = StreamCopyUsage; + exports.StreamDrawUsage = StreamDrawUsage; + exports.StreamReadUsage = StreamReadUsage; exports.StringKeyframeTrack = StringKeyframeTrack; exports.SubtractEquation = SubtractEquation; exports.SubtractiveBlending = SubtractiveBlending; diff --git a/build/three.min.js b/build/three.min.js index a2b73eac1d..24c42026d0 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -1,4 +1,3 @@ -// threejs.org/license (function(k,Aa){"object"===typeof exports&&"undefined"!==typeof module?Aa(exports):"function"===typeof define&&define.amd?define(["exports"],Aa):(k=k||self,Aa(k.THREE={}))})(this,function(k){function Aa(){}function w(a,b){this.x=a||0;this.y=b||0}function wa(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 ea(){this.elements=[1,0,0,0,1,0,0,0,1];0h)return!1}return!0}function nb(a,b){this.center=void 0!==a?a:new n;this.radius=void 0!==b?b:0}function Sb(a,b){this.origin=void 0!==a?a:new n;this.direction=void 0!==b?b:new n}function V(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 H(a,b,c){return void 0===b&&void 0=== +a.length-3;g<=f;g+=3){Rb.fromArray(a,g);var h=e.x*Math.abs(Rb.x)+e.y*Math.abs(Rb.y)+e.z*Math.abs(Rb.z),l=b.dot(Rb),m=c.dot(Rb),t=d.dot(Rb);if(Math.max(-Math.max(l,m,t),Math.min(l,m,t))>h)return!1}return!0}function nb(a,b){this.center=void 0!==a?a:new n;this.radius=void 0!==b?b:0}function Sb(a,b){this.origin=void 0!==a?a:new n;this.direction=void 0!==b?b:new n}function V(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 H(a,b,c){return void 0===b&&void 0=== c?this.set(a):this.setRGB(a,b,c)}function Qf(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a}function Rf(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function Sf(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}function xc(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 H;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex= void 0!==f?f:0}function M(){Object.defineProperty(this,"id",{value:Si++});this.uuid=P.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.needsUpdate=!0}function Fa(a){M.call(this);this.type="MeshBasicMaterial";this.color= new H(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 N(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.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function vd(a,b,c){N.call(this,new Int8Array(a),b,c)}function wd(a,b,c){N.call(this,new Uint8Array(a),b,c)}function xd(a,b,c){N.call(this,new Uint8ClampedArray(a),b,c)}function yd(a,b,c){N.call(this,new Int16Array(a),b,c)}function Tb(a,b,c){N.call(this,new Uint16Array(a),b,c)}function zd(a,b,c){N.call(this,new Int32Array(a),b,c)}function Ub(a,b,c){N.call(this, +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 vd(a,b,c){N.call(this,new Int8Array(a),b,c)}function wd(a,b,c){N.call(this,new Uint8Array(a),b,c)}function xd(a,b,c){N.call(this,new Uint8ClampedArray(a),b,c)}function yd(a,b,c){N.call(this,new Int16Array(a),b,c)}function Tb(a,b,c){N.call(this,new Uint16Array(a),b,c)}function zd(a,b,c){N.call(this,new Int32Array(a),b,c)}function Ub(a,b,c){N.call(this, new Uint32Array(a),b,c)}function A(a,b,c){N.call(this,new Float32Array(a),b,c)}function Ad(a,b,c){N.call(this,new Float64Array(a),b,c)}function hh(){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 ih(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:Ti+=2});this.uuid=P.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function S(a,b){D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new F;this.material=void 0!==b?b:new Fa({color:16777215*Math.random()});this.drawMode= -0;this.updateMorphTargets()}function jh(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,f,g,2!==b.side,h)))return null;Ce.copy(h);Ce.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Ce);return bc.far?null:{distance:b,point:Ce.clone(),object:a}}function De(a,b,c,d,e,f,g,h,l,m,p){Vb.fromBufferAttribute(e,l);Wb.fromBufferAttribute(e,m);Xb.fromBufferAttribute(e,p);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Tf.set(0,0,0);Uf.set(0,0,0); -Vf.set(0,0,0);for(var u=0,t=f.length;uc.far?null:{distance:b,point:Ce.clone(),object:a}}function De(a,b,c,d,e,f,g,h,l,m,t){Vb.fromBufferAttribute(e,l);Wb.fromBufferAttribute(e,m);Xb.fromBufferAttribute(e,t);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Tf.set(0,0,0);Uf.set(0,0,0); +Vf.set(0,0,0);for(var q=0,u=f.length;qg;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function Ab(a,b,c){Ba.call(this,a,b,c)}function Zb(a,b,c,d,e,f,g,h,l,m,p,u){T.call(this,null,f,g,h,l,m,d,e,p,u);this.image={data:a||null, +this.add(h);var l=new ha(90,1,a,b);l.up.set(0,-1,0);l.lookAt(new n(0,0,1));this.add(l);var m=new ha(90,1,a,b);m.up.set(0,-1,0);m.lookAt(new n(0,0,-1));this.add(m);d=d||{format:1022,magFilter:1006,minFilter:1006};this.renderTarget=new Bb(c,c,d);this.renderTarget.texture.name="CubeCamera";this.update=function(a,b){null===this.parent&&this.updateMatrixWorld();var c=a.getRenderTarget(),d=this.renderTarget,t=d.texture.generateMipmaps;d.texture.generateMipmaps=!1;a.setRenderTarget(d,0);a.render(b,e);a.setRenderTarget(d, +1);a.render(b,f);a.setRenderTarget(d,2);a.render(b,g);a.setRenderTarget(d,3);a.render(b,h);a.setRenderTarget(d,4);a.render(b,l);d.texture.generateMipmaps=t;a.setRenderTarget(d,5);a.render(b,m);a.setRenderTarget(c)};this.clear=function(a,b,c,d){for(var e=a.getRenderTarget(),f=this.renderTarget,g=0;6>g;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function Bb(a,b,c){Ba.call(this,a,b,c)}function Zb(a,b,c,d,e,f,g,h,l,m,t,q){T.call(this,null,f,g,h,l,m,d,e,t,q);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 cb(a,b){this.normal=void 0!==a?a:new n(1,0,0);this.constant=void 0!==b?b:0}function Cd(a,b,c,d,e,f){this.planes=[void 0!==a?a:new cb,void 0!==b?b:new cb,void 0!==c?c:new cb,void 0!==d?d:new cb,void 0!==e?e:new cb,void 0!==f?f:new cb]}function Wf(){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 Vi(a){function b(b,c){var d=b.array,e=b.dynamic?35048:35044,h=a.createBuffer();a.bindBuffer(c,h);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:h,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(u=d[m])if(h=u[0],l=u[1]){p&&e.addAttribute("morphTarget"+m,p[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function fj(a,b,c,d){var e={};return{update:function(a){var f=d.render.frame,h=a.geometry,l=b.get(a,h);e[l.id]!==f&&(h.isGeometry&&l.updateFromObject(a),b.update(l),e[l.id]=f);a.isInstancedMesh&&c.update(a.instanceMatrix,34962);return l},dispose:function(){e={}}}}function ob(a,b,c,d,e,f,g,h,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,h,l,m);this.flipY=!1}function Cc(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 Dc(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 Ec(a,b,c){var d=a[0];if(0>=d||0");return a.replace(Zf,Yf)}function Ch(a,b,c,d){a="";for(b=parseInt(b);bm;m++){if(q=d[m])if(h=q[0],l=q[1]){t&&e.addAttribute("morphTarget"+m,t[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a, +"morphTargetInfluences",c)}}}function fj(a,b,c,d){var e={};return{update:function(a){var f=d.render.frame,h=a.geometry,l=b.get(a,h);e[l.id]!==f&&(h.isGeometry&&l.updateFromObject(a),b.update(l),e[l.id]=f);a.isInstancedMesh&&c.update(a.instanceMatrix,34962);return l},dispose:function(){e={}}}}function ob(a,b,c,d,e,f,g,h,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,h,l,m);this.flipY=!1}function Cc(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 Dc(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 Ec(a,b,c){var d=a[0];if(0>=d||0");return a.replace(Zf,Yf)}function Ch(a,b,c,d){a="";for(b=parseInt(b);bc;c++)b.probe.push(new n);var d=new n,e=new O,f=new O;return{setup:function(c,h,l){for(var g=0,p=0,u=0,k=0;9>k;k++)b.probe[k].set(0,0,0);var q=h=0,r=0,v=0,n=0,z=0,x=0,G=0;l=l.matrixWorldInverse;c.sort(dk);k=0;for(var U=c.length;kc;c++)b.probe.push(new n);var d=new n,e=new O,f=new O;return{setup:function(c,h,l){for(var g=0,t=0,q=0,k=0;9>k;k++)b.probe[k].set(0,0,0);var p=h=0,r=0,v=0,n=0,z=0,x=0,G=0;l=l.matrixWorldInverse;c.sort(dk);k=0;for(var U=c.length;kja;ja++)b.probe[ja].addScaledVector(B.sh.coefficients[ja],w);else if(B.isDirectionalLight){var I=a.get(B);I.color.copy(B.color).multiplyScalar(B.intensity);I.direction.setFromMatrixPosition(B.matrixWorld);d.setFromMatrixPosition(B.target.matrixWorld);I.direction.sub(d);I.direction.transformDirection(l);if(I.shadow=B.castShadow)w=B.shadow,I.shadowBias=w.bias,I.shadowRadius=w.radius,I.shadowMapSize=w.mapSize,b.directionalShadowMap[h]=ja,b.directionalShadowMatrix[h]=B.shadow.matrix,z++;b.directional[h]= I;h++}else if(B.isSpotLight){I=a.get(B);I.position.setFromMatrixPosition(B.matrixWorld);I.position.applyMatrix4(l);I.color.copy(Ha).multiplyScalar(w);I.distance=A;I.direction.setFromMatrixPosition(B.matrixWorld);d.setFromMatrixPosition(B.target.matrixWorld);I.direction.sub(d);I.direction.transformDirection(l);I.coneCos=Math.cos(B.angle);I.penumbraCos=Math.cos(B.angle*(1-B.penumbra));I.decay=B.decay;if(I.shadow=B.castShadow)w=B.shadow,I.shadowBias=w.bias,I.shadowRadius=w.radius,I.shadowMapSize=w.mapSize, b.spotShadowMap[r]=ja,b.spotShadowMatrix[r]=B.shadow.matrix,G++;b.spot[r]=I;r++}else if(B.isRectAreaLight)I=a.get(B),I.color.copy(Ha).multiplyScalar(w),I.position.setFromMatrixPosition(B.matrixWorld),I.position.applyMatrix4(l),f.identity(),e.copy(B.matrixWorld),e.premultiply(l),f.extractRotation(e),I.halfWidth.set(.5*B.width,0,0),I.halfHeight.set(0,.5*B.height,0),I.halfWidth.applyMatrix4(f),I.halfHeight.applyMatrix4(f),b.rectArea[v]=I,v++;else if(B.isPointLight){I=a.get(B);I.position.setFromMatrixPosition(B.matrixWorld); -I.position.applyMatrix4(l);I.color.copy(B.color).multiplyScalar(B.intensity);I.distance=B.distance;I.decay=B.decay;if(I.shadow=B.castShadow)w=B.shadow,I.shadowBias=w.bias,I.shadowRadius=w.radius,I.shadowMapSize=w.mapSize,I.shadowCameraNear=w.camera.near,I.shadowCameraFar=w.camera.far,b.pointShadowMap[q]=ja,b.pointShadowMatrix[q]=B.shadow.matrix,x++;b.point[q]=I;q++}else B.isHemisphereLight&&(I=a.get(B),I.direction.setFromMatrixPosition(B.matrixWorld),I.direction.transformDirection(l),I.direction.normalize(), -I.skyColor.copy(B.color).multiplyScalar(w),I.groundColor.copy(B.groundColor).multiplyScalar(w),b.hemi[n]=I,n++)}b.ambient[0]=g;b.ambient[1]=p;b.ambient[2]=u;c=b.hash;if(c.directionalLength!==h||c.pointLength!==q||c.spotLength!==r||c.rectAreaLength!==v||c.hemiLength!==n||c.numDirectionalShadows!==z||c.numPointShadows!==x||c.numSpotShadows!==G)b.directional.length=h,b.spot.length=r,b.rectArea.length=v,b.point.length=q,b.hemi.length=n,b.directionalShadowMap.length=z,b.pointShadowMap.length=x,b.spotShadowMap.length= -G,b.directionalShadowMatrix.length=z,b.pointShadowMatrix.length=x,b.spotShadowMatrix.length=G,c.directionalLength=h,c.pointLength=q,c.spotLength=r,c.rectAreaLength=v,c.hemiLength=n,c.numDirectionalShadows=z,c.numPointShadows=x,c.numSpotShadows=G,b.version=fk++},state:b}}function Gh(){var a=new ek,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 gk(){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 Gh;b.set(c,new WeakMap);b.get(c).set(d,e);c.addEventListener("dispose",a)}else!1===b.get(c).has(d)?(e=new Gh,b.get(c).set(d,e)):e=b.get(c).get(d);return e},dispose:function(){b=new WeakMap}}}function Cb(a){M.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 Db(a){M.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 Hh(a,b,c){function d(b,c,d,e,f,g){var h=b.geometry;var l=m;var t=b.customDepthMaterial; -d.isPointLight&&(l=p,t=b.customDistanceMaterial);t?l=t:(t=!1,c.morphTargets&&(h&&h.isBufferGeometry?t=h.morphAttributes&&h.morphAttributes.position&&0\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n \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 = decodeHalfRGBA ( 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 = pow( squared_mean - mean * mean, 0.5 );\n gl_FragColor = encodeHalfRGBA( vec2( mean, std_dev ) );\n}"}), -r=q.clone();r.defines.HORIZONAL_PASS=1;var v=new F;v.addAttribute("position",new N(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var n=new S(v,q);for(v=0;4!==v;++v){var z=0!==(v&1),x=0!==(v&2),G=new Cb({depthPacking:3201,morphTargets:z,skinning:x});m[v]=G;z=new Db({morphTargets:z,skinning:x});p[v]=z}var U=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,m,p){if(!1!==U.enabled&&(!1!==U.autoUpdate||!1!==U.needsUpdate)&&0!==d.length){var u=a.getRenderTarget(), -k=a.getActiveCubeFace(),t=a.getActiveMipmapLevel(),v=a.state;v.setBlending(0);v.buffers.color.setClear(1,1,1,1);v.buffers.depth.setTest(!0);v.setScissorTest(!1);for(var y=0,x=d.length;yc||g.y>c)console.warn("THREE.WebGLShadowMap:",z,"has shadow exceeding max texture size, reducing"),g.x>c&&(h.x=Math.floor(c/B.x), +I.position.applyMatrix4(l);I.color.copy(B.color).multiplyScalar(B.intensity);I.distance=B.distance;I.decay=B.decay;if(I.shadow=B.castShadow)w=B.shadow,I.shadowBias=w.bias,I.shadowRadius=w.radius,I.shadowMapSize=w.mapSize,I.shadowCameraNear=w.camera.near,I.shadowCameraFar=w.camera.far,b.pointShadowMap[p]=ja,b.pointShadowMatrix[p]=B.shadow.matrix,x++;b.point[p]=I;p++}else B.isHemisphereLight&&(I=a.get(B),I.direction.setFromMatrixPosition(B.matrixWorld),I.direction.transformDirection(l),I.direction.normalize(), +I.skyColor.copy(B.color).multiplyScalar(w),I.groundColor.copy(B.groundColor).multiplyScalar(w),b.hemi[n]=I,n++)}b.ambient[0]=g;b.ambient[1]=t;b.ambient[2]=q;c=b.hash;if(c.directionalLength!==h||c.pointLength!==p||c.spotLength!==r||c.rectAreaLength!==v||c.hemiLength!==n||c.numDirectionalShadows!==z||c.numPointShadows!==x||c.numSpotShadows!==G)b.directional.length=h,b.spot.length=r,b.rectArea.length=v,b.point.length=p,b.hemi.length=n,b.directionalShadowMap.length=z,b.pointShadowMap.length=x,b.spotShadowMap.length= +G,b.directionalShadowMatrix.length=z,b.pointShadowMatrix.length=x,b.spotShadowMatrix.length=G,c.directionalLength=h,c.pointLength=p,c.spotLength=r,c.rectAreaLength=v,c.hemiLength=n,c.numDirectionalShadows=z,c.numPointShadows=x,c.numSpotShadows=G,b.version=fk++},state:b}}function Gh(){var a=new ek,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 gk(){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 Gh;b.set(c,new WeakMap);b.get(c).set(d,e);c.addEventListener("dispose",a)}else!1===b.get(c).has(d)?(e=new Gh,b.get(c).set(d,e)):e=b.get(c).get(d);return e},dispose:function(){b=new WeakMap}}}function Db(a){M.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 Eb(a){M.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 Hh(a,b,c){function d(b,c,d,e,f,g){var h=b.geometry;var l=m;var u=b.customDepthMaterial; +d.isPointLight&&(l=t,u=b.customDistanceMaterial);u?l=u:(u=!1,c.morphTargets&&(h&&h.isBufferGeometry?u=h.morphAttributes&&h.morphAttributes.position&&0\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n \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 = decodeHalfRGBA ( 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 = pow( squared_mean - mean * mean, 0.5 );\n gl_FragColor = encodeHalfRGBA( vec2( mean, std_dev ) );\n}"}), +r=p.clone();r.defines.HORIZONAL_PASS=1;var v=new F;v.addAttribute("position",new N(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var n=new S(v,p);for(v=0;4!==v;++v){var z=0!==(v&1),x=0!==(v&2),G=new Db({depthPacking:3201,morphTargets:z,skinning:x});m[v]=G;z=new Eb({morphTargets:z,skinning:x});t[v]=z}var U=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,m,t){if(!1!==U.enabled&&(!1!==U.autoUpdate||!1!==U.needsUpdate)&&0!==d.length){var q=a.getRenderTarget(), +k=a.getActiveCubeFace(),u=a.getActiveMipmapLevel(),v=a.state;v.setBlending(0);v.buffers.color.setClear(1,1,1,1);v.buffers.depth.setTest(!0);v.setScissorTest(!1);for(var y=0,x=d.length;yc||g.y>c)console.warn("THREE.WebGLShadowMap:",z,"has shadow exceeding max texture size, reducing"),g.x>c&&(h.x=Math.floor(c/B.x), g.x=h.x*B.x,G.mapSize.x=h.x),g.y>c&&(h.y=Math.floor(c/B.y),g.y=h.y*B.y,G.mapSize.y=h.y);null!==G.map||G.isPointLightShadow||3!==this.type||(B={minFilter:1006,magFilter:1006,format:1023},G.map=new Ba(g.x,g.y,B),G.map.texture.name=z.name+".shadowMap",G.mapPass=new Ba(g.x,g.y,B),G.camera.updateProjectionMatrix());null===G.map&&(B={minFilter:1003,magFilter:1003,format:1023},G.map=new Ba(g.x,g.y,B),G.map.texture.name=z.name+".shadowMap",G.camera.updateProjectionMatrix());a.setRenderTarget(G.map);a.clear(); -B=G.getViewportCount();for(var w=0;wd||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?P.floorPowerOfTwo:Math.floor, -b=d(e*a.width),e=d(e*a.height),void 0===E&&(E=h(b,e)),c=c?h(b,e):E,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 P.isPowerOfTwo(a.width)&&P.isPowerOfTwo(a.height)}function p(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!== -a.minFilter}function u(b,c,e,f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function k(a,c){if(!1===ja)return a;var d=a;6403===a&&(5126===c&&(d=33326),5131===c&&(d=33325),5121===c&&(d=33321));6407===a&&(5126===c&&(d=34837),5131===c&&(d=34843),5121===c&&(d=32849));6408===a&&(5126===c&&(d=34836),5131===c&&(d=34842),5121===c&&(d=32856));33325===d||33326===d||34842===d||34836===d?b.get("EXT_color_buffer_float"):(34843===d||34837===d)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."); -return d}function q(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&&C.delete(b);g.memory.textures--}function v(b){b=b.target;b.removeEventListener("dispose",v);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= +b=d(e*a.width),e=d(e*a.height),void 0===E&&(E=h(b,e)),c=c?h(b,e):E,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 P.isPowerOfTwo(a.width)&&P.isPowerOfTwo(a.height)}function t(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!== +a.minFilter}function q(b,c,e,f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function k(a,c){if(!1===ja)return a;var d=a;6403===a&&(5126===c&&(d=33326),5131===c&&(d=33325),5121===c&&(d=33321));6407===a&&(5126===c&&(d=34837),5131===c&&(d=34843),5121===c&&(d=32849));6408===a&&(5126===c&&(d=34836),5131===c&&(d=34842),5121===c&&(d=32856));33325===d||33326===d||34842===d||34836===d?b.get("EXT_color_buffer_float"):(34843===d||34837===d)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."); +return d}function p(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&&C.delete(b);g.memory.textures--}function v(b){b=b.target;b.removeEventListener("dispose",v);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;er;r++)t[r]=h||e?e?b.image[r].image:b.image[r]:l(b.image[r],!1,!0,F);var q=t[0],v=m(q)||ja,n=f.convert(b.format),y=f.convert(b.type),x=k(n,y);G(34067,b,v);if(h){for(r=0;6>r;r++){var z=t[r].mipmaps;for(h=0;hr;r++)if(e)for(c.texImage2D(34069+r,0,x,t[r].width,t[r].height,0,n,y,t[r].data),h=0;hr;r++)u[r]=h||e?e?b.image[r].image:b.image[r]:l(b.image[r],!1,!0,F);var p=u[0],v=m(p)||ja,n=f.convert(b.format),y=f.convert(b.type),x=k(n,y);G(34067,b,v);if(h){for(r=0;6>r;r++){var z=u[r].mipmaps;for(h=0;hr;r++)if(e)for(c.texImage2D(34069+r,0,x,u[r].width,u[r].height,0,n,y,u[r].data),h=0;h=I&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+I);M+=1;return a};this.resetTextureUnits=function(){M=0};this.setTexture2D=n;this.setTexture2DArray=function(a,b){var e=d.get(a);0x;x++)h.__webglFramebuffer[x]=a.createFramebuffer()}else if(h.__webglFramebuffer= -a.createFramebuffer(),t)if(ja){h.__webglMultisampledFramebuffer=a.createFramebuffer();h.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,h.__webglColorRenderbuffer);t=f.convert(e.texture.format);var z=f.convert(e.texture.type);t=k(t,z);z=D(e);a.renderbufferStorageMultisample(36161,z,t,e.width,e.height);a.bindFramebuffer(36160,h.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,h.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);e.depthBuffer&& -(h.__webglDepthRenderbuffer=a.createRenderbuffer(),A(h.__webglDepthRenderbuffer,e,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(q){x=e.width;var B=e.height;t=e.numViews;a.bindFramebuffer(36160,h.__webglFramebuffer);var U=b.get("OVR_multiview2");g.memory.textures+=2;z=a.createTexture();a.bindTexture(35866,z);a.texParameteri(35866,10240,9728);a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,32856, -x,B,t,0,6408,5121,null);U.framebufferTextureMultiviewOVR(36160,36064,z,0,0,t);var I=a.createTexture();a.bindTexture(35866,I);a.texParameteri(35866,10240,9728);a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,35056,x,B,t,0,34041,34042,null);U.framebufferTextureMultiviewOVR(36160,33306,I,0,0,t);B=Array(t);for(x=0;xx;x++)w(h.__webglFramebuffer[x],e,36064,34069+x);p(e.texture,y)&&u(34067,e.texture,e.width,e.height);c.bindTexture(34067,null)}else q||(c.bindTexture(3553,l.__webglTexture),G(3553,e.texture,y),w(h.__webglFramebuffer,e,36064,3553),p(e.texture,y)&&u(3553,e.texture,e.width,e.height),c.bindTexture(3553,null));if(e.depthBuffer){h=d.get(e);l=!0===e.isWebGLRenderTargetCube; +b),c.bindTexture(32879,e.__webglTexture))};this.setTextureCube=z;this.setTextureCubeDynamic=x;this.setupRenderTarget=function(e){var h=d.get(e),l=d.get(e.texture);e.addEventListener("dispose",v);l.__webglTexture=a.createTexture();g.memory.textures++;var r=!0===e.isWebGLRenderTargetCube,u=!0===e.isWebGLMultisampleRenderTarget,p=!0===e.isWebGLMultiviewRenderTarget,y=m(e)||ja;if(r){h.__webglFramebuffer=[];for(var x=0;6>x;x++)h.__webglFramebuffer[x]=a.createFramebuffer()}else if(h.__webglFramebuffer= +a.createFramebuffer(),u)if(ja){h.__webglMultisampledFramebuffer=a.createFramebuffer();h.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,h.__webglColorRenderbuffer);u=f.convert(e.texture.format);var z=f.convert(e.texture.type);u=k(u,z);z=D(e);a.renderbufferStorageMultisample(36161,z,u,e.width,e.height);a.bindFramebuffer(36160,h.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,h.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);e.depthBuffer&& +(h.__webglDepthRenderbuffer=a.createRenderbuffer(),A(h.__webglDepthRenderbuffer,e,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(p){x=e.width;var B=e.height;u=e.numViews;a.bindFramebuffer(36160,h.__webglFramebuffer);var U=b.get("OVR_multiview2");g.memory.textures+=2;z=a.createTexture();a.bindTexture(35866,z);a.texParameteri(35866,10240,9728);a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,32856, +x,B,u,0,6408,5121,null);U.framebufferTextureMultiviewOVR(36160,36064,z,0,0,u);var I=a.createTexture();a.bindTexture(35866,I);a.texParameteri(35866,10240,9728);a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,35056,x,B,u,0,34041,34042,null);U.framebufferTextureMultiviewOVR(36160,33306,I,0,0,u);B=Array(u);for(x=0;xx;x++)w(h.__webglFramebuffer[x],e,36064,34069+x);t(e.texture,y)&&q(34067,e.texture,e.width,e.height);c.bindTexture(34067,null)}else p||(c.bindTexture(3553,l.__webglTexture),G(3553,e.texture,y),w(h.__webglFramebuffer,e,36064,3553),t(e.texture,y)&&q(3553,e.texture,e.width,e.height),c.bindTexture(3553,null));if(e.depthBuffer){h=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,h.__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);h=d.get(e.depthTexture).__webglTexture;if(1026===e.depthTexture.format)a.framebufferTexture2D(36160,36096,3553,h,0);else if(1027===e.depthTexture.format)a.framebufferTexture2D(36160,33306,3553,h,0);else throw Error("Unknown depthTexture format");}else if(l)for(h.__webglDepthbuffer=[],l=0;6>l;l++)a.bindFramebuffer(36160,h.__webglFramebuffer[l]),h.__webglDepthbuffer[l]=a.createRenderbuffer(),A(h.__webglDepthbuffer[l], -e);else a.bindFramebuffer(36160,h.__webglFramebuffer),h.__webglDepthbuffer=a.createRenderbuffer(),A(h.__webglDepthbuffer,e);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture,e=m(a)||ja;if(p(b,e)){e=a.isWebGLRenderTargetCube?34067:3553;var f=d.get(b).__webglTexture;c.bindTexture(e,f);u(e,b,a.width,a.height);c.bindTexture(e,null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(ja){var c=d.get(b);a.bindFramebuffer(36008, +e);else a.bindFramebuffer(36160,h.__webglFramebuffer),h.__webglDepthbuffer=a.createRenderbuffer(),A(h.__webglDepthbuffer,e);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture,e=m(a)||ja;if(t(b,e)){e=a.isWebGLRenderTargetCube?34067:3553;var f=d.get(b).__webglTexture;c.bindTexture(e,f);q(e,b,a.width,a.height);c.bindTexture(e,null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(ja){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===O&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."), O=!0),a=a.texture);n(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLRenderTargetCube&&(!1===ca&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),ca=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?z(a,b):x(a,b)}}function Ih(a,b,c){var d=c.isWebGL2;return{convert:function(a){if(1E3===a)return 10497;if(1001===a)return 33071;if(1002===a)return 33648;if(1003===a)return 9728; if(1004===a)return 9984;if(1005===a)return 9986;if(1006===a)return 9729;if(1007===a)return 9985;if(1008===a)return 9987;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");if(null!==c)return c.HALF_FLOAT_OES}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(100===a)return 32774;if(101===a)return 32778;if(102===a)return 32779;if(200===a)return 0;if(201===a)return 1;if(202===a)return 768;if(203===a)return 769;if(204===a)return 770;if(205===a)return 771;if(206===a)return 772;if(207===a)return 773;if(208===a)return 774;if(209===a)return 775;if(210===a)return 776;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}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}if(36196===a&&(c=b.get("WEBGL_compressed_texture_etc1"),null!==c))return c.COMPRESSED_RGB_ETC1_WEBGL;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)if(c=b.get("WEBGL_compressed_texture_astc"),null!==c)return a;if(103===a||104===a){if(d){if(103===a)return 32775;if(104===a)return 32776}c=b.get("EXT_blend_minmax");if(null!==c){if(103===a)return c.MIN_EXT; -if(104===a)return c.MAX_EXT}}if(1020===a){if(d)return 34042;c=b.get("WEBGL_depth_texture");if(null!==c)return c.UNSIGNED_INT_24_8_WEBGL}return 0}}}function dg(a,b,c,d){Ba.call(this,a,b,d);this.stencilBuffer=this.depthBuffer=!1;this.numViews=c}function kk(a,b){function c(a){if(a.isArrayCamera)return a.cameras;p[0]=a;return p}function d(a){if(void 0===a.isArrayCamera)return!0;a=a.cameras;if(a.length>q)return!1;for(var b=1,c=a.length;bp)return!1;for(var b=1,c=a.length;bf.matrixWorld.determinant();aa.setMaterial(e,h);var l=t(a,c,e,f),m=!1;if(b!==d.id||ka!==l.id||T!==(!0===e.wireframe))b=d.id,ka=l.id,T=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(ya.update(f,d,e,l),m=!0);h=d.index;var p=d.attributes.position;c=1;!0===e.wireframe&&(h=xa.getWireframeAttribute(d),c=2);a=Aa;if(null!==h){var u=ra.get(h);a=Ba;a.setIndex(u)}if(m){if(!1!==Ea.isWebGL2|| -!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==qa.get("ANGLE_instanced_arrays")){aa.initAttributes();m=d.attributes;l=l.getAttributes();var k=e.defaultAttributeValues;for(w in l){var q=l[w];if(0<=q){var r=m[w];if(void 0!==r){var n=r.normalized,v=r.itemSize,y=ra.get(r);if(void 0!==y){var x=y.buffer,z=y.type;y=y.bytesPerElement;if(r.isInterleavedBufferAttribute){var B=r.data,G=B.stride;r=r.offset;B&&B.isInstancedInterleavedBuffer?(aa.enableAttributeAndDivisor(q,B.meshPerAttribute),void 0=== -d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):aa.enableAttribute(q);J.bindBuffer(34962,x);J.vertexAttribPointer(q,v,z,n,G*y,r*y)}else r.isInstancedBufferAttribute?(aa.enableAttributeAndDivisor(q,r.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=r.meshPerAttribute*r.count)):aa.enableAttribute(q),J.bindBuffer(34962,x),J.vertexAttribPointer(q,v,z,n,0,0)}}else if("instanceMatrix"===w)y=ra.get(f.instanceMatrix),void 0!==y&&(x=y.buffer,z=y.type,aa.enableAttributeAndDivisor(q+ -0,1),aa.enableAttributeAndDivisor(q+1,1),aa.enableAttributeAndDivisor(q+2,1),aa.enableAttributeAndDivisor(q+3,1),J.bindBuffer(34962,x),J.vertexAttribPointer(q+0,4,z,!1,64,0),J.vertexAttribPointer(q+1,4,z,!1,64,16),J.vertexAttribPointer(q+2,4,z,!1,64,32),J.vertexAttribPointer(q+3,4,z,!1,64,48));else if(void 0!==k&&(n=k[w],void 0!==n))switch(n.length){case 2:J.vertexAttrib2fv(q,n);break;case 3:J.vertexAttrib3fv(q,n);break;case 4:J.vertexAttrib4fv(q,n);break;default:J.vertexAttrib1fv(q,n)}}}aa.disableUnusedAttributes()}null!== -h&&J.bindBuffer(34963,u.buffer)}u=Infinity;null!==h?u=h.count:void 0!==p&&(u=p.count);h=d.drawRange.start*c;p=null!==g?g.start*c:0;var w=Math.max(h,p);g=Math.max(0,Math.min(u,h+d.drawRange.count*c,p+(null!==g?g.count*c:Infinity))-1-w+1);if(0!==g){if(f.isMesh)if(!0===e.wireframe)aa.setLineWidth(e.wireframeLinewidth*(null===X?fa:1)),a.setMode(1);else switch(f.drawMode){case 0:a.setMode(4);break;case 1:a.setMode(5);break;case 2:a.setMode(6)}else f.isLine?(e=e.linewidth,void 0===e&&(e=1),aa.setLineWidth(e* +aa.disableUnusedAttributes();J.drawArrays(4,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f,g){var h=f.isMesh&&0>f.matrixWorld.determinant();aa.setMaterial(e,h);var l=u(a,c,e,f),m=!1;if(b!==d.id||ka!==l.id||T!==(!0===e.wireframe))b=d.id,ka=l.id,T=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(ya.update(f,d,e,l),m=!0);h=d.index;var t=d.attributes.position;c=1;!0===e.wireframe&&(h=xa.getWireframeAttribute(d),c=2);a=Aa;if(null!==h){var k=ra.get(h);a=Ba;a.setIndex(k)}if(m){if(!1!==Ea.isWebGL2|| +!f.isInstancedMesh&&!d.isInstancedBufferGeometry||null!==qa.get("ANGLE_instanced_arrays")){aa.initAttributes();m=d.attributes;l=l.getAttributes();var q=e.defaultAttributeValues;for(w in l){var p=l[w];if(0<=p){var r=m[w];if(void 0!==r){var n=r.normalized,v=r.itemSize,y=ra.get(r);if(void 0!==y){var x=y.buffer,z=y.type;y=y.bytesPerElement;if(r.isInterleavedBufferAttribute){var B=r.data,G=B.stride;r=r.offset;B&&B.isInstancedInterleavedBuffer?(aa.enableAttributeAndDivisor(p,B.meshPerAttribute),void 0=== +d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):aa.enableAttribute(p);J.bindBuffer(34962,x);J.vertexAttribPointer(p,v,z,n,G*y,r*y)}else r.isInstancedBufferAttribute?(aa.enableAttributeAndDivisor(p,r.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=r.meshPerAttribute*r.count)):aa.enableAttribute(p),J.bindBuffer(34962,x),J.vertexAttribPointer(p,v,z,n,0,0)}}else if("instanceMatrix"===w)y=ra.get(f.instanceMatrix),void 0!==y&&(x=y.buffer,z=y.type,aa.enableAttributeAndDivisor(p+ +0,1),aa.enableAttributeAndDivisor(p+1,1),aa.enableAttributeAndDivisor(p+2,1),aa.enableAttributeAndDivisor(p+3,1),J.bindBuffer(34962,x),J.vertexAttribPointer(p+0,4,z,!1,64,0),J.vertexAttribPointer(p+1,4,z,!1,64,16),J.vertexAttribPointer(p+2,4,z,!1,64,32),J.vertexAttribPointer(p+3,4,z,!1,64,48));else if(void 0!==q&&(n=q[w],void 0!==n))switch(n.length){case 2:J.vertexAttrib2fv(p,n);break;case 3:J.vertexAttrib3fv(p,n);break;case 4:J.vertexAttrib4fv(p,n);break;default:J.vertexAttrib1fv(p,n)}}}aa.disableUnusedAttributes()}null!== +h&&J.bindBuffer(34963,k.buffer)}k=Infinity;null!==h?k=h.count:void 0!==t&&(k=t.count);h=d.drawRange.start*c;t=null!==g?g.start*c:0;var w=Math.max(h,t);g=Math.max(0,Math.min(k,h+d.drawRange.count*c,t+(null!==g?g.count*c:Infinity))-1-w+1);if(0!==g){if(f.isMesh)if(!0===e.wireframe)aa.setLineWidth(e.wireframeLinewidth*(null===X?fa:1)),a.setMode(1);else switch(f.drawMode){case 0:a.setMode(4);break;case 1:a.setMode(5);break;case 2:a.setMode(6)}else f.isLine?(e=e.linewidth,void 0===e&&(e=1),aa.setLineWidth(e* (null===X?fa:1)),f.isLineSegments?a.setMode(1):f.isLineLoop?a.setMode(2):a.setMode(3)):f.isPoints?a.setMode(0):f.isSprite&&a.setMode(4);f.isInstancedMesh?a.renderInstances(d,w,g,f.count):d.isInstancedBufferGeometry?a.renderInstances(d,w,g,d.maxInstancedCount):a.render(w,g)}};this.compile=function(a,b){C=va.get(a,b);C.init();a.traverse(function(a){a.isLight&&(C.pushLight(a),a.castShadow&&C.pushShadow(a))});C.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(h),point:c,index:b,face:null,object:g}))}function kg(a,b,c,d,e,f,g,h,l){T.call(this,a,b,c,d,e,f,g,h,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 Jc(a,b,c,d,e,f,g,h,l,m,p,u){T.call(this,null,f,g,h,l,m,d,e,p,u);this.image={width:b,height:c}; +jg.distanceSqToPoint(a);he.far||f.push({distance:a,distanceToRay:Math.sqrt(h),point:c,index:b,face:null,object:g}))}function kg(a,b,c,d,e,f,g,h,l){T.call(this,a,b,c,d,e,f,g,h,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 Jc(a,b,c,d,e,f,g,h,l,m,t,k){T.call(this,null,f,g,h,l,m,d,e,t,k);this.image={width:b,height:c}; this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Nd(a,b,c,d,e,f,g,h,l){T.call(this,a,b,c,d,e,f,g,h,l);this.needsUpdate=!0}function Od(a,b,c,d,e,f,g,h,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,h,m,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==h?h:1003;this.generateMipmaps= -this.flipY=!1}function Kc(a){F.call(this);this.type="WireframeGeometry";var b=[],c,d,e,f=[0,0],g={},h=["a","b","c"];if(a&&a.isGeometry){var l=a.faces;var m=0;for(d=l.length;mc;c++){var u=p[h[c]];var k=p[h[(c+1)%3]];f[0]=Math.min(u,k);f[1]=Math.max(u,k);u=f[0]+","+f[1];void 0===g[u]&&(g[u]={index1:f[0],index2:f[1]})}}for(u in g)m=g[u],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isBufferGeometry)if(h=new n,null!==a.index){l= -a.attributes.position;p=a.index;var q=a.groups;0===q.length&&(q=[{start:0,count:p.count,materialIndex:0}]);a=0;for(e=q.length;ac;c++)u=p.getX(m+c),k=p.getX(m+(c+1)%3),f[0]=Math.min(u,k),f[1]=Math.max(u,k),u=f[0]+","+f[1],void 0===g[u]&&(g[u]={index1:f[0],index2:f[1]});for(u in g)m=g[u],h.fromBufferAttribute(l,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(l,m.index2),b.push(h.x,h.y,h.z)}else for(l=a.attributes.position,m=0,d= +this.flipY=!1}function Kc(a){F.call(this);this.type="WireframeGeometry";var b=[],c,d,e,f=[0,0],g={},h=["a","b","c"];if(a&&a.isGeometry){var l=a.faces;var m=0;for(d=l.length;mc;c++){var k=t[h[c]];var u=t[h[(c+1)%3]];f[0]=Math.min(k,u);f[1]=Math.max(k,u);k=f[0]+","+f[1];void 0===g[k]&&(g[k]={index1:f[0],index2:f[1]})}}for(k in g)m=g[k],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isBufferGeometry)if(h=new n,null!==a.index){l= +a.attributes.position;t=a.index;var p=a.groups;0===p.length&&(p=[{start:0,count:t.count,materialIndex:0}]);a=0;for(e=p.length;ac;c++)k=t.getX(m+c),u=t.getX(m+(c+1)%3),f[0]=Math.min(k,u),f[1]=Math.max(k,u),k=f[0]+","+f[1],void 0===g[k]&&(g[k]={index1:f[0],index2:f[1]});for(k in g)m=g[k],h.fromBufferAttribute(l,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(l,m.index2),b.push(h.x,h.y,h.z)}else for(l=a.attributes.position,m=0,d= l.count/3;mc;c++)g=3*m+c,h.fromBufferAttribute(l,g),b.push(h.x,h.y,h.z),g=3*m+(c+1)%3,h.fromBufferAttribute(l,g),b.push(h.x,h.y,h.z);this.addAttribute("position",new A(b,3))}function Pd(a,b,c){E.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Lc(a,b,c));this.mergeVertices()}function Lc(a,b,c){F.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new n, -l=new n,m=new n,p=new n,k=new n,t,q;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var r=b+1;for(t=0;t<=c;t++){var v=t/c;for(q=0;q<=b;q++){var y=q/b;a(y,v,l);e.push(l.x,l.y,l.z);0<=y-1E-5?(a(y-1E-5,v,m),p.subVectors(l,m)):(a(y+1E-5,v,m),p.subVectors(m,l));0<=v-1E-5?(a(y,v-1E-5,m),k.subVectors(l,m)):(a(y,v+1E-5,m),k.subVectors(m,l));h.crossVectors(p,k).normalize();f.push(h.x,h.y,h.z);g.push(y,v)}}for(t=0;ta.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var r=b+1;for(u=0;u<=c;u++){var v=u/c;for(p=0;p<=b;p++){var y=p/b;a(y,v,l);e.push(l.x,l.y,l.z);0<=y-1E-5?(a(y-1E-5,v,m),t.subVectors(l,m)):(a(y+1E-5,v,m),t.subVectors(m,l));0<=v-1E-5?(a(y,v-1E-5,m),k.subVectors(l,m)):(a(y,v+1E-5,m),k.subVectors(m,l));h.crossVectors(t,k).normalize();f.push(h.x,h.y,h.z);g.push(y,v)}}for(u=0;ud&&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 h=[],l=[];(function(a){for(var c=new n,d=new n,g=new n,h=0;he&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.addAttribute("position", @@ -246,49 +244,49 @@ new A(h,3));this.addAttribute("normal",new A(h.slice(),3));this.addAttribute("uv this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ac(a,b));this.mergeVertices()}function ac(a,b){Da.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 Td(a,b){E.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Nc(a,b));this.mergeVertices()}function Nc(a,b){var c= (1+Math.sqrt(5))/2;Da.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 Ud(a,b){E.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Oc(a,b));this.mergeVertices()}function Oc(a,b){var c= (1+Math.sqrt(5))/2,d=1/c;Da.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 Vd(a,b,c,d,e,f){E.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 bc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function bc(a,b,c,d,e){function f(e){p=a.getPointAt(e/b,p);var f=g.normals[e];e=g.binormals[e];for(t=0;t<=d;t++){var m=t/d*Math.PI* -2,k=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+k*e.x;l.y=m*f.y+k*e.y;l.z=m*f.z+k*e.z;l.normalize();r.push(l.x,l.y,l.z);h.x=p.x+c*l.x;h.y=p.y+c*l.y;h.z=p.z+c*l.z;q.push(h.x,h.y,h.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 h=new n,l=new n,m=new w,p=new n,k,t,q=[],r=[],v=[],y=[];for(k= -0;k=b;e-=d)f=Qh(e,a[e],a[e+1],f);f&&cc(f,f.next)&&(Yd(f),f=f.next);return f}function Zd(a,b){if(!a)return a; -b||(b=a);do{var c=!1;if(a.steiner||!cc(a,a.next)&&0!==xa(a.prev,a,a.next))a=a.next;else{Yd(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function $d(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=lg(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==h);l.prevZ.nextZ=null;l.prevZ=null;h=l;var m,p,k,t,q=1;do{l=h;var r=h=null;for(p=0;l;){p++;var n=l;for(m=k=0;mn!==r.next.y>n&&r.next.y!==r.y&&k<(r.next.x- -r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(p=!p),r=r.next;while(r!==l);r=p}l=r}if(l){a=Sh(g,h);g=Zd(g,g.next);a=Zd(a,a.next);$d(g,b,c,d,e,f);$d(a,b,c,d,e,f);break a}h=h.next}g=g.next}while(g!==a)}break}}}}function lk(a,b,c,d){var e=a.prev,f=a.next;if(0<=xa(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,h=e.y>a.y?e.y>f.y?e.y:f.y:a.y>f.y?a.y:f.y,l=lg(e.x=l&&d&&d.z<= +64;d=Math.floor(d)||8;e=e||2;f=f||3;var h=[],l=[],m=[],t=[],k,u=new n,p=new n,r=new n,v=new n,y=new n,z=new n,x=new n;for(k=0;k<=c;++k){var w=k/c*e*Math.PI*2;g(w,e,f,a,r);g(w+.01,e,f,a,v);z.subVectors(v,r);x.addVectors(v,r);y.crossVectors(z,x);x.crossVectors(y,z);y.normalize();x.normalize();for(w=0;w<=d;++w){var U=w/d*Math.PI*2,B=-b*Math.cos(U);U=b*Math.sin(U);u.x=r.x+(B*x.x+U*y.x);u.y=r.y+(B*x.y+U*y.y);u.z=r.z+(B*x.z+U*y.z);l.push(u.x,u.y,u.z);p.subVectors(u,r).normalize();m.push(p.x,p.y,p.z);t.push(k/ +c);t.push(w/d)}}for(w=1;w<=c;w++)for(k=1;k<=d;k++)a=(d+1)*w+(k-1),b=(d+1)*w+k,e=(d+1)*(w-1)+k,h.push((d+1)*(w-1)+(k-1),a,e),h.push(a,b,e);this.setIndex(h);this.addAttribute("position",new A(l,3));this.addAttribute("normal",new A(m,3));this.addAttribute("uv",new A(t,2))}function Xd(a,b,c,d,e){E.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};this.fromBufferGeometry(new Qc(a,b,c,d,e));this.mergeVertices()}function Qc(a,b,c,d,e){F.call(this); +this.type="TorusBufferGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||1;b=b||.4;c=Math.floor(c)||8;d=Math.floor(d)||6;e=e||2*Math.PI;var f=[],g=[],h=[],l=[],m=new n,t=new n,k=new n,u,p;for(u=0;u<=c;u++)for(p=0;p<=d;p++){var r=p/d*e,v=u/c*Math.PI*2;t.x=(a+b*Math.cos(v))*Math.cos(r);t.y=(a+b*Math.cos(v))*Math.sin(r);t.z=b*Math.sin(v);g.push(t.x,t.y,t.z);m.x=a*Math.cos(r);m.y=a*Math.sin(r);k.subVectors(t,m).normalize();h.push(k.x,k.y,k.z);l.push(p/d);l.push(u/ +c)}for(u=1;u<=c;u++)for(p=1;p<=d;p++)a=(d+1)*(u-1)+p-1,b=(d+1)*(u-1)+p,e=(d+1)*u+p,f.push((d+1)*u+p-1,a,e),f.push(a,b,e);this.setIndex(f);this.addAttribute("position",new A(g,3));this.addAttribute("normal",new A(h,3));this.addAttribute("uv",new A(l,2))}function Ph(a,b,c,d,e){for(var f,g=0,h=b,l=c-d;h=b;e-=d)f=Qh(e,a[e],a[e+1],f);f&&cc(f,f.next)&&(Yd(f),f=f.next);return f}function Zd(a,b){if(!a)return a; +b||(b=a);do{var c=!1;if(a.steiner||!cc(a,a.next)&&0!==xa(a.prev,a,a.next))a=a.next;else{Yd(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function $d(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=lg(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==h);l.prevZ.nextZ=null;l.prevZ=null;h=l;var m,t,k,u,p=1;do{l=h;var r=h=null;for(t=0;l;){t++;var n=l;for(m=k=0;mn!==r.next.y>n&&r.next.y!==r.y&&k<(r.next.x- +r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(t=!t),r=r.next;while(r!==l);r=t}l=r}if(l){a=Sh(g,h);g=Zd(g,g.next);a=Zd(a,a.next);$d(g,b,c,d,e,f);$d(a,b,c,d,e,f);break a}h=h.next}g=g.next}while(g!==a)}break}}}}function lk(a,b,c,d){var e=a.prev,f=a.next;if(0<=xa(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,h=e.y>a.y?e.y>f.y?e.y:f.y:a.y>f.y?a.y:f.y,l=lg(e.x=l&&d&&d.z<= b;){if(c!==a.prev&&c!==a.next&&Rc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=xa(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&Rc(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=xa(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&Rc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=xa(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<=b;){if(d!==a.prev&&d!==a.next&&Rc(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=xa(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function mk(a,b){return a.x-b.x} -function nk(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 h=c.x=c.x&&c.x>=g&&d!==c.x&&Rc(eh.x)&&ae(c,a)&&(h=c,m=p)}c= +function nk(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 h=c.x=c.x&&c.x>=g&&d!==c.x&&Rc(eh.x)&&ae(c,a)&&(h=c,m=t)}c= c.next}return h}function lg(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 ok(a){var b=a,c=a;do{if(b.xxa(a.prev,a,a.next)?0<=xa(a,b,a.next)&&0<=xa(a,a.prev,b):0>xa(a,b,a.prev)||0>xa(a,a.next,b)}function Sh(a,b){var c=new mg(a.i,a.x,a.y),d=new mg(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 Qh(a,b,c,d){a=new mg(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 Yd(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 mg(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 Th(a){var b=a.length;2Number.EPSILON){var l=Math.sqrt(h),m=Math.sqrt(f*f+g*g);h=b.x-e/l;b=b.y+d/l;g=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+ -d*d;if(2>=e)return new w(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new w(f/e,d/e)}function h(a,b){for(L=a.length;0<=--L;){var c=L;var f=L-1;0>f&&(f=a.length-1);var g,h=x+2*E;for(g=0;g=e)return new w(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new w(f/e,d/e)}function h(a,b){for(L=a.length;0<=--L;){var c=L;var f=L-1;0>f&&(f=a.length-1);var g,h=x+2*E;for(g=0;gk;k++){var u=m[f[k]];var n=m[f[(k+1)%3]];d[0]=Math.min(u,n);d[1]=Math.max(u,n);u=d[0]+","+d[1];void 0===e[u]?e[u]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[u].face2=h}for(u in e)if(d=e[u],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<= -b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addAttribute("position",new A(c,3))}function gc(a,b,c,d,e,f,g,h){E.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new qb(a,b,c,d,e,f,g,h));this.mergeVertices()}function qb(a,b,c,d,e,f,g,h){function l(c){var e,f=new w,l=new n,p=0,v=!0===c?a:b,x=!0===c?1:-1;var A=r;for(e=1;e<=d;e++)u.push(0, -y*x,0),t.push(0,x,0),q.push(.5,.5),r++;var D=r;for(e=0;e<=d;e++){var E=e/d*h+g,C=Math.cos(E);E=Math.sin(E);l.x=v*E;l.y=y*x;l.z=v*C;u.push(l.x,l.y,l.z);t.push(0,x,0);f.x=.5*C+.5;f.y=.5*E*x+.5;q.push(f.x,f.y);r++}for(e=0;ek;k++){var q=m[f[k]];var n=m[f[(k+1)%3]];d[0]=Math.min(q,n);d[1]=Math.max(q,n);q=d[0]+","+d[1];void 0===e[q]?e[q]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[q].face2=h}for(q in e)if(d=e[q],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<= +b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addAttribute("position",new A(c,3))}function gc(a,b,c,d,e,f,g,h){E.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new rb(a,b,c,d,e,f,g,h));this.mergeVertices()}function rb(a,b,c,d,e,f,g,h){function l(c){var e,f=new w,l=new n,t=0,v=!0===c?a:b,x=!0===c?1:-1;var A=r;for(e=1;e<=d;e++)q.push(0, +y*x,0),u.push(0,x,0),p.push(.5,.5),r++;var D=r;for(e=0;e<=d;e++){var E=e/d*h+g,C=Math.cos(E);E=Math.sin(E);l.x=v*E;l.y=y*x;l.z=v*C;q.push(l.x,l.y,l.z);u.push(0,x,0);f.x=.5*C+.5;f.y=.5*E*x+.5;p.push(f.x,f.y);r++}for(e=0;ec;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.addAttribute("position",new A(b,3));b=new X({fog:!1});this.cone=new R(a,b);this.add(this.cone);this.update()}function gi(a){var b=[];a&&a.isBone&&b.push(a);for(var c= @@ -327,16 +325,16 @@ function cd(a,b){D.call(this);this.light=a;this.light.updateMatrixWorld();this.m !1}function ed(a,b,c){this.light=a;this.light.updateMatrixWorld();this.color=c;a=new Ib(b,4,2);b=new Fa({wireframe:!0,fog:!1});S.call(this,a,b);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1;this.update()}function fd(a,b){this.type="RectAreaLightHelper";this.light=a;this.color=b;a=new F;a.addAttribute("position",new A([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3));a.computeBoundingSphere();b=new X({fog:!1});ra.call(this,a,b);a=new F;a.addAttribute("position",new A([1,1,0,-1,1,0,-1,-1,0,1,1, 0,-1,-1,0,1,-1,0],3));a.computeBoundingSphere();this.add(new S(a,new Fa({side:1,fog:!1})));this.update()}function gd(a,b,c){D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.color=c;a=new ac(b);a.rotateY(.5*Math.PI);this.material=new Fa({wireframe:!0,fog:!1});void 0===this.color&&(this.material.vertexColors=2);b=a.getAttribute("position");b=new Float32Array(3*b.count);a.addAttribute("color",new N(b,3));this.add(new S(a,this.material)); this.update()}function hd(a,b){this.lightProbe=a;this.size=b;a=new va({defines:{GAMMA_OUTPUT:""},uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:"varying vec3 vNormal;\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"#define RECIPROCAL_PI 0.318309886\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n\t// matrix is assumed to be orthogonal\n\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n}\nvec3 linearToOutput( in vec3 a ) {\n\t#ifdef GAMMA_OUTPUT\n\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n\t#else\n\t\treturn a;\n\t#endif\n}\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\t// normal is assumed to have unit length\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\t// band 1\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\t// band 2\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nuniform vec3 sh[ 9 ]; // sh coefficients\nuniform float intensity; // light probe intensity\nvarying vec3 vNormal;\nvoid main() {\n\tvec3 normal = normalize( vNormal );\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );\n\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;\n\toutgoingLight = linearToOutput( outgoingLight );\n\tgl_FragColor = vec4( outgoingLight, 1.0 );\n}"}); -b=new Ib(1,32,16);S.call(this,b,a);this.onBeforeRender()}function lf(a,b,c,d){a=a||10;b=b||10;c=new H(void 0!==c?c:4473924);d=new H(void 0!==d?d:8947848);var e=b/2,f=a/b,g=a/2;a=[];for(var h=[],l=0,m=0,k=-g;l<=b;l++,k+=f){a.push(-g,0,k,g,0,k);a.push(k,0,-g,k,0,g);var u=l===e?c:d;u.toArray(h,m);m+=3;u.toArray(h,m);m+=3;u.toArray(h,m);m+=3;u.toArray(h,m);m+=3}b=new F;b.addAttribute("position",new A(a,3));b.addAttribute("color",new A(h,3));c=new X({vertexColors:2});R.call(this,b,c)}function mf(a,b,c, -d,e,f){a=a||10;b=b||16;c=c||8;d=d||64;e=new H(void 0!==e?e:4473924);f=new H(void 0!==f?f:8947848);var g=[],h=[],l;for(l=0;l<=b;l++){var m=l/b*2*Math.PI;var k=Math.sin(m)*a;m=Math.cos(m)*a;g.push(0,0,0);g.push(k,0,m);var u=l&1?e:f;h.push(u.r,u.g,u.b);h.push(u.r,u.g,u.b)}for(l=0;l<=c;l++){u=l&1?e:f;var n=a-a/c*l;for(b=0;ba?-1:0a&&(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(wa,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h= -c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],u=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||m!==u){f=1-g;var n=h*d+l*k+m*u+c*e,q=0<=n?1:-1,r=1-n*n;r>Number.EPSILON&&(r=Math.sqrt(r),n=Math.atan2(r,n*q),f=Math.sin(f*n)/r,g=Math.sin(g*n)/r);q*=g;h=h*f+d*q;l=l*f+k*q;m=m*f+u*q;c=c*f+e*q;f===1-g&&(g=1/Math.sqrt(h*h+l*l+m*m+c*c),h*=g,l*=g,m*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(wa.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this._onChangeCallback()}}, +c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],q=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||m!==q){f=1-g;var n=h*d+l*k+m*q+c*e,p=0<=n?1:-1,r=1-n*n;r>Number.EPSILON&&(r=Math.sqrt(r),n=Math.atan2(r,n*p),f=Math.sin(f*n)/r,g=Math.sin(g*n)/r);p*=g;h=h*f+d*p;l=l*f+k*p;m=m*f+q*p;c=c*f+e*p;f===1-g&&(g=1/Math.sqrt(h*h+l*l+m*m+c*c),h*=g,l*=g,m*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(wa.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(wa.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,h=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+h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f-c*d*e):"YXZ"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f-c*l*e,this._z= h*l*e-c*d*f,this._w=h*l*f+c*d*e):"ZXY"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f-c*d*e):"ZYX"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f+c*d*e):"YZX"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f-c*d*e):"XZY"===a&&(this._x=c*l*f-h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f+c*d*e);!1!==b&&this._onChangeCallback();return this},setFromAxisAngle:function(a,b){b/=2;var c=Math.sin(b); @@ -379,9 +377,9 @@ a;this.z=d*Math.cos(c);return this},setFromCylindrical:function(a){return this.s 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 oc=new n;Object.assign(ea.prototype,{isMatrix3:!0,set:function(a,b,c,d,e,f,g,h,l){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=h;m[6]=c;m[7]=f;m[8]=l;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6]; b[7]=a[7];b[8]=a[8];return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this},applyToBufferAttribute:function(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 kd,Kb={getDataURL:function(a){if("undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===kd&&(kd=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"));kd.width=a.width;kd.height=a.height;var b=kd.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height);a=kd}return 2048this.determinant()&&(e=-e);a.x=d[12];a.y=d[13];a.z=d[14];ta.copy(this);a=1/e;d=1/f;var h=1/g;ta.elements[0]*=a;ta.elements[1]*=a;ta.elements[2]*=a;ta.elements[4]*=d;ta.elements[5]*=d;ta.elements[6]*=d;ta.elements[8]*=h;ta.elements[9]*=h;ta.elements[10]*=h;b.setFromRotationMatrix(ta);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,h=1/(b-a),l=1/(c-d),m=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);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 ki=new O,li=new wa;Qb.RotationOrders= @@ -427,12 +425,12 @@ b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this._onChangeCa (this._x=0,this._z=Math.atan2(-f,l))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(-m,l),this._y=Math.atan2(-k,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(n,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){ki.makeRotationFromQuaternion(a);return this.setFromRotationMatrix(ki,b,c)},setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(a){li.setFromEuler(this);return this.setFromQuaternion(li,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(Of.prototype,{set:function(a){this.mask=1<e&&(e=m);k>f&&(f=k);n>g&&(g=n)}this.min.set(b,c,d); +var wb=[new n,new n,new n,new n,new n,new n,new n,new n],jb=new n,md=new n,nd=new n,od=new n,Mb=new n,Nb=new n,pc=new n,we=new n,rf=new n,sf=new n,Rb=new n;Object.assign(ab.prototype,{isBox3:!0,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromArray:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.length;he&&(e=m);k>f&&(f=k);n>g&&(g=n)}this.min.set(b,c,d); this.max.set(e,f,g);return this},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.count;he&&(e=m);k>f&&(f=k);n>g&&(g=n)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},intersectsSphere:function(a){this.clampPoint(a.center,jb);return jb.distanceToSquared(a.center)<=a.radius*a.radius},intersectsPlane:function(a){if(0=-a.constant},intersectsTriangle:function(a){if(this.isEmpty())return!1;this.getCenter(we);rf.subVectors(this.max,we);md.subVectors(a.a,we);nd.subVectors(a.b,we);od.subVectors(a.c,we);Mb.subVectors(nd,md);Nb.subVectors(od,nd);pc.subVectors(md,od);a=[0,-Mb.z,Mb.y,0,-Nb.z,Nb.y,0,-pc.z, pc.y,Mb.z,0,-Mb.x,Nb.z,0,-Nb.x,pc.z,0,-pc.x,-Mb.y,Mb.x,0,-Nb.y,Nb.x,0,-pc.y,pc.x,0];if(!Pf(a,md,nd,od,rf))return!1;a=[1,0,0,0,1,0,0,0,1];if(!Pf(a,md,nd,od,rf))return!1;sf.crossVectors(Mb,Nb);a=[sf.x,sf.y,sf.z];return Pf(a,md,nd,od,rf)},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box3: .clampPoint() target is now required"),b=new n);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){return jb.copy(a).clamp(this.min,this.max).sub(a).length()},getBoundingSphere:function(a){void 0=== -a&&console.error("THREE.Box3: .getBoundingSphere() target is now required");this.getCenter(a.center);a.radius=.5*this.getSize(jb).length();return a},intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(a){if(this.isEmpty())return this;vb[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(a);vb[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(a); -vb[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(a);vb[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(a);vb[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(a);vb[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(a);vb[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(a);vb[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(a);this.setFromPoints(vb);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&&console.error("THREE.Box3: .getBoundingSphere() target is now required");this.getCenter(a.center);a.radius=.5*this.getSize(jb).length();return a},intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(a){if(this.isEmpty())return this;wb[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(a);wb[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(a); +wb[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(a);wb[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(a);wb[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(a);wb[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(a);wb[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(a);wb[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(a);this.setFromPoints(wb);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 yk=new ab;Object.assign(nb.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(a,b){var c=this.center;void 0!==b?c.copy(b):yk.setFromPoints(a).getCenter(c);for(var d=b=0,e=a.length;d= this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(a.distanceToPoint(this.center))<=this.radius},clampPoint:function(a,b){var c=this.center.distanceToSquared(a); void 0===b&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),b=new n);b.copy(a);c>this.radius*this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center));return b},getBoundingBox:function(a){void 0===a&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),a=new ab);a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this}, -translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}});var wb=new n,Mg=new n,tf=new n,Ob=new n,Ng=new n,uf=new n,Og=new n;Object.assign(Sb.prototype,{set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){void 0===b&&(console.warn("THREE.Ray: .at() target is now required"), -b=new n);return b.copy(this.direction).multiplyScalar(a).add(this.origin)},lookAt:function(a){this.direction.copy(a).sub(this.origin).normalize();return this},recast:function(a){this.origin.copy(this.at(a,wb));return this},closestPointToPoint:function(a,b){void 0===b&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),b=new n);b.subVectors(a,this.origin);a=b.dot(this.direction);return 0>a?b.copy(this.origin):b.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))}, -distanceSqToPoint:function(a){var b=wb.subVectors(a,this.origin).dot(this.direction);if(0>b)return this.origin.distanceToSquared(a);wb.copy(this.direction).multiplyScalar(b).add(this.origin);return wb.distanceToSquared(a)},distanceSqToSegment:function(a,b,c,d){Mg.copy(a).add(b).multiplyScalar(.5);tf.copy(b).sub(a).normalize();Ob.copy(this.origin).sub(Mg);var e=.5*a.distanceTo(b),f=-this.direction.dot(tf),g=Ob.dot(this.direction),h=-Ob.dot(tf),l=Ob.lengthSq(),m=Math.abs(1-f*f);if(0a?b.copy(this.origin):b.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))}, +distanceSqToPoint:function(a){var b=xb.subVectors(a,this.origin).dot(this.direction);if(0>b)return this.origin.distanceToSquared(a);xb.copy(this.direction).multiplyScalar(b).add(this.origin);return xb.distanceToSquared(a)},distanceSqToSegment:function(a,b,c,d){Mg.copy(a).add(b).multiplyScalar(.5);tf.copy(b).sub(a).normalize();Ob.copy(this.origin).sub(Mg);var e=.5*a.distanceTo(b),f=-this.direction.dot(tf),g=Ob.dot(this.direction),h=-Ob.dot(tf),l=Ob.lengthSq(),m=Math.abs(1-f*f);if(0=-k?b<=k?(e=1/m,a*=e,b*=e,f=a*(a+f*b+2*g)+b*(f*a+b+2*h)+l):(b=e,a=Math.max(0,-(f*b+g)),f=-a*a+b*(b+2*h)+l):(b=-e,a=Math.max(0,-(f*b+g)),f=-a*a+b*(b+2*h)+l):b<=-k?(a=Math.max(0,-(-f*e+g)),b=0a)return null;a=Math.sqrt(a-d);d=c-a;c+=a;return 0>d&&0>c?null:0>d?this.at(c,b):this.at(d,b)},intersectsSphere:function(a){return this.distanceSqToPoint(a.center)<=a.radius*a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+ +d&&d.copy(tf).multiplyScalar(b).add(Mg);return f},intersectSphere:function(a,b){xb.subVectors(a.center,this.origin);var c=xb.dot(this.direction),d=xb.dot(xb)-c*c;a=a.radius*a.radius;if(d>a)return null;a=Math.sqrt(a-d);d=c-a;c+=a;return 0>d&&0>c?null:0>d?this.at(c,b):this.at(d,b)},intersectsSphere:function(a){return this.distanceSqToPoint(a.center)<=a.radius*a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+ a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){a=this.distanceToPlane(a);return null===a?null:this.at(a,b)},intersectsPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},intersectBox:function(a,b){var c=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 h=(a.min.y-f.y)*d;d*=a.max.y-f.y}else h=(a.max.y- -f.y)*d,d*=a.min.y-f.y;if(g>d||h>c)return null;if(h>g||g!==g)g=h;if(da||h>c)return null;if(h>g||g!==g)g=h;if(ac?null:this.at(0<=g?g:c,b)},intersectsBox:function(a){return null!==this.intersectBox(a,wb)},intersectTriangle:function(a,b,c,d,e){Ng.subVectors(b,a);uf.subVectors(c,a);Og.crossVectors(Ng,uf);b=this.direction.dot(Og);if(0b)d=-1,b=-b;else return null; -Ob.subVectors(this.origin,a);a=d*this.direction.dot(uf.crossVectors(Ob,uf));if(0>a)return null;c=d*this.direction.dot(Ng.cross(Ob));if(0>c||a+c>b)return null;a=-d*Ob.dot(Og);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 Ya=new n,xb=new n,Pg=new n,yb=new n,pd=new n,qd=new n,qi=new n,Qg=new n,Rg=new n,Sg=new n;Object.assign(V, -{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);Ya.subVectors(a,b);d.cross(Ya);a=d.lengthSq();return 0=yb.x+yb.y},getUV:function(a,b,c,d,e,f,g,h){this.getBarycoord(a,b,c,d,yb);h.set(0,0);h.addScaledVector(e,yb.x);h.addScaledVector(f,yb.y);h.addScaledVector(g,yb.z);return h},isFrontFacing:function(a,b,c,d){Ya.subVectors(c,b);xb.subVectors(a,b);return 0>Ya.cross(xb).dot(d)?!0:!1}});Object.assign(V.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(){Ya.subVectors(this.c,this.b);xb.subVectors(this.a,this.b);return.5*Ya.cross(xb).length()},getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"), +f.y)*d,d*=a.min.y-f.y;if(g>d||h>c)return null;if(h>g||g!==g)g=h;if(da||h>c)return null;if(h>g||g!==g)g=h;if(ac?null:this.at(0<=g?g:c,b)},intersectsBox:function(a){return null!==this.intersectBox(a,xb)},intersectTriangle:function(a,b,c,d,e){Ng.subVectors(b,a);uf.subVectors(c,a);Og.crossVectors(Ng,uf);b=this.direction.dot(Og);if(0b)d=-1,b=-b;else return null; +Ob.subVectors(this.origin,a);a=d*this.direction.dot(uf.crossVectors(Ob,uf));if(0>a)return null;c=d*this.direction.dot(Ng.cross(Ob));if(0>c||a+c>b)return null;a=-d*Ob.dot(Og);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 Ya=new n,yb=new n,Pg=new n,zb=new n,pd=new n,qd=new n,qi=new n,Qg=new n,Rg=new n,Sg=new n;Object.assign(V, +{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);Ya.subVectors(a,b);d.cross(Ya);a=d.lengthSq();return 0=zb.x+zb.y},getUV:function(a,b,c,d,e,f,g,h){this.getBarycoord(a,b,c,d,zb);h.set(0,0);h.addScaledVector(e,zb.x);h.addScaledVector(f,zb.y);h.addScaledVector(g,zb.z);return h},isFrontFacing:function(a,b,c,d){Ya.subVectors(c,b);yb.subVectors(a,b);return 0>Ya.cross(yb).dot(d)?!0:!1}});Object.assign(V.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(){Ya.subVectors(this.c,this.b);yb.subVectors(this.a,this.b);return.5*Ya.cross(yb).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 V.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 n);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return V.getBarycoord(a,this.a,this.b,this.c,b)},getUV:function(a,b,c,d,e){return V.getUV(a,this.a,this.b,this.c,b,c,d,e)},containsPoint:function(a){return V.containsPoint(a, this.a,this.b,this.c)},isFrontFacing:function(a){return V.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;pd.subVectors(d,c);qd.subVectors(e,c);Qg.subVectors(a,c);var f=pd.dot(Qg),g=qd.dot(Qg);if(0>=f&&0>=g)return b.copy(c);Rg.subVectors(a,d);var h=pd.dot(Rg),l=qd.dot(Rg);if(0<=h&&l<= h)return b.copy(d);var m=f*l-h*g;if(0>=m&&0<=f&&0>=h)return d=f/(f-h),b.copy(c).addScaledVector(pd,d);Sg.subVectors(a,e);a=pd.dot(Sg);var k=qd.dot(Sg);if(0<=k&&a<=k)return b.copy(e);f=a*g-f*k;if(0>=f&&0<=g&&0>=k)return m=g/(g-k),b.copy(c).addScaledVector(qd,m);g=h*k-a*l;if(0>=g&&0<=l-h&&0<=a-k)return qi.subVectors(e,d),m=(l-h)/(l-h+(a-k)),b.copy(d).addScaledVector(qi,m);e=1/(g+f+m);d=f*e;m*=e;return b.copy(c).addScaledVector(pd,d).addScaledVector(qd,m)},equals:function(a){return a.a.equals(this.a)&& @@ -501,17 +499,17 @@ this.userData);c&&(c=b(a.textures),a=b(a.images),0g;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}", +e+d,b,b-c,a,this.far);this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(a){a=D.prototype.toJSON.call(this,a);a.object.fov=this.fov;a.object.zoom=this.zoom;a.object.near=this.near;a.object.far=this.far;a.object.focus=this.focus;a.object.aspect=this.aspect;null!==this.view&&(a.object.view=Object.assign({},this.view));a.object.filmGauge=this.filmGauge;a.object.filmOffset=this.filmOffset;return a}});Bc.prototype=Object.create(D.prototype);Bc.prototype.constructor=Bc;Bb.prototype= +Object.create(Ba.prototype);Bb.prototype.constructor=Bb;Bb.prototype.isWebGLRenderTargetCube=!0;Bb.prototype.fromEquirectangularTexture=function(a,b){this.texture.type=b.type;this.texture.format=b.format;this.texture.encoding=b.encoding;var c=new ud,d=new va({type:"CubemapFromEquirect",uniforms:Yb({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 S(new Ed(5, 5,5),d);c.add(b);d=new Bc(1,10,1);d.renderTarget=this;d.renderTarget.texture.name="CubeCameraTexture";d.update(a,c);b.geometry.dispose();b.material.dispose();return this};Zb.prototype=Object.create(T.prototype);Zb.prototype.constructor=Zb;Zb.prototype.isDataTexture=!0;var Yg=new n,Ak=new n,Bk=new ea;Object.assign(cb.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=Yg.subVectors(c,b).cross(Ak.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(Yg),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&&0c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],k=c[7],n=c[8],u=c[9],t=c[10],q=c[11],r=c[12],v=c[13],y=c[14];c=c[15];b[0].setComponents(f-a,k-g,q-n,c-r).normalize();b[1].setComponents(f+a,k+g,q+n,c+r).normalize();b[2].setComponents(f+ -d,k+h,q+u,c+v).normalize();b[3].setComponents(f-d,k-h,q-u,c-v).normalize();b[4].setComponents(f-e,k-l,q-t,c-y).normalize();b[5].setComponents(f+e,k+l,q+t,c+y).normalize();return this},intersectsObject:function(a){var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere();rd.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(rd)},intersectsSprite:function(a){rd.center.set(0,0,0);rd.radius=.7071067811865476;rd.applyMatrix4(a.matrixWorld);return this.intersectsSphere(rd)}, +g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],k=c[7],n=c[8],q=c[9],u=c[10],p=c[11],r=c[12],v=c[13],y=c[14];c=c[15];b[0].setComponents(f-a,k-g,p-n,c-r).normalize();b[1].setComponents(f+a,k+g,p+n,c+r).normalize();b[2].setComponents(f+ +d,k+h,p+q,c+v).normalize();b[3].setComponents(f-d,k-h,p-q,c-v).normalize();b[4].setComponents(f-e,k-l,p-u,c-y).normalize();b[5].setComponents(f+e,k+l,p+u,c+y).normalize();return this},intersectsObject:function(a){var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere();rd.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(rd)},intersectsSprite:function(a){rd.center.set(0,0,0);rd.radius=.7071067811865476;rd.applyMatrix4(a.matrixWorld);return this.intersectsSphere(rd)}, 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)c;c++){var d=b[c];yf.x=0d.distanceToPoint(yf))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 Q={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", @@ -663,18 +661,18 @@ K.displacementmap,{opacity:{value:1}}]),vertexShader:Q.normal_vert,fragmentShade fragmentShader:Q.equirect_frag},distanceRGBA:{uniforms:ua([K.common,K.displacementmap,{referencePosition:{value:new n},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:Q.distanceRGBA_vert,fragmentShader:Q.distanceRGBA_frag},shadow:{uniforms:ua([K.lights,K.fog,{color:{value:new H(0)},opacity:{value:1}}]),vertexShader:Q.shadow_vert,fragmentShader:Q.shadow_frag}};db.physical={uniforms:ua([db.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new H(0)}, clearcoatNormalScale:{value:new w(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:Q.meshphysical_vert,fragmentShader:Q.meshphysical_frag};Dd.prototype=Object.create(E.prototype);Dd.prototype.constructor=Dd;$b.prototype=Object.create(F.prototype);$b.prototype.constructor=$b;ob.prototype=Object.create(T.prototype);ob.prototype.constructor=ob;ob.prototype.isCubeTexture=!0;Object.defineProperty(ob.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});Cc.prototype= Object.create(T.prototype);Cc.prototype.constructor=Cc;Cc.prototype.isDataTexture2DArray=!0;Dc.prototype=Object.create(T.prototype);Dc.prototype.constructor=Dc;Dc.prototype.isDataTexture3D=!0;var th=new T,pj=new Cc,rj=new Dc,uh=new ob,nh=[],ph=[],sh=new Float32Array(16),rh=new Float32Array(9),qh=new Float32Array(4);vh.prototype.updateCache=function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));Ga(b,a)};wh.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 Xf=/([\w\d_]+)(\])?(\[|\.)?/g;Bb.prototype.setValue=function(a,b,c,d){b=this.map[b];void 0!==b&&b.setValue(a,c,d)};Bb.prototype.setOptional=function(a,b,c){b=b[c];void 0!==b&&this.setValue(a,c,b)};Bb.upload=function(a,b,c,d){for(var e=0,f=b.length;e!==f;++e){var g=b[e],h=c[g.id];!1!==h.needsUpdate&&g.setValue(a,h.value,d)}};Bb.seqWithValue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var f=a[d];f.id in -b&&c.push(f)}return c};var Wj=0,Zf=/^[ \t]*#include +<([\w\d./]+)>/gm,Eh=/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,fk=0;Cb.prototype=Object.create(M.prototype);Cb.prototype.constructor=Cb;Cb.prototype.isMeshDepthMaterial=!0;Cb.prototype.copy=function(a){M.prototype.copy.call(this,a);this.depthPacking=a.depthPacking;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap; -this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;return this};Db.prototype=Object.create(M.prototype);Db.prototype.constructor=Db;Db.prototype.isMeshDistanceMaterial=!0;Db.prototype.copy=function(a){M.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; +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 Xf=/([\w\d_]+)(\])?(\[|\.)?/g;Cb.prototype.setValue=function(a,b,c,d){b=this.map[b];void 0!==b&&b.setValue(a,c,d)};Cb.prototype.setOptional=function(a,b,c){b=b[c];void 0!==b&&this.setValue(a,c,b)};Cb.upload=function(a,b,c,d){for(var e=0,f=b.length;e!==f;++e){var g=b[e],h=c[g.id];!1!==h.needsUpdate&&g.setValue(a,h.value,d)}};Cb.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 Wj=0,Zf=/^[ \t]*#include +<([\w\d./]+)>/gm,Eh=/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,fk=0;Db.prototype=Object.create(M.prototype);Db.prototype.constructor=Db;Db.prototype.isMeshDepthMaterial=!0;Db.prototype.copy=function(a){M.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};Eb.prototype=Object.create(M.prototype);Eb.prototype.constructor=Eb;Eb.prototype.isMeshDistanceMaterial=!0;Eb.prototype.copy=function(a){M.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};dg.prototype=Object.assign(Object.create(Ba.prototype),{constructor:dg,isWebGLMultiviewRenderTarget:!0,copy:function(a){Ba.prototype.copy.call(this,a);this.numViews=a.numViews;return this},setNumViews:function(a){this.numViews!==a&&(this.numViews=a,this.dispose());return this}});Fc.prototype=Object.assign(Object.create(D.prototype), {constructor:Fc,isGroup:!0});Hd.prototype=Object.assign(Object.create(ha.prototype),{constructor:Hd,isArrayCamera:!0});var Kh=new n,Lh=new n;Object.assign(eg.prototype,Aa.prototype);Object.assign(Mh.prototype,Aa.prototype);Object.assign(He.prototype,{isFogExp2:!0,clone:function(){return new He(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}});Object.assign(Ie.prototype,{isFog:!0,clone:function(){return new Ie(this.color,this.near, -this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});Object.defineProperty(Gb.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(Gb.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setDynamic:function(a){this.dynamic=a;return this},copy:function(a){this.array=new a.array.constructor(a.array);this.count=a.count;this.stride=a.stride;this.dynamic=a.dynamic;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:xe.clone(),uv:V.getUV(xe,zf,ye,Af,ti,Zg,ui,new w),face:null,object:this})},clone:function(){return(new this.constructor(this.material)).copy(this)}, +this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});Object.defineProperty(pb.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(pb.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:xe.clone(),uv:V.getUV(xe,zf,ye,Af,ti,Zg,ui,new w),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 Bf=new n,vi=new n;Ld.prototype=Object.assign(Object.create(D.prototype),{constructor:Ld,isLOD:!0,copy:function(a){D.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b=b[c].distance)b[c-1].object.visible=!1,b[c].object.visible=!0;else break;for(;cc||(h.applyMatrix4(this.matrixWorld),t=a.ray.origin.distanceTo(h),ta.far||b.push({distance:t,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}}else for(d=0,u=p.length/3-1;dc||(h.applyMatrix4(this.matrixWorld),t=a.ray.origin.distanceTo(h),ta.far||b.push({distance:t,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||(h.applyMatrix4(this.matrixWorld),t=a.ray.origin.distanceTo(h),ta.far||b.push({distance:t,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 Df=new n,Ef=new n;R.prototype=Object.assign(Object.create(ra.prototype), +e=this.matrixWorld;null===d.boundingSphere&&d.computeBoundingSphere();ze.copy(d.boundingSphere);ze.applyMatrix4(e);ze.radius+=c;if(!1!==a.ray.intersectsSphere(ze)){zi.getInverse(e);Cf.copy(a.ray).applyMatrix4(zi);c/=(this.scale.x+this.scale.y+this.scale.z)/3;c*=c;var f=new n,g=new n;e=new n;var h=new n,l=this&&this.isLineSegments?2:1;if(d.isBufferGeometry){var k=d.index,t=d.attributes.position.array;if(null!==k){k=k.array;d=0;for(var q=k.length-1;dc||(h.applyMatrix4(this.matrixWorld),u=a.ray.origin.distanceTo(h),ua.far||b.push({distance:u,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}}else for(d=0,q=t.length/3-1;dc||(h.applyMatrix4(this.matrixWorld),u=a.ray.origin.distanceTo(h),ua.far||b.push({distance:u,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||(h.applyMatrix4(this.matrixWorld),u=a.ray.origin.distanceTo(h),ua.far||b.push({distance:u,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 Df=new n,Ef=new n;R.prototype=Object.assign(Object.create(ra.prototype), {constructor:R,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;d80*c){var q=h=a[0];var r=d=a[1];for(l=c;lh&&(h=n),b>d&&(d=b);h=Math.max(h-q,d-r);h=0!==h?1/h:0}$d(f,g,c,q,r,h);return g}},pb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;epb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];Th(a);Uh(c,a);var f=a.length;b.forEach(Th); +Wd;Pc.prototype=Object.create(F.prototype);Pc.prototype.constructor=Pc;Xd.prototype=Object.create(E.prototype);Xd.prototype.constructor=Xd;Qc.prototype=Object.create(F.prototype);Qc.prototype.constructor=Qc;var Dk={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,f=Ph(a,0,e,c,!0),g=[];if(!f||f.next===f.prev)return g;var h;if(d){var l=c;d=[];var k;var n=0;for(k=b.length;n80*c){var p=h=a[0];var r=d=a[1];for(l=c;lh&&(h=n),b>d&&(d=b);h=Math.max(h-p,d-r);h=0!==h?1/h:0}$d(f,g,c,p,r,h);return g}},qb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;eqb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];Th(a);Uh(c,a);var f=a.length;b.forEach(Th); for(a=0;aMath.abs(g-l)?[new w(a,1-c),new w(h,1-d),new w(k,1-e),new w(u,1-b)]:[new w(g,1-c),new w(l,1-d),new w(n,1-e),new w(t,1-b)]}};be.prototype=Object.create(E.prototype); +this.parameters.options,a)};var pk={generateTopUV:function(a,b,c,d,e){a=b[3*d];d=b[3*d+1];var f=b[3*e];e=b[3*e+1];return[new w(b[3*c],b[3*c+1]),new w(a,d),new w(f,e)]},generateSideWallUV:function(a,b,c,d,e,f){a=b[3*c];var g=b[3*c+1];c=b[3*c+2];var h=b[3*d],l=b[3*d+1];d=b[3*d+2];var k=b[3*e],n=b[3*e+1];e=b[3*e+2];var q=b[3*f],u=b[3*f+1];b=b[3*f+2];return.01>Math.abs(g-l)?[new w(a,1-c),new w(h,1-d),new w(k,1-e),new w(q,1-b)]:[new w(g,1-c),new w(l,1-d),new w(n,1-e),new w(u,1-b)]}};be.prototype=Object.create(E.prototype); be.prototype.constructor=be;Sc.prototype=Object.create(eb.prototype);Sc.prototype.constructor=Sc;ce.prototype=Object.create(E.prototype);ce.prototype.constructor=ce;Ib.prototype=Object.create(F.prototype);Ib.prototype.constructor=Ib;de.prototype=Object.create(E.prototype);de.prototype.constructor=de;Tc.prototype=Object.create(F.prototype);Tc.prototype.constructor=Tc;ee.prototype=Object.create(E.prototype);ee.prototype.constructor=ee;Uc.prototype=Object.create(F.prototype);Uc.prototype.constructor= -Uc;ec.prototype=Object.create(E.prototype);ec.prototype.constructor=ec;ec.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);return Wh(this.parameters.shapes,a)};fc.prototype=Object.create(F.prototype);fc.prototype.constructor=fc;fc.prototype.toJSON=function(){var a=F.prototype.toJSON.call(this);return Wh(this.parameters.shapes,a)};Vc.prototype=Object.create(F.prototype);Vc.prototype.constructor=Vc;gc.prototype=Object.create(E.prototype);gc.prototype.constructor=gc;qb.prototype=Object.create(F.prototype); -qb.prototype.constructor=qb;fe.prototype=Object.create(gc.prototype);fe.prototype.constructor=fe;ge.prototype=Object.create(qb.prototype);ge.prototype.constructor=ge;he.prototype=Object.create(E.prototype);he.prototype.constructor=he;Wc.prototype=Object.create(F.prototype);Wc.prototype.constructor=Wc;var ia=Object.freeze({WireframeGeometry:Kc,ParametricGeometry:Pd,ParametricBufferGeometry:Lc,TetrahedronGeometry:Rd,TetrahedronBufferGeometry:Mc,OctahedronGeometry:Sd,OctahedronBufferGeometry:ac,IcosahedronGeometry:Td, +Uc;ec.prototype=Object.create(E.prototype);ec.prototype.constructor=ec;ec.prototype.toJSON=function(){var a=E.prototype.toJSON.call(this);return Wh(this.parameters.shapes,a)};fc.prototype=Object.create(F.prototype);fc.prototype.constructor=fc;fc.prototype.toJSON=function(){var a=F.prototype.toJSON.call(this);return Wh(this.parameters.shapes,a)};Vc.prototype=Object.create(F.prototype);Vc.prototype.constructor=Vc;gc.prototype=Object.create(E.prototype);gc.prototype.constructor=gc;rb.prototype=Object.create(F.prototype); +rb.prototype.constructor=rb;fe.prototype=Object.create(gc.prototype);fe.prototype.constructor=fe;ge.prototype=Object.create(rb.prototype);ge.prototype.constructor=ge;he.prototype=Object.create(E.prototype);he.prototype.constructor=he;Wc.prototype=Object.create(F.prototype);Wc.prototype.constructor=Wc;var ia=Object.freeze({WireframeGeometry:Kc,ParametricGeometry:Pd,ParametricBufferGeometry:Lc,TetrahedronGeometry:Rd,TetrahedronBufferGeometry:Mc,OctahedronGeometry:Sd,OctahedronBufferGeometry:ac,IcosahedronGeometry:Td, IcosahedronBufferGeometry:Nc,DodecahedronGeometry:Ud,DodecahedronBufferGeometry:Oc,PolyhedronGeometry:Qd,PolyhedronBufferGeometry:Da,TubeGeometry:Vd,TubeBufferGeometry:bc,TorusKnotGeometry:Wd,TorusKnotBufferGeometry:Pc,TorusGeometry:Xd,TorusBufferGeometry:Qc,TextGeometry:be,TextBufferGeometry:Sc,SphereGeometry:ce,SphereBufferGeometry:Ib,RingGeometry:de,RingBufferGeometry:Tc,PlaneGeometry:Dd,PlaneBufferGeometry:$b,LatheGeometry:ee,LatheBufferGeometry:Uc,ShapeGeometry:ec,ShapeBufferGeometry:fc,ExtrudeGeometry:dc, -ExtrudeBufferGeometry:eb,EdgesGeometry:Vc,ConeGeometry:fe,ConeBufferGeometry:ge,CylinderGeometry:gc,CylinderBufferGeometry:qb,CircleGeometry:he,CircleBufferGeometry:Wc,BoxGeometry:Xg,BoxBufferGeometry:Ed});hc.prototype=Object.create(M.prototype);hc.prototype.constructor=hc;hc.prototype.isShadowMaterial=!0;hc.prototype.copy=function(a){M.prototype.copy.call(this,a);this.color.copy(a.color);return this};Xc.prototype=Object.create(va.prototype);Xc.prototype.constructor=Xc;Xc.prototype.isRawShaderMaterial= +ExtrudeBufferGeometry:eb,EdgesGeometry:Vc,ConeGeometry:fe,ConeBufferGeometry:ge,CylinderGeometry:gc,CylinderBufferGeometry:rb,CircleGeometry:he,CircleBufferGeometry:Wc,BoxGeometry:Xg,BoxBufferGeometry:Ed});hc.prototype=Object.create(M.prototype);hc.prototype.constructor=hc;hc.prototype.isShadowMaterial=!0;hc.prototype.copy=function(a){M.prototype.copy.call(this,a);this.color.copy(a.color);return this};Xc.prototype=Object.create(va.prototype);Xc.prototype.constructor=Xc;Xc.prototype.isRawShaderMaterial= !0;fb.prototype=Object.create(M.prototype);fb.prototype.constructor=fb;fb.prototype.isMeshStandardMaterial=!0;fb.prototype.copy=function(a){M.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};ic.prototype=Object.create(fb.prototype);ic.prototype.constructor=ic;ic.prototype.isMeshPhysicalMaterial=!0;ic.prototype.copy=function(a){fb.prototype.copy.call(this,a);this.defines={STANDARD:"",PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearcoat=a.clearcoat;this.clearcoatRoughness= @@ -715,36 +713,36 @@ this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wirefra 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};mc.prototype=Object.create(M.prototype);mc.prototype.constructor=mc;mc.prototype.isMeshMatcapMaterial=!0;mc.prototype.copy=function(a){M.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};nc.prototype=Object.create(X.prototype);nc.prototype.constructor=nc;nc.prototype.isLineDashedMaterial=!0;nc.prototype.copy=function(a){X.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var Ek=Object.freeze({ShadowMaterial:hc,SpriteMaterial:Hb, -RawShaderMaterial:Xc,ShaderMaterial:va,PointsMaterial:Qa,MeshPhysicalMaterial:ic,MeshStandardMaterial:fb,MeshPhongMaterial:Ra,MeshToonMaterial:jc,MeshNormalMaterial:kc,MeshLambertMaterial:lc,MeshDepthMaterial:Cb,MeshDistanceMaterial:Db,MeshBasicMaterial:Fa,MeshMatcapMaterial:mc,LineDashedMaterial:nc,LineBasicMaterial:X,Material:M}),da={arraySlice:function(a,b,c){return da.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&& +RawShaderMaterial:Xc,ShaderMaterial:va,PointsMaterial:Qa,MeshPhysicalMaterial:ic,MeshStandardMaterial:fb,MeshPhongMaterial:Ra,MeshToonMaterial:jc,MeshNormalMaterial:kc,MeshLambertMaterial:lc,MeshDepthMaterial:Db,MeshDistanceMaterial:Eb,MeshBasicMaterial:Fa,MeshMatcapMaterial:mc,LineDashedMaterial:nc,LineBasicMaterial:X,Material:M}),da={arraySlice:function(a,b,c){return da.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 h=c[f]*b,l=0;l!==b;++l)e[g++]=a[h+l];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)}}}};Object.assign(Ia.prototype,{evaluate:function(a){var b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];a:{b:{c:{d:if(!(a< d)){for(var f=c+2;;){if(void 0===d){if(a=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=da.arraySlice(c,e,f),this.values=da.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&&da.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);1b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(P.clamp(d[l-1].dot(d[l]),-1,1)),e[l].applyMatrix4(h.makeRotationAxis(g,c))),f[l].crossVectors(d[l],e[l]);if(!0===b)for(c=Math.acos(P.clamp(e[0].dot(e[a]),-1,1)),c/=a,0d;)d+=c;for(;d>c;)d-=c;dc.length-2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(Yh(d,e.x,f.x,g.x,c.x),Yh(d,e.y,f.y,g.y,c.y));return b};Va.prototype.copy=function(a){C.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(); +SplineCurve:Va});sb.prototype=Object.assign(Object.create(C.prototype),{constructor:sb,add:function(a){this.curves.push(a)},closePath:function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new Ca(b,a))},getPoint:function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a=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>k&&(g=b[f],l=-l,h=b[e],k=-k),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=k*(a.x-g.x)-l*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=pb.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 Jb;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints()); -l=a?!l:l;h=[];var k=[],n=[],u=0;k[u]=void 0;n[u]=[];for(var t=0,q=f.length;tNumber.EPSILON){if(0>k&&(g=b[f],l=-l,h=b[e],k=-k),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=k*(a.x-g.x)-l*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=qb.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 Jb;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints()); +l=a?!l:l;h=[];var k=[],n=[],q=0;k[q]=void 0;n[q]=[];for(var u=0,p=f.length;ub;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= @@ -873,10 +871,10 @@ 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++,u=a[n];c[u.uuid]=k;a[k]=u;c[l]=n;a[n]=h;h=0;for(l=e;h!==l;++h){u=d[h];var t=u[k];u[k]=u[n];u[n]=t}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var l= -arguments[g].uuid,k=d[l];if(void 0!==k)if(delete d[l],k=b){var n=b++,q=a[n];c[q.uuid]=m;a[m]=q;c[k]=n;a[n]=h;h=0;for(k=e;h!==k;++h){q=d[h];var u=q[m];q[m]=q[n];q[n]=u}}}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 k= +arguments[g].uuid,m=d[k];if(void 0!==m)if(delete d[k],mc.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}re e?b:f&&1===(e&1)?c-b:b;if(2200===d)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else{this.time=b;break a}this.clampWhenFinished?this.paused=!0:this.enabled=!1;this.time=b;this._mixer.dispatchEvent({type:"finished",action:this,direction:0>a?-1:1})}else{-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,f)):this._setEndings(0===this.repetitions,!0,f));if(b>=c||0>b){d=Math.floor(b/c);b-=c*d;e+=Math.abs(d);var g=this.repetitions-e;0>=g?(this.clampWhenFinished? this.paused=!0:this.enabled=!1,this.time=b=0a,this._setEndings(a,!a,f)):this._setEndings(!1,!1,f),this._loopCount=e,this.time=b,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:d}))}else this.time=b;if(f&&1===(e&1))return c-b}return b},_setEndings:function(a,b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd= b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,b,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}});Eg.prototype=Object.assign(Object.create(Aa.prototype),{constructor:Eg,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName, -l=h[g];void 0===l&&(l={},h[g]=l);for(h=0;h!==e;++h){var k=d[h],n=k.name,u=l[n];if(void 0===u){u=f[h];if(void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,g,n));continue}u=new Dg(ya.create(c,n,b&&b._propertyBindings[h].binding.parsedPath),k.ValueTypeName,k.getValueSize());++u.referenceCount;this._addInactiveBinding(u,g,n)}f[h]=u;a[h].resultBuffer=u.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid, +k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var m=d[h],n=m.name,q=k[n];if(void 0===q){q=f[h];if(void 0!==q){null===q._cacheIndex&&(++q.referenceCount,this._addInactiveBinding(q,g,n));continue}q=new Dg(ya.create(c,n,b&&b._propertyBindings[h].binding.parsedPath),m.ValueTypeName,m.getValueSize());++q.referenceCount;this._addInactiveBinding(q,g,n)}f[h]=q;a[h].resultBuffer=q.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid, c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions= [];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}}, _isActiveAction:function(a){a=a._cacheIndex;return null!==a&&aMath.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 Pi=new n,of,Jg;tb.prototype=Object.create(D.prototype);tb.prototype.constructor=tb;tb.prototype.setDirection=function(a){.99999a.y?this.quaternion.set(1,0,0,0):(Pi.set(a.z,0,-a.x).normalize(),this.quaternion.setFromAxisAngle(Pi,Math.acos(a.y)))};tb.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()};tb.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};tb.prototype.copy=function(a){D.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};tb.prototype.clone=function(){return(new this.constructor).copy(this)};te.prototype=Object.create(R.prototype);te.prototype.constructor=te;C.create=function(a,b){console.log("THREE.Curve.create() has been deprecated"); -a.prototype=Object.create(C.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(rb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."); +0>b?1:0;this.lookAt(this.plane.normal);D.prototype.updateMatrixWorld.call(this,a)};var Pi=new n,of,Jg;ub.prototype=Object.create(D.prototype);ub.prototype.constructor=ub;ub.prototype.setDirection=function(a){.99999a.y?this.quaternion.set(1,0,0,0):(Pi.set(a.z,0,-a.x).normalize(),this.quaternion.setFromAxisAngle(Pi,Math.acos(a.y)))};ub.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()};ub.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};ub.prototype.copy=function(a){D.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};ub.prototype.clone=function(){return(new this.constructor).copy(this)};te.prototype=Object.create(R.prototype);te.prototype.constructor=te;C.create=function(a,b){console.log("THREE.Curve.create() has been deprecated"); +a.prototype=Object.create(C.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(sb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."); a=this.getSpacedPoints(a);return this.createGeometry(a)},createGeometry:function(a){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var b=new E,c=0,d=a.length;c