@needle-tools/engine 4.16.4 → 4.16.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{needle-engine.bundle-CtJr8rlr.min.js → needle-engine.bundle-Cndz6kVg.min.js} +2 -2
- package/dist/{needle-engine.bundle-DRRRuVe_.umd.cjs → needle-engine.bundle-D7PAIzue.umd.cjs} +4 -4
- package/dist/{needle-engine.bundle-Dx2kg9c0.js → needle-engine.bundle-_FYakfzP.js} +6 -7
- package/dist/needle-engine.d.ts +15 -15
- package/dist/needle-engine.js +2 -2
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/engine_mainloop_utils.js +3 -3
- package/lib/engine/engine_mainloop_utils.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/engine_mainloop_utils.ts +3 -3
|
@@ -141,7 +141,7 @@ void main(){
|
|
|
141
141
|
#__vconsole .vc-mask {
|
|
142
142
|
overflow: hidden;
|
|
143
143
|
}
|
|
144
|
-
`,Or?.prepend(i),o===!0&&r_()<=0&&L_(),console.log("\u{1F335} Debug console has loaded")}},e.onerror=()=>{console.warn("\u{1F335} Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),vc=!1,ui=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function ek(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const s=n.indexOf("?");s>-1&&(n=n.substring(0,s));const r=location.protocol+"//"+location.host+location.pathname+"/"+n,a=encodeURIComponent(r);o.fullUrl="https://viewer.needle.tools?inspect&file="+a;var l='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(l)}),o.on("show",function(){const t=e();t&&t.src!==o.fullUrl&&(t.src=o.fullUrl)}),o.on("hide",function(){const t=e();t&&(t.src="")}),o.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window \u2197",onClick:function(n){window.open(o.fullUrl,"_blank"),ui?.hide()}}),i.push({name:"Reload",onClick:function(n){const s=e();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=e();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),t(i)}),o}const yg="padding: 10px; font-family: monospace;",j_="margin-bottom: 10px;",kr="margin-bottom: 10px; margin-top: 15px;",tk="width: 100%; border-collapse: collapse; border: 1px solid rgba(0,0,0,0.1); table-layout: fixed;",B_="border: 1px solid rgba(0,0,0,0.1); padding: 5px;",ik=B_,nk=B_+" word-break: break-all;";function Gn(o,e=!1){e&&o.sort((i,n)=>(n.value?1:0)-(i.value?1:0));let t=`<table style='${tk}'>`;t+="<tbody>";for(const i of o){const n=typeof i.value=="boolean"?i.value?"\u2705":"\u274C":i.value;t+=`<tr><td style='${ik}'>${i.label}</td><td style='${nk}'>${n}</td></tr>`}return t+="</tbody></table>",t}function F_(){try{if(document.createElement("canvas").getContext("webgl2"))return"\u2705"}catch{}return"\u274C"}function ok(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("device-utilities","\u{1F4F1} Device Info");return o.on("renderTab",function(e){let t=`<div style='${yg}'>`;const i=mk();t+=`<h3 style='${j_}'>Device: ${i}</h3>`,t+=Gn([{label:"\u{1F4BB} Desktop",value:I.isDesktop()},{label:"\u{1F4F1} Mobile Device",value:I.isMobileDevice()},{label:"\u{1F34E} iOS",value:I.isiOS()},{label:"\u{1F4F1} iPad",value:I.isiPad()},{label:"\u{1F916} Android",value:I.isAndroidDevice()},{label:"\u{1F98A} Mozilla XR",value:I.isMozillaXR()},{label:"\u{1F335} Needle App Clip",value:I.isNeedleAppClip()},{label:"\u{1F34F} macOS",value:I.isMacOS()},{label:"\u{1F453} VisionOS",value:I.isVisionOS()},{label:"\u{1F9ED} Safari",value:I.isSafari()},{label:"\u{1F576}\uFE0F Meta Quest",value:I.isQuest()},{label:"\u{1F517} QuickLook AR Support",value:I.supportsQuickLookAR()}],!0);const n=[],s=I.getiOSVersion();s&&n.push({label:"\u{1F34E} iOS Version",value:s});const r=I.getChromeVersion();r&&n.push({label:"\u{1F310} Chrome Version",value:r});const a=I.getSafariVersion();a&&n.push({label:"\u{1F9ED} Safari Version",value:a}),n.length>0&&(t+=Gn(n,!1)),t+="</div>",t+=`<div style='${yg} margin-top: 20px;'>`,t+=`<h3 style='${j_}'>User Agent Info</h3>`;const l=[{label:"User Agent",value:navigator.userAgent},{label:"Platform",value:navigator.platform},{label:"App Version",value:navigator.appVersion},{label:"User Agent Data",value:navigator.userAgentData?`Platform: ${navigator.userAgentData.platform}, Mobile: ${navigator.userAgentData.mobile}`:"Not supported"},{label:"WebXR",value:"xr"in navigator?"\u2705":"\u274C"},{label:"WebGPU",value:"gpu"in navigator?"\u2705":"\u274C"},{label:"WebGL 2",value:F_()}];t+=Gn(l,!1),t+="</div>",e(t)}),o}function sk(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("graphics-info","\u{1F3A8} Graphics Info");return o.on("renderTab",async function(e){let t=`<div style='${yg}'>`;const i=rk();i.length>0&&(t+=`<h3 style='${kr}'>General GPU Info</h3>`,t+=Gn(i,!1));const n=lk();n.length>0&&(t+=`<h3 style='${kr}'>WebGL</h3>`,t+=Gn(n,!1));const s=ck();s.length>0&&(t+=`<h3 style='${kr}'>WebGL 2 Features</h3>`,t+=Gn(s,!1));const r=hk();r.length>0&&(t+=`<h3 style='${kr}'>WebGL Limits</h3>`,t+=Gn(r,!1));const a=dk();a.length>0&&(t+=`<h3 style='${kr}'>Texture Formats</h3>`,t+=Gn(a,!1));const l=await uk();if(l.length>0&&(t+=`<h3 style='${kr}'>WebGPU</h3>`,t+=Gn(l,!1)),I.isSafari()){const c=pk();c.length>0&&(t+=`<h3 style='${kr}'>Safari GPU Info</h3>`,t+=Gn(c,!1))}t+="</div>",e(t)}),o}function rk(){const o=[],e=window.devicePixelRatio;o.push({label:"Device Pixel Ratio",value:e.toString()}),o.push({label:"Width (px)",value:(window.innerWidth*e).toString()}),o.push({label:"Height (px)",value:(window.innerHeight*e).toString()});const t=I.isMobileDevice()?150:96,i=screen.width/t,n=screen.height/t,s=i*2.54,r=n*2.54;o.push({label:"Estimated Width (cm)",value:s.toFixed(1)}),o.push({label:"Estimated Height (cm)",value:r.toFixed(1)});const a=U_();if(a){o.push({label:"GPU",value:a.renderer}),o.push({label:"Driver",value:a.vendor}),o.push({label:"ANGLE",value:a.angle||"Not detected"});const l=ak(a.renderer);l&&(l.manufacturer&&o.push({label:"Manufacturer",value:l.manufacturer}),l.cardVersion&&o.push({label:"Card Version",value:l.cardVersion}),l.brand&&o.push({label:"Brand",value:l.brand}),o.push({label:"Integrated",value:l.integrated?"Yes":"No"}),l.layer&&o.push({label:"WebGL Layer",value:l.layer}))}return o}function ak(o){if(!o)return null;const e=(l,c)=>{const h=c.match(l);return h&&h[0]},t=e(/(ANGLE)/g,o)||void 0,i=e(/((NVIDIA|AMD|Intel)[^\d]*[^\s]+)/,o)||o,n=i.split(" ");n.shift();const s=e(/(NVIDIA|AMD|Intel)/g,i)||void 0,r=n.length>0?n.pop():void 0,a=n.length>0?n.join(" "):void 0;return{manufacturer:s,cardVersion:r,brand:a,integrated:s==="Intel",layer:t,card:i}}function lk(){const o=[],e=U_();return e&&(o.push({label:"\u{1F4CA} WebGL Version",value:e.version}),o.push({label:"\u{1F3AE} WebGL 2 Available",value:F_()})),o}function ck(){const o=[];try{const e=document.createElement("canvas").getContext("webgl2");if(!e)return o;o.push({label:"Float Color Buffer",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"Anisotropic Filtering",value:e.getExtension("EXT_texture_filter_anisotropic")?"\u2705":"\u274C"}),o.push({label:"Float Texture Linear",value:e.getExtension("OES_texture_float_linear")?"\u2705":"\u274C"}),o.push({label:"S3TC Compression",value:e.getExtension("WEBGL_compressed_texture_s3tc")?"\u2705":"\u274C"}),o.push({label:"ETC Compression",value:e.getExtension("WEBGL_compressed_texture_etc")?"\u2705":"\u274C"}),o.push({label:"PVRTC Compression",value:e.getExtension("WEBGL_compressed_texture_pvrtc")?"\u2705":"\u274C"}),o.push({label:"ASTC Compression",value:e.getExtension("WEBGL_compressed_texture_astc")?"\u2705":"\u274C"})}catch{}return o}function hk(){const o=[];try{const e=document.createElement("canvas"),t=e.getContext("webgl2")||e.getContext("webgl");if(!t)return o;const i=t instanceof WebGL2RenderingContext;o.push({label:"\u{1F4CF} Max Texture Size",value:t.getParameter(t.MAX_TEXTURE_SIZE).toString()}),o.push({label:"\u{1F3A8} Max Renderbuffer Size",value:t.getParameter(t.MAX_RENDERBUFFER_SIZE).toString()}),o.push({label:"\u{1F517} Max Vertex Attribs",value:t.getParameter(t.MAX_VERTEX_ATTRIBS).toString()}),o.push({label:"\u{1F3AF} Max Texture Units",value:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS).toString()}),i&&(o.push({label:"\u26A1 Max Samples",value:t.getParameter(t.MAX_SAMPLES).toString()}),o.push({label:"\u{1F504} Max Uniform Buffer Bindings",value:t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS).toString()}),o.push({label:"\u{1F4D0} Max 3D Texture Size",value:t.getParameter(t.MAX_3D_TEXTURE_SIZE).toString()}))}catch{}return o}function dk(){const o=[];try{document.createElement("canvas").getContext("webgl")&&(o.push({label:"WebGL 1 RGBA",value:"\u2705"}),o.push({label:"WebGL 1 RGB",value:"\u2705"}));const e=document.createElement("canvas").getContext("webgl2");e&&(o.push({label:"WebGL 2 RGBA32F",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"WebGL 2 RGB32F",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"WebGL 2 R11F_G11F_B10F",value:"\u2705"}),o.push({label:"WebGL 2 RGB565",value:"\u2705"}),o.push({label:"WebGL 2 RGB5_A1",value:"\u2705"}),o.push({label:"WebGL 2 RGBA4444",value:"\u2705"}))}catch{}return o}async function uk(){const o=[];if(!("gpu"in navigator))return o.push({label:"\u{1F680} WebGPU Support",value:"\u274C Not supported"}),o;o.push({label:"\u{1F680} WebGPU Support",value:"\u2705 Supported"});try{const e=await navigator.gpu.requestAdapter();if(!e)return o.push({label:"\u{1F3AF} Adapter",value:"No adapter available"}),o;o.push({label:"\u{1F3AF} Adapter",value:e.name||"Unknown Adapter"});const t=await e.requestDevice();o.push({label:"\u{1F527} Device",value:t.label||"WebGPU Device"}),o.push({label:"\u{1F4CF} Max Texture 2D",value:t.limits.maxTextureDimension2D.toString()}),o.push({label:"\u{1F4D0} Max Texture 3D",value:t.limits.maxTextureDimension3D.toString()}),o.push({label:"\u{1F4CA} Max Texture Array Layers",value:t.limits.maxTextureArrayLayers.toString()}),o.push({label:"\u{1F4BE} Max Buffer Size",value:`${(t.limits.maxBufferSize/1024/1024).toFixed(1)}MB`}),o.push({label:"\u{1F517} Max Bind Groups",value:t.limits.maxBindGroups.toString()})}catch(e){o.push({label:"\u274C Error",value:e.message})}return o}function U_(){try{const o=document.createElement("canvas"),e=o.getContext("webgl2")||o.getContext("webgl");if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info"),i=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),n=t?e.getParameter(t.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR),s=e.getParameter(e.VERSION);let r;if(i&&i.includes("ANGLE")){const a=i.match(/ANGLE \(([^)]+)\)/);a&&(r=a[1])}return{renderer:i,vendor:n,version:s,angle:r}}catch{return null}}function pk(){const o=[];try{const e=document.createElement("canvas").getContext("webgl");if(e){const t=e.getExtension("WEBGL_debug_renderer_info");if(t){const i=e.getParameter(t.UNMASKED_RENDERER_WEBGL);i&&i.includes("Apple")&&o.push({label:"\u{1F34E} Apple GPU",value:i})}}}catch{}try{const e=document.createElement("canvas").getContext("webgl");e&&(e.getSupportedExtensions()||[]).includes("WEBGL_compressed_texture_pvrtc")&&o.push({label:"\u{1F5DC}\uFE0F PVRTC Support",value:"\u2705"})}catch{}return o}function mk(){return I.isQuest()?"Meta Quest":I.isVisionOS()?"Vision Pro":I.isiOS()?I.isiPad()?"iPad":"iPhone/iPod":I.isAndroidDevice()?"Android Device":I.isMozillaXR()?"Mozilla XR Browser":I.isNeedleAppClip()?"Needle App Clip":I.isMacOS()?"Mac":I.isDesktop()?"Desktop PC":"Unknown Device"}function gk(){return document.querySelector("#__vconsole .vc-switch")||null}function fk(){return document.querySelector("#__vconsole")||null}const z_=w("debugdefines");Cs('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),Cs('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),Cs('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),Cs('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),Cs('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.16.4";'),Cs('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),Cs('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Wed Mar 18 2026 10:42:17 GMT+0000 (Coordinated Universal Time)";'),Cs('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const Ti="4.16.4",Va="undefined",wc="Wed Mar 18 2026 10:42:17 GMT+0000 (Coordinated Universal Time)";z_&&console.log(`Engine version: ${Ti} (generator: ${Va})
|
|
144
|
+
`,Or?.prepend(i),o===!0&&r_()<=0&&L_(),console.log("\u{1F335} Debug console has loaded")}},e.onerror=()=>{console.warn("\u{1F335} Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),vc=!1,ui=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function ek(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const s=n.indexOf("?");s>-1&&(n=n.substring(0,s));const r=location.protocol+"//"+location.host+location.pathname+"/"+n,a=encodeURIComponent(r);o.fullUrl="https://viewer.needle.tools?inspect&file="+a;var l='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(l)}),o.on("show",function(){const t=e();t&&t.src!==o.fullUrl&&(t.src=o.fullUrl)}),o.on("hide",function(){const t=e();t&&(t.src="")}),o.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window \u2197",onClick:function(n){window.open(o.fullUrl,"_blank"),ui?.hide()}}),i.push({name:"Reload",onClick:function(n){const s=e();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=e();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),t(i)}),o}const yg="padding: 10px; font-family: monospace;",j_="margin-bottom: 10px;",kr="margin-bottom: 10px; margin-top: 15px;",tk="width: 100%; border-collapse: collapse; border: 1px solid rgba(0,0,0,0.1); table-layout: fixed;",B_="border: 1px solid rgba(0,0,0,0.1); padding: 5px;",ik=B_,nk=B_+" word-break: break-all;";function Gn(o,e=!1){e&&o.sort((i,n)=>(n.value?1:0)-(i.value?1:0));let t=`<table style='${tk}'>`;t+="<tbody>";for(const i of o){const n=typeof i.value=="boolean"?i.value?"\u2705":"\u274C":i.value;t+=`<tr><td style='${ik}'>${i.label}</td><td style='${nk}'>${n}</td></tr>`}return t+="</tbody></table>",t}function F_(){try{if(document.createElement("canvas").getContext("webgl2"))return"\u2705"}catch{}return"\u274C"}function ok(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("device-utilities","\u{1F4F1} Device Info");return o.on("renderTab",function(e){let t=`<div style='${yg}'>`;const i=mk();t+=`<h3 style='${j_}'>Device: ${i}</h3>`,t+=Gn([{label:"\u{1F4BB} Desktop",value:I.isDesktop()},{label:"\u{1F4F1} Mobile Device",value:I.isMobileDevice()},{label:"\u{1F34E} iOS",value:I.isiOS()},{label:"\u{1F4F1} iPad",value:I.isiPad()},{label:"\u{1F916} Android",value:I.isAndroidDevice()},{label:"\u{1F98A} Mozilla XR",value:I.isMozillaXR()},{label:"\u{1F335} Needle App Clip",value:I.isNeedleAppClip()},{label:"\u{1F34F} macOS",value:I.isMacOS()},{label:"\u{1F453} VisionOS",value:I.isVisionOS()},{label:"\u{1F9ED} Safari",value:I.isSafari()},{label:"\u{1F576}\uFE0F Meta Quest",value:I.isQuest()},{label:"\u{1F517} QuickLook AR Support",value:I.supportsQuickLookAR()}],!0);const n=[],s=I.getiOSVersion();s&&n.push({label:"\u{1F34E} iOS Version",value:s});const r=I.getChromeVersion();r&&n.push({label:"\u{1F310} Chrome Version",value:r});const a=I.getSafariVersion();a&&n.push({label:"\u{1F9ED} Safari Version",value:a}),n.length>0&&(t+=Gn(n,!1)),t+="</div>",t+=`<div style='${yg} margin-top: 20px;'>`,t+=`<h3 style='${j_}'>User Agent Info</h3>`;const l=[{label:"User Agent",value:navigator.userAgent},{label:"Platform",value:navigator.platform},{label:"App Version",value:navigator.appVersion},{label:"User Agent Data",value:navigator.userAgentData?`Platform: ${navigator.userAgentData.platform}, Mobile: ${navigator.userAgentData.mobile}`:"Not supported"},{label:"WebXR",value:"xr"in navigator?"\u2705":"\u274C"},{label:"WebGPU",value:"gpu"in navigator?"\u2705":"\u274C"},{label:"WebGL 2",value:F_()}];t+=Gn(l,!1),t+="</div>",e(t)}),o}function sk(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("graphics-info","\u{1F3A8} Graphics Info");return o.on("renderTab",async function(e){let t=`<div style='${yg}'>`;const i=rk();i.length>0&&(t+=`<h3 style='${kr}'>General GPU Info</h3>`,t+=Gn(i,!1));const n=lk();n.length>0&&(t+=`<h3 style='${kr}'>WebGL</h3>`,t+=Gn(n,!1));const s=ck();s.length>0&&(t+=`<h3 style='${kr}'>WebGL 2 Features</h3>`,t+=Gn(s,!1));const r=hk();r.length>0&&(t+=`<h3 style='${kr}'>WebGL Limits</h3>`,t+=Gn(r,!1));const a=dk();a.length>0&&(t+=`<h3 style='${kr}'>Texture Formats</h3>`,t+=Gn(a,!1));const l=await uk();if(l.length>0&&(t+=`<h3 style='${kr}'>WebGPU</h3>`,t+=Gn(l,!1)),I.isSafari()){const c=pk();c.length>0&&(t+=`<h3 style='${kr}'>Safari GPU Info</h3>`,t+=Gn(c,!1))}t+="</div>",e(t)}),o}function rk(){const o=[],e=window.devicePixelRatio;o.push({label:"Device Pixel Ratio",value:e.toString()}),o.push({label:"Width (px)",value:(window.innerWidth*e).toString()}),o.push({label:"Height (px)",value:(window.innerHeight*e).toString()});const t=I.isMobileDevice()?150:96,i=screen.width/t,n=screen.height/t,s=i*2.54,r=n*2.54;o.push({label:"Estimated Width (cm)",value:s.toFixed(1)}),o.push({label:"Estimated Height (cm)",value:r.toFixed(1)});const a=U_();if(a){o.push({label:"GPU",value:a.renderer}),o.push({label:"Driver",value:a.vendor}),o.push({label:"ANGLE",value:a.angle||"Not detected"});const l=ak(a.renderer);l&&(l.manufacturer&&o.push({label:"Manufacturer",value:l.manufacturer}),l.cardVersion&&o.push({label:"Card Version",value:l.cardVersion}),l.brand&&o.push({label:"Brand",value:l.brand}),o.push({label:"Integrated",value:l.integrated?"Yes":"No"}),l.layer&&o.push({label:"WebGL Layer",value:l.layer}))}return o}function ak(o){if(!o)return null;const e=(l,c)=>{const h=c.match(l);return h&&h[0]},t=e(/(ANGLE)/g,o)||void 0,i=e(/((NVIDIA|AMD|Intel)[^\d]*[^\s]+)/,o)||o,n=i.split(" ");n.shift();const s=e(/(NVIDIA|AMD|Intel)/g,i)||void 0,r=n.length>0?n.pop():void 0,a=n.length>0?n.join(" "):void 0;return{manufacturer:s,cardVersion:r,brand:a,integrated:s==="Intel",layer:t,card:i}}function lk(){const o=[],e=U_();return e&&(o.push({label:"\u{1F4CA} WebGL Version",value:e.version}),o.push({label:"\u{1F3AE} WebGL 2 Available",value:F_()})),o}function ck(){const o=[];try{const e=document.createElement("canvas").getContext("webgl2");if(!e)return o;o.push({label:"Float Color Buffer",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"Anisotropic Filtering",value:e.getExtension("EXT_texture_filter_anisotropic")?"\u2705":"\u274C"}),o.push({label:"Float Texture Linear",value:e.getExtension("OES_texture_float_linear")?"\u2705":"\u274C"}),o.push({label:"S3TC Compression",value:e.getExtension("WEBGL_compressed_texture_s3tc")?"\u2705":"\u274C"}),o.push({label:"ETC Compression",value:e.getExtension("WEBGL_compressed_texture_etc")?"\u2705":"\u274C"}),o.push({label:"PVRTC Compression",value:e.getExtension("WEBGL_compressed_texture_pvrtc")?"\u2705":"\u274C"}),o.push({label:"ASTC Compression",value:e.getExtension("WEBGL_compressed_texture_astc")?"\u2705":"\u274C"})}catch{}return o}function hk(){const o=[];try{const e=document.createElement("canvas"),t=e.getContext("webgl2")||e.getContext("webgl");if(!t)return o;const i=t instanceof WebGL2RenderingContext;o.push({label:"\u{1F4CF} Max Texture Size",value:t.getParameter(t.MAX_TEXTURE_SIZE).toString()}),o.push({label:"\u{1F3A8} Max Renderbuffer Size",value:t.getParameter(t.MAX_RENDERBUFFER_SIZE).toString()}),o.push({label:"\u{1F517} Max Vertex Attribs",value:t.getParameter(t.MAX_VERTEX_ATTRIBS).toString()}),o.push({label:"\u{1F3AF} Max Texture Units",value:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS).toString()}),i&&(o.push({label:"\u26A1 Max Samples",value:t.getParameter(t.MAX_SAMPLES).toString()}),o.push({label:"\u{1F504} Max Uniform Buffer Bindings",value:t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS).toString()}),o.push({label:"\u{1F4D0} Max 3D Texture Size",value:t.getParameter(t.MAX_3D_TEXTURE_SIZE).toString()}))}catch{}return o}function dk(){const o=[];try{document.createElement("canvas").getContext("webgl")&&(o.push({label:"WebGL 1 RGBA",value:"\u2705"}),o.push({label:"WebGL 1 RGB",value:"\u2705"}));const e=document.createElement("canvas").getContext("webgl2");e&&(o.push({label:"WebGL 2 RGBA32F",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"WebGL 2 RGB32F",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"WebGL 2 R11F_G11F_B10F",value:"\u2705"}),o.push({label:"WebGL 2 RGB565",value:"\u2705"}),o.push({label:"WebGL 2 RGB5_A1",value:"\u2705"}),o.push({label:"WebGL 2 RGBA4444",value:"\u2705"}))}catch{}return o}async function uk(){const o=[];if(!("gpu"in navigator))return o.push({label:"\u{1F680} WebGPU Support",value:"\u274C Not supported"}),o;o.push({label:"\u{1F680} WebGPU Support",value:"\u2705 Supported"});try{const e=await navigator.gpu.requestAdapter();if(!e)return o.push({label:"\u{1F3AF} Adapter",value:"No adapter available"}),o;o.push({label:"\u{1F3AF} Adapter",value:e.name||"Unknown Adapter"});const t=await e.requestDevice();o.push({label:"\u{1F527} Device",value:t.label||"WebGPU Device"}),o.push({label:"\u{1F4CF} Max Texture 2D",value:t.limits.maxTextureDimension2D.toString()}),o.push({label:"\u{1F4D0} Max Texture 3D",value:t.limits.maxTextureDimension3D.toString()}),o.push({label:"\u{1F4CA} Max Texture Array Layers",value:t.limits.maxTextureArrayLayers.toString()}),o.push({label:"\u{1F4BE} Max Buffer Size",value:`${(t.limits.maxBufferSize/1024/1024).toFixed(1)}MB`}),o.push({label:"\u{1F517} Max Bind Groups",value:t.limits.maxBindGroups.toString()})}catch(e){o.push({label:"\u274C Error",value:e.message})}return o}function U_(){try{const o=document.createElement("canvas"),e=o.getContext("webgl2")||o.getContext("webgl");if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info"),i=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),n=t?e.getParameter(t.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR),s=e.getParameter(e.VERSION);let r;if(i&&i.includes("ANGLE")){const a=i.match(/ANGLE \(([^)]+)\)/);a&&(r=a[1])}return{renderer:i,vendor:n,version:s,angle:r}}catch{return null}}function pk(){const o=[];try{const e=document.createElement("canvas").getContext("webgl");if(e){const t=e.getExtension("WEBGL_debug_renderer_info");if(t){const i=e.getParameter(t.UNMASKED_RENDERER_WEBGL);i&&i.includes("Apple")&&o.push({label:"\u{1F34E} Apple GPU",value:i})}}}catch{}try{const e=document.createElement("canvas").getContext("webgl");e&&(e.getSupportedExtensions()||[]).includes("WEBGL_compressed_texture_pvrtc")&&o.push({label:"\u{1F5DC}\uFE0F PVRTC Support",value:"\u2705"})}catch{}return o}function mk(){return I.isQuest()?"Meta Quest":I.isVisionOS()?"Vision Pro":I.isiOS()?I.isiPad()?"iPad":"iPhone/iPod":I.isAndroidDevice()?"Android Device":I.isMozillaXR()?"Mozilla XR Browser":I.isNeedleAppClip()?"Needle App Clip":I.isMacOS()?"Mac":I.isDesktop()?"Desktop PC":"Unknown Device"}function gk(){return document.querySelector("#__vconsole .vc-switch")||null}function fk(){return document.querySelector("#__vconsole")||null}const z_=w("debugdefines");Cs('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),Cs('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),Cs('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),Cs('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),Cs('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.16.5";'),Cs('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),Cs('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Wed Mar 18 2026 11:58:51 GMT+0000 (Coordinated Universal Time)";'),Cs('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const Ti="4.16.5",Va="undefined",wc="Wed Mar 18 2026 11:58:51 GMT+0000 (Coordinated Universal Time)";z_&&console.log(`Engine version: ${Ti} (generator: ${Va})
|
|
145
145
|
Project built at ${wc}`);const Ss=NEEDLE_PUBLIC_KEY,qn="needle_isActiveInHierarchy",Mr="builtin_components",xc="needle_editor_guid";function Cs(o){try{(0,eval)(o)}catch(e){z_&&console.error(e)}}let N_,W_=null;function Cn(){return N_}function bg(o){if(o==null){console.warn("Oh no: someone tried registering a non-existend gltf-loader. When you see this log it might mean that needle-engine is being imported multiple times. Please check your project setup.");return}W_!==o&&(W_=o,N_=new o)}function yk(o,e){if(typeof window!==void 0&&window.SPECTOR){console.log(window.SPECTOR);const t=new URLSearchParams(window.location.search);if(t.has("spector")){let i=function(){if(n>o.time.frame)return window.requestAnimationFrame(()=>i());const r=s.captureCanvas(e);r&&r instanceof Promise?r.then(()=>s.displayUI()):s.displayUI()};const n=Number.parseInt(t.get("spector")||"0")||0;console.log("Scheduled Spector capture at frame #"+n);const s=new window.SPECTOR.Spector;s.spyCanvases=!0,i();return}else A()&&console.debug("Spector available: Add '?spector=<frame>' to the URL to enable it and capture a frame.")}}function V_(o){const e=o;return!!(e.parser&&e.parser.json)}var qd=(o=>(o[o.None=0]="None",o[o.DontExport=1]="DontExport",o))(qd||{});const $_=Symbol("component-name");function _g(o){return o&&o.isComponent}const bk=Symbol("object"),vg=new Ei(()=>new b,20);class H_{_point;_normal;_tangentVelocity;distance;impulse;friction;get point(){return vg.get().set(this._point.x,this._point.y,this._point.z)}get normal(){return vg.get().set(this._normal.x,this._normal.y,this._normal.z)}get tangentVelocity(){return vg.get().set(this._tangentVelocity.x,this._tangentVelocity.y,this._tangentVelocity.z)}constructor(e,t,i,n,s,r){this._point=e,this.distance=t,this._normal=i,this.impulse=n,this.friction=s,this._tangentVelocity=r}}class G_{contacts;constructor(e,t,i){this.me=e,this._collider=t,this._gameObject=t.gameObject,this.contacts=i}me;_collider;get collider(){return this._collider}_gameObject;get gameObject(){return this._gameObject}get rigidBody(){return this.collider?.attachedRigidbody}}class q_{object;collider;constructor(e,t){this.object=e,this.collider=t}}class xm{constructor(e){this.context=e,this.root.style.cssText=`
|
|
146
146
|
position: absolute;
|
|
147
147
|
width: 1px; height: 1px;
|
|
@@ -178,7 +178,7 @@ ${s.hand?"hand":"ctrl"} ${s.inputSource.handedness}[${s.index}] con:${s.connecte
|
|
|
178
178
|
The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
|
|
179
179
|
`,t),Ie.splice(e,1),e--;continue}if(t.destroyed)continue;if(!t.gameObject){console.warn(`Component can not be initialized: no GameObject assigned.
|
|
180
180
|
Did you add and remove a component in the same frame?`),Ie.splice(e,1),e--;continue}t.context=o,Lc(t.gameObject),Hg(t,o)}catch(t){console.error(t),Bo(Ie[e],o),Ie.splice(e,1),e--}for(let e=0;e<Ie.length;e++)try{const t=Ie[e];if(t.destroyed){Bo(Ie[e],o),Ie.splice(e,1),e--;continue}if(t.registering)try{t.registering()}catch(i){console.error(i)}t.__internalAwake!==void 0&&(t.gameObject||console.error("Calling awake for a component without a GameObject",t,t.gameObject),Lc(t.gameObject),t.activeAndEnabled&&Ic(t.__internalAwake.bind(t)))}catch(t){console.error(t),Bo(Ie[e],o),Ie.splice(e,1),e--}for(let e=0;e<Ie.length;e++)try{const t=Ie[e];if(t.destroyed||t.enabled===!1||(Lc(t.gameObject),t.activeAndEnabled===!1))continue;t.__internalEnable!==void 0&&(t.enabled=!0,Ic(t.__internalEnable.bind(t)))}catch(t){console.error(t),Bo(Ie[e],o),Ie.splice(e,1),e--}for(let e=0;e<Ie.length;e++)try{const t=Ie[e];if(t.destroyed||!t.gameObject)continue;o.new_script_start.push(t)}catch(t){console.error(t),Bo(Ie[e],o),Ie.splice(e,1),e--}Ie.length=0;for(const e of o.new_scripts_post_setup_callbacks)e&&e();o.new_scripts_post_setup_callbacks.length=0}}function mM(o){o&&(o.__internalDisable(!0),Bo(o,o.context))}function Fv(o,e){for(let t=0;t<o.new_script_start.length;t++)try{const i=o.new_script_start[t];if(e!==void 0&&i.gameObject!==e||i.destroyed||i.activeAndEnabled===!1)continue;Ic(i.__internalAwake.bind(i)),i.enabled&&(Ic(i.__internalEnable.bind(i)),Ic(i.__internalStart.bind(i)),o.new_script_start.splice(t,1),t--)}catch(i){console.error(i),Bo(o.new_script_start[t],o),o.new_script_start.splice(t,1),t--}}function Hg(o,e){e.scripts.indexOf(o)===-1&&(e.scripts.push(o),o.earlyUpdate&&e.scripts_earlyUpdate.push(o),o.update&&e.scripts_update.push(o),o.lateUpdate&&e.scripts_lateUpdate.push(o),o.onBeforeRender&&e.scripts_onBeforeRender.push(o),o.onAfterRender&&e.scripts_onAfterRender.push(o),o.onPausedChanged&&e.scripts_pausedChanged.push(o),Gg(o,null)&&e.new_scripts_xr.push(o),Gg(o,"immersive-vr")&&e.scripts_immersive_vr.push(o),Gg(o,"immersive-ar")&&e.scripts_immersive_ar.push(o))}function Bo(o,e){Yi(o,e.new_scripts),Yi(o,e.new_script_start),Yi(o,e.scripts),Yi(o,e.scripts_earlyUpdate),Yi(o,e.scripts_update),Yi(o,e.scripts_lateUpdate),Yi(o,e.scripts_onBeforeRender),Yi(o,e.scripts_onAfterRender),Yi(o,e.scripts_pausedChanged),Yi(o,e.new_scripts_xr),Yi(o,e.scripts_immersive_vr),Yi(o,e.scripts_immersive_ar),e.stopAllCoroutinesFrom(o)}function Yi(o,e){const t=e.indexOf(o);t>=0&&e.splice(t,1)}function Gg(o,e){if(o){const t=o;if(t.onBeforeXR||t.onEnterXR||t.onUpdateXR||t.onLeaveXR||t.onXRControllerAdded||t.onXRControllerRemoved)return!(e!=null&&t.supportsXR?.(e)===!1)}return!1}let qg=!0;function Xg(){qg=!0}function cu(o,e=!1){if(Ac.experimentalSmartHierarchyUpdate){if(!e&&!qg)return;qg=!1}if(o||(o=pe.Current.scene),!o){console.trace("Invalid call - no current context.");return}const t=il(o);Qg(o,t,!0)||($g||A()?console.error(`Error updating hierarchy
|
|
181
|
-
Do you have circular references in your project? <a target="_blank" href="https://docs.needle.tools/circular-reference"> Click here for more information.`,o):console.error('Failed to update active state in hierarchy of "'+o.name+'"',o),console.warn(" \u2191 this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."))}function Qg(o,e,t,i=0){if(i>1e3)return console.warn("Hierarchy is too deep (> 1000 level) - will abort updating active state"),!1;const n=il(o);if(e&&(e=n,e&&o.parent&&i===0)){const a=o.parent;e=a[qn],e===void 0&&(a instanceof Hi||(e=!0))}const s=o[qn]!==e;if(s){o[qn]=e,uM&&console.warn("ACTIVE CHANGE",{name:o.name,activeSelf:n,visible:o.visible,activeInHierarchy:e,changed:s,go:o});{const a=o.userData?.components;if(a)for(let l=0,c=a.length;l<c;l++){const h=a[l];if(e){if(h.enabled){try{h.__internalAwake()}catch(d){console.error(d)}h.enabled&&h.__internalEnable()}}else h.__didAwake&&h.enabled&&(h.__didEnable=!1,h.onDisable())}}}const r=o.children;if(r){if(!s&&!e){let l=!0;for(let c=0,h=r.length;c<h;c++){const d=r[c];d[qn]!==!1&&Qg(d,!1,t,i+1)===!1&&(l=!1)}return l}let a=!0;for(let l=0,c=r.length;l<c;l++)Qg(r[l],e,t,i+1)===!1&&(a=!1);return a}return!0}function Lc(o){if(!o){console.error("GO is null");return}let e=!0,t=!1,i=o;for(;i;){if(i.type==="Scene"&&(t=!0),!il(i)){e=!1;break}i=i.parent}o[qn]=e&&t}const hu=new Map,Uv=Symbol("prewarmFlag"),Yg=Symbol("waitingForPrewarm"),Zg=w("debugprewarm");function gM(o,e){!o||o[Uv]===!0||o[Yg]===!0||(hu.has(e)||hu.set(e,[]),o[Yg]=!0,hu.get(e).push(o),Zg&&console.debug("register prewarm",o.name))}let zv=null,Nv=null;function fM(o){if(!o)return;const e=hu.get(o);if(!e?.length)return;const t=o.mainCamera;if(t){Zg&&console.log("prewarm",e.length,"objects",[...e]);const i=o.renderer;if(i.compile){const n=o.scene;i.compile(n,t),zv??=new tC(64),Nv??=new iC(.001,9999999,zv),Nv.update(i,n);for(const s of e)s[Uv]=!0,s[Yg]=!1;e.length=0,Zg&&console.log("prewarm done")}}}pe.registerCallback(ue.ContextCreated,o=>{const e=o.context;qv(e),$v(e)});const du=w("debugcomponents"),Wv="eff8ba80-635d-11ec-90d6-0242ac120003";class jt{get seed(){return this._seed}set seed(e){this._seed=e}_originalSeed;_seed;constructor(e){typeof e=="string"&&(e=jt.hash(e)),this._originalSeed=e,this._seed=e}reset(){this._seed=this._originalSeed}generateUUID(e){if(typeof e=="string")return Wb(e,Wv);const t=this._seed;return this._seed-=1,Wb(t.toString(),Wv)}initialize(e){typeof e=="string"?this._seed=jt.hash(e):this._seed=e}static createFromString(e){return new jt(this.hash(e))}static hash(e){let t=0;for(let i=0;i<e.length;i++)t=e.charCodeAt(i)+((t<<5)-t);return t}}var Vv=(o=>(o.NewInstanceCreated="new-instance-created",o.InstanceDestroyed="instance-destroyed",o))(Vv||{});class yM{guid;dontSave;constructor(e){this.guid=e}}function Dc(o,e,t=!0,i){if(!o)return;const n=o;if(Ii(o,t),!e){console.warn("Can not send destroy: No networking connection provided",o.guid);return}if(!e.isConnected){A()&&console.debug("Can not send destroy: not connected",o.guid);return}let s=o.guid;if(!s&&n.uuid&&(s=n.uuid),!s){console.warn("Can not send destroy: failed to find guid",o);return}Kg(s,e,i)}function Kg(o,e,t){const i=new yM(o);t?.saveInRoom===!1&&(i.dontSave=!0),e.send("instance-destroyed",i,Pn.Queued)}function $v(o){o.connection.beginListen("instance-destroyed",e=>{du&&console.log("[Remote] Destroyed",o.scene,e);const t=df(e.guid,o.scene);t&&Ii(t)})}class bM{filename;hash;size;constructor(e,t,i){this.filename=e,this.hash=t,this.size=i}}class Hv{guid;originalGuid;seed;visible;hostData;dontSave;parent;position;rotation;scale;preventCreation=void 0;deleteStateOnDisconnect;constructor(e,t){this.originalGuid=e,this.guid=t}}function Jg(o,e,t,i){const n=o;if(!n.guid)return console.warn("Can not instantiate: No guid",n),null;if(e.context||(e.context=z.Current),!e.context)return console.error("Missing network instantiate options / reference to network connection in sync instantiate"),null;const s=e?{...e}:null,{instance:r,seed:a}=_M(n,e);if(r){const l=r;if(l.guid){du&&console.log("[Local] new instance","gameobject:",r?.guid);const c=new Hv(n.guid,l.guid);c.seed=a,e.deleteOnDisconnect===!0&&(c.deleteStateOnDisconnect=!0),s&&(s.position&&(Array.isArray(s.position)?c.position={x:s.position[0],y:s.position[1],z:s.position[2]}:c.position={x:s.position.x,y:s.position.y,z:s.position.z}),s.rotation&&(s.rotation instanceof at?s.rotation=new N().setFromEuler(s.rotation):s.rotation instanceof Array&&(s.rotation=new N().fromArray(s.rotation)),c.rotation={x:s.rotation.x,y:s.rotation.y,z:s.rotation.z,w:s.rotation.w}),s.scale&&(Array.isArray(s.scale)?c.scale={x:s.scale[0],y:s.scale[1],z:s.scale[2]}:c.scale={x:s.scale.x,y:s.scale.y,z:s.scale.z})),c.position||(c.position={x:l.position.x,y:l.position.y,z:l.position.z}),c.rotation||(c.rotation={x:l.quaternion.x,y:l.quaternion.y,z:l.quaternion.z,w:l.quaternion.w}),c.scale||(c.scale={x:l.scale.x,y:l.scale.y,z:l.scale.z}),c.visible=n.visible,s?.parent&&(typeof s.parent=="string"?c.parent=s.parent:c.parent=s.parent.guid),c.hostData=t,i===!1&&(c.dontSave=!0),!e?.context?.connection&&A()&&console.debug("Object will be instantiated but it will not be synced: not connected",n.guid),e.context.connection.isInRoom&&Ka.push(new WeakRef(l)),e?.context?.connection.send("new-instance-created",c)}else console.warn("Missing guid, can not send new instance event",l)}return r}function Gv(){return Math.random()*9999999}const Ka=new Array;function qv(o){o.connection.beginListen("new-instance-created",async e=>{const t=await vM(e.originalGuid,o.scene);if(e.preventCreation===!0)return;if(!t){console.warn("could not find object that was instantiated: "+e.guid);return}const i=new Wn;e.position&&(i.position=new b(e.position.x,e.position.y,e.position.z)),e.rotation&&(i.rotation=new N(e.rotation.x,e.rotation.y,e.rotation.z,e.rotation.w)),e.scale&&(i.scale=new b(e.scale.x,e.scale.y,e.scale.z)),i.parent=e.parent,e.seed&&(i.idProvider=new jt(e.seed)),i.visible=e.visible,i.context=o,du&&o.alias&&console.log("[Remote] instantiate in: "+o.alias);const n=Ur(t,i);Ka.push(new WeakRef(n)),n&&(e.parent==="scene"&&o.scene.add(n),du&&console.log("[Remote] new instance","gameobject:",n?.guid,t))}),o.connection.beginListen("left-room",()=>{Ka.length>0&&console.debug(`Left networking room, cleaning up ${Ka.length} instantiated objects`);for(const e of Ka){const t=e.deref();t&&t.destroy()}Ka.length=0})}function _M(o,e){const t=Gv(),i=e??new Wn;i.idProvider=new jt(t);const n=Ur(o,i);return{seed:t,instance:n}}const Xv={};function Qv(o,e){Xv[o]=e}async function vM(o,e){const t=Xv[o];if(t!=null){const i=await t(o);if(i)return i}return Yv(o,e)}function Yv(o,e){if(e===null||!o)return null;if(e.guid===o)return e;if(e.children)for(const t of e.children){const i=Yv(o,t);if(i)return i}return null}const jc=w("gizmos"),bt=w("debugextension"),ef=w("debugtypes");class wM{_types=new Map;_reverseTypes=new Map;constructor(){ef&&console.warn("TypeStore: Created",this)}add(e,t){ef&&console.warn("ADD TYPE",e);const i=this._types.get(e);i?ef&&i!==t&&console.warn("Type name exists multiple times in your project and may lead to runtime errors:",e):(this._types.set(e,t),this._reverseTypes.set(t,e))}get(e){return this._types.get(e)||null}getKey(e){return this._reverseTypes.get(e)||null}}const xM=Symbol("BuiltInType"),C=new wM,tf=function(o){C.get(o.name)||C.add(o.name,o)},nf=w("debugresolvedependencies"),SM=["/extensions/","extensions/"],CM=[{prefix:"/nodes/",dependencyName:"node"},{prefix:"/meshes/",dependencyName:"mesh"},{prefix:"/materials/",dependencyName:"material"},{prefix:"/textures/",dependencyName:"texture"},{prefix:"/animations/",dependencyName:"animation"},{prefix:"nodes/",dependencyName:"node"},{prefix:"meshes/",dependencyName:"mesh"},{prefix:"materials/",dependencyName:"material"},{prefix:"textures/",dependencyName:"texture"},{prefix:"animations/",dependencyName:"animation"}];async function of(o,e){nf&&console.log(o,e);const t=[];sf(CM,o,e,t);const i=await Promise.all(t);return typeof e=="string"&&i.length===1?i[0]:i}function Zv(o,e){return!o||!e?!1:o["needle:identifier"]!=null&&e["needle:identifier"]!=null?o["needle:identifier"]===e["needle:identifier"]:!1}function PM(o,e){o["needle:identifier"]=e}function sf(o,e,t,i){if(typeof t=="object"&&t!==void 0&&t!==null)for(const n of Object.keys(t)){const s=t[n];if(typeof s=="string"){const r=Kv(e,s);if(r!=null)typeof r.then=="function"?i.push(r.then(a=>t[n]=a)):t[n]=r;else{const a=Jv(o,e,s);if(a){i.push(a.then(l=>(t[n]=l,l)));continue}}}else if(Array.isArray(s))for(let r=0;r<s.length;r++){const a=s[r],l=Kv(e,a);if(l!=null){typeof l.then=="function"?i.push(l.then(c=>s[r]=c)):s[r]=l;continue}for(const c of o){const h=ew(c.prefix,a);if(h>=0){nf&&console.log(c,h,c.dependencyName),i.push(e.getDependency(c.dependencyName,h).then(d=>s[r]=d));break}}typeof a=="object"&&sf(o,e,a,i)}else typeof s=="object"&&sf(o,e,s,i)}else if(typeof t=="string"){const n=Jv(o,e,t);n&&i.push(n)}}function Kv(o,e){if(o&&o.plugins&&typeof e=="string"){for(const t of SM)if(e.startsWith(t)){let i=e.substring(t.length);const n=i.indexOf("/");n>=0&&(i=i.substring(0,n));const s=o.plugins[i];if(bt&&console.log(i,s),typeof s?.resolve=="function"){const r=e.substring(t.length+i.length+1);return s.resolve(o,r)}break}}return null}function Jv(o,e,t){for(const i of o){const n=ew(i.prefix,t);if(n>=0)return nf&&console.warn("GET DEPENDENCY",i,n,i.dependencyName),e.getDependency(i.dependencyName,n)}return null}function ew(o,e){if(typeof e=="string"&&e.startsWith(o)){const t=e.substring(o.length),i=Number.parseInt(t);if(i>=0)return i}return-1}const rf="NEEDLE_persistent_assets";function OM(o){return o?.___persistentAsset===!0}class kM{get name(){return rf}parser;constructor(e){this.parser=e}async afterRoot(e){if(!this.parser?.json?.extensions)return;const t=this.parser.json.extensions[rf];if(!t)return;bt&&console.log(t);const i=new Array;for(const n of t?.assets){const s=of(this.parser,n);s&&i.push(s)}await Promise.all(i)}resolve(e,t){const i=Number.parseInt(t);if(i>=0){bt&&console.log(t);const n=e.json.extensions[rf];if(n){const s=n?.assets[i];if(s&&typeof s=="object"){s.___persistentAsset=!0;const r=s.__type;r&&C.get(r)}return s}}return null}}const Qn=w("debugserializer");class MM{register(e,t){if(this.typeMap.has(e)){const i=this.typeMap.get(e);if(i===t)return;Qn&&console.warn("Type: "+e+" is already registered",t,i)}Qn&&console.log("Register type serializer",t.name,t,e),this.typeMap.set(e,t)}typeMap=new Map;getSerializer(e){if(e)return this.typeMap.get(e)}getSerializerForConstructor(e,t=0){if(t>20)return;if(!e||!e.constructor){Qn&&console.log("invalid type");return}const i=e.name,n=this.getSerializer(e);if(n!==void 0)return Qn&&console.log("FOUND SERIALIZER",n?.name,e.name,e.constructor.name,"for type: "+i,n,e,this.typeMap),n;const s=Object.getPrototypeOf(e);if(s&&s!==e){const r=this.getSerializerForConstructor(s,++t);if(r){const a=s.constructor||s.prototype;Qn&&console.log("FOUND SERIALIZER(in constructor) "+a.constructor.name,a.name,a,r),this.register(a,r)}return r}Qn&&console.warn("No serializer found for "+i,e,e.name,e.constructor.name)}}const uu=new MM;class Zi{name;constructor(e,t){if(this.name=t,Array.isArray(e))for(const i of e)uu.register(i,this);else uu.register(e,this)}}class EM{isDevMode=Mi();cache={};registerDefinedKeys(e,t){if(this.isDevMode&&this.cache[e]===void 0){this.cache[e]=Object.keys(t);const i=t;i.$serializedTypes&&Object.keys(i.$serializedTypes)&&this.cache[e].push(...Object.keys(i.$serializedTypes)),Qn&&console.log("registerDefinedKeys for "+e,this.cache[e],t)}}getDefinedKey(e,t){return this.cache[e]===void 0?!1:this.cache[e].includes(t)}}class af{root;gltf;gltfId;object;target;nodeId;nodeToObject;objectToNode;context;path;type;serializable;implementationInformation;constructor(e){this.root=e}}function tw(o,e){const t=o.$serializedTypes;if(t===void 0)return null;const i={};for(const s in t){const r=o[s];if(r!=null&&typeof r=="object"){const a=uu.getSerializerForConstructor(r);if(a){i[s]=a.onSerialize(r,e);continue}}i[s]=r}function n(s){const r=C._types;for(const[a,l]of r)if(l===o.constructor)return a;return s.__name||s.constructor.name}return i.name=n(o),typeof o.guid=="string"&&(i.guid=o.guid),i}const pu=[];function iw(o,e){if(!o)return e;typeof o.$serializedTypes=="object"&&(e||(e={}),Object.assign(e,o.$serializedTypes));const t=Object.getPrototypeOf(o);return iw(t,e)}function mu(o,e,t){if(!o)return!1;if(t.target=o,o.onBeforeDeserialize!==void 0){const n=o.onBeforeDeserialize(e,t);if(typeof n=="boolean")return n}const i=iw(o);if(e){if(typeof e.guid=="string"&&(o.guid=e.guid),i)for(const n in i){let s=function(l){const c=l.type;return c?lf(a,c,t,void 0,o[n]):lf(a,l,t,void 0,o[n])};const r=i[n],a=e[n];if(Qn&&console.log(n,a,o,r),!(o[n]!==void 0&&a===void 0)&&(t.type=void 0,t.path=n,t.serializable=r,!(o.onBeforeDeserializeMember!==void 0&&o.onBeforeDeserializeMember(n,a,t)===!0))){if(r===null)o[n]=a;else{if(Array.isArray(r))for(let l=0;l<r.length;l++){const c=r[l],h=s(c);if(h!==void 0||l===r.length-1){o[n]=h;break}}else o[n]=s(r);pu.length=0}o.onAfterDeserializeMember!==void 0&&o.onAfterDeserializeMember(n,a,t)}}AM(o,e)}return TM(o,e,t.implementationInformation),o.onAfterDeserialize!==void 0&&o.onAfterDeserialize(e,t),!0}const RM=w("noerrors");function TM(o,e,t){if(RM||!e||!Mi()||!o||o.constructor&&o.constructor[xM]===!0)return;const i=o.constructor?.name,n=Object.getOwnPropertyNames(e);for(const s of n){if(s==="sourceId")continue;const r=o[s];if(r==null)continue;const a=e[s];if(t?.getDefinedKey(i,s)===!1){const l=s.charAt(0).toUpperCase()+s.slice(1);t.getDefinedKey(i,l)&&(xr(Ri.Warn,'<strong>Please rename</strong> "'+l+'" to "'+s+'" in '+i),console.warn('Please use lowercase for field: "'+l+'" in '+i,a,o));continue}if(a!=null){if(typeof a=="object"&&(r===void 0||!r.isObject3D)){if(typeof a.node=="number"||typeof a.guid=="string"){if(a.could_not_resolve)continue;if(!(r!==void 0&&Object.keys(r).length>1)){xr(Ri.Warn,`<strong>Missing serialization for object reference!</strong>
|
|
181
|
+
Do you have circular references in your project? <a target="_blank" href="https://docs.needle.tools/circular-reference"> Click here for more information.`,o):console.error('Failed to update active state in hierarchy of "'+o.name+'"',o),console.warn(" \u2191 this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."))}function Qg(o,e,t,i=0){if(i>1e3)return console.warn("Hierarchy is too deep (> 1000 level) - will abort updating active state"),!1;const n=il(o);if(e&&(e=n,e&&o.parent&&i===0)){const a=o.parent;e=a[qn],e===void 0&&(a instanceof Hi||(e=!0))}const s=o[qn]!==e;if(s){o[qn]=e,uM&&console.warn("ACTIVE CHANGE",{name:o.name,activeSelf:n,visible:o.visible,activeInHierarchy:e,changed:s,go:o});{const a=o.userData?.components;if(a)for(let l=a.length-1,c=-1;l>c;l--){const h=a[l];if(e){if(h?.enabled){try{h.__internalAwake()}catch(d){console.error(d)}h.enabled&&h.__internalEnable()}}else h&&h.__didAwake&&h.enabled&&(h.__didEnable=!1,h.onDisable())}}}const r=o.children;if(r){if(!s&&!e){let l=!0;for(let c=0,h=r.length;c<h;c++){const d=r[c];d[qn]!==!1&&Qg(d,!1,t,i+1)===!1&&(l=!1)}return l}let a=!0;for(let l=0,c=r.length;l<c;l++)Qg(r[l],e,t,i+1)===!1&&(a=!1);return a}return!0}function Lc(o){if(!o){console.error("GO is null");return}let e=!0,t=!1,i=o;for(;i;){if(i.type==="Scene"&&(t=!0),!il(i)){e=!1;break}i=i.parent}o[qn]=e&&t}const hu=new Map,Uv=Symbol("prewarmFlag"),Yg=Symbol("waitingForPrewarm"),Zg=w("debugprewarm");function gM(o,e){!o||o[Uv]===!0||o[Yg]===!0||(hu.has(e)||hu.set(e,[]),o[Yg]=!0,hu.get(e).push(o),Zg&&console.debug("register prewarm",o.name))}let zv=null,Nv=null;function fM(o){if(!o)return;const e=hu.get(o);if(!e?.length)return;const t=o.mainCamera;if(t){Zg&&console.log("prewarm",e.length,"objects",[...e]);const i=o.renderer;if(i.compile){const n=o.scene;i.compile(n,t),zv??=new tC(64),Nv??=new iC(.001,9999999,zv),Nv.update(i,n);for(const s of e)s[Uv]=!0,s[Yg]=!1;e.length=0,Zg&&console.log("prewarm done")}}}pe.registerCallback(ue.ContextCreated,o=>{const e=o.context;qv(e),$v(e)});const du=w("debugcomponents"),Wv="eff8ba80-635d-11ec-90d6-0242ac120003";class jt{get seed(){return this._seed}set seed(e){this._seed=e}_originalSeed;_seed;constructor(e){typeof e=="string"&&(e=jt.hash(e)),this._originalSeed=e,this._seed=e}reset(){this._seed=this._originalSeed}generateUUID(e){if(typeof e=="string")return Wb(e,Wv);const t=this._seed;return this._seed-=1,Wb(t.toString(),Wv)}initialize(e){typeof e=="string"?this._seed=jt.hash(e):this._seed=e}static createFromString(e){return new jt(this.hash(e))}static hash(e){let t=0;for(let i=0;i<e.length;i++)t=e.charCodeAt(i)+((t<<5)-t);return t}}var Vv=(o=>(o.NewInstanceCreated="new-instance-created",o.InstanceDestroyed="instance-destroyed",o))(Vv||{});class yM{guid;dontSave;constructor(e){this.guid=e}}function Dc(o,e,t=!0,i){if(!o)return;const n=o;if(Ii(o,t),!e){console.warn("Can not send destroy: No networking connection provided",o.guid);return}if(!e.isConnected){A()&&console.debug("Can not send destroy: not connected",o.guid);return}let s=o.guid;if(!s&&n.uuid&&(s=n.uuid),!s){console.warn("Can not send destroy: failed to find guid",o);return}Kg(s,e,i)}function Kg(o,e,t){const i=new yM(o);t?.saveInRoom===!1&&(i.dontSave=!0),e.send("instance-destroyed",i,Pn.Queued)}function $v(o){o.connection.beginListen("instance-destroyed",e=>{du&&console.log("[Remote] Destroyed",o.scene,e);const t=df(e.guid,o.scene);t&&Ii(t)})}class bM{filename;hash;size;constructor(e,t,i){this.filename=e,this.hash=t,this.size=i}}class Hv{guid;originalGuid;seed;visible;hostData;dontSave;parent;position;rotation;scale;preventCreation=void 0;deleteStateOnDisconnect;constructor(e,t){this.originalGuid=e,this.guid=t}}function Jg(o,e,t,i){const n=o;if(!n.guid)return console.warn("Can not instantiate: No guid",n),null;if(e.context||(e.context=z.Current),!e.context)return console.error("Missing network instantiate options / reference to network connection in sync instantiate"),null;const s=e?{...e}:null,{instance:r,seed:a}=_M(n,e);if(r){const l=r;if(l.guid){du&&console.log("[Local] new instance","gameobject:",r?.guid);const c=new Hv(n.guid,l.guid);c.seed=a,e.deleteOnDisconnect===!0&&(c.deleteStateOnDisconnect=!0),s&&(s.position&&(Array.isArray(s.position)?c.position={x:s.position[0],y:s.position[1],z:s.position[2]}:c.position={x:s.position.x,y:s.position.y,z:s.position.z}),s.rotation&&(s.rotation instanceof at?s.rotation=new N().setFromEuler(s.rotation):s.rotation instanceof Array&&(s.rotation=new N().fromArray(s.rotation)),c.rotation={x:s.rotation.x,y:s.rotation.y,z:s.rotation.z,w:s.rotation.w}),s.scale&&(Array.isArray(s.scale)?c.scale={x:s.scale[0],y:s.scale[1],z:s.scale[2]}:c.scale={x:s.scale.x,y:s.scale.y,z:s.scale.z})),c.position||(c.position={x:l.position.x,y:l.position.y,z:l.position.z}),c.rotation||(c.rotation={x:l.quaternion.x,y:l.quaternion.y,z:l.quaternion.z,w:l.quaternion.w}),c.scale||(c.scale={x:l.scale.x,y:l.scale.y,z:l.scale.z}),c.visible=n.visible,s?.parent&&(typeof s.parent=="string"?c.parent=s.parent:c.parent=s.parent.guid),c.hostData=t,i===!1&&(c.dontSave=!0),!e?.context?.connection&&A()&&console.debug("Object will be instantiated but it will not be synced: not connected",n.guid),e.context.connection.isInRoom&&Ka.push(new WeakRef(l)),e?.context?.connection.send("new-instance-created",c)}else console.warn("Missing guid, can not send new instance event",l)}return r}function Gv(){return Math.random()*9999999}const Ka=new Array;function qv(o){o.connection.beginListen("new-instance-created",async e=>{const t=await vM(e.originalGuid,o.scene);if(e.preventCreation===!0)return;if(!t){console.warn("could not find object that was instantiated: "+e.guid);return}const i=new Wn;e.position&&(i.position=new b(e.position.x,e.position.y,e.position.z)),e.rotation&&(i.rotation=new N(e.rotation.x,e.rotation.y,e.rotation.z,e.rotation.w)),e.scale&&(i.scale=new b(e.scale.x,e.scale.y,e.scale.z)),i.parent=e.parent,e.seed&&(i.idProvider=new jt(e.seed)),i.visible=e.visible,i.context=o,du&&o.alias&&console.log("[Remote] instantiate in: "+o.alias);const n=Ur(t,i);Ka.push(new WeakRef(n)),n&&(e.parent==="scene"&&o.scene.add(n),du&&console.log("[Remote] new instance","gameobject:",n?.guid,t))}),o.connection.beginListen("left-room",()=>{Ka.length>0&&console.debug(`Left networking room, cleaning up ${Ka.length} instantiated objects`);for(const e of Ka){const t=e.deref();t&&t.destroy()}Ka.length=0})}function _M(o,e){const t=Gv(),i=e??new Wn;i.idProvider=new jt(t);const n=Ur(o,i);return{seed:t,instance:n}}const Xv={};function Qv(o,e){Xv[o]=e}async function vM(o,e){const t=Xv[o];if(t!=null){const i=await t(o);if(i)return i}return Yv(o,e)}function Yv(o,e){if(e===null||!o)return null;if(e.guid===o)return e;if(e.children)for(const t of e.children){const i=Yv(o,t);if(i)return i}return null}const jc=w("gizmos"),bt=w("debugextension"),ef=w("debugtypes");class wM{_types=new Map;_reverseTypes=new Map;constructor(){ef&&console.warn("TypeStore: Created",this)}add(e,t){ef&&console.warn("ADD TYPE",e);const i=this._types.get(e);i?ef&&i!==t&&console.warn("Type name exists multiple times in your project and may lead to runtime errors:",e):(this._types.set(e,t),this._reverseTypes.set(t,e))}get(e){return this._types.get(e)||null}getKey(e){return this._reverseTypes.get(e)||null}}const xM=Symbol("BuiltInType"),C=new wM,tf=function(o){C.get(o.name)||C.add(o.name,o)},nf=w("debugresolvedependencies"),SM=["/extensions/","extensions/"],CM=[{prefix:"/nodes/",dependencyName:"node"},{prefix:"/meshes/",dependencyName:"mesh"},{prefix:"/materials/",dependencyName:"material"},{prefix:"/textures/",dependencyName:"texture"},{prefix:"/animations/",dependencyName:"animation"},{prefix:"nodes/",dependencyName:"node"},{prefix:"meshes/",dependencyName:"mesh"},{prefix:"materials/",dependencyName:"material"},{prefix:"textures/",dependencyName:"texture"},{prefix:"animations/",dependencyName:"animation"}];async function of(o,e){nf&&console.log(o,e);const t=[];sf(CM,o,e,t);const i=await Promise.all(t);return typeof e=="string"&&i.length===1?i[0]:i}function Zv(o,e){return!o||!e?!1:o["needle:identifier"]!=null&&e["needle:identifier"]!=null?o["needle:identifier"]===e["needle:identifier"]:!1}function PM(o,e){o["needle:identifier"]=e}function sf(o,e,t,i){if(typeof t=="object"&&t!==void 0&&t!==null)for(const n of Object.keys(t)){const s=t[n];if(typeof s=="string"){const r=Kv(e,s);if(r!=null)typeof r.then=="function"?i.push(r.then(a=>t[n]=a)):t[n]=r;else{const a=Jv(o,e,s);if(a){i.push(a.then(l=>(t[n]=l,l)));continue}}}else if(Array.isArray(s))for(let r=0;r<s.length;r++){const a=s[r],l=Kv(e,a);if(l!=null){typeof l.then=="function"?i.push(l.then(c=>s[r]=c)):s[r]=l;continue}for(const c of o){const h=ew(c.prefix,a);if(h>=0){nf&&console.log(c,h,c.dependencyName),i.push(e.getDependency(c.dependencyName,h).then(d=>s[r]=d));break}}typeof a=="object"&&sf(o,e,a,i)}else typeof s=="object"&&sf(o,e,s,i)}else if(typeof t=="string"){const n=Jv(o,e,t);n&&i.push(n)}}function Kv(o,e){if(o&&o.plugins&&typeof e=="string"){for(const t of SM)if(e.startsWith(t)){let i=e.substring(t.length);const n=i.indexOf("/");n>=0&&(i=i.substring(0,n));const s=o.plugins[i];if(bt&&console.log(i,s),typeof s?.resolve=="function"){const r=e.substring(t.length+i.length+1);return s.resolve(o,r)}break}}return null}function Jv(o,e,t){for(const i of o){const n=ew(i.prefix,t);if(n>=0)return nf&&console.warn("GET DEPENDENCY",i,n,i.dependencyName),e.getDependency(i.dependencyName,n)}return null}function ew(o,e){if(typeof e=="string"&&e.startsWith(o)){const t=e.substring(o.length),i=Number.parseInt(t);if(i>=0)return i}return-1}const rf="NEEDLE_persistent_assets";function OM(o){return o?.___persistentAsset===!0}class kM{get name(){return rf}parser;constructor(e){this.parser=e}async afterRoot(e){if(!this.parser?.json?.extensions)return;const t=this.parser.json.extensions[rf];if(!t)return;bt&&console.log(t);const i=new Array;for(const n of t?.assets){const s=of(this.parser,n);s&&i.push(s)}await Promise.all(i)}resolve(e,t){const i=Number.parseInt(t);if(i>=0){bt&&console.log(t);const n=e.json.extensions[rf];if(n){const s=n?.assets[i];if(s&&typeof s=="object"){s.___persistentAsset=!0;const r=s.__type;r&&C.get(r)}return s}}return null}}const Qn=w("debugserializer");class MM{register(e,t){if(this.typeMap.has(e)){const i=this.typeMap.get(e);if(i===t)return;Qn&&console.warn("Type: "+e+" is already registered",t,i)}Qn&&console.log("Register type serializer",t.name,t,e),this.typeMap.set(e,t)}typeMap=new Map;getSerializer(e){if(e)return this.typeMap.get(e)}getSerializerForConstructor(e,t=0){if(t>20)return;if(!e||!e.constructor){Qn&&console.log("invalid type");return}const i=e.name,n=this.getSerializer(e);if(n!==void 0)return Qn&&console.log("FOUND SERIALIZER",n?.name,e.name,e.constructor.name,"for type: "+i,n,e,this.typeMap),n;const s=Object.getPrototypeOf(e);if(s&&s!==e){const r=this.getSerializerForConstructor(s,++t);if(r){const a=s.constructor||s.prototype;Qn&&console.log("FOUND SERIALIZER(in constructor) "+a.constructor.name,a.name,a,r),this.register(a,r)}return r}Qn&&console.warn("No serializer found for "+i,e,e.name,e.constructor.name)}}const uu=new MM;class Zi{name;constructor(e,t){if(this.name=t,Array.isArray(e))for(const i of e)uu.register(i,this);else uu.register(e,this)}}class EM{isDevMode=Mi();cache={};registerDefinedKeys(e,t){if(this.isDevMode&&this.cache[e]===void 0){this.cache[e]=Object.keys(t);const i=t;i.$serializedTypes&&Object.keys(i.$serializedTypes)&&this.cache[e].push(...Object.keys(i.$serializedTypes)),Qn&&console.log("registerDefinedKeys for "+e,this.cache[e],t)}}getDefinedKey(e,t){return this.cache[e]===void 0?!1:this.cache[e].includes(t)}}class af{root;gltf;gltfId;object;target;nodeId;nodeToObject;objectToNode;context;path;type;serializable;implementationInformation;constructor(e){this.root=e}}function tw(o,e){const t=o.$serializedTypes;if(t===void 0)return null;const i={};for(const s in t){const r=o[s];if(r!=null&&typeof r=="object"){const a=uu.getSerializerForConstructor(r);if(a){i[s]=a.onSerialize(r,e);continue}}i[s]=r}function n(s){const r=C._types;for(const[a,l]of r)if(l===o.constructor)return a;return s.__name||s.constructor.name}return i.name=n(o),typeof o.guid=="string"&&(i.guid=o.guid),i}const pu=[];function iw(o,e){if(!o)return e;typeof o.$serializedTypes=="object"&&(e||(e={}),Object.assign(e,o.$serializedTypes));const t=Object.getPrototypeOf(o);return iw(t,e)}function mu(o,e,t){if(!o)return!1;if(t.target=o,o.onBeforeDeserialize!==void 0){const n=o.onBeforeDeserialize(e,t);if(typeof n=="boolean")return n}const i=iw(o);if(e){if(typeof e.guid=="string"&&(o.guid=e.guid),i)for(const n in i){let s=function(l){const c=l.type;return c?lf(a,c,t,void 0,o[n]):lf(a,l,t,void 0,o[n])};const r=i[n],a=e[n];if(Qn&&console.log(n,a,o,r),!(o[n]!==void 0&&a===void 0)&&(t.type=void 0,t.path=n,t.serializable=r,!(o.onBeforeDeserializeMember!==void 0&&o.onBeforeDeserializeMember(n,a,t)===!0))){if(r===null)o[n]=a;else{if(Array.isArray(r))for(let l=0;l<r.length;l++){const c=r[l],h=s(c);if(h!==void 0||l===r.length-1){o[n]=h;break}}else o[n]=s(r);pu.length=0}o.onAfterDeserializeMember!==void 0&&o.onAfterDeserializeMember(n,a,t)}}AM(o,e)}return TM(o,e,t.implementationInformation),o.onAfterDeserialize!==void 0&&o.onAfterDeserialize(e,t),!0}const RM=w("noerrors");function TM(o,e,t){if(RM||!e||!Mi()||!o||o.constructor&&o.constructor[xM]===!0)return;const i=o.constructor?.name,n=Object.getOwnPropertyNames(e);for(const s of n){if(s==="sourceId")continue;const r=o[s];if(r==null)continue;const a=e[s];if(t?.getDefinedKey(i,s)===!1){const l=s.charAt(0).toUpperCase()+s.slice(1);t.getDefinedKey(i,l)&&(xr(Ri.Warn,'<strong>Please rename</strong> "'+l+'" to "'+s+'" in '+i),console.warn('Please use lowercase for field: "'+l+'" in '+i,a,o));continue}if(a!=null){if(typeof a=="object"&&(r===void 0||!r.isObject3D)){if(typeof a.node=="number"||typeof a.guid=="string"){if(a.could_not_resolve)continue;if(!(r!==void 0&&Object.keys(r).length>1)){xr(Ri.Warn,`<strong>Missing serialization for object reference!</strong>
|
|
182
182
|
|
|
183
183
|
Please change to:
|
|
184
184
|
@serializable(Object3D)
|