vendor: 5,970 bytes, line 1
1function t(t){let e=t[0],s=t[1],i=t[2];return Math.sqrt(e*e+s*s+i*i)}function e(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function s(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t[2]=e[2]+s[2],t}function i(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t[2]=e[2]-s[2],t}function r(t,e,s){return t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function n(t){let e=t[0],s=t[1],i=t[2];return e*e+s*s+i*i}function h(t,e){let s=e[0],i=e[1],r=e[2],n=s*s+i*i+r*r;return n>0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function a(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function o(t,e,s){let i=e[0],r=e[1],n=e[2],h=s[0],a=s[1],o=s[2];return t[0]=r*o-n*a,t[1]=n*h-i*o,t[2]=i*a-r*h,t}const l=function(){const t=[0,0,0],s=[0,0,0];return function(i,r){e(t,i),e(s,r),h(t,t),h(s,s);let n=a(t,s);return n>1?0:n<-1?Math.PI:Math.acos(n)}}();class u extends Array{constructor(t=0,e=t,s=t){return super(t,e,s),this}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set(t,e=t,s=t){return t.length?this.copy(t):(function(t,e,s,i){t[0]=e,t[1]=s,t[2]=i}(this,t,e,s),this)}copy(t){return e(this,t),this}add(t,e){return e?s(this,t,e):s(this,this,t),this}sub(t,e){return e?i(this,t,e):i(this,this,t),this}multiply(t){var e,s,i;return t.length?(s=this,i=t,(e=this)[0]=s[0]*i[0],e[1]=s[1]*i[1],e[2]=s[2]*i[2]):r(this,this,t),this}divide(t){var e,s,i;return t.length?(s=this,i=t,(e=this)[0]=s[0]/i[0],e[1]=s[1]/i[1],e[2]=s[2]/i[2]):r(this,this,1/t),this}inverse(t=this){var e,s;return s=t,(e=this)[0]=1/s[0],e[1]=1/s[1],e[2]=1/s[2],this}len(){return t(this)}distance(e){return e?function(t,e){let s=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(s*s+i*i+r*r)}(this,e):t(this)}squaredLen(){return n(this)}squaredDistance(t){return t?function(t,e){let s=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return s*s+i*i+r*r}(this,t):n(this)}negate(t=this){var e,s;return s=t,(e=this)[0]=-s[0],e[1]=-s[1],e[2]=-s[2],this}cross(t,e){return e?o(this,t,e):o(this,this,t),this}scale(t){return r(this,this,t),this}normalize(){return h(this,this),this}dot(t){return a(this,t)}equals(t){return e=t,this[0]===e[0]&&this[1]===e[1]&&this[2]===e[2];var e}applyMatrix3(t){return function(t,e,s){let i=e[0],r=e[1],n=e[2];t[0]=i*s[0]+r*s[3]+n*s[6],t[1]=i*s[1]+r*s[4]+n*s[7],t[2]=i*s[2]+r*s[5]+n*s[8]}(this,this,t),this}applyMatrix4(t){return function(t,e,s){let i=e[0],r=e[1],n=e[2],h=s[3]*i+s[7]*r+s[11]*n+s[15];h=h||1,t[0]=(s[0]*i+s[4]*r+s[8]*n+s[12])/h,t[1]=(s[1]*i+s[5]*r+s[9]*n+s[13])/h,t[2]=(s[2]*i+s[6]*r+s[10]*n+s[14])/h}(this,this,t),this}scaleRotateMatrix4(t){return function(t,e,s){let i=e[0],r=e[1],n=e[2],h=s[3]*i+s[7]*r+s[11]*n+s[15];h=h||1,t[0]=(s[0]*i+s[4]*r+s[8]*n)/h,t[1]=(s[1]*i+s[5]*r+s[9]*n)/h,t[2]=(s[2]*i+s[6]*r+s[10]*n)/h}(this,this,t),this}applyQuaternion(t){return function(t,e,s){let i=e[0],r=e[1],n=e[2],h=s[0],a=s[1],o=s[2],l=a*n-o*r,u=o*i-h*n,c=h*r-a*i,d=a*c-o*u,g=o*l-h*c,f=h*u-a*l,p=2*s[3];l*=p,u*=p,c*=p,d*=2,g*=2,f*=2,t[0]=i+l+d,t[1]=r+u+g,t[2]=n+c+f}(this,this,t),this}angle(t){return l(this,t)}lerp(t,e){return function(t,e,s,i){let r=e[0],n=e[1],h=e[2];t[0]=r+i*(s[0]-r),t[1]=n+i*(s[1]-n),t[2]=h+i*(s[2]-h)}(this,this,t,e),this}smoothLerp(t,e,s){return function(t,e,s,i,r){const n=Math.exp(-i*r);let h=e[0],a=e[1],o=e[2];t[0]=s[0]+(h-s[0])*n,t[1]=s[1]+(a-s[1])*n,t[2]=s[2]+(o-s[2])*n}(this,this,t,e,s),this}clone(){return new u(this[0],this[1],this[2])}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}transformDirection(t){const e=this[0],s=this[1],i=this[2];return this[0]=t[0]*e+t[4]*s+t[8]*i,this[1]=t[1]*e+t[5]*s+t[9]*i,this[2]=t[2]*e+t[6]*s+t[10]*i,this.normalize()}}const c=new u;let d=1,g=1,f=!1;class p{constructor(t,e={}){t.canvas,this.gl=t,this.attributes=e,this.id=d++,this.VAOs={},this.drawRange={start:0,count:0},this.instancedCount=0,this.gl.renderer.bindVertexArray(null),this.gl.renderer.currentGeometry=null,this.glState=this.gl.renderer.state;for(let s in e)this.addAttribute(s,e[s])}addAttribute(t,e){if(this.attributes[t]=e,e.id=g++,e.size=e.size||1,e.type=e.type||(e.data.constructor===Float32Array?this.gl.FLOAT:e.data.constructor===Uint16Array?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT),e.target="index"===t?this.gl.ELEMENT_ARRAY_BUFFER:this.gl.ARRAY_BUFFER,e.normalized=e.normalized||!1,e.stride=e.stride||0,e.offset=e.offset||0,e.count=e.count||(e.stride?e.data.byteLength/e.stride:e.data.length/e.size),e.divisor=e.instanced||0,e.needsUpdate=!1,e.usage=e.usage||this.gl.STATIC_DRAW,e.buffer||this.updateAttribute(e),e.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==e.count*e.divisor)return this.instancedCount=Math.min(this.instancedCount,e.count*e.divisor);this.instancedCount=e.count*e.divisor}else"index"===t?this.drawRange.count=e.count:this.attributes.index||(this.drawRange.count=Math.max(this.drawRange.count,e.count))}updateAttribute(t){const e=!t.buffer;e&&(t.buffer=this.gl.createBuffer()),this.glState.boundBuffer!==t.buffer&&(this.gl.bindBuffer(t.target,t.buffer),this.glState.boundBuffer=t.buffer),e?this.gl.bufferData(t.target,t.data,t.usage):this.gl.bufferSubData(t.target,0,t.data),t.needsUpdate=!1}setIndex(t){this.addAttribute("index",t)}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}setInstancedCount(t){this.instancedCount=t}createVAO(t){this.VAOs[t.attributeOrder]=this.gl.renderer.createVertexArray(),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.bindAttributes(t)}bindAttributes(t){t.attributeLocations.forEach((t,{name:e,type:s})=>{if(!this.attributes[e])return;const i=this.attributes[e];this.gl.bindBuffer(i.target,i.buffer),this.glState.boundBuffer=i.buffer;let r=1;35674===s&&(r=2),35675===s&&(r=3),35676===s&&(r=4);const n=i.size/r,h=1===r?0:r*r*4,a=1===r?0:4*r;for(let o=0;o<r;o++)this.gl.vertexAttribPointer(t+o,n,i.type,i.normalized,i.stride+h,i.offset+o*a),this.gl.enableVertexAttribArray(t
1+o),this.gl.renderer.vertexAttribDivisor(t+o,i.divisor)}),this.attributes.index&&this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.attributes.index.buffer)}draw({program:t,mode:e=this.gl.TRIANGLES}){this.gl.renderer.currentGeometry!==`${this.id}_${t.attributeOrder}`&&(this.VAOs[t.attributeOrder]||this.createVAO(t),this.gl.renderer.bindVertexArray(this.VAOs[t.attributeOrder]),this.gl.renderer.currentGeometry=`${this.id}_${t.attributeOrder}`),t.attributeLocations.forEach((t,{name:e})=>{const s=this.attributes[e];s.needsUpdate&&this.updateAttribute(s)});let s=2;this.attributes.index?.type===this.gl.UNSIGNED_INT&&(s=4),this.isInstanced?this.attributes.index?this.gl.renderer.drawElementsInstanced(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*s,this.instancedCount):this.gl.renderer.drawArraysInstanced(e,this.drawRange.start,this.drawRange.count,this.instancedCount):this.attributes.index?this.gl.drawElements(e,this.drawRange.count,this.attributes.index.type,this.attributes.index.offset+this.drawRange.start*s):this.gl.drawArrays(e,this.drawRange.start,this.drawRange.count)}getPosition(){const t=this.attributes.position;return t.data?t:f?void 0:f=!0}computeBoundingBox(t){t||(t=this.getPosition());const e=t.data,s=t.size;this.bounds||(this.bounds={min:new u,max:new u,center:new u,scale:new u,radius:1/0});const i=this.bounds.min,r=this.bounds.max,n=this.bounds.center,h=this.bounds.scale;i.set(1/0),r.set(-1/0);for(let a=0,o=e.length;a<o;a+=s){const t=e[a],s=e[a+1],n=e[a+2];i.x=Math.min(t,i.x),i.y=Math.min(s,i.y),i.z=Math.min(n,i.z),r.x=Math.max(t,r.x),r.y=Math.max(s,r.y),r.z=Math.max(n,r.z)}h.sub(r,i),n.add(i,r).divide(2)}computeBoundingSphere(t){t||(t=this.getPosition());const e=t.data,s=t.size;this.bounds||this.computeBoundingBox(t);let i=0;for(let r=0,n=e.length;r<n;r+=s)c.fromArray(e,r),i=Math.max(i,this.bounds.center.squaredDistance(c));this.bounds.radius=Math.sqrt(i)}remove(){for(let t in this.VAOs)this.gl.renderer.deleteVertexArray(this.VAOs[t]),delete this.VAOs[t];for(let t in this.attributes)this.gl.deleteBuffer(this.attributes[t].buffer),delete this.attributes[t]}}let m=1;const x={};class b{constructor(t,{vertex:e,fragment:s,uniforms:i={},transparent:r=!1,cullFace:n=t.BACK,frontFace:h=t.CCW,depthTest:a=!0,depthWrite:o=!0,depthFunc:l=t.LEQUAL}={}){t.canvas,this.gl=t,this.uniforms=i,this.id=m++,this.transparent=r,this.cullFace=n,this.frontFace=h,this.depthTest=a,this.depthWrite=o,this.depthFunc=l,this.blendFunc={},this.blendEquation={},this.stencilFunc={},this.stencilOp={},this.transparent&&!this.blendFunc.src&&(this.gl.renderer.premultipliedAlpha?this.setBlendFunc(this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA):this.setBlendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)),this.vertexShader=t.createShader(t.VERTEX_SHADER),this.fragmentShader=t.createShader(t.FRAGMENT_SHADER),this.program=t.createProgram(),t.attachShader(this.program,this.vertexShader),t.attachShader(this.program,this.fragmentShader),this.setShaders({vertex:e,fragment:s})}setShaders({vertex:t,fragment:e}){if(t&&(this.gl.shaderSource(this.vertexShader,t),this.gl.compileShader(this.vertexShader),this.gl.getShaderInfoLog(this.vertexShader)),e&&(this.gl.shaderSource(this.fragmentShader,e),this.gl.compileShader(this.fragmentShader),this.gl.getShaderInfoLog(this.fragmentShader)),this.gl.linkProgram(this.program),!this.gl.getProgramParameter(this.program,this.gl.LINK_STATUS))return;this.uniformLocations=new Map;let s=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_UNIFORMS);for(let n=0;n<s;n++){let t=this.gl.getActiveUniform(this.program,n);this.uniformLocations.set(t,this.gl.getUniformLocation(this.program,t.name));const e=t.name.match(/(\w+)/g);t.uniformName=e[0],t.nameComponents=e.slice(1)}this.attributeLocations=new Map;const i=[],r=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES);for(let n=0;n<r;n++){const t=this.gl.getActiveAttrib(this.program,n),e=this.gl.getAttribLocation(this.program,t.name);-1!==e&&(i[e]=t.name,this.attributeLocations.set(t,e))}this.attributeOrder=i.join("")}setBlendFunc(t,e,s,i){this.blendFunc.src=t,this.blendFunc.dst=e,this.blendFunc.srcAlpha=s,this.blendFunc.dstAlpha=i,t&&(this.transparent=!0)}setBlendEquation(t,e){this.blendEquation.modeRGB=t,this.blendEquation.modeAlpha=e}setStencilFunc(t,e,s){this.stencilRef=e,this.stencilFunc.func=t,this.stencilFunc.ref=e,this.stencilFunc.mask=s}setStencilOp(t,e,s){this.stencilOp.stencilFail=t,this.stencilOp.depthFail=e,this.stencilOp.depthPass=s}applyState(){this.depthTest?this.gl.renderer.enable(this.gl.DEPTH_TEST):this.gl.renderer.disable(this.gl.DEPTH_TEST),this.cullFace?this.gl.renderer.enable(this.gl.CULL_FACE):this.gl.renderer.disable(this.gl.CULL_FACE),this.blendFunc.src?this.gl.renderer.enable(this.gl.BLEND):this.gl.renderer.disable(this.gl.BLEND),this.cullFace&&this.gl.renderer.setCullFace(this.cullFace),this.gl.renderer.setFrontFace(this.frontFace),this.gl.renderer.setDepthMask(this.depthWrite),this.gl.renderer.setDepthFunc(this.depthFunc),this.blendFunc.src&&this.gl.renderer.setBlendFunc(this.blendFunc.src,this.blendFunc.dst,this.blendFunc.srcAlpha,this.blendFunc.dstAlpha),this.gl.renderer.setBlendEquation(this.blendEquation.modeRGB,this.blendEquation.modeAlpha),this.stencilFunc.func||this.stencilOp.stencilFail?this.gl.renderer.enable(this.gl.STENCIL_TEST):this.gl.renderer.disable(this.gl.STENCIL_TEST),this.gl.renderer.setStencilFunc(this.stencilFunc.func,this.stencilFunc.ref,this.stencilFunc.mask),this.gl.renderer.setStencilOp(this.stencilOp.stencilFail,this.stencilOp.depthFail,this.stencilOp.depthPass)}use({flipFaces:t=!1}={}){let e=-1;this.gl.renderer.state.currentProgram===this.id||(this.gl.useProgram(this.program),this.gl.renderer.state.currentProgram=this.id
1),this.uniformLocations.forEach((t,s)=>{let i=this.uniforms[s.uniformName];for(const e of s.nameComponents){if(!i)break;if(!(e in i)){if(Array.isArray(i.value))break;i=void 0;break}i=i[e]}if(!i)return E(s.name);if(i&&void 0===i.value)return E(s.name);if(i.value.texture)return e+=1,i.value.update(e),M(this.gl,s.type,t,e);if(i.value.length&&i.value[0].texture){const r=[];return i.value.forEach(t=>{e+=1,t.update(e),r.push(e)}),M(this.gl,s.type,t,r)}M(this.gl,s.type,t,i.value)}),this.applyState(),t&&this.gl.renderer.setFrontFace(this.frontFace===this.gl.CCW?this.gl.CW:this.gl.CCW)}remove(){this.gl.deleteProgram(this.program)}}function M(t,e,s,i){i=i.length?function(t){const e=t.length,s=t[0].length;if(void 0===s)return t;const i=e*s;let r=x[i];r||(x[i]=r=new Float32Array(i));for(let n=0;n<e;n++)r.set(t[n],n*s);return r}(i):i;const r=t.renderer.state.uniformLocations.get(s);if(i.length)if(void 0===r||r.length!==i.length)t.renderer.state.uniformLocations.set(s,i.slice(0));else{if(function(t,e){if(t.length!==e.length)return!1;for(let s=0,i=t.length;s<i;s++)if(t[s]!==e[s])return!1;return!0}(r,i))return;r.set?r.set(i):function(t,e){for(let s=0,i=t.length;s<i;s++)t[s]=e[s]}(r,i),t.renderer.state.uniformLocations.set(s,r)}else{if(r===i)return;t.renderer.state.uniformLocations.set(s,i)}switch(e){case 5126:return i.length?t.uniform1fv(s,i):t.uniform1f(s,i);case 35664:return t.uniform2fv(s,i);case 35665:return t.uniform3fv(s,i);case 35666:return t.uniform4fv(s,i);case 35670:case 5124:case 35678:case 36306:case 35680:case 36289:return i.length?t.uniform1iv(s,i):t.uniform1i(s,i);case 35671:case 35667:return t.uniform2iv(s,i);case 35672:case 35668:return t.uniform3iv(s,i);case 35673:case 35669:return t.uniform4iv(s,i);case 35674:return t.uniformMatrix2fv(s,!1,i);case 35675:return t.uniformMatrix3fv(s,!1,i);case 35676:return t.uniformMatrix4fv(s,!1,i)}}let _=0;function E(t){_>100||_++}const A=new u;let v=1;class F{constructor({canvas:t=document.createElement("canvas"),width:e=300,height:s=150,dpr:i=1,alpha:r=!1,depth:n=!0,stencil:h=!1,antialias:a=!1,premultipliedAlpha:o=!1,preserveDrawingBuffer:l=!1,powerPreference:u="default",autoClear:c=!0,webgl:d=2}={}){const g={alpha:r,depth:n,stencil:h,antialias:a,premultipliedAlpha:o,preserveDrawingBuffer:l,powerPreference:u};this.dpr=i,this.alpha=r,this.color=!0,this.depth=n,this.stencil=h,this.premultipliedAlpha=o,this.autoClear=c,this.id=v++,2===d&&(this.gl=t.getContext("webgl2",g)),this.isWebgl2=!!this.gl,this.gl||(this.gl=t.getContext("webgl",g)),this.gl,this.gl.renderer=this,this.setSize(e,s),this.state={},this.state.blendFunc={src:this.gl.ONE,dst:this.gl.ZERO},this.state.blendEquation={modeRGB:this.gl.FUNC_ADD},this.state.cullFace=!1,this.state.frontFace=this.gl.CCW,this.state.depthMask=!0,this.state.depthFunc=this.gl.LEQUAL,this.state.premultiplyAlpha=!1,this.state.flipY=!1,this.state.unpackAlignment=4,this.state.framebuffer=null,this.state.viewport={x:0,y:0,width:null,height:null},this.state.textureUnits=[],this.state.activeTextureUnit=0,this.state.boundBuffer=null,this.state.uniformLocations=new Map,this.state.currentProgram=null,this.extensions={},this.isWebgl2?(this.getExtension("EXT_color_buffer_float"),this.getExtension("OES_texture_float_linear")):(this.getExtension("OES_texture_float"),this.getExtension("OES_texture_float_linear"),this.getExtension("OES_texture_half_float"),this.getExtension("OES_texture_half_float_linear"),this.getExtension("OES_element_index_uint"),this.getExtension("OES_standard_derivatives"),this.getExtension("EXT_sRGB"),this.getExtension("WEBGL_depth_texture"),this.getExtension("WEBGL_draw_buffers")),this.getExtension("WEBGL_compressed_texture_astc"),this.getExtension("EXT_texture_compression_bptc"),this.getExtension("WEBGL_compressed_texture_s3tc"),this.getExtension("WEBGL_compressed_texture_etc1"),this.getExtension("WEBGL_compressed_texture_pvrtc"),this.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this.drawBuffers=this.getExtension("WEBGL_draw_buffers","drawBuffers","drawBuffersWEBGL"),this.parameters={},this.parameters.maxTextureUnits=this.gl.getParameter(this.gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.parameters.maxAnisotropy=this.getExtension("EXT_texture_filter_anisotropic")?this.gl.getParameter(this.getExtension("EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}setSize(t,e){this.width=t,this.height=e,this.gl.canvas.width=t*this.dpr,this.gl.canvas.height=e*this.dpr,this.gl.canvas.style&&Object.assign(this.gl.canvas.style,{width:t+"px",height:e+"px"})}setViewport(t,e,s=0,i=0){this.state.viewport.width===t&&this.state.viewport.height===e||(this.state.viewport.width=t,this.state.viewport.height=e,this.state.viewport.x=s,this.state.viewport.y=i,this.gl.viewport(s,i,t,e))}setScissor(t,e,s=0,i=0){this.gl.scissor(s,i,t,e)}enable(t){!0!==this.state[t]&&(this.gl.enable(t),this.state[t]=!0)}disable(t){!1!==this.state[t]&&(this.gl.disable(t),this.state[t]=!1)}setBlendFunc(t,e,s,i){this.state.blendFunc.src===t&&this.state.blendFunc.dst===e&&this.state.blendFunc.srcAlpha===s&&this.state.blendFunc.dstAlpha===i||(this.state.blendFunc.src=t,this.state.blendFunc.dst=e,this.state.blendFunc.srcAlpha=s,this.state.blendFunc.dstAlpha=i,void 0!==s?this.gl.blendFuncSeparate(t,e,s,i):this.gl.blendFunc(t,e))}setBlendEquation(t,e){t=t||this.gl.FUNC_ADD,this.state.blendEquation.modeRGB===t&&this.state.blendEquation.modeAlpha===e||(this.state.blendEquation.modeRGB=t,this.state.blendEquation.modeAlpha=e,void 0!==e?this.gl.blendEquationSeparate(t,e):this.gl.blendEquation(t))}setCullFace(t){this.state.cullFace!==t&&(this.state.cullFace=t,this.gl.cullFace(t))}setFrontFace(t){this.state.frontFace!==t&&(this.state.frontFace=t,this.gl.frontFace(t))}setDepthMask(t){this.state.depthMask!==t&&(this.state.depthMask=t,this.gl.depthMask(t))}setDepthFunc(t){this.state.depthFunc!==t&&(this.state.depthFunc=t,this.gl.depthFunc(t))}setStencilMask(t){this.state.stencilMask!==t&&(this.state.stencilMask=t,this.gl.stencilMask(t))}setStencilFunc(t,e,s){this.state.stencilFunc===t&&this.state.stencilRef===e&&this.state.stencilFuncMask===s||(this.state.stencilFunc=t||this.gl.ALWAYS,this.state.stencilRef=e||0,this.state.stencilFuncMask=s||0,this.gl.stencilFunc(t||this.gl.ALWAYS,e||0,s||0))}setStencilOp(t,e,s){this.state.stencilFail===t&&this.state.stencilDepthFail===e&&this.state.stencilDepthPass===s||(this.state.stencilFail=t,this.state.stencilDepthFail=e,this.state.stencilDepthPass=s,this.gl.stencilOp(t,e,s))}activeTexture(t){this.state.activeTextureUnit!==t&&(this.state.activeTextureUnit=t,this.gl.activeTexture(this.gl.TEXTURE0+t))}bindFramebuffer({target:t=this.gl.FRAMEBUFFER,buffer:e=null}={}){this.state.framebuffer!==e&&(this.state.framebuffer=e,this.gl.bindFramebuffer(t,e))}getExtension(t,e,s){return e&&this.gl[e]?this.gl[e].bind(this.gl):(this.extensions[t]||(this.extensions[t]=this.gl.getExtension(t)),e?this.extensions[t]?this.extensions[t][s].bind(this.extensions[t]):null:this.extensions[t])}sortOpaque(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:t.zDepth!==e.zDepth?t.zDepth-e.zDepth:e.id-t.id}
1sortTransparent(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.zDepth!==e.zDepth?e.zDepth-t.zDepth:e.id-t.id}sortUI(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program.id!==e.program.id?t.program.id-e.program.id:e.id-t.id}getRenderList({scene:t,camera:e,frustumCull:s,sort:i}){let r=[];if(e&&s&&e.updateFrustum(),t.traverse(t=>{if(!t.visible)return!0;t.draw&&(s&&t.frustumCulled&&e&&!e.frustumIntersectsMesh(t)||r.push(t))}),i){const t=[],s=[],i=[];r.forEach(r=>{r.program.transparent?r.program.depthTest?s.push(r):i.push(r):t.push(r),r.zDepth=0,0===r.renderOrder&&r.program.depthTest&&e&&(r.worldMatrix.getTranslation(A),A.applyMatrix4(e.projectionViewMatrix),r.zDepth=A.z)}),t.sort(this.sortOpaque),s.sort(this.sortTransparent),i.sort(this.sortUI),r=t.concat(s,i)}return r}render({scene:t,camera:e,target:s=null,update:i=!0,sort:r=!0,frustumCull:n=!0,clear:h}){null===s?(this.bindFramebuffer(),this.setViewport(this.width*this.dpr,this.height*this.dpr)):(this.bindFramebuffer(s),this.setViewport(s.width,s.height)),(h||this.autoClear&&!1!==h)&&(!this.depth||s&&!s.depth||(this.enable(this.gl.DEPTH_TEST),this.setDepthMask(!0)),(this.stencil||!s||s.stencil)&&(this.enable(this.gl.STENCIL_TEST),this.setStencilMask(255)),this.gl.clear((this.color?this.gl.COLOR_BUFFER_BIT:0)|(this.depth?this.gl.DEPTH_BUFFER_BIT:0)|(this.stencil?this.gl.STENCIL_BUFFER_BIT:0))),i&&t.updateMatrixWorld(),e&&e.updateMatrixWorld(),this.getRenderList({scene:t,camera:e,frustumCull:n,sort:r}).forEach(t=>{t.draw({camera:e})})}}function w(t,e,s){let i=e[0],r=e[1],n=e[2],h=e[3],a=s[0],o=s[1],l=s[2],u=s[3];return t[0]=i*u+h*a+r*l-n*o,t[1]=r*u+h*o+n*a-i*l,t[2]=n*u+h*l+i*o-r*a,t[3]=h*u-i*a-r*o-n*l,t}class y extends Array{constructor(t=0,e=0,s=0,i=1){super(t,e,s,i),this.onChange=()=>{},this._target=this;const r=["0","1","2","3"];return new Proxy(this,{set(t,e){const s=Reflect.set(...arguments);return s&&r.includes(e)&&t.onChange(),s}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set w(t){this._target[3]=t,this.onChange()}identity(){var t;return(t=this._target)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.onChange(),this}set(t,e,s,i){return t.length?this.copy(t):(function(t,e,s,i,r){t[0]=e,t[1]=s,t[2]=i,t[3]=r}(this._target,t,e,s,i),this.onChange(),this)}rotateX(t){return function(t,e,s){s*=.5;let i=e[0],r=e[1],n=e[2],h=e[3],a=Math.sin(s),o=Math.cos(s);t[0]=i*o+h*a,t[1]=r*o+n*a,t[2]=n*o-r*a,t[3]=h*o-i*a}(this._target,this._target,t),this.onChange(),this}rotateY(t){return function(t,e,s){s*=.5;let i=e[0],r=e[1],n=e[2],h=e[3],a=Math.sin(s),o=Math.cos(s);t[0]=i*o-n*a,t[1]=r*o+h*a,t[2]=n*o+i*a,t[3]=h*o-r*a}(this._target,this._target,t),this.onChange(),this}rotateZ(t){return function(t,e,s){s*=.5;let i=e[0],r=e[1],n=e[2],h=e[3],a=Math.sin(s),o=Math.cos(s);t[0]=i*o+r*a,t[1]=r*o-i*a,t[2]=n*o+h*a,t[3]=h*o-n*a}(this._target,this._target,t),this.onChange(),this}inverse(t=this._target){return function(t,e){let s=e[0],i=e[1],r=e[2],n=e[3],h=s*s+i*i+r*r+n*n,a=h?1/h:0;t[0]=-s*a,t[1]=-i*a,t[2]=-r*a,t[3]=n*a}(this._target,t),this.onChange(),this}conjugate(t=this._target){var e,s;return s=t,(e=this._target)[0]=-s[0],e[1]=-s[1],e[2]=-s[2],e[3]=s[3],this.onChange(),this}copy(t){return e=this._target,s=t,e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],this.onChange(),this;var e,s}normalize(t=this._target){return function(t,e){let s=e[0],i=e[1],r=e[2],n=e[3],h=s*s+i*i+r*r+n*n;h>0&&(h=1/Math.sqrt(h)),t[0]=s*h,t[1]=i*h,t[2]=r*h,t[3]=n*h}(this._target,t),this.onChange(),this}multiply(t,e){return e?w(this._target,t,e):w(this._target,this._target,t),this.onChange(),this}dot(t){return e=this._target,s=t,e[0]*s[0]+e[1]*s[1]+e[2]*s[2]+e[3]*s[3];var e,s}fromMatrix3(t){return function(t,e){let s,i=e[0]+e[4]+e[8];if(i>0)s=Math.sqrt(i+1),t[3]=.5*s,s=.5/s,t[0]=(e[5]-e[7])*s,t[1]=(e[6]-e[2])*s,t[2]=(e[1]-e[3])*s;else{let i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);let r=(i+1)%3,n=(i+2)%3;s=Math.sqrt(e[3*i+i]-e[3*r+r]-e[3*n+n]+1),t[i]=.5*s,s=.5/s,t[3]=(e[3*r+n]-e[3*n+r])*s,t[r]=(e[3*r+i]+e[3*i+r])*s,t[n]=(e[3*n+i]+e[3*i+n])*s}}(this._target,t),this.onChange(),this}fromEuler(t,e){return function(t,e,s="YXZ"){let i=Math.sin(.5*e[0]),r=Math.cos(.5*e[0]),n=Math.sin(.5*e[1]),h=Math.cos(.5*e[1]),a=Math.sin(.5*e[2]),o=Math.cos(.5*e[2]);"XYZ"===s?(t[0]=i*h*o+r*n*a,t[1]=r*n*o-i*h*a,t[2]=r*h*a+i*n*o,t[3]=r*h*o-i*n*a):"YXZ"===s?(t[0]=i*h*o+r*n*a,t[1]=r*n*o-i*h*a,t[2]=r*h*a-i*n*o,t[3]=r*h*o+i*n*a):"ZXY"===s?(t[0]=i*h*o-r*n*a,t[1]=r*n*o+i*h*a,t[2]=r*h*a+i*n*o,t[3]=r*h*o-i*n*a):"ZYX"===s?(t[0]=i*h*o-r*n*a,t[1]=r*n*o+i*h*a,t[2]=r*h*a-i*n*o,t[3]=r*h*o+i*n*a):"YZX"===s?(t[0]=i*h*o+r*n*a,t[1]=r*n*o+i*h*a,t[2]=r*h*a-i*n*o,t[3]=r*h*o-i*n*a):"XZY"===s&&(t[0]=i*h*o-r*n*a,t[1]=r*n*o-i*h*a,t[2]=r*h*a+i*n*o,t[3]=r*h*o+i*n*a)}(this._target,t,t.order),e||this.onChange(),this}fromAxisAngle(t,e){return function(t,e,s){s*=.5;let i=Math.sin(s);t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(s)}(this._target,t,e),this.onChange(),this}slerp(t,e){return function(t,e,s,i){let r,n,h,a,o,l=e[0],u=e[1],c=e[2],d=e[3],g=s[0],f=s[1],p=s[2],m=s[3];n=l*g+u*f+c*p+d*m,n<0&&(n=-n,g=-g,f=-f,p=-p,m=-m),1-n>1e-6?(r=Math.acos(n),h=Math.sin(r),a=Math.sin((1-i)*r)/h,o=Math.sin(i*r)/h):(a=1-i,o=i),t[0]=a*l+o*g,t[1]=a*u+o*f,t[2]=a*c+o*p,t[3]=a*d+o*m}(this._target,this._target,t,e),this.onChange(),this}fromArray(t,e=0){return this._target[0]=t[e],this._target[1]=t[e+1],this._target[2]=t[e+2],this._target[3]=t[e+3],this.onChange(),this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}}function C(t){let e=t[0],s=t[1],i=t[2],r=t[3],n=t[4],h=t[5],a=t[6],o=t[7],l=t[8],u=t[9],c=t[10],d=t[11],g=t[12],f=t[13],p=t[14],m=t[15];return(e*h-s*n)*(c*m-d*p)-(e*a-i*n)*(u*m-d*f)+(e*o-r*n)*(u*p-c*f)+(s*a-i*h)*(l*m-d*g)-(s*o-r*h)*(l*p-c*g)+(i*o-r*a)*(l*f-u*g)}function S(t,e,s){let i=e[0],r=e[1],n=e[2],h=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],d=e[9],g=e[10],f=e[11],p=e[12],m=e[13],x=e[14],b=e[15],M=s[0],_=s[1],E=s[2],A=s[3];
vendor: 5,854 bytes, line 1
1return t[0]=M*i+_*a+E*c+A*p,t[1]=M*r+_*o+E*d+A*m,t[2]=M*n+_*l+E*g+A*x,t[3]=M*h+_*u+E*f+A*b,M=s[4],_=s[5],E=s[6],A=s[7],t[4]=M*i+_*a+E*c+A*p,t[5]=M*r+_*o+E*d+A*m,t[6]=M*n+_*l+E*g+A*x,t[7]=M*h+_*u+E*f+A*b,M=s[8],_=s[9],E=s[10],A=s[11],t[8]=M*i+_*a+E*c+A*p,t[9]=M*r+_*o+E*d+A*m,t[10]=M*n+_*l+E*g+A*x,t[11]=M*h+_*u+E*f+A*b,M=s[12],_=s[13],E=s[14],A=s[15],t[12]=M*i+_*a+E*c+A*p,t[13]=M*r+_*o+E*d+A*m,t[14]=M*n+_*l+E*g+A*x,t[15]=M*h+_*u+E*f+A*b,t}function O(t,e){let s=e[0],i=e[1],r=e[2],n=e[4],h=e[5],a=e[6],o=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(s,i,r),t[1]=Math.hypot(n,h,a),t[2]=Math.hypot(o,l,u),t}const R=function(){const t=[1,1,1];return function(e,s){let i=t;O(i,s);let r=1/i[0],n=1/i[1],h=1/i[2],a=s[0]*r,o=s[1]*n,l=s[2]*h,u=s[4]*r,c=s[5]*n,d=s[6]*h,g=s[8]*r,f=s[9]*n,p=s[10]*h,m=a+c+p,x=0;return m>0?(x=2*Math.sqrt(m+1),e[3]=.25*x,e[0]=(d-f)/x,e[1]=(g-l)/x,e[2]=(o-u)/x):a>c&&a>p?(x=2*Math.sqrt(1+a-c-p),e[3]=(d-f)/x,e[0]=.25*x,e[1]=(o+u)/x,e[2]=(g+l)/x):c>p?(x=2*Math.sqrt(1+c-a-p),e[3]=(g-l)/x,e[0]=(o+u)/x,e[1]=.25*x,e[2]=(d+f)/x):(x=2*Math.sqrt(1+p-a-c),e[3]=(o-u)/x,e[0]=(g+l)/x,e[1]=(d+f)/x,e[2]=.25*x),e}}();function T(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t[2]=e[2]+s[2],t[3]=e[3]+s[3],t[4]=e[4]+s[4],t[5]=e[5]+s[5],t[6]=e[6]+s[6],t[7]=e[7]+s[7],t[8]=e[8]+s[8],t[9]=e[9]+s[9],t[10]=e[10]+s[10],t[11]=e[11]+s[11],t[12]=e[12]+s[12],t[13]=e[13]+s[13],t[14]=e[14]+s[14],t[15]=e[15]+s[15],t}function L(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t[2]=e[2]-s[2],t[3]=e[3]-s[3],t[4]=e[4]-s[4],t[5]=e[5]-s[5],t[6]=e[6]-s[6],t[7]=e[7]-s[7],t[8]=e[8]-s[8],t[9]=e[9]-s[9],t[10]=e[10]-s[10],t[11]=e[11]-s[11],t[12]=e[12]-s[12],t[13]=e[13]-s[13],t[14]=e[14]-s[14],t[15]=e[15]-s[15],t}class B extends Array{constructor(t=1,e=0,s=0,i=0,r=0,n=1,h=0,a=0,o=0,l=0,u=1,c=0,d=0,g=0,f=0,p=1){return super(t,e,s,i,r,n,h,a,o,l,u,c,d,g,f,p),this}get x(){return this[12]}get y(){return this[13]}get z(){return this[14]}get w(){return this[15]}set x(t){this[12]=t}set y(t){this[13]=t}set z(t){this[14]=t}set w(t){this[15]=t}set(t,e,s,i,r,n,h,a,o,l,u,c,d,g,f,p){return t.length?this.copy(t):(function(t,e,s,i,r,n,h,a,o,l,u,c,d,g,f,p,m){t[0]=e,t[1]=s,t[2]=i,t[3]=r,t[4]=n,t[5]=h,t[6]=a,t[7]=o,t[8]=l,t[9]=u,t[10]=c,t[11]=d,t[12]=g,t[13]=f,t[14]=p,t[15]=m}(this,t,e,s,i,r,n,h,a,o,l,u,c,d,g,f,p),this)}translate(t,e=this){return function(t,e,s){let i,r,n,h,a,o,l,u,c,d,g,f,p=s[0],m=s[1],x=s[2];e===t?(t[12]=e[0]*p+e[4]*m+e[8]*x+e[12],t[13]=e[1]*p+e[5]*m+e[9]*x+e[13],t[14]=e[2]*p+e[6]*m+e[10]*x+e[14],t[15]=e[3]*p+e[7]*m+e[11]*x+e[15]):(i=e[0],r=e[1],n=e[2],h=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],d=e[9],g=e[10],f=e[11],t[0]=i,t[1]=r,t[2]=n,t[3]=h,t[4]=a,t[5]=o,t[6]=l,t[7]=u,t[8]=c,t[9]=d,t[10]=g,t[11]=f,t[12]=i*p+a*m+c*x+e[12],t[13]=r*p+o*m+d*x+e[13],t[14]=n*p+l*m+g*x+e[14],t[15]=h*p+u*m+f*x+e[15])}(this,e,t),this}rotate(t,e,s=this){return function(t,e,s,i){let r,n,h,a,o,l,u,c,d,g,f,p,m,x,b,M,_,E,A,v,F,w,y,C,S=i[0],O=i[1],R=i[2],T=Math.hypot(S,O,R);Math.abs(T)<1e-6||(T=1/T,S*=T,O*=T,R*=T,r=Math.sin(s),n=Math.cos(s),h=1-n,a=e[0],o=e[1],l=e[2],u=e[3],c=e[4],d=e[5],g=e[6],f=e[7],p=e[8],m=e[9],x=e[10],b=e[11],M=S*S*h+n,_=O*S*h+R*r,E=R*S*h-O*r,A=S*O*h-R*r,v=O*O*h+n,F=R*O*h+S*r,w=S*R*h+O*r,y=O*R*h-S*r,C=R*R*h+n,t[0]=a*M+c*_+p*E,t[1]=o*M+d*_+m*E,t[2]=l*M+g*_+x*E,t[3]=u*M+f*_+b*E,t[4]=a*A+c*v+p*F,t[5]=o*A+d*v+m*F,t[6]=l*A+g*v+x*F,t[7]=u*A+f*v+b*F,t[8]=a*w+c*y+p*C,t[9]=o*w+d*y+m*C,t[10]=l*w+g*y+x*C,t[11]=u*w+f*y+b*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]))}(this,s,t,e),this}scale(t,e=this){return function(t,e,s){let i=s[0],r=s[1],n=s[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(this,e,"number"==typeof t?[t,t,t]:t),this}add(t,e){return e?T(this,t,e):T(this,this,t),this}sub(t,e){return e?L(this,t,e):L(this,this,t),this}multiply(t,e){var s,i,r;return t.length?e?S(this,t,e):S(this,this,t):(i=this,r=t,(s=this)[0]=i[0]*r,s[1]=i[1]*r,s[2]=i[2]*r,s[3]=i[3]*r,s[4]=i[4]*r,s[5]=i[5]*r,s[6]=i[6]*r,s[7]=i[7]*r,s[8]=i[8]*r,s[9]=i[9]*r,s[10]=i[10]*r,s[11]=i[11]*r,s[12]=i[12]*r,s[13]=i[13]*r,s[14]=i[14]*r,s[15]=i[15]*r),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}copy(t){var e,s;return s=t,(e=this)[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],e[9]=s[9],e[10]=s[10],e[11]=s[11],e[12]=s[12],e[13]=s[13],e[14]=s[14],e[15]=s[15],this}fromPerspective({fov:t,aspect:e,near:s,far:i}={}){return function(t,e,s,i,r){let n=1/Math.tan(e/2),h=1/(i-r);t[0]=n/s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(r+i)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*r*i*h,t[15]=0}(this,t,e,s,i),this}fromOrthogonal({left:t,right:e,bottom:s,top:i,near:r,far:n}){return function(t,e,s,i,r,n,h){let a=1/(e-s),o=1/(i-r),l=1/(n-h);t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+s)*a,t[13]=(r+i)*o,t[14]=(h+n)*l,t[15]=1}(this,t,e,s,i,r,n),this}fromQuaternion(t){return function(t,e){let s=e[0],i=e[1],r=e[2],n=e[3],h=s+s,a=i+i,o=r+r,l=s*h,u=i*h,c=i*a,d=r*h,g=r*a,f=r*o,p=n*h,m=n*a,x=n*o;t[0]=1-c-f,t[1]=u+x,t[2]=d-m,t[3]=0,t[4]=u-x,t[5]=1-l-f,t[6]=g+p,t[7]=0,t[8]=d+m,t[9]=g-p,t[10]=1-l-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(this,t),this}setPosition(t){return this.x=t[0],this.y=t[1],this.z=t[2],this}inverse(t=this){return function(t,e){let s=e[0],i=e[1],r=e[2],n=e[3],h=e[4],a=e[5],o=e[6],l=e[7],u=e[8],c=e[9],d=e[10],g=e[11],f=e[12],p=e[13],m=e[14],x=e[15],b=s*a-i*h,M=s*o-r*h,_=s*l-n*h,E=i*o-r*a,A=i*l-n*a,v=r*l-n*o,F=u*p-c*f,w=u*m-d*f,y=u*x-g*f,C=c*m-d*p,S=c*x-g*p,O=d*x-g*m,R=b*O-M*S+_*C+E*y-A*w+v*F;R&&(R=1/R,t[0]=(a*O-o*S+l*C)*R,t[1]=(r*S-i*O-n*C)*R,t[2]=(p*v-m*A+x*E)
1*R,t[3]=(d*A-c*v-g*E)*R,t[4]=(o*y-h*O-l*w)*R,t[5]=(s*O-r*y+n*w)*R,t[6]=(m*_-f*v-x*M)*R,t[7]=(u*v-d*_+g*M)*R,t[8]=(h*S-a*y+l*F)*R,t[9]=(i*y-s*S-n*F)*R,t[10]=(f*A-p*_+x*b)*R,t[11]=(c*_-u*A-g*b)*R,t[12]=(a*w-h*C-o*F)*R,t[13]=(s*C-i*w+r*F)*R,t[14]=(p*M-f*E-m*b)*R,t[15]=(u*E-c*M+d*b)*R)}(this,t),this}compose(t,e,s){return function(t,e,s,i){const r=t,n=e[0],h=e[1],a=e[2],o=e[3],l=n+n,u=h+h,c=a+a,d=n*l,g=n*u,f=n*c,p=h*u,m=h*c,x=a*c,b=o*l,M=o*u,_=o*c,E=i[0],A=i[1],v=i[2];r[0]=(1-(p+x))*E,r[1]=(g+_)*E,r[2]=(f-M)*E,r[3]=0,r[4]=(g-_)*A,r[5]=(1-(d+x))*A,r[6]=(m+b)*A,r[7]=0,r[8]=(f+M)*v,r[9]=(m-b)*v,r[10]=(1-(d+p))*v,r[11]=0,r[12]=s[0],r[13]=s[1],r[14]=s[2],r[15]=1}(this,t,e,s),this}decompose(e,s,i){return function(e,s,i,r){let n=t([e[0],e[1],e[2]]);const h=t([e[4],e[5],e[6]]),a=t([e[8],e[9],e[10]]);C(e)<0&&(n=-n),i[0]=e[12],i[1]=e[13],i[2]=e[14];const o=e.slice(),l=1/n,u=1/h,c=1/a;o[0]*=l,o[1]*=l,o[2]*=l,o[4]*=u,o[5]*=u,o[6]*=u,o[8]*=c,o[9]*=c,o[10]*=c,R(s,o),r[0]=n,r[1]=h,r[2]=a}(this,e,s,i),this}getRotation(t){return R(t,this),this}getTranslation(t){var e,s;return s=this,(e=t)[0]=s[12],e[1]=s[13],e[2]=s[14],this}getScaling(t){return O(t,this),this}getMaxScaleOnAxis(){return function(t){let e=t[0],s=t[1],i=t[2],r=t[4],n=t[5],h=t[6],a=t[8],o=t[9],l=t[10];const u=e*e+s*s+i*i,c=r*r+n*n+h*h,d=a*a+o*o+l*l;return Math.sqrt(Math.max(u,c,d))}(this)}lookAt(t,e,s){return function(t,e,s,i){let r=e[0],n=e[1],h=e[2],a=i[0],o=i[1],l=i[2],u=r-s[0],c=n-s[1],d=h-s[2],g=u*u+c*c+d*d;0===g?d=1:(g=1/Math.sqrt(g),u*=g,c*=g,d*=g);let f=o*d-l*c,p=l*u-a*d,m=a*c-o*u;g=f*f+p*p+m*m,0===g&&(l?a+=1e-6:o?l+=1e-6:o+=1e-6,f=o*d-l*c,p=l*u-a*d,m=a*c-o*u,g=f*f+p*p+m*m),g=1/Math.sqrt(g),f*=g,p*=g,m*=g,t[0]=f,t[1]=p,t[2]=m,t[3]=0,t[4]=c*m-d*p,t[5]=d*f-u*m,t[6]=u*p-c*f,t[7]=0,t[8]=u,t[9]=c,t[10]=d,t[11]=0,t[12]=r,t[13]=n,t[14]=h,t[15]=1}(this,t,e,s),this}determinant(){return C(this)}fromArray(t,e=0){return this[0]=t[e],this[1]=t[e+1],this[2]=t[e+2],this[3]=t[e+3],this[4]=t[e+4],this[5
1]=t[e+5],this[6]=t[e+6],this[7]=t[e+7],this[8]=t[e+8],this[9]=t[e+9],this[10]=t[e+10],this[11]=t[e+11],this[12]=t[e+12],this[13]=t[e+13],this[14]=t[e+14],this[15]=t[e+15],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t[e+4]=this[4],t[e+5]=this[5],t[e+6]=this[6],t[e+7]=this[7],t[e+8]=this[8],t[e+9]=this[9],t[e+10]=this[10],t[e+11]=this[11],t[e+12]=this[12],t[e+13]=this[13],t[e+14]=this[14],t[e+15]=this[15],t}}const D=new B;class N extends Array{constructor(t=0,e=t,s=t,i="YXZ"){super(t,e,s),this.order=i,this.onChange=()=>{},this._target=this;const r=["0","1","2"];return new Proxy(this,{set(t,e){const s=Reflect.set(...arguments);return s&&r.includes(e)&&t.onChange(),s}})}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this._target[0]=t,this.onChange()}set y(t){this._target[1]=t,this.onChange()}set z(t){this._target[2]=t,this.onChange()}set(t,e=t,s=t){return t.length?this.copy(t):(this._target[0]=t,this._target[1]=e,this._target[2]=s,this.onChange(),this)}copy(t){return this._target[0]=t[0],this._target[1]=t[1],this._target[2]=t[2],this.onChange(),this}reorder(t){return this._target.order=t,this.onChange(),this}fromRotationMatrix(t,e=this.order){return function(t,e,s="YXZ"){"XYZ"===s?(t[1]=Math.asin(Math.min(Math.max(e[8],-1),1)),Math.abs(e[8])<.99999?(t[0]=Math.atan2(-e[9],e[10]),t[2]=Math.atan2(-e[4],e[0])):(t[0]=Math.atan2(e[6],e[5]),t[2]=0)):"YXZ"===s?(t[0]=Math.asin(-Math.min(Math.max(e[9],-1),1)),Math.abs(e[9])<.99999?(t[1]=Math.atan2(e[8],e[10]),t[2]=Math.atan2(e[1],e[5])):(t[1]=Math.atan2(-e[2],e[0]),t[2]=0)):"ZXY"===s?(t[0]=Math.asin(Math.min(Math.max(e[6],-1),1)),Math.abs(e[6])<.99999?(t[1]=Math.atan2(-e[2],e[10]),t[2]=Math.atan2(-e[4],e[5])):(t[1]=0,t[2]=Math.atan2(e[1],e[0]))):"ZYX"===s?(t[1]=Math.asin(-Math.min(Math.max(e[2],-1),1)),Math.abs(e[2])<.99999?(t[0]=Math.atan2(e[6],e[10]),t[2]=Math.atan2(e[1],e[0])):(t[0]=0,t[2]=Math.atan2(-e[4],e[5]))):"YZX"===s?(t[2]=Math.asin(Math.min(Math.max(e[1],-1),1)),Math.abs(e[1])<.99999?(t[0]=Math.atan2(-e[9],e[5]),t[1]=Math.atan2(-e[2],e[0])):(t[0]=0,t[1]=Math.atan2(e[8],e[10]))):"XZY"===s&&(t[2]=Math.asin(-Math.min(Math.max(e[4],-1),1)),Math.abs(e[4])<.99999?(t[0]=Math.atan2(e[6],e[5]),t[1]=Math.atan2(e[8],e[0])):(t[0]=Math.atan2(-e[9],e[10]),t[1]=0))}(this._target,t,e),this.onChange(),this}fromQuaternion(t,e=this.order,s){return D.fromQuaternion(t),this._target.fromRotationMatrix(D,e),s||this.onChange(),this}fromArray(t,e=0){return this._target[0]=t[e],this._target[1]=t[e+1],this._target[2]=t[e+2],this}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}}class I{constructor(){this.parent=null,this.children=[],this.visible=!0,this.matrix=new B,this.worldMatrix=new B,this.matrixAutoUpdate=!0,this.worldMatrixNeedsUpdate=!1,this.position=new u,this.quaternion=new y,this.scale=new u(1),this.rotation=new N,this.up=new u(0,1,0),this.rotation._target.onChange=()=>this.quaternion.fromEuler(this.rotation,!0),this.quaternion._target.onChange=()=>this.rotation.fromQuaternion(this.quaternion,void 0,!0)}setParent(t,e=!0){this.parent&&t!==this.parent&&this.parent.removeChild(this,!1),this.parent=t,e&&t&&t.addChild(this,!1)}addChild(t,e=!0){~this.children.indexOf(t)||this.children.push(t),e&&t.setParent(this,!1)}removeChild(t,e=!0){~this.children.indexOf(t)&&this.children.splice(this.children.indexOf(t),1),e&&t.setParent(null,!1)}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.worldMatrixNeedsUpdate||t)&&(null===this.parent?this.worldMatrix.copy(this.matrix):this.worldMatrix.multiply(this.parent.worldMatrix,this.matrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(let e=0,s=this.children.length;e<s;e++)this.children[e].updateMatrixWorld(t)}updateMatrix(){this.matrix.compose(this.quaternion,this.position,this.scale),this.worldMatrixNeedsUpdate=!0}traverse(t){if(!t(this))for(let e=0,s=this.children.length;e<s;e++)this.children[e].traverse(t)}decompose(){this.matrix.decompose(this.quaternion._target,this.position,this.scale),this.rotation.fromQuaternion(this.quaternion)}lookAt(t,e=!1){e?this.matrix.lookAt(this.position,t,this.up):this.matrix.lookAt(t,this.position,this.up),this.matrix.getRotation(this.quaternion._target),this.rotation.fromQuaternion(this.quaternion)}}function P(t,e,s){let i=e[0],r=e[1],n=e[2],h=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],d=s[0],g=s[1],f=s[2],p=s[3],m=s[4],x=s[5],b=s[6],M=s[7],_=s[8];return t[0]=d*i+g*h+f*l,t[1]=d*r+g*a+f*u,t[2]=d*n+g*o+f*c,t[3]=p*i+m*h+x*l,t[4]=p*r+m*a+x*u,t[5]=p*n+m*o+x*c,t[6]=b*i+M*h+_*l,t[7]=b*r+M*a+_*u,t[8]=b*n+M*o+_*c,t}class q extends Array{constructor(t=1,e=0,s=0,i=0,r=1,n=0,h=0,a=0,o=1){return super(t,e,s,i,r,n,h,a,o),this}set(t,e,s,i,r,n,h,a,o){return t.length?this.copy(t):(function(t,e,s,i,r,n,h,a,o,l){t[0]=e,t[1]=s,t[2]=i,t[3]=r,t[4]=n,t[5]=h,t[6]=a,t[7]=o,t[8]=l}(this,t,e,s,i,r,n,h,a,o),this)}translate(t,e=this){return function(t,e,s){let i=e[0],r=e[1],n=e[2],h=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],d=s[0],g=s[1];t[0]=i,t[1]=r,t[2]=n,t[3]=h,t[4]=a,t[5]=o,t[6]=d*i+g*h+l,t[7]=d*r+g*a+u,t[8]=d*n+g*o+c}(this,e,t),this}rotate(t,e=this){return function(t,e,s){let i=e[0],r=e[1],n=e[2],h=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],d=Math.sin(s),g=Math.cos(s);t[0]=g*i+d*h,t[1]=g*r+d*a,t[2]=g*n+d*o,t[3]=g*h-d*i,t[4]=g*a-d*r,t[5]=g*o-d*n,t[6]=l,t[7]=u,t[8]=c}(this,e,t),this}scale(t,e=this){return function(t,e,s){let i=s[0],r=s[1];t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}(this,e,t),this}multiply(t,e){return e?P(this,t,e):P(this,this,t),this}identity(){var t;return(t=this)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this}copy(t){var e,s;return s=t,(e=this)[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],this}fromMatrix4(t){var e,s;return s=t,(e=this)[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[4],e[4]=s[5],e[5]=s[6],e[6]=s[8],e[7]=s[9],e[8]=s[10],this}fromQuaternion(t){return function(t,e){let s=e[0],i=e[1],r=e[2],n=e[3],h=s+s,a=i+i,o=r+r,l=s*h,u=i*h,c=i*a,d=r*h,g=r*a,f=r*o,p=n*h,m=n*a,x=n*o;t[0]=1-c-f,t[3]=u-x,t[6]=d+m,t[1]=u+x,t[4]=1-l-f,t[7]=g-p,t[2]=d-m,t[5]=g+p,t[8]=1-l-c}(this,t),this}fromBasis(t,e,s){return this.set(t[0],t[1],t[2],e[0],e[1],e[2],s[0],s[1],s[2]),this}inverse(t=this){return function(t,e){let s=e[0],i=e[1],r=e[2],n=e[3],h=e[4],a=e[5],o=e[6],l=e[7],u=e[8],c=u*h-a*l,d=-u*n+a*o,g=l*n-h*o,f=s*c+i*d+r*g;f&&(f=1/f,t[0]=c*f,t[1]=(-u*i+r*l)*f,t[2]=(a*i-r*h)*f,t[3]=d*f,t[4]=(u*s-r*o)*f,t[5]=(-a*s+r*n)*f,t[6]=g*f,t[7]=(-l*s+i*o)*f,t[8]=(h*s-i*n)*f)}(this,t),this}getNormalMatrix(t){return function(t,e){let s=e[0],i=e[1],r=e[2],n=e[3],h=e[4],a=e[5],o=e[6],l=e[7],u=e[8],c=e[9],d=e[10],g=e[11],f=e[12],p=e[13],m=e[14],x=e[15],b=s*a-i*h,M=s*o-r*h,_=s*l-n*h,E=i*o-r*a,A=i*l-n*a,v=r*l-n*o,F=u*p-c*f,w=u*m-d*f,y=u*x-g*f,C=c*m-d*p,S=c*x-g*p,O=d*x-g*m,R=b*O-M*S+_*C+E*y-A*w+v*F;
1R&&(R=1/R,t[0]=(a*O-o*S+l*C)*R,t[1]=(o*y-h*O-l*w)*R,t[2]=(h*S-a*y+l*F)*R,t[3]=(r*S-i*O-n*C)*R,t[4]=(s*O-r*y+n*w)*R,t[5]=(i*y-s*S-n*F)*R,t[6]=(p*v-m*A+x*E)*R,t[7]=(m*_-f*v-x*M)*R,t[8]=(f*A-p*_+x*b)*R)}(this,t),this}}let U=0;class z extends I{constructor(t,{geometry:e,program:s,mode:i=t.TRIANGLES,frustumCulled:r=!0,renderOrder:n=0}={}){super(),t.canvas,this.gl=t,this.id=U++,this.geometry=e,this.program=s,this.mode=i,this.frustumCulled=r,this.renderOrder=n,this.modelViewMatrix=new B,this.normalMatrix=new q,this.beforeRenderCallbacks=[],this.afterRenderCallbacks=[]}onBeforeRender(t){return this.beforeRenderCallbacks.push(t),this}onAfterRender(t){return this.afterRenderCallbacks.push(t),this}draw({camera:t}={}){t&&(this.program.uniforms.modelMatrix||Object.assign(this.program.uniforms,{modelMatrix:{value:null},viewMatrix:{value:null},modelViewMatrix:{value:null},normalMatrix:{value:null},projectionMatrix:{value:null},cameraPosition:{value:null}}),this.program.uniforms.projectionMatrix.value=t.projectionMatrix,this.program.uniforms.cameraPosition.value=t.worldPosition,this.program.uniforms.viewMatrix.value=t.viewMatrix,this.modelViewMatrix.multiply(t.viewMatrix,this.worldMatrix),this.normalMatrix.getNormalMatrix(this.modelViewMatrix),this.program.uniforms.modelMatrix.value=this.worldMatrix,this.program.uniforms.modelViewMatrix.value=this.modelViewMatrix,this.program.uniforms.normalMatrix.value=this.normalMatrix),this.beforeRenderCallbacks.forEach(e=>e&&e({mesh:this,camera:t}));let e=this.program.cullFace&&this.worldMatrix.determinant()<0;this.program.use({flipFaces:e}),this.geometry.draw({mode:this.mode,program:this.program}),this.afterRenderCallbacks.forEach(e=>e&&e({mesh:this,camera:t}))}}class V extends p{constructor(t,{attributes:e={}}={}){Object.assign(e,{position:{size:2,data:new Float32Array([-1,-1,3,-1,-1,3])},uv:{size:2,data:new Float32Array([0,0,2,0,0,2])}}),super(t,e)}}export{z as M,b as P,F as R,V as T};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.