t2-model-skinner/docs/_next/static/chunks/fb7d5399.ddae1e8fed13bcfe.js

187 lines
503 KiB
JavaScript
Raw Normal View History

2022-12-02 22:26:17 -08:00
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[737],{9477:function(e,t,i){let n;i.d(t,{$V:function(){return oo},A5E:function(){return oh},CP7:function(){return rz},D1R:function(){return x},DvJ:function(){return iu},EB7:function(){return ad},EJi:function(){return so},F5T:function(){return tF},FM8:function(){return eh},Hw6:function(){return eT},IEO:function(){return rX},ILR:function(){return A},IOt:function(){return W},Ilk:function(){return eS},JUT:function(){return eD},Kj0:function(){return il},LY2:function(){return h},M8C:function(){return el},N$j:function(){return rq},NMF:function(){return B},OdW:function(){return rZ},OoA:function(){return p},Ox3:function(){return sJ},PMe:function(){return sV},Pa4:function(){return eN},QRU:function(){return sQ},SPe:function(){return r2},Syv:function(){return F},TUv:function(){return rj},TlE:function(){return tG},Tme:function(){return tT},TyD:function(){return f},USm:function(){return tu},UY4:function(){return aa},UlW:function(){return k},Vkp:function(){return eu},VzW:function(){return M},Wid:function(){return ss},Wl3:function(){return r},Xcj:function(){return on},YKA:function(){return O},YLQ:function(){return m},ZAu:function(){return rC},Z_g:function(){return ap},Zp0:function(){return sK},ZzF:function(){return eU},_12:function(){return iP},_AM:function(){return C},_C8:function(){return sp},_Li:function(){return a},_am:function(){return i_},_fP:function(){return eI},a$l:function(){return tj},aH4:function(){return g},aLr:function(){return e1},aNw:function(){return sC},av9:function(){return T},blk:function(){return ar},bsb:function(){return N},cLu:function(){return b},cPb:function(){return iv},cek:function(){return sq},dSO:function(){return u},dUE:function(){return sy},dd2:function(){return eP},dpR:function(){return sN},eaV:function(){return L},ehD:function(){return s},ejS:function(){return an},ekQ:function(){return D},fto:function(){return P},hEm:function(){return w},hH6:function(){return sR},iKG:function(){return ik},iLg:function(){return sb},iMs:function(){return or},iUV:function(){return oe},jAl:function(){return z},jFi:function(){return o},jyz:function(){return im},kB5:function(){return rB},knz:function(){return H},l0P:function(){return R},lRF:function(){return rM},lk7:function(){return sZ},m7l:function(){return sT},nls:function(){return r4},oAp:function(){return iy},pBf:function(){return J},ptH:function(){return I},qyh:function(){return _},rnI:function(){return G},rpg:function(){return c},u9r:function(){return t$},uEv:function(){return U},uL9:function(){return l},uWy:function(){return d},vBJ:function(){return tB},vpT:function(){return rU},wem:function(){return v},wk1:function(){return S},woe:function(){return au},wuA:function(){return E},x12:function(){return ae},xEZ:function(){return eC},xsS:function(){return rO},yC1:function(){return sw},yGw:function(){return te},ywz:function(){return y},yxD:function(){return sI},z$h:function(){return V}});let r=0,a=1,s=2,o=0,l=0,h=4,u=303,c=1e3,d=1001,p=1002,f=1003,m=1004,g=1005,v=1006,_=1007,x=1008,y=1009,M=1015,b=1016,S=1023,w=1028,T=1030,E=33776,A=33779,C=35840,L=35842,P=36196,R=37492,D=37496,I=37808,N=36492,z=2200,O=2201,U=2202,F=2300,B=2301,k=1,V=2,G=3e3,H=3001,W=0,j="srgb",q="srgb-linear",X="300 es";class J{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let i=this._listeners,n=i[e];if(void 0!==n){let r=n.indexOf(t);-1!==r&&n.splice(r,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners,i=t[e.type];if(void 0!==i){e.target=this;let n=i.slice(0);for(let r=0,a=n.length;r<a;r++)n[r].call(this,e);e.target=null}}}let Y=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","
varying vec3 vWorldDirection;
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}
`,fragmentShader:`
uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
}
`},n=new iu(5,5,5),r=new im({name:"CubemapFromEquirect",uniforms:ic(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:a,blending:o});r.uniforms.tEquirect.value=t;let s=new il(n,r),l=t.minFilter;t.minFilter===x&&(t.minFilter=v);let h=new i_(1,10,this);return h.update(e,s),t.minFilter=l,s.geometry.dispose(),s.material.dispose(),this}clear(e,t,i,n){let r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,i,n);e.setRenderTarget(r)}}let iM=new eN,ib=new eN,iS=new eu;class iw{constructor(e=new eN(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let n=iM.subVectors(i,t).cross(ib.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){let i=e.delta(iM),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;let r=-(e.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:t.copy(i).multiplyScalar(r).add(e.start)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||iS.getNormalMatrix(e),n=this.coplanarPoint(iM).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}let iT=new e1,iE=new eN;class iA{constructor(e=new iw,t=new iw,i=new iw,n=new iw,r=new iw,a=new iw){this.planes=[e,t,i,n,r,a]}set(e,t,i,n,r,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(r),s[5].copy(a),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){let t=this.planes,i=e.elements,n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],l=i[5],h=i[6],u=i[7],c=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],_=i[15];return t[0].setComponents(s-n,u-o,f-c,_-m).normalize(),t[1].setComponents(s+n,u+o,f+c,_+m).normalize(),t[2].setComponents(s+r,u+l,f+d,_+g).normalize(),t[3].setComponents(s-r,u-l,f-d,_-g).normalize(),t[4].setComponents(s-a,u-h,f-p,_-v).normalize(),t[5].setComponents(s+a,u+h,f+p,_+v).normalize(),this}intersectsObject(e){let t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),iT.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(iT)}intersectsSprite(e){return iT.center.set(0,0,0),iT.radius=.7071067811865476,iT.applyMatrix4(e.matrixWorld),this.intersectsSphere(iT)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let r=0;r<6;r++){let a=t[r].distanceToPoint(i);if(a<n)return!1}return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let n=t[i];if(iE.x=n.normal.x>0?e.max.x:e.min.x,iE.y=n.normal.y>0?e.max.y:e.min.y,iE.z=n.normal.z>0?e.max.z:e.min.z,0>n.distanceToPoint(iE))return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(0>t[i].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}}function iC(){let e=null,t=!1,i=null,n=null;function r(t,a){i(t,a),n=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==i&&(n=e.requestAnimationFrame
precision mediump float;
precision mediump int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
uniform int samples;
uniform float weights[ n ];
uniform bool latitudinal;
uniform float dTheta;
uniform float mipInt;
uniform vec3 poleAxis;
#define ENVMAP_TYPE_CUBE_UV
#include <cube_uv_reflection_fragment>
vec3 getSample( float theta, vec3 axis ) {
float cosTheta = cos( theta );
// Rodrigues' axis-angle rotation
vec3 sampleDirection = vOutputDirection * cosTheta
+ cross( axis, vOutputDirection ) * sin( theta )
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
return bilinearCubeUV( envMap, sampleDirection, mipInt );
}
void main() {
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
}
axis = normalize( axis );
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
for ( int i = 1; i < n; i++ ) {
if ( i >= samples ) {
break;
}
float theta = dTheta * float( i );
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
}
}
`,blending:o,depthTest:!1,depthWrite:!1});return a}(r,e,t)}return n}_compileMaterial(e){let t=new il(this._lodPlanes[0],e);this._renderer.compile(t,iG)}_sceneToCubeUV(e,t,i,n){let r=new iv(90,1,t,i),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],h=this._renderer,u=h.autoClear,c=h.toneMapping;h.getClearColor(iH),h.toneMapping=l,h.autoClear=!1;let d=new tB({name:"PMREM.Background",side:a,depthWrite:!1,depthTest:!1}),p=new il(new iu,d),f=!1,m=e.background;m?m.isColor&&(d.color.copy(m),e.background=null,f=!0):(d.color.copy(iH),f=!0);for(let g=0;g<6;g++){let v=g%3;0===v?(r.up.set(0,s[g],0),r.lookAt(o[g],0,0)):1===v?(r.up.set(0,0,s[g]),r.lookAt(0,o[g],0)):(r.up.set(0,s[g],0),r.lookAt(0,0,o[g]));let _=this._cubeSize;iZ(n,v*_,g>2?_:0,_,_),h.setRenderTarget(n),f&&h.render(p,r),h.render(e,r)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=c,h.autoClear=u,e.background=m}_textureToCubeUV(e,t){let i=this._renderer,n=301===e.mapping||302===e.mapping;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=iQ()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=iK());let r=n?this._cubemapMaterial:this._equirectMaterial,a=new il(this._lodPlanes[0],r),s=r.uniforms;s.envMap.value=e;let o=this._cubeSize;iZ(t,0,0,3*o,2*o),i.setRenderTarget(t),i.render(a,iG)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let n=1;n<this._lodPlanes.length;n++){let r=Math.sqrt(this._sigmas[n]*this._sigmas[n]-this._sigmas[n-1]*this._sigmas[n-1]),a=iX[(n-1)%iX.length];this._blur(e,n-1,n,r,a)}t.autoClear=i}_blur(e,t,i,n,r){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,i,n,"latitudinal",r),this._halfBlur(a,e,i,i,n,"longitudinal",r)}_halfBlur(e,t,i,n,r,a,s){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");let h=new il(this._lodPlanes[n],l),u=l.uniforms,c=this._sizeLods[i]-1,d=isFinite(r)?Math.PI/(2*c):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):20;f>20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);let m=[],g=0;for(let v=0;v<20;++v){let _=v/p,x=Math.exp(-_*_/2);m.push(x),0===v?g+=x:v<f&&(g+=2*x)}for(let y=0;y<m.length;y++)m[y]=m[y]/g;u.envMap.value=e.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value="latitudinal"===a,s&&(u.poleAxis.value=s);let{_lodMax:M}=this;u.dTheta.value=d,u.mipInt.value=M-i;let b=this._sizeLods[n],S=4*(this._cubeSize-b);iZ(t,3*b*(n>M-4?n-M+4:0),S,3*b,2*b),o.setRenderTarget(t),o.render(h,iG)}}function iY(e,t,i){let n=new eP(e,t,i);return n.texture.mapping=306,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function iZ(e,t,i,n,r){e.viewport.set(t,i,n,r),e.scissor.set(t,i,n,r)}function iK(){return new im({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:i$(),fragmentShader:`
precision mediump float;
precision mediump int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
#include <common>
void main() {
vec3 outputDirection = normalize( vOutputDirection );
vec2 uv = equirectUv( outputDirection );
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
}
`,blending:o,depthTest:!1,depthWrite:!1})}function iQ(){return new im({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:i$(),fragmentShader:`
precision mediump float;
precision mediump int;
uniform float flipEnvMap;
varying vec3 vOutputDirection;
uniform samplerCube envMap;
void main() {
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
}
`,blending:o,depthTest:!1,depthWrite:!1})}function i$(){return`
precision mediump float;
precision mediump int;
attribute float faceIndex;
varying vec3 vOutputDirection;
// RH coordinate system; PMREM face-indexing convention
vec3 getDirection( vec2 uv, float face ) {
uv = 2.0 * uv - 1.0;
vec3 direction = vec3( uv, 1.0 );
if ( face == 0.0 ) {
direction = direction.zyx; // ( 1, v, u ) pos x
} else if ( face == 1.0 ) {
direction = direction.xzy;
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
} else if ( face == 2.0 ) {
direction.x *= -1.0; // ( -u, v, 1 ) pos z
} else if ( face == 3.0 ) {
direction = direction.zyx;
direction.xz *= -1.0; // ( -1, v, -u ) neg x
} else if ( face == 4.0 ) {
direction = direction.xzy;
direction.xy *= -1.0; // ( -u, -1, v ) neg y
} else if ( face == 5.0 ) {
direction.z *= -1.0; // ( u, v, -1 ) neg z
}
return direction;
}
void main() {
vOutputDirection = getDirection( uv, faceIndex );
gl_Position = vec4( position, 1.0 );
}
`}function i0(e){let t=new WeakMap,i=null;function n(e){let i=e.target;i.removeEventListener("dispose",n);let r=t.get(i);void 0!==r&&(t.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture){let a=r.mapping,s=a===u||304===a,o=301===a||302===a;if(s||o){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let l=t.get(r);return null===i&&(i=new iJ(e)),l=s?i.fromEquirectangular(r,l):i.fromCubemap(r,l),t.set(r,l),l.texture}if(t.has(r))return t.get(r).texture;{let h=r.image;if(!(s&&h&&h.height>0||o&&h&&function(e){let t=0;for(let i=0;i<6;i++)void 0!==e[i]&&t++;return 6===t}(h)))return null;{null===i&&(i=new iJ(e));let c=s?i.fromEquirectangular(r):i.fromCubemap(r);return t.set(r,c),r.addEventListener("dispose",n),c.texture}}}}return r},dispose:function(){t=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function i1(e){let t={};function i(i){let n;if(void 0!==t[i])return t[i];switch(i){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(i)}return t[i]=n,n}return{has:function(e){return null!==i(e)},init:function(e){e.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture")},get:function(e){let t=i(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function i3(e,t,i,n){let r={},a=new WeakMap;function s(e){let o=e.target;for(let l in null!==o.index&&t.remove(o.index),o.attributes)t.remove(o.attributes[l]);o.removeEventListener("dispose",s),delete r[o.id];let h=a.get(o);h&&(t.remove(h),a.delete(o)),n.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,i.memory.geometries--}function o(e){let i=[],n=e.index,r=e.attributes.position,s=0;if(null!==n){let o=n.array;s=n.version;for(let l=0,h=o.length;l<h;l+=3){let u=o[l+0],c=o[l+1],d=o[l+2];i.push(u,c,c,d,d,u)}}else{let p=r.array;s=r.version;for(let f=0,m=p.length/3-1;f<m;f+=3){let g=f+0,v=f+1,_=f+2;i.push(g,v,v,_,_,g)}}let x=new(ec(i)?tW:tH)(i,1);x.version=s;let y=a.get(e);y&&t.remove(y),a.set(e,x)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener("dispose",s),r[t.id]=!0,i.memory.geometries++),t},update:function(e){let i=e.attributes;for(let n in i)t.update(i[n],34962);let r=e.morphAttributes;for(let a in r){let s=r[a];for(let o=0,l=s.length;o<l;o++)t.update(s[o],34962)}},getWireframeAttribute:function(e){let t=a.get(e);if(t){let i=e.index;null!==i&&t.version<i.version&&o(e)}else o(e);return a.get(e)}}}function i2(e,t,i,n){let r,a,s;let o=n.isWebGL2;this.setMode=function(e){r=e},this.setIndex=function(e){a=e.type,s=e.bytesPerElement},this.render=function(t,n){e.drawElements(r,n,a,t*s),i.update(n,r,1)},this.renderInstances=function(n,l,h){let u,c;if(0!==h){if(o)u=e,c="drawElementsInstanced";else if(u=t.get("ANGLE_instanced_arrays"),c="drawElementsInstancedANGLE",null===u){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}u[c](r,l,a,n*s,h),i.update(l,r,h)}}}function i4(e){let t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,program
//# sourceMappingURL=fb7d5399.ddae1e8fed13bcfe.js.map