You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
644 KiB

4 years ago
  1. !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={"exports":{},"id":r,"loaded":!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";var r=n(2),i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(r),a=new i.WebGLRenderer;a.setSize(window.innerWidth,window.innerHeight),document.body.appendChild(a.domElement);var o=new i.PerspectiveCamera(45,window.innerWidth/window.innerHeight,1,500);o.position.set(0,0,100),o.lookAt(0,0,0);var s=new i.Scene,c=new i.LineBasicMaterial({"color":255}),l=[];l.push(new i.Vector3(-10,0,0)),l.push(new i.Vector3(0,10,0)),l.push(new i.Vector3(10,0,0));var h=(new i.BufferGeometry).setFromPoints(l),u=new i.Line(h,c);s.add(u),a.render(s,o)},function(t,e,n){var r,i,a,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(n,s){"object"===o(e)&&void 0!==t?s(e):(i=[e],r=s,void 0!==(a="function"==typeof r?r.apply(e,i):r)&&(t.exports=a))}(0,function(t){"use strict";function e(){}function n(t,e,r,i,a,o,s,c,l,h){Object.defineProperty(this,"id",{"value":bl++}),this.uuid=fl.generateUUID(),this.name="",this.image=void 0!==t?t:n.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:n.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:As,this.wrapT=void 0!==i?i:As,this.magFilter=void 0!==a?a:Os,this.minFilter=void 0!==o?o:Ds,this.anisotropy=void 0!==l?l:1,this.format=void 0!==s?s:Zs,this.internalFormat=null,this.type=void 0!==c?c:Ns,this.offset=new ml(0,0),this.repeat=new ml(1,1),this.center=new ml(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new gl,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:Yc,this.version=0,this.onUpdate=null}function r(t,e,r){this.width=t,this.height=e,this.scissor=new _l(0,0,t,e),this.scissorTest=!1,this.viewport=new _l(0,0,t,e),r=r||{},this.texture=new n(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,this.texture.minFilter=void 0!==r.minFilter?r.minFilter:Os,this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0!==r.stencilBuffer&&r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}function i(t,e,n){r.call(this,t,e,n),this.samples=4}function a(t,e,n,r,i){for(var a=0,o=t.length-3;a<=o;a+=3){Hl.fromArray(t,a);var s=i.x*Math.abs(Hl.x)+i.y*Math.abs(Hl.y)+i.z*Math.abs(Hl.z),c=e.dot(Hl),l=n.dot(Hl),h=r.dot(Hl);if(Math.max(-Math.max(c,l,h),Math.min(c,l,h))>s)return!1}return!0}function s(){function t(){i.setFromEuler(r,!1)}function e(){r.setFromQuaternion(i,void 0,!1)}Object.defineProperty(this,"id",{"value":uh++}),this.uuid=fl.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=s.DefaultUp.clone();var n=new Tl,r=new oh,i=new Ml,a=new Tl(1,1,1);r._onChange(t),i._onChange(e),Object.defineProperties(this,{"position":{"configurable":!0,"enumerable":!0,"value":n},"rotation":{"configurable":!0,"enumerable":!0,"value":r},"quaternion":{"configurable":!0,"enumerable":!0,"value":i},"scale":{"configurable":!0,"enumerable":!0,"value":a},"modelViewMatrix":{"value":new Kl},"normalMatrix":{"value":new gl}}),this.matrix=new Kl,this.matrixWorld=new Kl,this.matrixAutoUpdate=s.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new hh,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function c(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function l(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function h(t){return t<.0031308?1
  2. var n=Gu[e];void 0===n&&(n=new Int32Array(e),Gu[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function ht(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function ut(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(st(n,e))return;t.uniform2fv(this.addr,e),ct(n,e)}}function pt(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(st(n,e))return;t.uniform3fv(this.addr,e),ct(n,e)}}function dt(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(st(n,e))return;t.uniform4fv(this.addr,e),ct(n,e)}}function ft(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(st(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),ct(n,e)}else{if(st(n,r))return;Hu.set(r),t.uniformMatrix2fv(this.addr,!1,Hu),ct(n,r)}}function mt(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(st(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),ct(n,e)}else{if(st(n,r))return;Uu.set(r),t.uniformMatrix3fv(this.addr,!1,Uu),ct(n,r)}}function vt(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(st(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),ct(n,e)}else{if(st(n,r))return;Fu.set(r),t.uniformMatrix4fv(this.addr,!1,Fu),ct(n,r)}}function gt(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(e||Iu,i)}function yt(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||Du,i)}function xt(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||Nu,i)}function bt(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(e||Bu,i)}function _t(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function wt(t,e){var n=this.cache;st(n,e)||(t.uniform2iv(this.addr,e),ct(n,e))}function Mt(t,e){var n=this.cache;st(n,e)||(t.uniform3iv(this.addr,e),ct(n,e))}function St(t,e){var n=this.cache;st(n,e)||(t.uniform4iv(this.addr,e),ct(n,e))}function Tt(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Et(t){switch(t){case 5126:return ht;case 35664:return ut;case 35665:return pt;case 35666:return dt;case 35674:return ft;case 35675:return mt;case 35676:return vt;case 5124:case 35670:return _t;case 35667:case 35671:return wt;case 35668:case 35672:return Mt;case 35669:case 35673:return St;case 5125:return Tt;case 35678:case 36198:case 36298:case 36306:case 35682:return gt;case 35679:case 36299:case 36307:return xt;case 35680:case 36300:case 36308:case 36293:return bt;case 36289:case 36303:case 36311:case 36292:return yt}}function At(t,e){t.uniform1fv(this.addr,e)}function Lt(t,e){t.uniform1iv(this.addr,e)}function Rt(t,e){t.uniform2iv(this.addr,e)}function Pt(t,e){t.uniform3iv(this.addr,e)}function Ct(t,e){t.uniform4iv(this.addr,e)}function Ot(t,e){var n=ot(e,this.size,2);t.uniform2fv(this.addr,n)}function It(t,e){var n=ot(e,this.size,3);t.uniform3fv(this.addr,n)}function Dt(t,e){var n=ot(e,this.size,4);t.uniform4fv(this.addr,n)}function Nt(t,e){var n=ot(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Bt(t,e){var n=ot(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function zt(t,e){var n=ot(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Gt(t,e,n){var r=e.length,i=lt(n,r);t.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(e[a]||Iu,i[a])}function Ft(t,e,n){var r=e.length,i=lt(n,r);t.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(e[a]||Bu,i[a])}function Ut(t){switch(t){case 5126:return At;case 35664:return Ot;case 35665:return It;case 35666:return Dt;case 35674:return Nt;case 35675:return Bt;case 35676:return zt;case 5124:case 35670:
  3. this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function Pe(t){u.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Tl,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}function Ce(t,e,n){function i(n,r){var i=e.update(_);y.uniforms.shadow_pass.value=n.map.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,y,_,null),x.uniforms.shadow_pass.value=n.mapPass.texture,x.uniforms.resolution.value=n.mapSize,x.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,x,_,null)}function a(t,e,n){var r=t<<0|e<<1|n<<2,i=f[r];return void 0===i&&(i=new Re({"depthPacking":rl,"morphTargets":t,"skinning":e}),f[r]=i),i}function o(t,e,n){var r=t<<0|e<<1|n<<2,i=m[r];return void 0===i&&(i=new Pe({"morphTargets":t,"skinning":e}),m[r]=i),i}function s(e,n,r,i,s,c,l){var h=null,u=a,p=e.customDepthMaterial;if(!0===i.isPointLight&&(u=o,p=e.customDistanceMaterial),void 0===p){var d=!1;!0===r.morphTargets&&(d=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var f=!1;!0===e.isSkinnedMesh&&(!0===r.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));h=u(d,f,!0===e.isInstancedMesh)}else h=p;if(t.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=h.uuid,y=r.uuid,x=v[m];void 0===x&&(x={},v[m]=x);var b=x[y];void 0===b&&(b=h.clone(),x[y]=b),h=b}return h.visible=r.visible,h.wireframe=r.wireframe,h.side=l===Co?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:g[r.side],h.clipShadows=r.clipShadows,h.clippingPlanes=r.clippingPlanes,h.clipIntersection=r.clipIntersection,h.wireframeLinewidth=r.wireframeLinewidth,h.linewidth=r.linewidth,!0===i.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(i.matrixWorld),h.nearDistance=s,h.farDistance=c),h}function c(n,r,i,a,o){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&o===Co)&&(!n.frustumCulled||l.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,n.matrixWorld);var h=e.update(n),u=n.material;if(Array.isArray(u))for(var p=h.groups,d=0,f=p.length;d<f;d++){var m=p[d],v=u[m.materialIndex];if(v&&v.visible){var g=s(n,h,v,a,i.near,i.far,o);t.renderBufferDirect(i,null,h,g,n,m)}}else if(u.visible){var y=s(n,h,u,a,i.near,i.far,o);t.renderBufferDirect(i,null,h,y,n,null)}}for(var x=n.children,b=0,_=x.length;b<_;b++)c(x[b],r,i,a,o)}}var l=new Ru,h=new ml,u=new ml,p=new _l,f=[],m=[],v={},g={"0":Io,"1":Oo,"2":Do},y=new I({"defines":{"SAMPLE_RATE":.25,"HALF_SAMPLE_RATE":1/8},"uniforms":{"shadow_pass":{"value":null},"resolution":{"value":new ml},"radius":{"value":4}},"vertexShader":Zu,"fragmentShader":Yu}),x=y.clone();x.defines.HORIZONAL_PASS=1;var b=new S;b.setAttribute("position",new d(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var _=new T(b,y),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ro,this.render=function(e,a,o){if(!1!==w.enabled&&(!1!==w.autoUpdate||!1!==w.needsUpdate)&&0!==e.length){var s=t.getRenderTarget(),d=t.getActiveCubeFace(),f=t.getActiveMipmapLevel(),m=t.state;m.setBlending(No),m.buffers.color.setClear(1,1,1,1),m.buffers.depth.setTest(!0),m.setScissorTest(!1);for(var v=0,g=e.length;v<g;v++){var y=e[v],x=y.shadow;if(!1!==x.autoUpdate||!1!==x.needsUpdate)if(void 0!==x){h.copy(x.mapSize);var b=x.getFrameExtents();if(h.multiply(b),u.copy(x.mapSize),(h.x>n||h.y>n)&&(h.x>n&&(u.x=Math.floor(n/b.x),h.x=u.x*b.x,x.mapSize.x=u.x),h.y>n&&(u.y=Math.floor(n/b.y),h.y=u.y*b.y,x.mapSize.y=u.y)),null===x.map&&!x.isPointLightShadow&&this.type===Co){var _={"minFilter":Os,"magFilter":Os,"format":Zs};x.map=new r(h.x,h.y,_),x.map.texture.name=y.name+".shadowMap",x.mapPass=new
  4. e.isLineDashedMaterial&&a(t,e)):e.isPointsMaterial?o(t,e,n,g):e.isSpriteMaterial?s(t,e):e.isShadowMaterial?(t.color.value.copy(e.color),t.opacity.value=e.opacity):e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)}function r(e,n){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.specularMap&&(e.specularMap.value=n.specularMap);var r=t.get(n).envMap;if(r){e.envMap.value=r,e.flipEnvMap.value=r.isCubeTexture?-1:1,e.reflectivity.value=n.reflectivity,e.refractionRatio.value=n.refractionRatio;var i=t.get(r).__maxMipLevel;void 0!==i&&(e.maxMipLevel.value=i)}n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity);var a;n.map?a=n.map:n.specularMap?a=n.specularMap:n.displacementMap?a=n.displacementMap:n.normalMap?a=n.normalMap:n.bumpMap?a=n.bumpMap:n.roughnessMap?a=n.roughnessMap:n.metalnessMap?a=n.metalnessMap:n.alphaMap?a=n.alphaMap:n.emissiveMap?a=n.emissiveMap:n.clearcoatMap?a=n.clearcoatMap:n.clearcoatNormalMap?a=n.clearcoatNormalMap:n.clearcoatRoughnessMap&&(a=n.clearcoatRoughnessMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),e.uvTransform.value.copy(a.matrix));var o;n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),e.uv2Transform.value.copy(o.matrix))}function i(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}function a(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function o(t,e,n,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*r,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap);var i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}function s(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function c(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function l(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Io&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Io&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function h(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===Io&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===Io&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function u(e,n){e.roughness.value=n.roughness,e.metalness.value=n.metalness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap),n.bumpMap&&(e.bumpMap.value=n.bumpMap,e.bumpScale.value=n.bumpScale,n.side===Io&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,e.normalScale.value.copy(n.normalScale),n.side===Io&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacem
  5. e.push(v.x,v.y,v.z),v.fromBufferAttribute(g,D.index2),e.push(v.x,v.y,v.z)}}else for(var N=t.attributes.position,B=0,z=N.count/3;B<z;B++)for(var G=0;G<3;G++){var F=3*B+G;v.fromBufferAttribute(N,F),e.push(v.x,v.y,v.z);var U=3*B+(G+1)%3;v.fromBufferAttribute(N,U),e.push(v.x,v.y,v.z)}}this.setAttribute("position",new _(e,3))}function pn(t,e,n){L.call(this),this.type="ParametricGeometry",this.parameters={"func":t,"slices":e,"stacks":n},this.fromBufferGeometry(new dn(t,e,n)),this.mergeVertices()}function dn(t,e,n){S.call(this),this.type="ParametricBufferGeometry",this.parameters={"func":t,"slices":e,"stacks":n};var r=[],i=[],a=[],o=[],s=new Tl,c=new Tl,l=new Tl,h=new Tl,u=new Tl;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var p=e+1,d=0;d<=n;d++)for(var f=d/n,m=0;m<=e;m++){var v=m/e;t(v,f,c),i.push(c.x,c.y,c.z),v-1e-5>=0?(t(v-1e-5,f,l),h.subVectors(c,l)):(t(v+1e-5,f,l),h.subVectors(l,c)),f-1e-5>=0?(t(v,f-1e-5,l),u.subVectors(c,l)):(t(v,f+1e-5,l),u.subVectors(l,c)),s.crossVectors(h,u).normalize(),a.push(s.x,s.y,s.z),o.push(v,f)}for(var g=0;g<n;g++)for(var y=0;y<e;y++){var x=g*p+y,b=g*p+y+1,w=(g+1)*p+y+1,M=(g+1)*p+y;r.push(x,b,M),r.push(b,w,M)}this.setIndex(r),this.setAttribute("position",new _(i,3)),this.setAttribute("normal",new _(a,3)),this.setAttribute("uv",new _(o,2))}function fn(t,e,n,r){L.call(this),this.type="PolyhedronGeometry",this.parameters={"vertices":t,"indices":e,"radius":n,"detail":r},this.fromBufferGeometry(new mn(t,e,n,r)),this.mergeVertices()}function mn(t,e,n,r){function i(t,e,n,r){for(var i=Math.pow(2,r),a=[],s=0;s<=i;s++){a[s]=[];for(var c=t.clone().lerp(n,s/i),l=e.clone().lerp(n,s/i),h=i-s,u=0;u<=h;u++)a[s][u]=0===u&&s===i?c:c.clone().lerp(l,u/h)}for(var p=0;p<i;p++)for(var d=0;d<2*(i-p)-1;d++){var f=Math.floor(d/2);d%2==0?(o(a[p][f+1]),o(a[p+1][f]),o(a[p][f])):(o(a[p][f+1]),o(a[p+1][f+1]),o(a[p+1][f]))}}function a(){for(var t=0;t<d.length;t+=6){var e=d[t+0],n=d[t+2],r=d[t+4],i=Math.max(e,n,r),a=Math.min(e,n,r);i>.9&&a<.1&&(e<.2&&(d[t+0]+=1),n<.2&&(d[t+2]+=1),r<.2&&(d[t+4]+=1))}}function o(t){p.push(t.x,t.y,t.z)}function s(e,n){var r=3*e;n.x=t[r+0],n.y=t[r+1],n.z=t[r+2]}function c(){for(var t=new Tl,e=new Tl,n=new Tl,r=new Tl,i=new ml,a=new ml,o=new ml,s=0,c=0;s<p.length;s+=9,c+=6){t.set(p[s+0],p[s+1],p[s+2]),e.set(p[s+3],p[s+4],p[s+5]),n.set(p[s+6],p[s+7],p[s+8]),i.set(d[c+0],d[c+1]),a.set(d[c+2],d[c+3]),o.set(d[c+4],d[c+5]),r.copy(t).add(e).add(n).divideScalar(3);var u=h(r);l(i,c+0,t,u),l(a,c+2,e,u),l(o,c+4,n,u)}}function l(t,e,n,r){r<0&&1===t.x&&(d[e]=t.x-1),0===n.x&&0===n.z&&(d[e]=r/2/Math.PI+.5)}function h(t){return Math.atan2(t.z,-t.x)}function u(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}S.call(this),this.type="PolyhedronBufferGeometry",this.parameters={"vertices":t,"indices":e,"radius":n,"detail":r},n=n||1,r=r||0;var p=[],d=[];!function(t){for(var n=new Tl,r=new Tl,a=new Tl,o=0;o<e.length;o+=3)s(e[o+0],n),s(e[o+1],r),s(e[o+2],a),i(n,r,a,t)}(r),function(t){for(var e=new Tl,n=0;n<p.length;n+=3)e.x=p[n+0],e.y=p[n+1],e.z=p[n+2],e.normalize().multiplyScalar(t),p[n+0]=e.x,p[n+1]=e.y,p[n+2]=e.z}(n),function(){for(var t=new Tl,e=0;e<p.length;e+=3){t.x=p[e+0],t.y=p[e+1],t.z=p[e+2];var n=h(t)/2/Math.PI+.5,r=u(t)/Math.PI+.5;d.push(n,1-r)}c(),a()}(),this.setAttribute("position",new _(p,3)),this.setAttribute("normal",new _(p.slice(),3)),this.setAttribute("uv",new _(d,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function vn(t,e){L.call(this),this.type="TetrahedronGeometry",this.parameters={"radius":t,"detail":e},this.fromBufferGeometry(new gn(t,e)),this.mergeVertices()}function gn(t,e){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];mn.call(this,n,r,t,e),this.type="TetrahedronBufferGeometry",this.parameters={"radius":t,"detail":e}}function yn(t,e){L.call(this),this.type="OctahedronGeometry",this.parameters={"radius":t,"detail":e},this.fromBufferGeometry(new xn(t,e)),this.mergeVertices()}function xn(t,e){var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,
  6. this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function zr(t){u.call(this),this.type="MeshLambertMaterial",this.color=new kh(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new kh(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=us,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Gr(t){u.call(this),this.defines={"MATCAP":""},this.type="MeshMatcapMaterial",this.color=new kh(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=il,this.normalScale=new ml(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Fr(t){$e.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function Ur(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function Hr(t,e,n,r){Ur.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function kr(t,e,n,r){Ur.call(this,t,e,n,r)}function Vr(t,e,n,r){Ur.call(this,t,e,n,r)}function jr(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Bp.convertArray(e,this.TimeBufferType),this.values=Bp.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Wr(t,e,n){jr.call(this,t,e,n)}function qr(t,e,n,r){jr.call(this,t,e,n,r)}function Xr(t,e,n,r){jr.call(this,t,e,n,r)}function Yr(t,e,n,r){Ur.call(this,t,e,n,r)}function Zr(t,e,n,r){jr.call(this,t,e,n,r)}function Jr(t,e,n,r){jr.call(this,t,e,n,r)}function Qr(t,e,n,r){jr.call(this,t,e,n,r)}function Kr(t,e,n,r){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.blendMode=void 0!==r?r:Xc,this.uuid=fl.generateUUID(),this.duration<0&&this.resetDuration()}function $r(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Xr;case"vector":case"vector2":case"vector3":case"vector4":return Qr;case"color":return qr;case"quaternion":return Zr;case"bool":case"boolean":return Wr;case"string":return Jr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function ti(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=$r(t.type);if(void 0===t.times){var n=[],r=[];Bp.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}function ei(t,e,n){var r=this,i=!1,a=0,o=0,s=void 0,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,!1===i&&void 0!==r.onStart&&r.onStart(t,a,o),i=!0},this.itemEnd=function(t){a++,void 0!==r.onProgress&&r.onProgress(t,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){var e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=c.length;e<n;e+=2){var r=c[e],i=c[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null}}function ni(t){this.manager=void 0!==t?t:Gp,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}function ri(t){ni.call(this,t)}function ii(t){ni.call(this,t)}function ai(t){ni.call(this,t)}function oi(t){ni.call(this,t)
  7. "vertexShader":"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t","fragmentShader":"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t","blending":No,"depthTest":!1,"depthWrite":!1})}function ja(t,e,n,r,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Vh(t,e,n,i,a,o)}function Wa(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function qa(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function Xa(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new an(t,e)}function Ya(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new qe(t)}function Za(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new an(t,e)}function Ja(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new rn(t)}function Qa(
  8. ;var Ml=function(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),Object.defineProperty(this,"isQuaternion",{"value":!0}),this._x=t,this._y=e,this._z=n,this._w=r},Sl={"x":{"configurable":!0},"y":{"configurable":!0},"z":{"configurable":!0},"w":{"configurable":!0}};Ml.slerp=function(t,e,n,r){return n.copy(t).slerp(e,r)},Ml.slerpFlat=function(t,e,n,r,i,a,o){var s=n[r+0],c=n[r+1],l=n[r+2],h=n[r+3],u=i[a+0],p=i[a+1],d=i[a+2],f=i[a+3];if(h!==f||s!==u||c!==p||l!==d){var m=1-o,v=s*u+c*p+l*d+h*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,v*g);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var _=o*g;if(s=s*m+u*_,c=c*m+p*_,l=l*m+d*_,h=h*m+f*_,m===1-o){var w=1/Math.sqrt(s*s+c*c+l*l+h*h);s*=w,c*=w,l*=w,h*=w}}t[e]=s,t[e+1]=c,t[e+2]=l,t[e+3]=h},Ml.multiplyQuaternionsFlat=function(t,e,n,r,i,a){var o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],h=i[a],u=i[a+1],p=i[a+2],d=i[a+3];return t[e]=o*d+l*h+s*p-c*u,t[e+1]=s*d+l*u+c*h-o*p,t[e+2]=c*d+l*p+o*u-s*h,t[e+3]=l*d-o*h-s*u-c*p,t},Sl.x.get=function(){return this._x},Sl.x.set=function(t){this._x=t,this._onChangeCallback()},Sl.y.get=function(){return this._y},Sl.y.set=function(t){this._y=t,this._onChangeCallback()},Sl.z.get=function(){return this._z},Sl.z.set=function(t){this._z=t,this._onChangeCallback()},Sl.w.get=function(){return this._w},Sl.w.set=function(t){this._w=t,this._onChangeCallback()},Ml.prototype.set=function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this},Ml.prototype.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},Ml.prototype.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},Ml.prototype.setFromEuler=function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,a=t._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),h=o(i/2),u=s(n/2),p=s(r/2),d=s(i/2);switch(a){case"XYZ":this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d;break;case"YXZ":this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d;break;case"ZXY":this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d;break;case"ZYX":this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d;break;case"YZX":this._x=u*l*h+c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h-u*p*d;break;case"XZY":this._x=u*l*h-c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h+u*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==e&&this._onChangeCallback(),this},Ml.prototype.setFromAxisAngle=function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},Ml.prototype.setFromRotationMatrix=function(t){var e=t.elements,n=e[0],r=e[4],i=e[8],a=e[1],o=e[5],s=e[9],c=e[2],l=e[6],h=e[10],u=n+o+h;if(u>0){var p=.5/Math.sqrt(u+1);this._w=.25/p,this._x=(l-s)*p,this._y=(i-c)*p,this._z=(a-r)*p}else if(n>o&&n>h){var d=2*Math.sqrt(1+n-o-h);this._w=(l-s)/d,this._x=.25*d,this._y=(r+a)/d,this._z=(i+c)/d}else if(o>h){var f=2*Math.sqrt(1+o-n-h);this._w=(i-c)/f,this._x=(r+a)/f,this._y=.25*f,this._z=(s+l)/f}else{var m=2*Math.sqrt(1+h-n-o);this._w=(a-r)/m,this._x=(i+c)/m,this._y=(s+l)/m,this._z=.25*m}return this._onChangeCallback(),this},Ml.prototype.setFromUnitVectors=function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},Ml.prototype.angleTo=function(t){return 2*Math.acos(Math.abs(fl.clamp(this.dot(t),-1,1)))},Ml.prototype.rotateTowards=function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},Ml.prototype.identity=function(){return this.set(0,0,0,1)},Ml.prototype.inverse=function(){return this.conju
  9. var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},Kl.prototype.determinant=function(){var t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],c=t[13],l=t[2],h=t[6],u=t[10],p=t[14];return t[3]*(+i*s*h-r*c*h-i*o*u+n*c*u+r*o*p-n*s*p)+t[7]*(+e*s*p-e*c*u+i*a*u-r*a*p+r*c*l-i*s*l)+t[11]*(+e*c*h-e*o*p-i*a*h+n*a*p+i*o*l-n*c*l)+t[15]*(-r*o*l-e*s*h+e*o*u+r*a*h-n*a*u+n*s*l)},Kl.prototype.transpose=function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},Kl.prototype.setPosition=function(t,e,n){var r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this},Kl.prototype.getInverse=function(t,e){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=t.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],h=r[6],u=r[7],p=r[8],d=r[9],f=r[10],m=r[11],v=r[12],g=r[13],y=r[14],x=r[15],b=d*y*u-g*f*u+g*h*m-l*y*m-d*h*x+l*f*x,_=v*f*u-p*y*u-v*h*m+c*y*m+p*h*x-c*f*x,w=p*g*u-v*d*u+v*l*m-c*g*m-p*l*x+c*d*x,M=v*d*h-p*g*h-v*l*f+c*g*f+p*l*y-c*d*y,S=i*b+a*_+o*w+s*M;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/S;return n[0]=b*T,n[1]=(g*f*s-d*y*s-g*o*m+a*y*m+d*o*x-a*f*x)*T,n[2]=(l*y*s-g*h*s+g*o*u-a*y*u-l*o*x+a*h*x)*T,n[3]=(d*h*s-l*f*s-d*o*u+a*f*u+l*o*m-a*h*m)*T,n[4]=_*T,n[5]=(p*y*s-v*f*s+v*o*m-i*y*m-p*o*x+i*f*x)*T,n[6]=(v*h*s-c*y*s-v*o*u+i*y*u+c*o*x-i*h*x)*T,n[7]=(c*f*s-p*h*s+p*o*u-i*f*u-c*o*m+i*h*m)*T,n[8]=w*T,n[9]=(v*d*s-p*g*s-v*a*m+i*g*m+p*a*x-i*d*x)*T,n[10]=(c*g*s-v*l*s+v*a*u-i*g*u-c*a*x+i*l*x)*T,n[11]=(p*l*s-c*d*s-p*a*u+i*d*u+c*a*m-i*l*m)*T,n[12]=M*T,n[13]=(p*g*o-v*d*o+v*a*f-i*g*f-p*a*y+i*d*y)*T,n[14]=(v*l*o-c*g*o-v*a*h+i*g*h+c*a*y-i*l*y)*T,n[15]=(c*d*o-p*l*o+p*a*h-i*d*h-c*a*f+i*l*f)*T,this},Kl.prototype.scale=function(t){var e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this},Kl.prototype.getMaxScaleOnAxis=function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))},Kl.prototype.makeTranslation=function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},Kl.prototype.makeRotationX=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},Kl.prototype.makeRotationY=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},Kl.prototype.makeRotationZ=function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},Kl.prototype.makeRotationAxis=function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,a=t.x,o=t.y,s=t.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this},Kl.prototype.makeScale=function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},Kl.prototype.makeShear=function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},Kl.prototype.compose=function(t,e,n){var r=this.elements,i=e._x,a=e._y,o=e._z,s=e._w,c=i+i,l=a+a,h=o+o,u=i*c,p=i*l,d=i*h,f=a*l,m=a*h,v=o*h,g=s*c,y=s*l,x=s*h,b=n.x,_=n.y,w=n.z;return r[0]=(1-(f+v))*b,r[1]=(p+x)*b,r[2]=(d-y)*b,r[3]=0,r[4]=(p-x)*_,r[5]=(1-(u+v))*_,r[6]=(m+g)*_,r[7]=0,r[8]=(d+y)*w,r[9]=(m-g)*w,r[10]=(1-(u+f))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},Kl.prototype.decompose=function(t,e,n){var r=this.elements,i=$l.set(r[0],r[1],r[2]).length(),a=$l.set(r[4],r[5],r[6]).length(),o=$l.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],th.copy(this);var s=1/i,c=1/a,l=1/o;return th.elements[0]*=s,th.elements[1]*=s,th.elements[2]*=s,th.elements[4]*=c,th.elements[5]*=c,th.elements[6]*=c,th.elements[8]*=l,th.elements[9]*=l,th.elements[10]*=l,e.setFromRotationMatrix(th),n.x=i,n.
  10. return(new this.constructor).copy(this)},Vh.prototype.copy=function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(var r=0,i=t.vertexColors.length;r<i;r++)this.vertexColors[r]=t.vertexColors[r].clone();return this};var jh=0;u.prototype=Object.assign(Object.create(e.prototype),{"constructor":u,"isMaterial":!0,"onBeforeCompile":function(){},"customProgramCacheKey":function(){return this.onBeforeCompile.toString()},"setValues":function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},"toJSON":function(t){function e(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}var n=void 0===t||"string"==typeof t;n&&(t={"textures":{},"images":{}});var r={"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(r.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,r.reflectivity=this.reflectivity,r.refractionRatio=this.refractionRatio,void 0!==this.combine&&(r.combine=this.combine),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),vo
  11. void 0!==l&&n.faceVertexUvs[1].push([(new ml).fromBufferAttribute(l,t),(new ml).fromBufferAttribute(l,e),(new ml).fromBufferAttribute(l,r)])}var n=this,r=null!==t.index?t.index:void 0,i=t.attributes;if(void 0===i.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var a=i.position,o=i.normal,s=i.color,c=i.uv,l=i.uv2;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var h=0;h<a.count;h++)n.vertices.push((new Tl).fromBufferAttribute(a,h)),void 0!==s&&n.colors.push((new kh).fromBufferAttribute(s,h));var u=t.groups;if(u.length>0)for(var p=0;p<u.length;p++)for(var d=u[p],f=d.start,m=d.count,v=f,g=f+m;v<g;v+=3)void 0!==r?e(r.getX(v),r.getX(v+1),r.getX(v+2),d.materialIndex):e(v,v+1,v+2,d.materialIndex);else if(void 0!==r)for(var y=0;y<r.count;y+=3)e(r.getX(y),r.getX(y+1),r.getX(y+2));else for(var x=0;x<a.count;x+=3)e(x,x+1,x+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},"center":function(){return this.computeBoundingBox(),this.boundingBox.getCenter(_u).negate(),this.translate(_u.x,_u.y,_u.z),this},"normalize":function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new Kl;return r.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(r),this},"computeFaceNormals":function(){for(var t=new Tl,e=new Tl,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),i.normal.copy(t)}},"computeVertexNormals":function(t){void 0===t&&(t=!0);for(var e=new Array(this.vertices.length),n=0,r=this.vertices.length;n<r;n++)e[n]=new Tl;if(t)for(var i=new Tl,a=new Tl,o=0,s=this.faces.length;o<s;o++){var c=this.faces[o],l=this.vertices[c.a],h=this.vertices[c.b],u=this.vertices[c.c];i.subVectors(u,h),a.subVectors(l,h),i.cross(a),e[c.a].add(i),e[c.b].add(i),e[c.c].add(i)}else{this.computeFaceNormals();for(var p=0,d=this.faces.length;p<d;p++){var f=this.faces[p];e[f.a].add(f.normal),e[f.b].add(f.normal),e[f.c].add(f.normal)}}for(var m=0,v=this.vertices.length;m<v;m++)e[m].normalize();for(var g=0,y=this.faces.length;g<y;g++){var x=this.faces[g],b=x.vertexNormals;3===b.length?(b[0].copy(e[x.a]),b[1].copy(e[x.b]),b[2].copy(e[x.c])):(b[0]=e[x.a].clone(),b[1]=e[x.b].clone(),b[2]=e[x.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},"computeFlatVertexNormals":function(){this.computeFaceNormals();for(var t=0,e=this.faces.length;t<e;t++){var n=this.faces[t],r=n.vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},"computeMorphNormals":function(){for(var t=0,e=this.faces.length;t<e;t++){var n=this.faces[t];n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]);for(var r=0,i=n.vertexNormals.length;r<i;r++)n.__originalVertexNormals[r]?n.__originalVertexNormals[r].copy(n.vertexNormals[r]):n.__originalVertexNormals[r]=n.vertexNormals[r].clone()}var a=new L;a.faces=this.faces;for(var o=0,s=this.morphTargets.length;o<s;o++){if(!this.morphNormals[o]){this.morphNormals[o]={},this.morphNormals[o].faceNormals=[],this.morphNormals[o].vertexNormals=[];for(var c=this.morphNormals[o].faceNormals,l=this.morphNormals[o].vertexNormals,h=0,u=this.faces.length;h<u;h++){var p=new Tl,d={"a":new Tl,"b":new Tl,"c":new Tl};c.push(p),l.push(d)}}var f=this.morphNormals[o];a.vertices=this.morphTargets[o].vertices,a.computeFaceNormals(),a.computeVertexNormals();for(var m=0,v=this.faces.length;m<v;m++){var g=this.faces[m],y=f.faceNormals[m],x=f.vertexNormals[m];y.copy(g.normal),x.a.copy(g.vertexNormals[0]),x.b.copy(g.vertexNormals[1]),x.c.copy(g.vertexNormals[2])}}for(var b=0,_=this.faces.length;b<_;b++){var w=this.faces[b];w.normal=w.__original
  12. "common":"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}","cube_uv_reflection_fragment":"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv
  13. "lights_physical_pars_fragment":"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLE
  14. "shadowmap_vertex":"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif","shadowmask_pars_fragment":"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}","skinbase_vertex":"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif","skinning_pars_vertex":"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#e
  15. "meshphysical_frag":"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <transmissionmap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <transmissionmap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","meshphysical_vert":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normal
  16. "distance":a.distance})}return e}}),Ze.prototype=Object.assign(Object.create(T.prototype),{"constructor":Ze,"isSkinnedMesh":!0,"copy":function(t){return T.prototype.copy.call(this,t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this},"bind":function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},"pose":function(){this.skeleton.pose()},"normalizeSkinWeights":function(){for(var t=new _l,e=this.geometry.attributes.skinWeight,n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},"updateMatrixWorld":function(t){T.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},"boneTransform":function(){var t=new Tl,e=new _l,n=new _l,r=new Tl,i=new Kl;return function(a,o){var s=this.skeleton,c=this.geometry;e.fromBufferAttribute(c.attributes.skinIndex,a),n.fromBufferAttribute(c.attributes.skinWeight,a),t.fromBufferAttribute(c.attributes.position,a).applyMatrix4(this.bindMatrix),o.set(0,0,0);for(var l=0;l<4;l++){var h=n.getComponent(l);if(0!==h){var u=e.getComponent(l);i.multiplyMatrices(s.bones[u].matrixWorld,s.boneInverses[u]),o.addScaledVector(r.copy(t).applyMatrix4(i),h)}}return o.applyMatrix4(this.bindMatrixInverse)}}()});var fp=new Kl,mp=new Kl;Object.assign(Je.prototype,{"calculateInverses":function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new Kl;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},"pose":function(){for(var t=0,e=this.bones.length;t<e;t++){var n=this.bones[t];n&&n.matrixWorld.getInverse(this.boneInverses[t])}for(var r=0,i=this.bones.length;r<i;r++){var a=this.bones[r];a&&(a.parent&&a.parent.isBone?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale))}},"update":function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=t.length;i<a;i++){var o=t[i]?t[i].matrixWorld:mp;fp.multiplyMatrices(o,e[i]),fp.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},"clone":function(){return new Je(this.bones,this.boneInverses)},"getBoneByName":function(t){for(var e=0,n=this.bones.length;e<n;e++){var r=this.bones[e];if(r.name===t)return r}},"dispose":function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Qe.prototype=Object.assign(Object.create(s.prototype),{"constructor":Qe,"isBone":!0});var vp=new Kl,gp=new Kl,yp=[],xp=new T;Ke.prototype=Object.assign(Object.create(T.prototype),{"constructor":Ke,"isInstancedMesh":!0,"copy":function(t){return T.prototype.copy.call(this,t),this.instanceMatrix.copy(t.instanceMatrix),this.count=t.count,this},"setColorAt":function(t,e){null===this.instanceColor&&(this.instanceColor=new d(new Float32Array(3*this.count),3)),e.toArray(this.instanceColor.array,3*t)},"getMatrixAt":function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},"raycast":function(t,e){var n=this.matrixWorld,r=this.count;if(xp.geometry=this.geometry,xp.material=this.material,void 0!==xp.material)for(var i=0;i<r;i++){this.getMatrixAt(i,vp),gp.multiplyMatrices(n,vp),xp.matrixWorld=gp,xp.raycast(t,yp);for(var a=0,o=yp.length;a<o;a++){var s=yp[a];s.instanceId=i,s.object=this,e.push(s)}yp.length=0}},"setMatrixAt":function(t,e){e.toArray(this.instanceMatrix.array,16*t)},"updateMorphTargets":function(){}}),$e.prototype=Object.create(u.prototype),$e.prototype.constructor=$e,$e.prototype.isLineBasicMaterial=!0,$e.prototype.copy=function(t){return u.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejo
  17. qr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":qr,"ValueTypeName":"color"}),Xr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":Xr,"ValueTypeName":"number"}),Yr.prototype=Object.assign(Object.create(Ur.prototype),{"constructor":Yr,"interpolate_":function(t,e,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-e)/(r-e),c=t*o,l=c+o;c!==l;c+=4)Ml.slerpFlat(i,0,a,c-o,a,c,s);return i}}),Zr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":Zr,"ValueTypeName":"quaternion","DefaultInterpolation":2301,"InterpolantFactoryMethodLinear":function(t){return new Yr(this.times,this.values,this.getValueSize(),t)},"InterpolantFactoryMethodSmooth":void 0}),Jr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":Jr,"ValueTypeName":"string","ValueBufferType":Array,"DefaultInterpolation":2300,"InterpolantFactoryMethodLinear":void 0,"InterpolantFactoryMethodSmooth":void 0}),Qr.prototype=Object.assign(Object.create(jr.prototype),{"constructor":Qr,"ValueTypeName":"vector"}),Object.assign(Kr,{"parse":function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,a=n.length;i!==a;++i)e.push(ti(n[i]).scale(r));return new Kr(t.name,t.duration,e,t.blendMode)},"toJSON":function(t){for(var e=[],n=t.tracks,r={"name":t.name,"duration":t.duration,"tracks":e,"uuid":t.uuid,"blendMode":t.blendMode},i=0,a=n.length;i!==a;++i)e.push(jr.toJSON(n[i]));return r},"CreateFromMorphTargetSequence":function(t,e,n,r){for(var i=e.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var l=Bp.getKeyframeOrder(s);s=Bp.sortedArray(s,1,l),c=Bp.sortedArray(c,1,l),r||0!==s[0]||(s.push(i),c.push(c[0])),a.push(new Xr(".morphTargetInfluences["+e[o].name+"]",s,c).scale(1/n))}return new Kr(t,-1,a)},"findByName":function(t,e){var n=t;if(!Array.isArray(t)){var r=t;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null},"CreateClipsFromMorphTargetSequences":function(t,e,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],c=s.name.match(i);if(c&&c.length>1){var l=c[1],h=r[l];h||(r[l]=h=[]),h.push(s)}}var u=[];for(var p in r)u.push(Kr.CreateFromMorphTargetSequence(p,r[p],e,n));return u},"parseAnimation":function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var a=[],o=[];Bp.flattenJSON(n,a,o,r),0!==a.length&&i.push(new t(e,a,o))}},r=[],i=t.name||"default",a=t.fps||30,o=t.blendMode,s=t.length||-1,c=t.hierarchy||[],l=0;l<c.length;l++){var h=c[l].keys;if(h&&0!==h.length)if(h[0].morphTargets){var u={},p=void 0;for(p=0;p<h.length;p++)if(h[p].morphTargets)for(var d=0;d<h[p].morphTargets.length;d++)u[h[p].morphTargets[d]]=-1;for(var f in u){for(var m=[],v=[],g=0;g!==h[p].morphTargets.length;++g){var y=h[p];m.push(y.time),v.push(y.morphTarget===f?1:0)}r.push(new Xr(".morphTargetInfluence["+f+"]",m,v))}s=u.length*(a||1)}else{var x=".bones["+e[l].name+"]";n(Qr,x+".position",h,"pos",r),n(Zr,x+".quaternion",h,"rot",r),n(Qr,x+".scale",h,"scl",r)}}return 0===r.length?null:new Kr(i,s,r,o)}}),Object.assign(Kr.prototype,{"resetDuration":function(){for(var t=this.tracks,e=0,n=0,r=t.length;n!==r;++n){var i=this.tracks[n];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this},"trim":function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},"validate":function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},"optimize":function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},"clone":function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new Kr(this.name,this.duration,t,this.blendMode)}});var zp={"enabled":!1,"files":{},"add":function(t,e){!1!==this.enabled&&(this.files[t]=e)},"get":function(t){if(!1!==this.enabled)return this.files[t]},"remove":function(t){delete this.files[t]},"clear":function(){this.files={}}},Gp=new ei;Object.assign(ni.prototype,{"load":function
  18. var e=s.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Vi.prototype=Object.assign(Object.create(zi.prototype),{"constructor":Vi,"isDirectionalLightShadow":!0,"updateMatrices":function(t){zi.prototype.updateMatrices.call(this,t)}}),ji.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":ji,"isDirectionalLight":!0,"copy":function(t){return Ni.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Wi.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":Wi,"isAmbientLight":!0}),qi.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":qi,"isRectAreaLight":!0,"copy":function(t){return Ni.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},"toJSON":function(t){var e=Ni.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}});var Wp=function(){Object.defineProperty(this,"isSphericalHarmonics3",{"value":!0}),this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new Tl)};Wp.prototype.set=function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},Wp.prototype.zero=function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},Wp.prototype.getAt=function(t,e){var n=t.x,r=t.y,i=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.282095),e.addScaledVector(a[1],.488603*r),e.addScaledVector(a[2],.488603*i),e.addScaledVector(a[3],.488603*n),e.addScaledVector(a[4],n*r*1.092548),e.addScaledVector(a[5],r*i*1.092548),e.addScaledVector(a[6],.315392*(3*i*i-1)),e.addScaledVector(a[7],n*i*1.092548),e.addScaledVector(a[8],.546274*(n*n-r*r)),e},Wp.prototype.getIrradianceAt=function(t,e){var n=t.x,r=t.y,i=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.886227),e.addScaledVector(a[1],1.023328*r),e.addScaledVector(a[2],1.023328*i),e.addScaledVector(a[3],1.023328*n),e.addScaledVector(a[4],.858086*n*r),e.addScaledVector(a[5],.858086*r*i),e.addScaledVector(a[6],.743125*i*i-.247708),e.addScaledVector(a[7],.858086*n*i),e.addScaledVector(a[8],.429043*(n*n-r*r)),e},Wp.prototype.add=function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},Wp.prototype.addScaledSH=function(t,e){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this},Wp.prototype.scale=function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},Wp.prototype.lerp=function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},Wp.prototype.equals=function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},Wp.prototype.copy=function(t){return this.set(t.coefficients)},Wp.prototype.clone=function(){return(new this.constructor).copy(this)},Wp.prototype.fromArray=function(t,e){void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this},Wp.prototype.toArray=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(t,e+3*r);return t},Wp.getBasisAt=function(t,e){var n=t.x,r=t.y,i=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*i,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*i,e[6]=.315392*(3*i*i-1),e[7]=1.092548*n*i,e[8]=.546274*(n*n-r*r)},Xi.prototype=Object.assign(Object.create(Ni.prototype),{"constructor":Xi,"isLightProbe":!0,"copy":function(t){return Ni.prototype.copy.call(this,t),this.sh.copy(t.sh),this},"fromJSON":function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this},"toJSON":function(t){var e=Ni.prototype.toJSON.call(this,t);return e.object.sh=this.sh.toArray(),e}}),Yi.prototype=Object.assign(Object.create(ni.prototype),{"constructor":Yi,"load":function(t,e,n,r){var i=this,a=new ri(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.load(t,function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):c
  19. ha.prototype.play=function(t){if(void 0===t&&(t=0),!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()},ha.prototype.pause=function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this)},ha.prototype.stop=function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this)},ha.prototype.connect=function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this},ha.prototype.disconnect=function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this},ha.prototype.getFilters=function(){return this.filters},ha.prototype.setFilters=function(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},ha.prototype.setDetune=function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},ha.prototype.getDetune=function(){return this.detune},ha.prototype.getFilter=function(){return this.getFilters()[0]},ha.prototype.setFilter=function(t){return this.setFilters(t?[t]:[])},ha.prototype.setPlaybackRate=function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this)},ha.prototype.getPlaybackRate=function(){return this.playbackRate},ha.prototype.onEnded=function(){this.isPlaying=!1},ha.prototype.getLoop=function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},ha.prototype.setLoop=function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this)},ha.prototype.setLoopStart=function(t){return this.loopStart=t,this},ha.prototype.setLoopEnd=function(t){return this.loopEnd=t,this},ha.prototype.getVolume=function(){return this.gain.gain.value},ha.prototype.setVolume=function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this};var od=new Tl,sd=new Ml,cd=new Tl,ld=new Tl;ua.prototype=Object.create(ha.prototype),ua.prototype.constructor=ua,ua.prototype.getOutput=function(){return this.panner},ua.prototype.getRefDistance=function(){return this.panner.refDistance},ua.prototype.setRefDistance=function(t){return this.panner.refDistance=t,this},ua.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor},ua.prototype.setRolloffFactor=function(t){return this.panner.rolloffFactor=t,this},ua.prototype.getDistanceModel=function(){return this.panner.distance
  20. Ed.prototype.setFromPoints=function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},Ed.prototype.setFromCenterAndSize=function(t,e){var n=Td.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},Ed.prototype.clone=function(){return(new this.constructor).copy(this)},Ed.prototype.copy=function(t){return this.min.copy(t.min),this.max.copy(t.max),this},Ed.prototype.makeEmpty=function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},Ed.prototype.isEmpty=function(){return this.max.x<this.min.x||this.max.y<this.min.y},Ed.prototype.getCenter=function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new ml),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},Ed.prototype.getSize=function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new ml),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},Ed.prototype.expandByPoint=function(t){return this.min.min(t),this.max.max(t),this},Ed.prototype.expandByVector=function(t){return this.min.sub(t),this.max.add(t),this},Ed.prototype.expandByScalar=function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},Ed.prototype.containsPoint=function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},Ed.prototype.containsBox=function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},Ed.prototype.getParameter=function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new ml),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},Ed.prototype.intersectsBox=function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},Ed.prototype.clampPoint=function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new ml),e.copy(t).clamp(this.min,this.max)},Ed.prototype.distanceToPoint=function(t){return Td.copy(t).clamp(this.min,this.max).sub(t).length()},Ed.prototype.intersect=function(t){return this.min.max(t.min),this.max.min(t.max),this},Ed.prototype.union=function(t){return this.min.min(t.min),this.max.max(t.max),this},Ed.prototype.translate=function(t){return this.min.add(t),this.max.add(t),this},Ed.prototype.equals=function(t){return t.min.equals(this.min)&&t.max.equals(this.max)};var Ad=new Tl,Ld=new Tl,Rd=function(t,e){this.start=void 0!==t?t:new Tl,this.end=void 0!==e?e:new Tl};Rd.prototype.set=function(t,e){return this.start.copy(t),this.end.copy(e),this},Rd.prototype.clone=function(){return(new this.constructor).copy(this)},Rd.prototype.copy=function(t){return this.start.copy(t.start),this.end.copy(t.end),this},Rd.prototype.getCenter=function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Tl),t.addVectors(this.start,this.end).multiplyScalar(.5)},Rd.prototype.delta=function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Tl),t.subVectors(this.end,this.start)},Rd.prototype.distanceSq=function(){return this.start.distanceToSquared(this.end)},Rd.prototype.distance=function(){return this.start.distanceTo(this.end)},Rd.prototype.at=function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Tl),this.delta(e).multiplyScalar(t).add(this.start)},Rd.prototype.closestPointToPointParameter=function(t,e){Ad.subVectors(t,this.start),Ld.subVectors(this.end,this.start);var n=Ld.dot(Ld),r=Ld.dot(Ad),i=r/n;return e&&(i=fl.clamp(i,0,1)),i},Rd.prototype.closestPointToPoint=function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Tl),this.delta(n).multiplyScalar(r).add(this.start)},Rd.prototype.applyMatrix4=function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},Rd.prototype.equals=function(t){return t.start.equals(this.start)&&t.end.equal
  21. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},"shadowCameraTop":{"set":function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},"shadowCameraBottom":{"set":function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},"shadowCameraNear":{"set":function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},"shadowCameraFar":{"set":function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},"shadowCameraVisible":{"set":function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},"shadowBias":{"set":function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},"shadowDarkness":{"set":function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},"shadowMapWidth":{"set":function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},"shadowMapHeight":{"set":function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(d.prototype,{"length":{"get":function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},"dynamic":{"get":function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===ll},"set":function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(ll)}}}),Object.assign(d.prototype,{"setDynamic":function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?ll:cl),this},"copyIndicesArray":function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},"setArray":function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(S.prototype,{"addIndex":function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},"addAttribute":function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new d(arguments[1],arguments[2])))},"addDrawCall":function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},"clearDrawCalls":function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},"computeTangents":function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},"computeOffsets":function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},"removeAttribute":function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},"applyMatrix":function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(S.prototype,{"drawcalls":{"get":function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},"offsets":{"get":function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Zi.prototype,{"maxInstancedCount":{"