PageSourceSearch

https://www.3d-editor.com/_next/static/chunks/5638.8aba2a396a04a40c.js

js 3d-editor.com collected 2026-10-02 00:49:36 UTC 10,851 bytes, 65 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5638],{42817:function(e,t,n){n.d(t,{Y:function(){return i}});var r=n(57437);function i(e){let{rotating:t,onToggle:n}=e;return(0,r.jsxs)("button",{type:"button",className:"preview-autorotate".concat(t?" is-on":""),onClick:n,"aria-pressed":t,title:t?"Pause auto-rotation":"Resume auto-rotation",children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24",width:"13",height:"13","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),(0,r.jsx)("path",{d:"M21 3v5h-5"})]}),(0,r.jsx)("span",{children:"Auto-rotate"})]})}},55638:function(e,t,n){n.r(t),n.d(t,{PreviewSphere:function(){return d}});var r=n(57437),i=n(2265),s=n(51448),a=n(72079),o=n(2691),l=n(41235),u=n(83880),v=n(42817);function d(e){let{maps:t,params:n,mapsVersion:d}=e,c=(0,i.useRef)(null),m=(0,i.useRef)(null),f=(0,i.useRef)([]),p=(0,i.useRef)(null),[h,x]=(0,i.useState)(()=>!window.matchMedia("(prefers-reduced-motion: reduce)").matches),g=(0,i.useRef)(h);return g.current=h,(0,i.useEffect)(()=>{let e;let r=c.current;if(!r)return;try{e=new s.CP7({antialias:!0,alpha:!0})}catch(e){return}e.setPixelRatio(Math.min(window.devicePixelRatio,2)),(0,u.TM)(e);let i=r.clientWidth||600,v=r.clientHeight||320;e.setSize(i,v),r.appendChild(e.domElement);let d=new a.xsS,h=(0,u.kM)(e);d.environment=h.texture;let x=e.capabilities.getMaxAnisotropy(),w=(e,t)=>{let n=new a.ROQ(e);
1return n.colorSpace=t?a.KI_:a.aCh,n.wrapS=a.rpg,n.wrapT=a.rpg,n.anisotropy=x,f.current.push(n),n},y=new a.Wid({color:16777215,map:t.albedo?w(t.albedo,!0):null,normalMap:t.normal?w(t.normal,!1):null,normalScale:new a.FM8(n.normalScale,n.flipGreen?-n.normalScale:n.normalScale),roughnessMap:t.roughness?w(t.roughness,!1):null,roughness:n.roughness,metalness:n.metalness,aoMap:t.ao?w(t.ao,!1):null,aoMapIntensity:n.aoIntensity,displacementMap:t.displacement?w(t.displacement,!1):null,displacementScale:n.displacementScale});m.current=y;let M=new a.xo$(1,220,220),D=new a.Kj0(M,y);d.add(D);let U=new a.cPb(u.UV,i/v,.01,100),S=1/Math.sin(u.UV*Math.PI/360)*1.18;U.position.set(.25*S,.12*S,S),U.updateProjectionMatrix();let b=new o.z(U,e.domElement);p.current=b,b.enableDamping=!0,b.dampingFactor=.08,b.autoRotate=g.current,b.autoRotateSpeed=1.1,b.enablePan=!1,b.minDistance=1.4,b.maxDistance=3*S,e.domElement.style.touchAction="pan-y";let j=new ResizeObserver(()=>{let t=r.clientWidth,n=r.clientHeight||320;0!==t&&(e.setSize(t,n),U.aspect=t/n,U.updateProjectionMatrix())});j.observe(r);let A=0,R=!0,k=()=>{R&&!document.hidden?(b.update(),e.render(d,U),A=requestAnimationFrame(k)):A=0},P=()=>{R&&!document.hidden&&0===A?k():(!R||document.hidden)&&0!==A&&(cancelAnimationFrame(A),A=0)},C=new IntersectionObserver(e=>{let[t]=e;R=t.isIntersecting,P()});return C.observe(r),document.addEventListener("visibilitychange",P),k(),()=>{for(let e of(cancelAnimationFrame(A),C.disconnect(),document.removeEventListener("visibilitychange",P),j.disconnect(),b.dispose(),f.current))e.dispose();f.current=[],m.current=null,(0,l.U7)(D),h.dispose(),e.dispose(),e.forceContextLoss(),e.domElement.remove()}},[]),(0,i.useEffect)(()=>{let e=m.current;e&&(e.normalScale.set(n.normalScale,n.flipGreen?-n.normalScale:n.normalScale),e.roughness=n.roughness,e.metalness=n.metalness,e.aoMapIntensity=n.aoIntensity,e.displacementScale=n.displacementScale)},[n]),(0,i.useEffect)(()=>{for(let e of f.current)e.needsUpdate=!0},[d]),(0,r.jsx)("div",{className:"glb-opt-viewer",ref:c,role:"img","aria-label":"Live PBR material preview",children:(0,r.jsx)(v.Y,{rotating:h,onToggle:()=>x(e=>{let t=!e;return p.current&&(p.current.autoRotate=t),t})})})}},83880:function(e,t,n){n.d(t,{UV:function(){return u},TM:function(){return v},sh:function(){return m},kM:function(){return c},cz:function(){return d}});var r=n(72079),i=n(51448);class s extends r.xsS{constructor(){super(),this.name="RoomEnvironment",this.position.y=-3.5;let e=new r.DvJ;e.deleteAttribute("uv");let t=new r.Wid({side:r._Li}),n=new r.Wid,i=new r.cek(16777215,900,28,2);i.position.set(.418,16.199,.3),this.add(i);let s=new r.Kj0(e,t);s.position.set(-.757,13.219,.717),s.scale.set(31.713,28.305,28.591),this.add(s);let o=new r.SPe(e,n,6),l=new r.Tme;l.position.set(-10.906,2.009,1.846),l.rotation.set(0,-.195,0),l.scale.set(2.328,7.905,4.651),l.updateMatrix(),o.setMatrixAt(0,l.matrix),l.position.set(-5.607,-.754,-.758),l.rotation.set(0,.994,0),l.scale.set(1.97,1.534,3.955),l.updateMatrix(),o.setMatrixAt(1,l.matrix),l.position.set(6.167,.857,7.803),l.rotation.set(0,.561,0),l.scale.set(3.927,6.285,3.687),l.updateMatrix(),o.setMatrixAt(2,l.matrix),l.position.set(-2.017,.018,6.124),l.rotation.set(0,.333,0),l.scale.set(2.002,4.566,2.064),l.updateMatrix(),o.setMatrixAt(3,l.matrix),l.position.set(2.291,-.756,-2.621),l.rotation.set(0,-.286,0),l.scale.set(1.546,1.552,1.496),l.updateMatrix(),o.setMatrixAt(4,l.matrix),l.position.set(-2.193,-.369,-5.547),l.rotation.set(0,.516,0),l.scale.set(3.875,3.487,2.986),l.updateMatrix(),o.setMatrixAt(5,l.matrix),this.add(o);let u=new r.Kj0(e,a(50));u.position.set(-16.116,14.37,8.208),u.scale.set(.1,2.428,2.739),this.add(u);let v=new r.Kj0(e,a(50));v.position.set(-16.109,18.021,-8.207),v.scale.set(.1,2.425,2.751),this.add(v);let d=new r.Kj0(e,a(17));d.position.set(14.904,12.198,-1.832),d.scale.set(.15,4.265,6.331),this.add(d);let c=new r.Kj0(e,a(43));c.position.set(-.462,8.89,14.52),c.scale.set(4.38,5.441,.088),this.add(c);let m=new r.Kj0(e,a(20));m.position.set(3.235,11.486,-12.541),m.scale.set(2.5,2,.1),this.add(m);let f=new r.Kj0(e,a(100));f.position.set(0,20,0),f.scale.set(1,.1,1),this.add(f)}dispose(){let e=new Set;for(let t of(this.traverse(t=>{t.isMesh&&(e.add(t.geometry),e.add(t.material))}),e))t.dispose()}}function a(e){return new r.YBo({color:0,emissive:16777215,emissiveIntensity:e})}let o={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
2
3		varying vec2 vUv;
4
5		void main() {
6
7			vUv = uv;
8			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
9
10		}`,fragmentShader:`
11
12		uniform sampler2D tDiffuse;
13		uniform float h;
14
15		varying vec2 vUv;
16
17		void main() {
18
19			vec4 sum = vec4( 0.0 );
20
21			sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;
22			sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;
23			sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;
24			sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;
25			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
26			sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;
27			sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;
28			sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;
29			sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;
30
31			gl_FragColor = sum;
32
33		}`},l={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
34
35		varying vec2 vUv;
36
37		void main() {
38
39			vUv = uv;
40			gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
41
42		}`,fragmentShader:`
43
44		uniform sampler2D tDiffuse;
45		uniform float v;
46
47		varying vec2 vUv;
48
49		void main() {
50
51			vec4 sum = vec4( 0.0 );
52
53			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;
54			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;
55			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;
56			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;
57			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
58			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;
59			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;
60			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;
61			sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;
62
63			gl_FragColor = sum;
64
65		}`},u=30;function v(e){e.toneMapping=r.ORg,e.toneMappingExposure=1.3}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return e/Math.sin(t*Math.PI/360)}function c(e){let t=new i.anP(e),n=new s,r=t.fromScene(n,.04).texture;
65return n.dispose(),t.dispose(),{texture:r,dispose:()=>r.dispose()}}function m(e,t,n){var i,s,a,u;let v=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},d=n.getSize(new r.Pa4),c=n.getCenter(new r.Pa4),m=null!==(i=v.resolution)&&void 0!==i?i:512,f=null!==(s=v.darkness)&&void 0!==s?s:1.1,p=null!==(a=v.blur)&&void 0!==a?a:3.2,h=1.5*Math.max(d.x,1e-4),x=1.5*Math.max(d.z,1e-4),g=1.5*Math.max(d.y,1e-4),w=new r.ZAu;w.position.set(c.x,n.min.y,c.z);let y=new r.dd2(m,m);y.texture.generateMipmaps=!1;let M=new r.dd2(m,m);M.texture.generateMipmaps=!1;let D=new r._12(h,x).rotateX(Math.PI/2),U=new r.vBJ({map:y.texture,opacity:null!==(u=v.opacity)&&void 0!==u?u:1,transparent:!0,depthWrite:!1}),S=new r.Kj0(D,U);S.renderOrder=1,S.scale.y=-1,w.add(S);let b=new r.Kj0(D);b.visible=!1,w.add(b);let j=new r.iKG(-h/2,h/2,x/2,-x/2,0,g);j.rotation.x=Math.PI/2,w.add(j);let A=new r.lRF,R={value:f};A.onBeforeCompile=e=>{e.uniforms.darkness=R,e.fragmentShader="uniform float darkness;\n".concat(e.fragmentShader).replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")},A.depthTest=!1,A.depthWrite=!1;let k=new r.jyz(o);k.depthTest=!1;let P=new r.jyz(l);function C(t){b.visible=!0,b.material=k,k.uniforms.tDiffuse.value=y.texture,k.uniforms.h.value=t/m,e.setRenderTarget(M),e.render(b,j),b.material=P,P.uniforms.tDiffuse.value=M.texture,P.uniforms.v.value=t/m,e.setRenderTarget(y),e.render(b,j),b.visible=!1}return P.depthTest=!1,{group:w,update:function(){let n=t.background,r=t.overrideMaterial,i=e.getClearAlpha();S.visible=!1,t.background=null,t.overrideMaterial=A,e.setClearAlpha(0),e.setRenderTarget(y),e.clear(),e.render(t,j),t.overrideMaterial=r,C(p),C(.4*p),e.setRenderTarget(null),e.setClearAlpha(i),t.background=n,S.visible=!0},dispose(){y.dispose(),M.dispose(),D.dispose(),U.dispose(),A.dispose(),k.dispose(),P.dispose()}}}},41235:function(e,t,n){n.d(t,{U7:function(){return a},cZ:function(){return s},nL:function(){return o}});var r=n(72079);let i=new WeakSet;function s(e){for(let t of Array.isArray(e)?e:[e])i.add(t);return e}function a(e){let t=new Set,n=new Set,r=new Set;e.traverse(e=>{e.geometry&&!t.has(e.geometry)&&(e.geometry.dispose(),t.add(e.geometry)),e.material&&o(e.material,n,r)}),e.clear()}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;for(let s of Array.isArray(e)?e:[e])if(!t.has(s)){if(!i.has(s))for(let e of Object.values(s))e instanceof r.xEZ&&!n.has(e)&&(e.dispose(),n.add(e));s.dispose(),t.add(s)}}}}]);

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.