@needle-tools/engine 4.11.2 → 4.11.3
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/CHANGELOG.md +3 -0
- package/dist/{needle-engine.bundle-DxIfYnRl.js → needle-engine.bundle-B_aGaFmh.js} +7 -7
- package/dist/{needle-engine.bundle-BaUshOzH.min.js → needle-engine.bundle-TscA1IdQ.min.js} +2 -2
- package/dist/{needle-engine.bundle-Ci2JE5sk.umd.cjs → needle-engine.bundle-YQ3I1QD8.umd.cjs} +3 -3
- 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-components/SeeThrough.js +5 -1
- package/lib/engine-components/SeeThrough.js.map +1 -1
- package/lib/engine-components/export/usdz/ThreeUSDZExporter.js.map +1 -1
- package/package.json +1 -1
- package/src/engine-components/SeeThrough.ts +5 -1
- package/src/engine-components/export/usdz/ThreeUSDZExporter.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,9 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [4.11.3] - 2025-10-21
|
|
8
|
+
- Fix: See-Through with MeshPhysicalMaterial
|
|
9
|
+
|
|
7
10
|
## [4.11.2] - 2025-10-20
|
|
8
11
|
- Change: Animation component disable `randomStartTime`
|
|
9
12
|
- Change: Vite build build pipeline plugin increased default max wait time to 60 seconds.
|
|
@@ -1775,11 +1775,11 @@ vo('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"]
|
|
|
1775
1775
|
vo('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');
|
|
1776
1776
|
vo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');
|
|
1777
1777
|
vo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
|
|
1778
|
-
vo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.11.
|
|
1778
|
+
vo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.11.3";');
|
|
1779
1779
|
vo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
|
|
1780
|
-
vo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "
|
|
1780
|
+
vo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Tue Oct 21 2025 13:19:13 GMT+0000 (Coordinated Universal Time)";');
|
|
1781
1781
|
vo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
|
|
1782
|
-
const Bn = "4.11.
|
|
1782
|
+
const Bn = "4.11.3", Qm = "undefined", M0 = "Tue Oct 21 2025 13:19:13 GMT+0000 (Coordinated Universal Time)";
|
|
1783
1783
|
k0 && console.log(`Engine version: ${Bn} (generator: ${Qm})
|
|
1784
1784
|
Project built at ${M0}`);
|
|
1785
1785
|
const zl = NEEDLE_PUBLIC_KEY, po = "needle_isActiveInHierarchy", Yr = "builtin_components", Yh = "needle_editor_guid";
|
|
@@ -35673,13 +35673,13 @@ class Ao extends M {
|
|
|
35673
35673
|
if (!o) continue;
|
|
35674
35674
|
let r = B.lerp(o.opacity, e, t <= 0 ? 1 : this.context.time.deltaTime / t);
|
|
35675
35675
|
r >= 0.99 ? r = 1 : r <= 0.01 && (r = 0);
|
|
35676
|
-
const a = o.transparent, l = o.alphaHash;
|
|
35676
|
+
const a = o.transparent, l = o.alphaHash, c = o.opacity;
|
|
35677
35677
|
if (o.alphaHash = this.useAlphaHash, o.userData && "seeThrough" in o.userData) {
|
|
35678
|
-
const
|
|
35679
|
-
o.opacity =
|
|
35678
|
+
const h = o.userData.seeThrough.initial;
|
|
35679
|
+
o.opacity = h.opacity * r, o.transparent = o.opacity >= 1 ? h.transparent : !this.useAlphaHash;
|
|
35680
35680
|
} else
|
|
35681
35681
|
o.transparent = o.opacity >= 1 ? !1 : !this.useAlphaHash;
|
|
35682
|
-
(a
|
|
35682
|
+
(a !== o.transparent || l !== o.alphaHash || o.opacity !== c) && (o.needsUpdate = !0);
|
|
35683
35683
|
}
|
|
35684
35684
|
});
|
|
35685
35685
|
}
|
|
@@ -141,7 +141,7 @@ void main(){
|
|
|
141
141
|
#__vconsole .vc-mask {
|
|
142
142
|
overflow: hidden;
|
|
143
143
|
}
|
|
144
|
-
`,br?.prepend(i),o===!0&&Ub()<=0&&d_(),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.":"")),rc=!1,Hi=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function LO(){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"),Hi?.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}function jO(){return document.querySelector("#__vconsole .vc-switch")||null}function DO(){return document.querySelector("#__vconsole")||null}const p_=v("debugdefines");gs('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),gs('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),gs('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),gs('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),gs('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.11.
|
|
144
|
+
`,br?.prepend(i),o===!0&&Ub()<=0&&d_(),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.":"")),rc=!1,Hi=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function LO(){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"),Hi?.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}function jO(){return document.querySelector("#__vconsole .vc-switch")||null}function DO(){return document.querySelector("#__vconsole")||null}const p_=v("debugdefines");gs('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),gs('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),gs('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),gs('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),gs('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.11.3";'),gs('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),gs('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Tue Oct 21 2025 13:19:13 GMT+0000 (Coordinated Universal Time)";'),gs('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const bn="4.11.3",Dd="undefined",og="Tue Oct 21 2025 13:19:13 GMT+0000 (Coordinated Universal Time)";p_&&console.log(`Engine version: ${bn} (generator: ${Dd})
|
|
145
145
|
Project built at ${og}`);const Ea=NEEDLE_PUBLIC_KEY,Po="needle_isActiveInHierarchy",_r="builtin_components",ac="needle_editor_guid";function gs(o){try{(0,eval)(o)}catch(e){p_&&console.error(e)}}let m_,g_=null;function _n(){return m_}function sg(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}g_!==o&&(g_=o,m_=new o)}const ki=Symbol("shadowDomOwner"),BO=v("debugpatch");function Bd(o,e,t,i){const n=BO===e;if(!t&&!i)return;const s=e+"___needle";UO(o,e,t,i);const r=Object.getOwnPropertyDescriptor(o,e),a=o[e];n&&console.log("Patch",o.constructor.name,e,r,a),r?(n&&console.log("Apply patch with existing descriptor",o.constructor.name,e,r),typeof r.value=="function"&&(o[e]=y_(r.value,o,e))):(n&&console.log("Create patch with new property",o.constructor.name,e,r),Object.defineProperty(o,e,{set:function(l){if(typeof l=="function")this[s]=y_(l,o,e);else{const c=this[s];b_(o,e,this,c,l),this[s]=l,__(o,e,this,c,l)}},get:function(){const l=this[s];return typeof l=="function"&&l[s]?l[s]:l}}))}function FO(o,e,t){const i=ag(o,e);if(i)for(let n=i.length-1;n>=0;n--){const s=i[n];s.prefix===t&&(s.prefix=null),s.postfix===t&&(s.postfix=null),!s.prefix&&!s.postfix&&i.splice(n,1)}}const f_=Symbol("Needle:Patches:WrappedFunction");function y_(o,e,t){if(o[f_])return o;const i=function(...n){b_(e,t,this,...n);const s=o.apply(this,n);return __(e,t,this,s,...n),s};return i[f_]=!0,i}const Fd="Needle:Patches";function rg(){return globalThis[Fd]||(globalThis[Fd]=new WeakMap),globalThis[Fd]}function ag(o,e){const t=rg().get(o);return t?t.get(e):null}function UO(o,e,t,i){let n=rg().get(o);n||(n=new Map,rg().set(o,n));let s=n.get(e);s||(s=[],n.set(e,s)),s.push({prefix:t,postfix:i})}function b_(o,e,t,...i){if(!t)return;const n=ag(o,e);if(n)for(const s of n)s.prefix?.call(t,...i)}function __(o,e,t,i,...n){if(!t)return;const s=ag(o,e);if(s)for(const r of s)r.postfix?.call(t,i,...n)}const Aa=[];function Ud(o){Aa.indexOf(o)===-1&&Aa.push(o)}function zO(o){const e=Aa.indexOf(o);e!==-1&&Aa.splice(e,1)}const Ia=[];function lg(o){Ia.indexOf(o)===-1&&Ia.push(o)}function NO(o){const e=Ia.indexOf(o);e!==-1&&Ia.splice(e,1)}function v_(o){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-start",{detail:o}));for(let e=0;e<Aa.length;e++)Aa[e](o)}function w_(o){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-end",{detail:o}));for(let e=0;e<Ia.length;e++)Ia[e](o)}const st=v("debuginput");var zd=(o=>(o.Mouse="mouse",o.Touch="touch",o.Controller="controller",o.Hand="hand",o))(zd||{}),Ae=(o=>(o.PointerDown="pointerdown",o.PointerUp="pointerup",o.PointerMove="pointermove",o.KeyDown="keydown",o.KeyUp="keyup",o.KeyPressed="keypress",o))(Ae||{});class Oo extends PointerEvent{clientZ;deviceIndex;origin;source;mode;get isSpatial(){return this.mode!="screen"}get ray(){return this._ray||(this._ray=new yo(this.space.worldPosition.clone(),this.space.worldForward.clone())),this._ray}set ray(e){this._ray=e}get hasRay(){return this._ray!==void 0}_ray;space;isClick=!1;isDoubleClick=!1;get used(){return this._used}_used=!1;use(){this._used=!0}get pointerId(){return this._pointerid}_pointerid;get pointerType(){return this._pointerType}_pointerType;get type(){return this._type}_type;metadata={};intersections=new Array;constructor(e,t,i){super(e,i),this.clientZ=i.clientZ,this._pointerid=i.pointerId,this._pointerType=i.pointerType,this._type=e,this.deviceIndex=i.deviceIndex,this.origin=i.origin,this.source=t,this.mode=i.mode,this._ray=i.ray,this.space=i.device}_immediatePropagationStopped=!1;get immediatePropagationStopped(){return this._immediatePropagationStopped}_propagationStopped=!1;get propagationStopped(){return this._immediatePropagationStopped||this._propagationStopped}stopImmediatePropagation(){this._immediatePropagationStopped=!0,super.stopImmediatePropagation(),this.source?.stopImmediatePropagation()}stopPropagation(){this._propagationStopped=!0,super.stopPropagation(),this.source?.stopPropagation(),st&&console.warn("Stop propagation...",this.pointerId,this.pointerType)}}class lc extends KeyboardEvent{source;constructor(e,t,i){super(e,i),this.source=t}stopImmediatePropagation(){super.stopImmediatePropagation(),this.source?.stopImmediatePropagation()}}class VO{key;keyType;source;constructor(e){this.key=e.key,this.keyType=e.type,this.source=e}}var oi=(o=>(o[o.Early=-100]="Early",o[o.Default=0]="Default",o[o.Late=100]="Late",o))(oi||{});class x_{_eventListeners={};addEventListener(e,t,i){if(this._eventListeners[e]||(this._eventListeners[e]=[]),!t||typeof t!="function"){console.error("Invalid call to addEventListener: callback is required and must be a function!");return}i?i={...i}:i={};let n=0;i?.queue!=null&&(n=i.queue);const s=this._eventListeners[e],r=s.find(a=>a.priority===n);r?r.listeners.push({callback:t,options:i}):(s.push({priority:n,listeners:[{callback:t,options:i}]}),s.sort((a,l)=>a.priority-l.priority))}removeEventListener(e,t,i){if(!this._eventListeners[e]||!t)return;const n=this._eventListeners[e];if(i?.queue!=null){const s=n.find(a=>a.priority===i.queue);if(!s)return;const r=s.listeners.findIndex(a=>a.callback===t);r>=0&&s.listeners.splice(r,1)}else for(const s of n){const r=s.listeners.findIndex(a=>a.callback===t);r>=0&&s.listeners.splice(r,1)}}dispatchEvent(e){let t=!1;if(e instanceof lc){const i=this._eventListeners[e.type];if(i)for(const n of i)for(let s=0;s<n.listeners.length;s++){const r=n.listeners[s];if(r.options?.signal?.aborted){n.listeners.splice(s,1),s--;continue}r.options.once&&(n.listeners.splice(s,1),s--),r.callback(e)}}if(e instanceof Oo){const i=this._eventListeners[e.type];if(i)for(const n of i){if(t)break;for(let s=0;s<n.listeners.length;s++){const r=n.listeners[s];if(r.options?.signal?.aborted){n.listeners.splice(s,1),s--;continue}if(e.immediatePropagationStopped){t=!0,st&&console.log("immediatePropagationStopped",e.type);break}else e.propagationStopped&&(t=!0,st&&console.log("propagationStopped",e.type));r.options.once&&(n.listeners.splice(s,1),s--),r.callback(e)}}}}_doubleClickTimeThreshold=.2;_longPressTimeThreshold=1;get mousePosition(){return this._pointerPositions[0]}get mousePositionRC(){return this._pointerPositionsRC[0]}get mouseDown(){return this._pointerDown[0]}get mouseUp(){return this._pointerUp[0]}get mouseClick(){return this._pointerClick[0]}get mouseDoubleClick(){return this._pointerDoubleClick[0]}get mousePressed(){return this._pointerPressed[0]}get mouseWheelChanged(){return this.getMouseWheelChanged(0)}get click(){return this._pointerClick[0]}get doubleClick(){return this._pointerDoubleClick[0]}getGamepad(e=0){return typeof navigator<"u"&&"getGamepads"in navigator&&navigator.getGamepads()[e]||null}_setCursorTypes=[];setCursorPointer(){this.setCursor("pointer")}setCursorNormal(){this.unsetCursor("pointer")}setCursor(e){this._setCursorTypes.push(e),this._setCursorTypes.length>10&&this._setCursorTypes.shift(),this.updateCursor()}unsetCursor(e){for(let t=this._setCursorTypes.length-1;t>=0;t--)if(this._setCursorTypes[t]===e){this._setCursorTypes.splice(t,1),this.updateCursor();break}}updateCursor(){this._setCursorTypes?.length==0?this.context.domElement.style.cursor="default":this.context.domElement.style.cursor=this._setCursorTypes[this._setCursorTypes.length-1]}getIsPointerIdInUse(e){for(const t of this._pointerEventsPressed)if(t.pointerId===e&&t.used)return!0;return!1}getPointerPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&e++;return e}getPointerPosition(e){return e>=this._pointerPositions.length?null:this._pointerPositions[e]}getPointerPositionLastFrame(e){return e>=this._pointerPositionsLastFrame.length?null:this._pointerPositionsLastFrame[e]}getPointerPositionDelta(e){return e>=this._pointerPositionsDelta.length?null:this._pointerPositionsDelta[e]}getPointerPositionRC(e){return e>=this._pointerPositionsRC.length?null:this._pointerPositionsRC[e]}getPointerDown(e){return e>=this._pointerDown.length?!1:this._pointerDown[e]}getPointerUp(e){return e>=this._pointerUp.length?!1:this._pointerUp[e]}getPointerPressed(e){return e>=this._pointerPressed.length?!1:this._pointerPressed[e]}getPointerClicked(e){return e>=this._pointerClick.length?!1:this._pointerClick[e]}getPointerDoubleClicked(e){return e>=this._pointerDoubleClick.length?!1:this._pointerDoubleClick[e]}getPointerDownTime(e){return e>=this._pointerDownTime.length?-1:this._pointerDownTime[e]}getPointerUpTime(e){return e>=this._pointerUpTime.length?-1:this._pointerUpTime[e]}getPointerLongPress(e){return e>=this._pointerDownTime.length?!1:this.getPointerPressed(e)&&this.context.time.time-this._pointerDownTime[e]>this._longPressTimeThreshold}getIsMouse(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="mouse"}getIsTouch(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="touch"}getTouchesPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&this.getIsTouch(t)&&e++;return e}getMouseWheelChanged(e=0){return e>=this._mouseWheelChanged.length?!1:this._mouseWheelChanged[e]}getMouseWheelDeltaY(e=0){return e>=this._mouseWheelDeltaY.length?0:this._mouseWheelDeltaY[e]}getPointerEvent(e){if(!(e>=this._pointerEvent.length))return this._pointerEvent[e]??void 0}*foreachPointerId(e){for(let t=0;t<this._pointerTypes.length;t++)if(this._pointerIsActive(t)){if(e!==void 0){const i=this._pointerTypes[t];if(Array.isArray(e)){let n=!1;for(const s of e)if(i===s){n=!0;break}if(!n)continue}else if(e!==i)continue}yield t}}*foreachTouchId(){for(let e=0;e<this._pointerTypes.length;e++)this._pointerTypes[e]==="touch"&&this._pointerIsActive[e]&&(yield e)}_pointerIsActive(e){return e<0?!1:this._pointerPressed[e]||this._pointerDown[e]||this._pointerUp[e]}context;_pointerDown=[!1];_pointerUp=[!1];_pointerClick=[!1];_pointerDoubleClick=[!1];_pointerPressed=[!1];_pointerPositions=[new J];_pointerPositionsLastFrame=[new J];_pointerPositionsDelta=[new J];_pointerPositionsRC=[new J];_pointerPositionDown=[new b];_pointerDownTime=[];_pointerUpTime=[];_pointerUpTimestamp=[];_pointerIds=[];_pointerTypes=[""];_mouseWheelChanged=[!1];_mouseWheelDeltaY=[0];_pointerEvent=[];_pointerEventsPressed=[];_pointerSpace=[];_pressedStack=new Map;onDownButton(e,t){let i=this._pressedStack.get(e);i||(i=[],this._pressedStack.set(e,i)),i.push(t)}onReleaseButton(e,t){const i=this._pressedStack.get(e);if(!i)return;const n=i.indexOf(t);n>=0&&i.splice(n,1)}getFirstPressedButtonForPointer(e){const t=this._pressedStack.get(e);if(t)return t[0]}getLatestPressedButtonForPointer(e){const t=this._pressedStack.get(e);if(t)return t[t.length-1]}getKeyDown(e){if(e!==void 0)return this.isKeyDown(e);for(const t in this.keysPressed){const i=this.keysPressed[t];if(i.startFrame===this.context.time.frameCount)return i.key}return null}getKeyPressed(e){if(e!==void 0)return this.isKeyPressed(e);for(const t in this.keysPressed){const i=this.keysPressed[t];if(i.pressed)return i.key}return null}getKeyUp(e){if(e!==void 0)return this.isKeyUp(e);for(const t in this.keysPressed){const i=this.keysPressed[t];return i.pressed===!1&&i.frame===this.context.time.frameCount}return null}isKeyDown(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyDown(n))return!0;return!1}const i=this.keysPressed[e];return i?i.startFrame===this.context.time.frameCount&&i.pressed:!1}isKeyUp(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyUp(n))return!0;return!1}const i=this.keysPressed[e];return i?i.frame===this.context.time.frameCount&&i.pressed===!1:!1}isKeyPressed(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyPressed(n))return!0;return!1}const i=this.keysPressed[e];return i&&i.pressed||!1}getCodeForCommonKeyName(e){if(e.length===1){if(e>="0"&&e<="9")return["Digit"+e];if(e>="a"&&e<="z")return["Key"+e.toUpperCase()];if(e==" ")return["Space"]}switch(e){case"shift":case"Shift":return["ShiftLeft","ShiftRight"];case"control":case"Control":return["ControlLeft","ControlRight"];case"alt":case"Alt":return["AltLeft","AltRight"]}return null}createInputEvent(e){switch(e.type){case"pointerdown":st&&Ee("Create Pointer down"),this.onDownButton(e.deviceIndex,e.button),this.onDown(e);break;case"pointermove":st&&Ee("Create Pointer move"),this.onMove(e);break;case"pointerup":st&&Ee("Create Pointer up"),this.onUp(e),this.onReleaseButton(e.deviceIndex,e.button);break}}convertScreenspaceToRaycastSpace(e){return e.x=(e.x-this.context.domX)/this.context.domWidth*2-1,e.y=-((e.y-this.context.domY)/this.context.domHeight)*2+1,e}constructor(e){this.context=e,this.context.post_render_callbacks.push(this.onEndOfFrame)}_htmlEventSource;bindEvents(){this.unbindEvents(),this._htmlEventSource=this.context.renderer.domElement,window.addEventListener("contextmenu",this.onContextMenu),this._htmlEventSource.addEventListener("pointerdown",this.onPointerDown,{passive:!0}),window.addEventListener("pointermove",this.onPointerMove,{passive:!0,capture:!0}),window.addEventListener("pointerup",this.onPointerUp,{passive:!0}),window.addEventListener("pointercancel",this.onPointerCancel,{passive:!0}),window.addEventListener("touchstart",this.onTouchStart,{passive:!0}),window.addEventListener("touchmove",this.onTouchMove,{passive:!0}),window.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this._htmlEventSource.addEventListener("wheel",this.onMouseWheel,{passive:!0}),window.addEventListener("wheel",this.onWheelWindow,{passive:!0}),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keypress",this.onKeyPressed,!1),window.addEventListener("keyup",this.onKeyUp,!1),window.addEventListener("blur",this.onLostFocus)}unbindEvents(){for(const e in this._eventListeners)this._eventListeners[e].length=0;window.removeEventListener("contextmenu",this.onContextMenu),this._htmlEventSource?.removeEventListener("pointerdown",this.onPointerDown),window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerCancel),window.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd),this._htmlEventSource?.removeEventListener("wheel",this.onMouseWheel,!1),window.removeEventListener("wheel",this.onWheelWindow,!1),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keypress",this.onKeyPressed,!1),window.removeEventListener("keyup",this.onKeyUp,!1),window.removeEventListener("blur",this.onLostFocus)}dispose(){const e=this.context.post_render_callbacks.indexOf(this.onEndOfFrame);e>=0&&this.context.post_render_callbacks.splice(e,1),this.unbindEvents()}onLostFocus=()=>{for(const e in this.keysPressed)this.keysPressed[e].pressed=!1};_receivedPointerMoveEventsThisFrame=new Array;onEndOfFrame=()=>{this._receivedPointerMoveEventsThisFrame.length=0;for(let e=0;e<this._pointerUp.length;e++)this._pointerUp[e]=!1;for(let e=0;e<this._pointerDown.length;e++)this._pointerDown[e]=!1;for(let e=0;e<this._pointerClick.length;e++)this._pointerClick[e]=!1;for(let e=0;e<this._pointerDoubleClick.length;e++)this._pointerDoubleClick[e]=!1;for(const e of this._pointerPositionsDelta)e.set(0,0);for(let e=0;e<this._mouseWheelChanged.length;e++)this._mouseWheelChanged[e]=!1;for(let e=0;e<this._mouseWheelDeltaY.length;e++)this._mouseWheelDeltaY[e]=0};canReceiveInput(e){return e.target===this.context.renderer?.domElement||e.target===this.context.domElement||this.context.isInAR||this.context.isInAR&&e.target===document.body&&q.isMozillaXR()?!0:(st&&console.warn("CanReceiveInput:False for",e.target),!1)}onContextMenu=e=>{this.canReceiveInput(e)!==!1&&e instanceof PointerEvent&&e.pointerType};keysPressed={};onKeyDown=e=>{if(st&&console.log(`key down ${e.code}, ${this.context.application.hasFocus}`,e),!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(t&&t.pressed)return;this.keysPressed[e.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:e.key,code:e.code};const i=new lc("keydown",e,e);this.onDispatchEvent(i)};onKeyPressed=e=>{if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(!t)return;t.pressed=!0,t.frame=this.context.time.frameCount+1;const i=new lc("keypress",e,e);this.onDispatchEvent(i)};onKeyUp=e=>{if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(!t)return;t.pressed=!1,t.frame=this.context.time.frameCount+1;const i=new lc("keyup",e,e);this.onDispatchEvent(i)};onWheelWindow=e=>{document.pointerLockElement&&this.onMouseWheel(e)};onMouseWheel=e=>{if(this.canReceiveInput(e)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const t=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=t+e.deltaY};onPointerDown=e=>{if(this.context.isInAR||this.canReceiveInput(e)===!1)return;e.target instanceof HTMLElement&&e.target.setPointerCapture(e.pointerId);const t=this.getPointerId(e);st&&Ee(`pointer down #${t}, identifier:${e.pointerId}`);const i=this.getAndUpdateSpatialObjectForScreenPosition(t,e.clientX,e.clientY),n=new Oo("pointerdown",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:t,button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:i,pressure:e.pressure});this.onDown(n)};onPointerMove=e=>{if(this.context.isInAR||this._receivedPointerMoveEventsThisFrame.includes(e.pointerId))return;this._receivedPointerMoveEventsThisFrame.push(e.pointerId);let t=e.button;e.pointerType==="mouse"&&(t=this.getFirstPressedButtonForPointer(0)??0);const i=this.getPointerId(e,t);t===-1&&(t=i);const n=this.getAndUpdateSpatialObjectForScreenPosition(i,e.clientX,e.clientY),s=new Oo("pointermove",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:i,button:t,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:n,pressure:e.pressure});this.onMove(s)};onPointerCancel=e=>{this.context.isInAR||(st&&console.log("Pointer cancel",e),this.onPointerUp(e))};onPointerUp=e=>{if(this.context.isInAR)return;e.target instanceof HTMLElement&&e.target.releasePointerCapture(e.pointerId);const t=this.getPointerId(e),i=new Oo("pointerup",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:t,button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:this.getAndUpdateSpatialObjectForScreenPosition(t,e.clientX,e.clientY),pressure:e.pressure});this.onUp(i),this._pointerIds[t]=-1,st&&console.log("ID="+t,"PointerId="+e.pointerId,"ALL:",[...this._pointerIds])};getPointerId(e,t){return e.pointerType==="mouse"?0+(t??e.button):this.getPointerIndex(e.pointerId)}getButtonName(e){const t=e.button;if(e.pointerType==="mouse")switch(t){case 0:return"left";case 1:return"middle";case 2:return"right"}return"unknown"}onTouchStart=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),s=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),r=new Oo("pointerdown",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:s,pressure:i.force});this.onDown(r)}};onTouchMove=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),s=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),r=new Oo("pointermove",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:s,pressure:i.force});this.onMove(r)}};onTouchEnd=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),s=new Oo("pointerup",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),pressure:i.force});this.onUp(s),this._pointerIds[n]=-1}};tempNearPlaneVector=new b;tempFarPlaneVector=new b;tempLookMatrix=new Z;getAndUpdateSpatialObjectForScreenPosition(e,t,i){let n=this._pointerSpace[e];n||(n=new O,this._pointerSpace[e]=n),this._pointerSpace[e]=n;const s=this.context.mainCamera;if(s){const r=this.tempNearPlaneVector.set(t,i,-1);this.convertScreenspaceToRaycastSpace(r);const a=this.tempFarPlaneVector.set(r.x,r.y,1);r.unproject(s),a.unproject(s);const l=s.worldUp||D(0,1,0).applyQuaternion(be(s));this.tempLookMatrix.lookAt(a,r,l),n.position.set(r.x,r.y,r.z),n.quaternion.setFromRotationMatrix(this.tempLookMatrix)}return n}isInRect(e){if(this.context.isInXR)return!0;const t=this.context.domElement.getBoundingClientRect(),i=e.clientX,n=e.clientY,s=i>=t.x&&i<=t.right&&n>=t.y&&n<=t.bottom;return st&&!s&&console.log("Not in rect",t,i,n),s}onDown(e){const t=e.pointerId;if(this.getPointerPressed(t)&&console.warn(`Received pointerDown for pointerId that is already pressed: ${t}`,st?e:""),st&&console.log(e.pointerType,"DOWN",t),!!this.isInRect(e)){for(this.setPointerState(t,this._pointerPressed,!0),this.setPointerState(t,this._pointerDown,!0),this.setPointerStateT(t,this._pointerEvent,e.source);t>=this._pointerTypes.length;)this._pointerTypes.push(e.pointerType);for(this._pointerTypes[t]=e.pointerType;t>=this._pointerPositionDown.length;)this._pointerPositionDown.push(new b);for(this._pointerPositionDown[t].set(e.clientX,e.clientY,e.clientZ??0);t>=this._pointerPositions.length;)this._pointerPositions.push(new J);this._pointerPositions[t].set(e.clientX,e.clientY),t>=this._pointerDownTime.length&&this._pointerDownTime.push(0),this._pointerDownTime[t]=this.context.time.realtimeSinceStartup,this.updatePointerPosition(e),this._pointerEventsPressed.push(e),this.onDispatchEvent(e)}}onMove(e){const t=e.pointerId,i=this.getPointerPressed(t);i===!1&&!this.isInRect(e)||e.pointerType==="touch"&&!i||(this.updatePointerPosition(e),this.setPointerStateT(t,this._pointerEvent,e.source),this.onDispatchEvent(e))}onUp(e){const t=e.pointerId;if(!this.getPointerPressed(t)){st&&console.log(e.pointerType,"UP",t,"was not down");return}st&&console.log(e.pointerType,"UP",t),this.setPointerState(t,this._pointerPressed,!1),this.setPointerStateT(t,this._pointerEvent,e.source),this.setPointerState(t,this._pointerUp,!0),this.updatePointerPosition(e);for(let a=this._pointerEventsPressed.length-1;a>=0;a--)if(this._pointerEventsPressed[a].pointerId===t){this._pointerEventsPressed.splice(a,1);break}if(!this._pointerPositionDown[t]){st&&fe("Received pointer up event without matching down event for button: "+t),console.warn("Received pointer up event without matching down event for button: "+t);return}const i=this._pointerUpTime[t],n=this._pointerDownTime[t],s=this.context.time.realtimeSinceStartup,r=s-n;if(t>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),this._pointerUpTime[t]=s,r<1){let a=e.clientX-this._pointerPositionDown[t].x,l=e.clientY-this._pointerPositionDown[t].y,c=0;if(e.isSpatial&&e.clientZ!=null&&(c=e.clientZ-this._pointerPositionDown[t].z,a*=200,l*=200,c*=200),Math.abs(a)<5&&Math.abs(l)<5&&Math.abs(c)<5){this.setPointerState(t,this._pointerClick,!0),e.isClick=!0;const h=s-i;st&&console.log("CLICK",t,a,l,c,h),h<this._doubleClickTimeThreshold&&h>0&&(this.setPointerState(t,this._pointerDoubleClick,!0),e.isDoubleClick=!0)}}this.onDispatchEvent(e)}updatePointerPosition(e){const t=e.pointerId;for(;t>=this._pointerPositions.length;)this._pointerPositions.push(new J);for(;t>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new J);for(;t>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new J);const i=this._pointerPositionsLastFrame[t];i.copy(this._pointerPositions[t]);const n=this._pointerPositionsDelta[t];let s=e.clientX-i.x,r=e.clientY-i.y;if(e.source instanceof MouseEvent||e.source instanceof TouchEvent){const h=e.source;s===0&&h.movementX!==0&&(s=h.movementX||0),r===0&&h.movementY!==0&&(r=h.movementY||0)}n.x+=s,n.y+=r,this._pointerPositions[t].x=e.clientX,this._pointerPositions[t].y=e.clientY;const a=e.clientX,l=e.clientY;for(;t>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new J);const c=this._pointerPositionsRC[t];c.set(a,l),this.convertScreenspaceToRaycastSpace(c)}getPointerIndex(e){let t=-1;for(let i=0;i<this._pointerIds.length;i++){if(this._pointerIds[i]===e)return i;t===-1&&this._pointerIds[i]===-1&&(t=i)}return t!==-1?(this._pointerIds[t]=e,t):(st&&console.log("PUSH pointerId:",e),this._pointerIds.push(e),this._pointerIds.length-1)}setPointerState(e,t,i){t[e]=i}setPointerStateT(e,t,i){return t[e]=i,i}onDispatchEvent(e){const t=V.Current;try{V.Current=this.context,this.dispatchEvent(e)}finally{V.Current=t}}}const La=new Z().makeRotationY(Math.PI),Gi=new N().setFromAxisAngle(new b(0,1,0),Math.PI),WO=v("debugwebxr");class $O{priority=-1e5;gameObject;isXRRig(){return!0}get isActive(){return this.gameObject.visible}constructor(){if(this.gameObject=new O,this.gameObject.name="Implicit XR Rig",WO){const e=Sg(16733661);e.position.y+=.5,this.gameObject.add(e)}}}const ko=v("debugwebxr"),Nd=v("debugcustomgesture"),HO="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",GO="generic-trigger",qO=new N().setFromEuler(new ot(bo.degToRad(0),bo.degToRad(-90),bo.degToRad(-90))),XO=new b(.04,-.04,0);class cg{xr;get context(){return this.xr.context}inputSource;index=0;emitEvents=!0;get connected(){return this._connected}_connected=!0;get isTracking(){return this._isTracking}_isTracking=!1;get gamepad(){return this.__gamepad??=this.inputSource.gamepad}__gamepad;get isHand(){return this.hand!=null}get hand(){return this.__hand??=this.inputSource.hand}__hand;get handObject(){return this.context.renderer.xr.getHand(this.index)}get profiles(){return this.inputSource.profiles}get layout(){return this._layout}get targetRayMode(){return this.inputSource.targetRayMode}get targetRaySpace(){return this.inputSource.targetRaySpace}get gripSpace(){return this.inputSource.gripSpace}get side(){return this.__side??=this.inputSource.handedness}__side=void 0;get isRight(){return this.side==="right"}get isLeft(){return this.side==="left"}get isStylus(){return this._isMxInk}getHitTestSource(){return this._hitTestSource||this._requestHitTestSource(),this._hitTestSource}get hasHitTestSource(){return this._hitTestSource}cancelHitTestSource(){this._hitTestSource&&(this._hitTestSource.cancel(),this._hitTestSource=void 0)}_hitTestSource=void 0;_hasSelectEvent=!1;get hasSelectEvent(){return this._hasSelectEvent}_isMxInk=!1;_isMetaQuestTouchController=!1;getHitTest(){return this.xr.getHitTest(this)}_handJointPoses=new Map;getHandJointPose(e,t){if(t=t||this.xr.frame,!this.hand||!t?.getJointPose||!this.xr.referenceSpace)return null;let i=this._handJointPoses?.get(e);return i||(i=t.getJointPose(e,this.xr.referenceSpace),i&&this._handJointPoses.set(e,i),i)}_gripMatrix=new Z;_gripPosition=new b;_gripQuaternion=new N;_linearVelocity=new b;_rayPositionRaw=new b;_rayRotationRaw=new N;_rayMatrix=new Z;_rayPosition=new b;_rayQuaternion=new N;get gripPosition(){return D(this._gripPosition)}get gripQuaternion(){return ni(this._gripQuaternion)}get gripMatrix(){return this._gripMatrix}get gripLinearVelocity(){return D(this._linearVelocity).applyQuaternion(Gi)}get rayPosition(){return D(this._rayPosition)}get rayQuaternion(){return ni(this._rayQuaternion)}get gripWorldPosition(){return D(this._gripWorldPosition)}_gripWorldPosition=new b;get gripWorldQuaternion(){return ni(this._gripWorldQuaternion)}_gripWorldQuaternion=new N;get rayWorldPosition(){return D(this._rayWorldPosition)}_rayWorldPosition=new b;updateRayWorldPosition(){const e=this.xr.context.mainCamera?.parent;this._rayWorldPosition.copy(this._rayPositionRaw),e&&this._rayWorldPosition.applyMatrix4(e.matrixWorld)}get rayWorldQuaternion(){return ni(this._rayWorldQuaternion)}_rayWorldQuaternion=new N;get pinchPosition(){return D(this._pinchPosition)}_pinchPosition=new b;updateRayWorldQuaternion(){const e=this.xr.context.mainCamera?.parent,t=e?be(e):void 0;this._rayWorldQuaternion.copy(this._rayRotationRaw).multiply(Gi),t&&this._rayWorldQuaternion.premultiply(t)}get ray(){return this._ray.origin.copy(this.rayWorldPosition),this._ray.direction.copy(D(0,0,1).applyQuaternion(this.rayWorldQuaternion)),this._ray}_ray;_hand_wristDotUp=void 0;get handWristDotUp(){if(this._hand_wristDotUp!==void 0)return this._hand_wristDotUp;const e=this.handObject?.joints.wrist;if(e){const t=D(0,1,0).applyQuaternion(e.quaternion),i=D(0,1,0).dot(t);return this._hand_wristDotUp=i}}get isHandUpsideDown(){return this.handWristDotUp!==void 0?this.handWristDotUp<-.7:!1}get isTeleportGesture(){return this.isHandUpsideDown&&this.getGesture("pinch")?.isDown}get object(){return this._object}_object;_gripSpaceObject;_raySpaceObject;model=null;_debugAxesHelper=new xi(.15);_debugGripAxesHelper=new xi(.07);_debugRayAxesHelper=new xi(.07);async getModelUrl(){return this.getMotionController?.then(e=>e?.assetUrl||null)}constructor(e,t,i){this.xr=e,this.inputSource=t,this.index=i,this._object=new O,this._object.name=`NeedleXRController_${i}`,ko&&(this._object.add(this._debugAxesHelper),this._gripSpaceObject=new O,this._raySpaceObject=new O,this._gripSpaceObject.name=`NeedleXRController_${i}_gripSpace`,this._raySpaceObject.name=`NeedleXRController_${i}_raySpace`,this._gripSpaceObject.add(this._debugGripAxesHelper),this._raySpaceObject.add(this._debugRayAxesHelper),this.xr.context.scene.add(this._gripSpaceObject),this.xr.context.scene.add(this._raySpaceObject)),this.xr.context.scene.add(this._object),this._ray=new yo,this.pointerInit={origin:this,pointerType:this.hand?"hand":"controller",deviceIndex:this.index,pointerId:-1,mode:this.inputSource.targetRayMode,ray:this._ray,device:this._object,buttonName:"none"},this.initialize(),this.subscribeEvents()}_hitTestSourcePromise=null;_requestHitTestSource(){return this._hitTestSourcePromise?this._hitTestSourcePromise:this.xr.mode==="immersive-ar"&&this.inputSource.targetRayMode==="tracked-pointer"&&this.xr.session.requestHitTestSourceForTransientInput?this._hitTestSourcePromise=this.xr.session.requestHitTestSourceForTransientInput({profile:this.inputSource.profiles[0],offsetRay:new XRRay})?.then(e=>(this._hitTestSourcePromise=null,this.connected?this._hitTestSource=e:(e.cancel(),null)))??null:null}onPointerHits=e=>{};onUpdate(e){this.onUpdateFrame(e),this.updateInputEvents(),this.onUpdateMove()}onRenderDebug(){B.DrawSphere(this.rayWorldPosition,.003),B.DrawDirection(this.rayWorldPosition,D(0,0,10).applyQuaternion(this.rayWorldQuaternion));const e=(this.inputSource.gripSpace?this.gripWorldPosition:this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(.1)),t=this.inputSource.profiles.join(`
|
|
146
146
|
`);let i=`Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
|
|
147
147
|
C:${this.connected?"x":"-"} T:${this.isTracking?"x":"-"} Hand:${this.inputSource.hand?"x":"-"} Pen: ${this._isMxInk?"x":"-"}`;if(this.inputSource.hand&&(i+=`
|
|
@@ -1399,7 +1399,7 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
|
|
|
1399
1399
|
}
|
|
1400
1400
|
}
|
|
1401
1401
|
`}}var f2=Object.defineProperty,y2=Object.getOwnPropertyDescriptor,kh=(o,e,t,i)=>{for(var n=i>1?void 0:i?y2(e,t):e,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=(i?r(e,t,n):r(n))||n);return i&&n&&f2(e,t,n),n};const Rt=v("debugscreensharing");var v1=(o=>(o[o.Screen=0]="Screen",o[o.Camera=1]="Camera",o[o.Canvas=2]="Canvas",o[o.Microphone=3]="Microphone",o))(v1||{});class Qs extends R{allowStartOnClick=!0;onPointerEnter(){this.context.connection.allowEditing!=!1&&this.allowStartOnClick&&this.context.input.setCursor("pointer")}onPointerExit(){this.context.connection.allowEditing!=!1&&this.allowStartOnClick&&this.context.input.unsetCursor("pointer")}onPointerClick(e){if(this.context.connection.allowEditing!=!1&&this.allowStartOnClick&&!(e&&e.pointerId!==0)){if(this.isReceiving&&this.videoPlayer?.isPlaying){this.videoPlayer&&(this.videoPlayer.screenspace=!this.videoPlayer.screenspace);return}if(this.isSending){this.close();return}this.share()}}autoConnect=!1;set videoPlayer(e){this._videoPlayer&&(this.isSending||this.isReceiving)&&this._videoPlayer.stop(),this._videoPlayer=e,this._videoPlayer&&this._currentStream&&(this.isSending||this.isReceiving)&&this._videoPlayer.setVideo(this._currentStream)}get videoPlayer(){return this._videoPlayer}_videoPlayer;_audioSource;get screenspace(){return this.videoPlayer?.screenspace??!1}set screenspace(e){this.videoPlayer&&(this.videoPlayer.screenspace=e)}device="Screen";deviceName;deviceFilter;get currentScream(){return this._currentStream}get currentMode(){return this._currentMode}get isSending(){return this._currentStream?.active&&this._currentMode===1}get isReceiving(){if(this._currentMode===2){if(!this._currentStream||this._currentStream.active===!1)return!1;const e=this._currentStream.getTracks();for(const t of e)if(t.readyState==="live")return!0}return!1}get requiresVideoPlayer(){return this.device!=="Microphone"}_net;_requestOpen=!1;_currentStream=null;_currentMode=0;awake(){typeof this.device=="number"&&(this.device=v1[this.device]),Rt&&console.log("Screensharing",this.name,this),Ei.registerWaitForAllowAudio(()=>{this._videoPlayer&&this._currentStream&&this._currentMode===2&&(this._videoPlayer.playInBackground=!0,this._videoPlayer.setVideo(this._currentStream))}),this._net=new dd(this)}onEnable(){this._net?.enable(),this._net?.addEventListener(Yn.StreamReceived,this.onReceiveStream),this._net?.addEventListener(Yn.StreamEnded,this.onCallEnded),this.context.connection.beginListen(te.JoinedRoom,this.onJoinedRoom),this.autoConnect&&Nn(1e3).then(()=>(this.enabled&&this.autoConnect&&!this.isReceiving&&!this.isSending&&this.context.connection.isInRoom&&this.share(),0))}onDisable(){this._net?.removeEventListener(Yn.StreamReceived,this.onReceiveStream),this._net?.removeEventListener(Yn.StreamEnded,this.onCallEnded),this.context.connection.stopListen(te.JoinedRoom,this.onJoinedRoom),this._net?.disable(),this.close()}onJoinedRoom=async()=>{await Nn(1e3),this.autoConnect&&!this.isSending&&!this.isReceiving&&this.context.connection.isInRoom&&this.share()};_ensureVideoPlayer(){const e=new dt;e.aspectMode=y1.AdjustWidth,x.addComponent(this.gameObject,e),this._videoPlayer=e}_activeShareRequest=null;async share(e){return this._activeShareRequest?this._activeShareRequest:(this._activeShareRequest=this.internalShare(e),this._activeShareRequest.then(()=>this._activeShareRequest=null))}async internalShare(e){if(this.context.connection.isInRoom===!1){console.warn("Can not start screensharing: requires network connection"),A()&&fe("Can not start screensharing: requires network connection. Add a SyncedRoom component or join a room first.");return}if(e?.device&&(this.device=e.device),!this.videoPlayer&&this.requiresVideoPlayer&&(this._videoPlayer||(this._videoPlayer=x.getComponent(this.gameObject,dt)??void 0),this.videoPlayer||this._ensureVideoPlayer(),!this.videoPlayer)){console.warn("Can not share video without a videoPlayer assigned");return}this._requestOpen=!0;try{const t=e?.constraints??{echoCancellation:!0,autoGainControl:!1},i={video:t,audio:t},n=i.video;switch(n!==void 0&&typeof n!="boolean"&&(n.width||(n.width={max:1920}),n.height||(n.height={max:1920}),n.aspectRatio||(n.aspectRatio={ideal:1.7777777778}),n.frameRate||(n.frameRate={ideal:24}),n.facingMode||(n.facingMode={ideal:"user"})),this.device){case"Camera":this.tryShareUserCamera(i,e);break;case"Screen":{if(!navigator.mediaDevices.getDisplayMedia){console.error("No getDisplayMedia support");return}const r=await navigator.mediaDevices.getDisplayMedia(i);this._requestOpen?this.setStream(r,1):Zn(r)}break;case"Canvas":const s=this.context.renderer.domElement.captureStream(0);this.setStream(s,1);break;case"Microphone":{if(!navigator.mediaDevices.getUserMedia){console.error("No getDisplayMedia support");return}i.video=!1;const r=await navigator.mediaDevices.getUserMedia(i);this._requestOpen?this.setStream(r,1):Zn(r)}break;default:console.error("Can not start screen sharing: Unknown device type",this.device)}}catch(t){if(t.name==="NotAllowedError"){console.log("Selection cancelled"),this._requestOpen=!1;return}console.error("Error opening video",t)}}close(){this._requestOpen=!1,this._currentStream&&(Rt&&console.warn("Close current stream / disposing resources, stream was active?",this._currentStream.active),this._net?.stopSendingStream(this._currentStream),Zn(this._currentStream),this._currentMode=0,this._currentStream=null)}setStream(e,t){if(e===this._currentStream||(this.close(),!e))return;this._currentStream=e,this._requestOpen=!0,this._currentMode=t;const i=this.device!=="Microphone",n=t===1;i?(this._videoPlayer||this._ensureVideoPlayer(),this._videoPlayer?this._videoPlayer.setVideo(e):console.error("No video player assigned for video stream")):(this._audioSource||(this._audioSource=new Ei,this._audioSource.spatialBlend=0,this._audioSource.volume=1,this.gameObject.addComponent(this._audioSource)),n||(Rt&&console.log("PLAY",e.getAudioTracks()),this._audioSource.volume=1,this._audioSource?.play(e))),n&&this._net?.startSendingStream(e),n&&(this._videoPlayer&&(this._videoPlayer.muted=!0),this._audioSource?.stop());for(const s of e.getTracks())s.addEventListener("ended",()=>{Rt&&console.log("Track ended",s),this.close()}),Rt&&s.kind==="video"&&console.log(n?"Video \u2192":"Video \u2190",s.getSettings())}onReceiveStream=e=>{e.stream?.active===!0&&this.setStream(e.stream,2)};onCallEnded=e=>{Rt&&console.log("CALL ENDED",this.isReceiving,this?.screenspace),this.isReceiving&&(this.screenspace=!1)};async tryShareUserCamera(e,t){const i=(await navigator.mediaDevices.enumerateDevices()).filter(s=>s.kind==="videoinput");Rt&&console.log(`Request camera. These are your kind:videoinput devices:
|
|
1402
|
-
`,i);let n=!1;for(const s of i)try{if(!this._requestOpen){Rt&&console.log("Camera selection cancelled");break}if(s.kind!=="videoinput"){Rt&&console.log("Skipping non-video device",s);continue}const r=s.deviceId;if(t?.deviceId!=null||t?.deviceFilter!=null){if(t?.deviceId!==void 0&&r!==t.deviceId){Rt&&console.log("Skipping device due to options.deviceId: "+s.label+"; "+s.deviceId);continue}if(t?.deviceFilter&&t.deviceFilter(s)===!1){Rt&&console.log("Skipping device due to options.deviceFilter: "+s.label+"; "+s.deviceId);continue}}else if(this.deviceFilter)if(this.deviceFilter(s)===!1){Rt&&console.log("Skipping device due to ScreenShare.deviceFilter: "+s.label+"; "+s.deviceId);continue}else Rt&&console.log("Selected device by filter",s);else if(this.deviceName){const l=s.label.toLowerCase(),c=this.deviceName.toLowerCase(),h=l.includes(c),d=s.deviceId===this.deviceName;if(!h&&!d){Rt&&console.log("Skipping device due to ScreenShare.deviceName: "+s.label+"; "+s.deviceId);continue}else Rt&&console.log("Selected device by name",s)}e.video!==!1&&((typeof e.video>"u"||typeof e.video=="boolean")&&(e.video={}),e.video.deviceId=r),n=!0;const a=await navigator.mediaDevices.getUserMedia(e).catch(l=>(console.error("Failed to get user media",l),null));if(a===null)continue;this._requestOpen?(this.setStream(a,1),Rt&&console.log("Selected camera",s)):(Zn(a),Rt&&console.log("Camera selection cancelled"));break}catch(r){if(r.message==="Failed to allocate videosource"||r.message==="Could not start video source"){fe("Failed to start video: Try another camera (Code "+r.code+")"),console.warn(r);continue}else console.error("Failed to get user media",r.message,r.code,r)}!n&&A()&&(fe("No camera found for sharing. Please connect a camera (see console for more information)"),console.warn("No camera found for sharing. Please connect a camera",i,this.deviceName,"Using deviceFilter? "+this.deviceFilter!=null,"Using options? "+t!=null,"Using deviceName? "+this.deviceName!=null,"Using options.deviceId? "+t?.deviceId!=null,"Using options.deviceFilter? "+t?.deviceFilter!=null))}}kh([u()],Qs.prototype,"allowStartOnClick",2),kh([u()],Qs.prototype,"autoConnect",2),kh([u(dt)],Qs.prototype,"videoPlayer",1),kh([u()],Qs.prototype,"device",2),kh([u()],Qs.prototype,"deviceName",2);var b2=Object.defineProperty,Rl=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&b2(e,t,n),n};const _2=v("debugseethrough");let v2=0;class Qo extends R{referencePoint=null;fadeDuration=.05;minAlpha=0;useAlphaHash=!0;set needsUpdate(e){this._needsUpdate=e}get needsUpdate(){return this._needsUpdate}overrideAlpha=-1;autoUpdate=!0;_referencePointVector=new b;_referencePointDir=new b;_distance=0;_renderer=null;_needsUpdate=!0;_id=v2++;onEnable(){this._needsUpdate=!0,this._renderer=null,Mh.components.push(this)}onDisable(){this._renderer?.forEach(t=>{const i=this.rendererMaterialsOriginal.get(t);for(let n=0;n<t.sharedMaterials.length;n++)t.sharedMaterials[n]&&i&&i[n]&&(t.sharedMaterials[n]=i[n]);this.rendererMaterials.delete(t),this.rendererMaterialsOriginal.delete(t)});const e=Mh.components.indexOf(this);e!==-1&&Mh.components.splice(e,1)}update(){if(this._needsUpdate?(this._needsUpdate=!1,this._renderer=this.gameObject.getComponentsInChildren(Yt),this.updateDirection()):this.autoUpdate&&(this.context.time.frame+this._id)%20===0&&this.updateDirection(),!this.autoUpdate||!this.referencePoint)return;const e=this._referencePointDir.dot(this.context.mainCamera.worldForward)>.2;if(_2&&this.referencePoint){const t=this.gameObject.worldPosition;B.DrawArrow(D(t),t.sub(this._referencePointDir),e?16711680:65280),B.DrawWireSphere(this.referencePoint.worldPosition,.05,255)}e?this.updateAlpha(this.minAlpha,this.fadeDuration):this.updateAlpha(1,this.fadeDuration)}rendererMaterials=new WeakMap;rendererMaterialsOriginal=new WeakMap;updateDirection(){this.referencePoint??=this.context.scene,this._referencePointVector.copy(this.gameObject.worldPosition.sub(this.referencePoint.worldPosition)),this._distance=this._referencePointVector.length(),this._referencePointDir.copy(this._referencePointVector).multiply(D(1,.5,1)).normalize()}updateAlpha(e,t=this.fadeDuration){this.overrideAlpha!==void 0&&this.overrideAlpha!==-1&&(e=this.overrideAlpha),this._renderer?.forEach(i=>{if(e<.9?i.gameObject.raycastAllowed=!1:i.gameObject.raycastAllowed=!0,!this.rendererMaterials.has(i)){const s=new Array,r=new Array;for(let a=0;a<i.sharedMaterials.length;a++){const l=i.sharedMaterials[a];if(!l)continue;s.push(l);const c=l.clone();c.userData=l.userData||{},c.userData.seeThrough={initial:{opacity:c.opacity,transparent:c.transparent,alphaHash:c.alphaHash}},r.push(c),i.sharedMaterials[a]=c}this.rendererMaterials.set(i,r),this.rendererMaterialsOriginal.set(i,s)}const n=i.hasLightmap?i.sharedMaterials:this.rendererMaterials.get(i);if(n)for(const s of n){if(!s)continue;let r=I.lerp(s.opacity,e,t<=0?1:this.context.time.deltaTime/t);r>=.99?r=1:r<=.01&&(r=0);const a=s.transparent,l=s.alphaHash;if(s.alphaHash=this.useAlphaHash,s.userData&&"seeThrough"in s.userData){const
|
|
1402
|
+
`,i);let n=!1;for(const s of i)try{if(!this._requestOpen){Rt&&console.log("Camera selection cancelled");break}if(s.kind!=="videoinput"){Rt&&console.log("Skipping non-video device",s);continue}const r=s.deviceId;if(t?.deviceId!=null||t?.deviceFilter!=null){if(t?.deviceId!==void 0&&r!==t.deviceId){Rt&&console.log("Skipping device due to options.deviceId: "+s.label+"; "+s.deviceId);continue}if(t?.deviceFilter&&t.deviceFilter(s)===!1){Rt&&console.log("Skipping device due to options.deviceFilter: "+s.label+"; "+s.deviceId);continue}}else if(this.deviceFilter)if(this.deviceFilter(s)===!1){Rt&&console.log("Skipping device due to ScreenShare.deviceFilter: "+s.label+"; "+s.deviceId);continue}else Rt&&console.log("Selected device by filter",s);else if(this.deviceName){const l=s.label.toLowerCase(),c=this.deviceName.toLowerCase(),h=l.includes(c),d=s.deviceId===this.deviceName;if(!h&&!d){Rt&&console.log("Skipping device due to ScreenShare.deviceName: "+s.label+"; "+s.deviceId);continue}else Rt&&console.log("Selected device by name",s)}e.video!==!1&&((typeof e.video>"u"||typeof e.video=="boolean")&&(e.video={}),e.video.deviceId=r),n=!0;const a=await navigator.mediaDevices.getUserMedia(e).catch(l=>(console.error("Failed to get user media",l),null));if(a===null)continue;this._requestOpen?(this.setStream(a,1),Rt&&console.log("Selected camera",s)):(Zn(a),Rt&&console.log("Camera selection cancelled"));break}catch(r){if(r.message==="Failed to allocate videosource"||r.message==="Could not start video source"){fe("Failed to start video: Try another camera (Code "+r.code+")"),console.warn(r);continue}else console.error("Failed to get user media",r.message,r.code,r)}!n&&A()&&(fe("No camera found for sharing. Please connect a camera (see console for more information)"),console.warn("No camera found for sharing. Please connect a camera",i,this.deviceName,"Using deviceFilter? "+this.deviceFilter!=null,"Using options? "+t!=null,"Using deviceName? "+this.deviceName!=null,"Using options.deviceId? "+t?.deviceId!=null,"Using options.deviceFilter? "+t?.deviceFilter!=null))}}kh([u()],Qs.prototype,"allowStartOnClick",2),kh([u()],Qs.prototype,"autoConnect",2),kh([u(dt)],Qs.prototype,"videoPlayer",1),kh([u()],Qs.prototype,"device",2),kh([u()],Qs.prototype,"deviceName",2);var b2=Object.defineProperty,Rl=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&b2(e,t,n),n};const _2=v("debugseethrough");let v2=0;class Qo extends R{referencePoint=null;fadeDuration=.05;minAlpha=0;useAlphaHash=!0;set needsUpdate(e){this._needsUpdate=e}get needsUpdate(){return this._needsUpdate}overrideAlpha=-1;autoUpdate=!0;_referencePointVector=new b;_referencePointDir=new b;_distance=0;_renderer=null;_needsUpdate=!0;_id=v2++;onEnable(){this._needsUpdate=!0,this._renderer=null,Mh.components.push(this)}onDisable(){this._renderer?.forEach(t=>{const i=this.rendererMaterialsOriginal.get(t);for(let n=0;n<t.sharedMaterials.length;n++)t.sharedMaterials[n]&&i&&i[n]&&(t.sharedMaterials[n]=i[n]);this.rendererMaterials.delete(t),this.rendererMaterialsOriginal.delete(t)});const e=Mh.components.indexOf(this);e!==-1&&Mh.components.splice(e,1)}update(){if(this._needsUpdate?(this._needsUpdate=!1,this._renderer=this.gameObject.getComponentsInChildren(Yt),this.updateDirection()):this.autoUpdate&&(this.context.time.frame+this._id)%20===0&&this.updateDirection(),!this.autoUpdate||!this.referencePoint)return;const e=this._referencePointDir.dot(this.context.mainCamera.worldForward)>.2;if(_2&&this.referencePoint){const t=this.gameObject.worldPosition;B.DrawArrow(D(t),t.sub(this._referencePointDir),e?16711680:65280),B.DrawWireSphere(this.referencePoint.worldPosition,.05,255)}e?this.updateAlpha(this.minAlpha,this.fadeDuration):this.updateAlpha(1,this.fadeDuration)}rendererMaterials=new WeakMap;rendererMaterialsOriginal=new WeakMap;updateDirection(){this.referencePoint??=this.context.scene,this._referencePointVector.copy(this.gameObject.worldPosition.sub(this.referencePoint.worldPosition)),this._distance=this._referencePointVector.length(),this._referencePointDir.copy(this._referencePointVector).multiply(D(1,.5,1)).normalize()}updateAlpha(e,t=this.fadeDuration){this.overrideAlpha!==void 0&&this.overrideAlpha!==-1&&(e=this.overrideAlpha),this._renderer?.forEach(i=>{if(e<.9?i.gameObject.raycastAllowed=!1:i.gameObject.raycastAllowed=!0,!this.rendererMaterials.has(i)){const s=new Array,r=new Array;for(let a=0;a<i.sharedMaterials.length;a++){const l=i.sharedMaterials[a];if(!l)continue;s.push(l);const c=l.clone();c.userData=l.userData||{},c.userData.seeThrough={initial:{opacity:c.opacity,transparent:c.transparent,alphaHash:c.alphaHash}},r.push(c),i.sharedMaterials[a]=c}this.rendererMaterials.set(i,r),this.rendererMaterialsOriginal.set(i,s)}const n=i.hasLightmap?i.sharedMaterials:this.rendererMaterials.get(i);if(n)for(const s of n){if(!s)continue;let r=I.lerp(s.opacity,e,t<=0?1:this.context.time.deltaTime/t);r>=.99?r=1:r<=.01&&(r=0);const a=s.transparent,l=s.alphaHash,c=s.opacity;if(s.alphaHash=this.useAlphaHash,s.userData&&"seeThrough"in s.userData){const h=s.userData.seeThrough.initial;s.opacity=h.opacity*r,s.transparent=s.opacity>=1?h.transparent:!this.useAlphaHash}else s.transparent=s.opacity>=1?!1:!this.useAlphaHash;(a!==s.transparent||l!==s.alphaHash||s.opacity!==c)&&(s.needsUpdate=!0)}})}}Rl([u(O)],Qo.prototype,"referencePoint"),Rl([u()],Qo.prototype,"fadeDuration"),Rl([u()],Qo.prototype,"minAlpha"),Rl([u()],Qo.prototype,"useAlphaHash"),Rl([u()],Qo.prototype,"overrideAlpha"),Rl([u()],Qo.prototype,"autoUpdate");class Mh{static components=[];get extensionName(){return"SeeThrough"}}const w1=new Mh;Tn.beforeExport.addEventListener(o=>{Mh.components.length!==0&&o.exporter.extensions.includes(w1)===!1&&o.exporter.extensions.push(w1)});var w2=Object.defineProperty,x1=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&w2(e,t,n),n};class Rh extends R{mode=0;shadowColor=new oe(0,0,0,1);targetMesh;start(){if(this.gameObject instanceof G)this.gameObject instanceof G&&this.gameObject.material&&(this.gameObject.material=this.gameObject.material.clone(),this.targetMesh=this.gameObject,this.targetMesh.receiveShadow=!0);else{const e=xr.createPrimitive(wr.Quad,{name:"ShadowCatcher",material:new pt({color:10066329,roughness:1,metalness:0,transparent:!0})});e.receiveShadow=!0,e.geometry.rotateX(-Math.PI/2),this.gameObject.add(e),this.targetMesh=e}if(!this.targetMesh){console.warn("ShadowCatcher: no mesh to apply shadow catching to. Groups are currently not supported.");return}switch(this.targetMesh.layers.set(2),this.mode){case 0:this.applyShadowMaterial();break;case 1:this.applyLightBlendMaterial();break;case 2:this.applyOccluderMaterial();break}}applyLightBlendMaterial(){if(!this.targetMesh)return;const e=this.targetMesh.material;e.blending=rb,this.applyMaterialOptions(e),e.onBeforeCompile=t=>{t.fragmentShader=t.fragmentShader.replace("vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;",`vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
|
|
1403
1403
|
// diffuse-only lighting with overdrive to somewhat compensate
|
|
1404
1404
|
// for the loss of indirect lighting and to make it more visible.
|
|
1405
1405
|
vec3 direct = (reflectedLight.directDiffuse + reflectedLight.directSpecular) * 6.6;
|
package/dist/{needle-engine.bundle-Ci2JE5sk.umd.cjs → needle-engine.bundle-YQ3I1QD8.umd.cjs}
RENAMED
|
@@ -141,7 +141,7 @@ void main(){
|
|
|
141
141
|
#__vconsole .vc-mask {
|
|
142
142
|
overflow: hidden;
|
|
143
143
|
}
|
|
144
|
-
`,Co?.prepend(i),s===!0&&Rb()<=0&&Xb(),console.log("🌵 Debug console has loaded")}},e.onerror=()=>{console.warn("🌵 Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),il=!1,Ri=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function RS(){if(!globalThis.VConsole)return;const s=new VConsole.VConsolePlugin("needle-console","🌵 Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+s._id+" iframe");return s.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const o=n.indexOf("?");o>-1&&(n=n.substring(0,o));const a=location.protocol+"//"+location.host+location.pathname+"/"+n,l=encodeURIComponent(a);s.fullUrl="https://viewer.needle.tools?inspect&file="+l;var h='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(h)}),s.on("show",function(){const t=e();t&&t.src!==s.fullUrl&&(t.src=s.fullUrl)}),s.on("hide",function(){const t=e();t&&(t.src="")}),s.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window ↗",onClick:function(n){window.open(s.fullUrl,"_blank"),Ri?.hide()}}),i.push({name:"Reload",onClick:function(n){const o=e();o&&(o.src=s.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const o=e();o.requestFullscreen?o.requestFullscreen():o.webkitRequestFullscreen instanceof Function&&o.webkitRequestFullscreen()}}),t(i)}),s}function TS(){const s=document.querySelector("#__vconsole .vc-switch");return s||null}function AS(){const s=document.querySelector("#__vconsole");return s||null}const Qb=x("debugdefines");ro('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";');ro('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');ro('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');ro('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');ro('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.11.
|
|
144
|
+
`,Co?.prepend(i),s===!0&&Rb()<=0&&Xb(),console.log("🌵 Debug console has loaded")}},e.onerror=()=>{console.warn("🌵 Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),il=!1,Ri=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function RS(){if(!globalThis.VConsole)return;const s=new VConsole.VConsolePlugin("needle-console","🌵 Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+s._id+" iframe");return s.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const o=n.indexOf("?");o>-1&&(n=n.substring(0,o));const a=location.protocol+"//"+location.host+location.pathname+"/"+n,l=encodeURIComponent(a);s.fullUrl="https://viewer.needle.tools?inspect&file="+l;var h='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(h)}),s.on("show",function(){const t=e();t&&t.src!==s.fullUrl&&(t.src=s.fullUrl)}),s.on("hide",function(){const t=e();t&&(t.src="")}),s.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window ↗",onClick:function(n){window.open(s.fullUrl,"_blank"),Ri?.hide()}}),i.push({name:"Reload",onClick:function(n){const o=e();o&&(o.src=s.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const o=e();o.requestFullscreen?o.requestFullscreen():o.webkitRequestFullscreen instanceof Function&&o.webkitRequestFullscreen()}}),t(i)}),s}function TS(){const s=document.querySelector("#__vconsole .vc-switch");return s||null}function AS(){const s=document.querySelector("#__vconsole");return s||null}const Qb=x("debugdefines");ro('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";');ro('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');ro('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');ro('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');ro('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.11.3";');ro('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');ro('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Tue Oct 21 2025 13:19:13 GMT+0000 (Coordinated Universal Time)";');ro('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const en="4.11.3",Qd="undefined",vm="Tue Oct 21 2025 13:19:13 GMT+0000 (Coordinated Universal Time)";Qb&&console.log(`Engine version: ${en} (generator: ${Qd})
|
|
145
145
|
Project built at ${vm}`);const Zr=NEEDLE_PUBLIC_KEY,ls="needle_isActiveInHierarchy",Do="builtin_components",Ul="needle_editor_guid";function ro(s){try{(0,eval)(s)}catch(e){Qb&&console.error(e)}}let Yb,Dy=null;function on(){return Yb}function wm(s){if(s==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}Dy!==s&&(Dy=s,Yb=new s)}const ai=Symbol("shadowDomOwner"),DS=x("debugpatch");function Yd(s,e,t,i){const n=DS===e;if(!t&&!i)return;const o=e+"___needle";IS(s,e,t,i);const r=Object.getOwnPropertyDescriptor(s,e),a=s[e];n&&console.log("Patch",s.constructor.name,e,r,a),r?(n&&console.log("Apply patch with existing descriptor",s.constructor.name,e,r),typeof r.value=="function"&&(s[e]=Iy(r.value,s,e))):(n&&console.log("Create patch with new property",s.constructor.name,e,r),Object.defineProperty(s,e,{set:function(l){if(typeof l=="function")this[o]=Iy(l,s,e);else{const h=this[o];Kb(s,e,this,h,l),this[o]=l,Zb(s,e,this,h,l)}},get:function(){const l=this[o];return typeof l=="function"&&l[o]?l[o]:l}}))}function LS(s,e,t){const i=xm(s,e);if(i)for(let n=i.length-1;n>=0;n--){const o=i[n];o.prefix===t&&(o.prefix=null),o.postfix===t&&(o.postfix=null),!o.prefix&&!o.postfix&&i.splice(n,1)}}const Ly=Symbol("Needle:Patches:WrappedFunction");function Iy(s,e,t){if(s[Ly])return s;const i=function(...n){Kb(e,t,this,...n);const o=s.apply(this,n);return Zb(e,t,this,o,...n),o};return i[Ly]=!0,i}const Zh="Needle:Patches";function yp(){return globalThis[Zh]||(globalThis[Zh]=new WeakMap),globalThis[Zh]}function xm(s,e){const t=yp().get(s);return t?t.get(e):null}function IS(s,e,t,i){let n=yp().get(s);n||(n=new Map,yp().set(s,n));let o=n.get(e);o||(o=[],n.set(e,o)),o.push({prefix:t,postfix:i})}function Kb(s,e,t,...i){if(!t)return;const n=xm(s,e);if(n)for(const o of n)o.prefix?.call(t,...i)}function Zb(s,e,t,i,...n){if(!t)return;const o=xm(s,e);if(o)for(const r of o)r.postfix?.call(t,i,...n)}const ma=[];function Kd(s){ma.indexOf(s)===-1&&ma.push(s)}function jS(s){const e=ma.indexOf(s);e!==-1&&ma.splice(e,1)}const ga=[];function Sm(s){ga.indexOf(s)===-1&&ga.push(s)}function BS(s){const e=ga.indexOf(s);e!==-1&&ga.splice(e,1)}function Jb(s){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-start",{detail:s}));for(let e=0;e<ma.length;e++)ma[e](s)}function e0(s){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-end",{detail:s}));for(let e=0;e<ga.length;e++)ga[e](s)}const Xe=x("debuginput");var Zd=(s=>(s.Mouse="mouse",s.Touch="touch",s.Controller="controller",s.Hand="hand",s))(Zd||{}),xe=(s=>(s.PointerDown="pointerdown",s.PointerUp="pointerup",s.PointerMove="pointermove",s.KeyDown="keydown",s.KeyUp="keyup",s.KeyPressed="keypress",s))(xe||{});class Zn extends PointerEvent{clientZ;deviceIndex;origin;source;mode;get isSpatial(){return this.mode!="screen"}get ray(){return this._ray||(this._ray=new c.Ray(this.space.worldPosition.clone(),this.space.worldForward.clone())),this._ray}set ray(e){this._ray=e}get hasRay(){return this._ray!==void 0}_ray;space;isClick=!1;isDoubleClick=!1;get used(){return this._used}_used=!1;use(){this._used=!0}get pointerId(){return this._pointerid}_pointerid;get pointerType(){return this._pointerType}_pointerType;get type(){return this._type}_type;metadata={};intersections=new Array;constructor(e,t,i){super(e,i),this.clientZ=i.clientZ,this._pointerid=i.pointerId,this._pointerType=i.pointerType,this._type=e,this.deviceIndex=i.deviceIndex,this.origin=i.origin,this.source=t,this.mode=i.mode,this._ray=i.ray,this.space=i.device}_immediatePropagationStopped=!1;get immediatePropagationStopped(){return this._immediatePropagationStopped}_propagationStopped=!1;get propagationStopped(){return this._immediatePropagationStopped||this._propagationStopped}stopImmediatePropagation(){this._immediatePropagationStopped=!0,super.stopImmediatePropagation(),this.source?.stopImmediatePropagation()}stopPropagation(){this._propagationStopped=!0,super.stopPropagation(),this.source?.stopPropagation(),Xe&&console.warn("Stop propagation...",this.pointerId,this.pointerType)}}class wl extends KeyboardEvent{source;constructor(e,t,i){super(e,i),this.source=t}stopImmediatePropagation(){super.stopImmediatePropagation(),this.source?.stopImmediatePropagation()}}class FS{key;keyType;source;constructor(e){this.key=e.key,this.keyType=e.type,this.source=e}}var Xt=(s=>(s[s.Early=-100]="Early",s[s.Default=0]="Default",s[s.Late=100]="Late",s))(Xt||{});class t0{_eventListeners={};addEventListener(e,t,i){if(this._eventListeners[e]||(this._eventListeners[e]=[]),!t||typeof t!="function"){console.error("Invalid call to addEventListener: callback is required and must be a function!");return}i?i={...i}:i={};let n=0;i?.queue!=null&&(n=i.queue);const o=this._eventListeners[e],r=o.find(a=>a.priority===n);r?r.listeners.push({callback:t,options:i}):(o.push({priority:n,listeners:[{callback:t,options:i}]}),o.sort((a,l)=>a.priority-l.priority))}removeEventListener(e,t,i){if(!this._eventListeners[e]||!t)return;const n=this._eventListeners[e];if(i?.queue!=null){const o=n.find(a=>a.priority===i.queue);if(!o)return;const r=o.listeners.findIndex(a=>a.callback===t);r>=0&&o.listeners.splice(r,1)}else for(const o of n){const r=o.listeners.findIndex(a=>a.callback===t);r>=0&&o.listeners.splice(r,1)}}dispatchEvent(e){let t=!1;if(e instanceof wl){const i=this._eventListeners[e.type];if(i)for(const n of i)for(let o=0;o<n.listeners.length;o++){const r=n.listeners[o];if(r.options?.signal?.aborted){n.listeners.splice(o,1),o--;continue}r.options.once&&(n.listeners.splice(o,1),o--),r.callback(e)}}if(e instanceof Zn){const i=this._eventListeners[e.type];if(i)for(const n of i){if(t)break;for(let o=0;o<n.listeners.length;o++){const r=n.listeners[o];if(r.options?.signal?.aborted){n.listeners.splice(o,1),o--;continue}if(e.immediatePropagationStopped){t=!0,Xe&&console.log("immediatePropagationStopped",e.type);break}else e.propagationStopped&&(t=!0,Xe&&console.log("propagationStopped",e.type));r.options.once&&(n.listeners.splice(o,1),o--),r.callback(e)}}}}_doubleClickTimeThreshold=.2;_longPressTimeThreshold=1;get mousePosition(){return this._pointerPositions[0]}get mousePositionRC(){return this._pointerPositionsRC[0]}get mouseDown(){return this._pointerDown[0]}get mouseUp(){return this._pointerUp[0]}get mouseClick(){return this._pointerClick[0]}get mouseDoubleClick(){return this._pointerDoubleClick[0]}get mousePressed(){return this._pointerPressed[0]}get mouseWheelChanged(){return this.getMouseWheelChanged(0)}get click(){return this._pointerClick[0]}get doubleClick(){return this._pointerDoubleClick[0]}getGamepad(e=0){return typeof navigator<"u"&&"getGamepads"in navigator&&navigator.getGamepads()[e]||null}_setCursorTypes=[];setCursorPointer(){this.setCursor("pointer")}setCursorNormal(){this.unsetCursor("pointer")}setCursor(e){this._setCursorTypes.push(e),this._setCursorTypes.length>10&&this._setCursorTypes.shift(),this.updateCursor()}unsetCursor(e){for(let t=this._setCursorTypes.length-1;t>=0;t--)if(this._setCursorTypes[t]===e){this._setCursorTypes.splice(t,1),this.updateCursor();break}}updateCursor(){this._setCursorTypes?.length==0?this.context.domElement.style.cursor="default":this.context.domElement.style.cursor=this._setCursorTypes[this._setCursorTypes.length-1]}getIsPointerIdInUse(e){for(const t of this._pointerEventsPressed)if(t.pointerId===e&&t.used)return!0;return!1}getPointerPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&e++;return e}getPointerPosition(e){return e>=this._pointerPositions.length?null:this._pointerPositions[e]}getPointerPositionLastFrame(e){return e>=this._pointerPositionsLastFrame.length?null:this._pointerPositionsLastFrame[e]}getPointerPositionDelta(e){return e>=this._pointerPositionsDelta.length?null:this._pointerPositionsDelta[e]}getPointerPositionRC(e){return e>=this._pointerPositionsRC.length?null:this._pointerPositionsRC[e]}getPointerDown(e){return e>=this._pointerDown.length?!1:this._pointerDown[e]}getPointerUp(e){return e>=this._pointerUp.length?!1:this._pointerUp[e]}getPointerPressed(e){return e>=this._pointerPressed.length?!1:this._pointerPressed[e]}getPointerClicked(e){return e>=this._pointerClick.length?!1:this._pointerClick[e]}getPointerDoubleClicked(e){return e>=this._pointerDoubleClick.length?!1:this._pointerDoubleClick[e]}getPointerDownTime(e){return e>=this._pointerDownTime.length?-1:this._pointerDownTime[e]}getPointerUpTime(e){return e>=this._pointerUpTime.length?-1:this._pointerUpTime[e]}getPointerLongPress(e){return e>=this._pointerDownTime.length?!1:this.getPointerPressed(e)&&this.context.time.time-this._pointerDownTime[e]>this._longPressTimeThreshold}getIsMouse(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="mouse"}getIsTouch(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="touch"}getTouchesPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&this.getIsTouch(t)&&e++;return e}getMouseWheelChanged(e=0){return e>=this._mouseWheelChanged.length?!1:this._mouseWheelChanged[e]}getMouseWheelDeltaY(e=0){return e>=this._mouseWheelDeltaY.length?0:this._mouseWheelDeltaY[e]}getPointerEvent(e){if(!(e>=this._pointerEvent.length))return this._pointerEvent[e]??void 0}*foreachPointerId(e){for(let t=0;t<this._pointerTypes.length;t++)if(this._pointerIsActive(t)){if(e!==void 0){const i=this._pointerTypes[t];if(Array.isArray(e)){let n=!1;for(const o of e)if(i===o){n=!0;break}if(!n)continue}else if(e!==i)continue}yield t}}*foreachTouchId(){for(let e=0;e<this._pointerTypes.length;e++)this._pointerTypes[e]==="touch"&&this._pointerIsActive[e]&&(yield e)}_pointerIsActive(e){return e<0?!1:this._pointerPressed[e]||this._pointerDown[e]||this._pointerUp[e]}context;_pointerDown=[!1];_pointerUp=[!1];_pointerClick=[!1];_pointerDoubleClick=[!1];_pointerPressed=[!1];_pointerPositions=[new c.Vector2];_pointerPositionsLastFrame=[new c.Vector2];_pointerPositionsDelta=[new c.Vector2];_pointerPositionsRC=[new c.Vector2];_pointerPositionDown=[new c.Vector3];_pointerDownTime=[];_pointerUpTime=[];_pointerUpTimestamp=[];_pointerIds=[];_pointerTypes=[""];_mouseWheelChanged=[!1];_mouseWheelDeltaY=[0];_pointerEvent=[];_pointerEventsPressed=[];_pointerSpace=[];_pressedStack=new Map;onDownButton(e,t){let i=this._pressedStack.get(e);i||(i=[],this._pressedStack.set(e,i)),i.push(t)}onReleaseButton(e,t){const i=this._pressedStack.get(e);if(!i)return;const n=i.indexOf(t);n>=0&&i.splice(n,1)}getFirstPressedButtonForPointer(e){const t=this._pressedStack.get(e);if(t)return t[0]}getLatestPressedButtonForPointer(e){const t=this._pressedStack.get(e);if(t)return t[t.length-1]}getKeyDown(e){if(e!==void 0)return this.isKeyDown(e);for(const t in this.keysPressed){const i=this.keysPressed[t];if(i.startFrame===this.context.time.frameCount)return i.key}return null}getKeyPressed(e){if(e!==void 0)return this.isKeyPressed(e);for(const t in this.keysPressed){const i=this.keysPressed[t];if(i.pressed)return i.key}return null}getKeyUp(e){if(e!==void 0)return this.isKeyUp(e);for(const t in this.keysPressed){const i=this.keysPressed[t];return i.pressed===!1&&i.frame===this.context.time.frameCount}return null}isKeyDown(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyDown(n))return!0;return!1}const i=this.keysPressed[e];return i?i.startFrame===this.context.time.frameCount&&i.pressed:!1}isKeyUp(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyUp(n))return!0;return!1}const i=this.keysPressed[e];return i?i.frame===this.context.time.frameCount&&i.pressed===!1:!1}isKeyPressed(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyPressed(n))return!0;return!1}const i=this.keysPressed[e];return i&&i.pressed||!1}getCodeForCommonKeyName(e){if(e.length===1){if(e>="0"&&e<="9")return["Digit"+e];if(e>="a"&&e<="z")return["Key"+e.toUpperCase()];if(e==" ")return["Space"]}switch(e){case"shift":case"Shift":return["ShiftLeft","ShiftRight"];case"control":case"Control":return["ControlLeft","ControlRight"];case"alt":case"Alt":return["AltLeft","AltRight"]}return null}createInputEvent(e){switch(e.type){case"pointerdown":Xe&&Ce("Create Pointer down"),this.onDownButton(e.deviceIndex,e.button),this.onDown(e);break;case"pointermove":Xe&&Ce("Create Pointer move"),this.onMove(e);break;case"pointerup":Xe&&Ce("Create Pointer up"),this.onUp(e),this.onReleaseButton(e.deviceIndex,e.button);break}}convertScreenspaceToRaycastSpace(e){return e.x=(e.x-this.context.domX)/this.context.domWidth*2-1,e.y=-((e.y-this.context.domY)/this.context.domHeight)*2+1,e}constructor(e){this.context=e,this.context.post_render_callbacks.push(this.onEndOfFrame)}_htmlEventSource;bindEvents(){this.unbindEvents(),this._htmlEventSource=this.context.renderer.domElement,window.addEventListener("contextmenu",this.onContextMenu),this._htmlEventSource.addEventListener("pointerdown",this.onPointerDown,{passive:!0}),window.addEventListener("pointermove",this.onPointerMove,{passive:!0,capture:!0}),window.addEventListener("pointerup",this.onPointerUp,{passive:!0}),window.addEventListener("pointercancel",this.onPointerCancel,{passive:!0}),window.addEventListener("touchstart",this.onTouchStart,{passive:!0}),window.addEventListener("touchmove",this.onTouchMove,{passive:!0}),window.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this._htmlEventSource.addEventListener("wheel",this.onMouseWheel,{passive:!0}),window.addEventListener("wheel",this.onWheelWindow,{passive:!0}),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keypress",this.onKeyPressed,!1),window.addEventListener("keyup",this.onKeyUp,!1),window.addEventListener("blur",this.onLostFocus)}unbindEvents(){for(const e in this._eventListeners)this._eventListeners[e].length=0;window.removeEventListener("contextmenu",this.onContextMenu),this._htmlEventSource?.removeEventListener("pointerdown",this.onPointerDown),window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerCancel),window.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd),this._htmlEventSource?.removeEventListener("wheel",this.onMouseWheel,!1),window.removeEventListener("wheel",this.onWheelWindow,!1),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keypress",this.onKeyPressed,!1),window.removeEventListener("keyup",this.onKeyUp,!1),window.removeEventListener("blur",this.onLostFocus)}dispose(){const e=this.context.post_render_callbacks.indexOf(this.onEndOfFrame);e>=0&&this.context.post_render_callbacks.splice(e,1),this.unbindEvents()}onLostFocus=()=>{for(const e in this.keysPressed)this.keysPressed[e].pressed=!1};_receivedPointerMoveEventsThisFrame=new Array;onEndOfFrame=()=>{this._receivedPointerMoveEventsThisFrame.length=0;for(let e=0;e<this._pointerUp.length;e++)this._pointerUp[e]=!1;for(let e=0;e<this._pointerDown.length;e++)this._pointerDown[e]=!1;for(let e=0;e<this._pointerClick.length;e++)this._pointerClick[e]=!1;for(let e=0;e<this._pointerDoubleClick.length;e++)this._pointerDoubleClick[e]=!1;for(const e of this._pointerPositionsDelta)e.set(0,0);for(let e=0;e<this._mouseWheelChanged.length;e++)this._mouseWheelChanged[e]=!1;for(let e=0;e<this._mouseWheelDeltaY.length;e++)this._mouseWheelDeltaY[e]=0};canReceiveInput(e){return e.target===this.context.renderer?.domElement||e.target===this.context.domElement||this.context.isInAR||this.context.isInAR&&e.target===document.body&&exports.DeviceUtilities.isMozillaXR()?!0:(Xe&&console.warn("CanReceiveInput:False for",e.target),!1)}onContextMenu=e=>{this.canReceiveInput(e)!==!1&&e instanceof PointerEvent&&e.pointerType};keysPressed={};onKeyDown=e=>{if(Xe&&console.log(`key down ${e.code}, ${this.context.application.hasFocus}`,e),!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(t&&t.pressed)return;this.keysPressed[e.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:e.key,code:e.code};const i=new wl("keydown",e,e);this.onDispatchEvent(i)};onKeyPressed=e=>{if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(!t)return;t.pressed=!0,t.frame=this.context.time.frameCount+1;const i=new wl("keypress",e,e);this.onDispatchEvent(i)};onKeyUp=e=>{if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(!t)return;t.pressed=!1,t.frame=this.context.time.frameCount+1;const i=new wl("keyup",e,e);this.onDispatchEvent(i)};onWheelWindow=e=>{document.pointerLockElement&&this.onMouseWheel(e)};onMouseWheel=e=>{if(this.canReceiveInput(e)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const t=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=t+e.deltaY};onPointerDown=e=>{if(this.context.isInAR||this.canReceiveInput(e)===!1)return;e.target instanceof HTMLElement&&e.target.setPointerCapture(e.pointerId);const t=this.getPointerId(e);Xe&&Ce(`pointer down #${t}, identifier:${e.pointerId}`);const i=this.getAndUpdateSpatialObjectForScreenPosition(t,e.clientX,e.clientY),n=new Zn("pointerdown",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:t,button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:i,pressure:e.pressure});this.onDown(n)};onPointerMove=e=>{if(this.context.isInAR||this._receivedPointerMoveEventsThisFrame.includes(e.pointerId))return;this._receivedPointerMoveEventsThisFrame.push(e.pointerId);let t=e.button;e.pointerType==="mouse"&&(t=this.getFirstPressedButtonForPointer(0)??0);const i=this.getPointerId(e,t);t===-1&&(t=i);const n=this.getAndUpdateSpatialObjectForScreenPosition(i,e.clientX,e.clientY),o=new Zn("pointermove",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:i,button:t,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:n,pressure:e.pressure});this.onMove(o)};onPointerCancel=e=>{this.context.isInAR||(Xe&&console.log("Pointer cancel",e),this.onPointerUp(e))};onPointerUp=e=>{if(this.context.isInAR)return;e.target instanceof HTMLElement&&e.target.releasePointerCapture(e.pointerId);const t=this.getPointerId(e),i=new Zn("pointerup",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:t,button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:this.getAndUpdateSpatialObjectForScreenPosition(t,e.clientX,e.clientY),pressure:e.pressure});this.onUp(i),this._pointerIds[t]=-1,Xe&&console.log("ID="+t,"PointerId="+e.pointerId,"ALL:",[...this._pointerIds])};getPointerId(e,t){return e.pointerType==="mouse"?0+(t??e.button):this.getPointerIndex(e.pointerId)}getButtonName(e){const t=e.button;if(e.pointerType==="mouse")switch(t){case 0:return"left";case 1:return"middle";case 2:return"right"}return"unknown"}onTouchStart=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),o=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),r=new Zn("pointerdown",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:o,pressure:i.force});this.onDown(r)}};onTouchMove=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),o=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),r=new Zn("pointermove",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:o,pressure:i.force});this.onMove(r)}};onTouchEnd=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),o=new Zn("pointerup",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),pressure:i.force});this.onUp(o),this._pointerIds[n]=-1}};tempNearPlaneVector=new c.Vector3;tempFarPlaneVector=new c.Vector3;tempLookMatrix=new c.Matrix4;getAndUpdateSpatialObjectForScreenPosition(e,t,i){let n=this._pointerSpace[e];n||(n=new c.Object3D,this._pointerSpace[e]=n),this._pointerSpace[e]=n;const o=this.context.mainCamera;if(o){const r=this.tempNearPlaneVector.set(t,i,-1);this.convertScreenspaceToRaycastSpace(r);const a=this.tempFarPlaneVector.set(r.x,r.y,1);r.unproject(o),a.unproject(o);const l=o.worldUp||j(0,1,0).applyQuaternion(ue(o));this.tempLookMatrix.lookAt(a,r,l),n.position.set(r.x,r.y,r.z),n.quaternion.setFromRotationMatrix(this.tempLookMatrix)}return n}isInRect(e){if(this.context.isInXR)return!0;const t=this.context.domElement.getBoundingClientRect(),i=e.clientX,n=e.clientY,o=i>=t.x&&i<=t.right&&n>=t.y&&n<=t.bottom;return Xe&&!o&&console.log("Not in rect",t,i,n),o}onDown(e){const t=e.pointerId;if(this.getPointerPressed(t)&&console.warn(`Received pointerDown for pointerId that is already pressed: ${t}`,Xe?e:""),Xe&&console.log(e.pointerType,"DOWN",t),!!this.isInRect(e)){for(this.setPointerState(t,this._pointerPressed,!0),this.setPointerState(t,this._pointerDown,!0),this.setPointerStateT(t,this._pointerEvent,e.source);t>=this._pointerTypes.length;)this._pointerTypes.push(e.pointerType);for(this._pointerTypes[t]=e.pointerType;t>=this._pointerPositionDown.length;)this._pointerPositionDown.push(new c.Vector3);for(this._pointerPositionDown[t].set(e.clientX,e.clientY,e.clientZ??0);t>=this._pointerPositions.length;)this._pointerPositions.push(new c.Vector2);this._pointerPositions[t].set(e.clientX,e.clientY),t>=this._pointerDownTime.length&&this._pointerDownTime.push(0),this._pointerDownTime[t]=this.context.time.realtimeSinceStartup,this.updatePointerPosition(e),this._pointerEventsPressed.push(e),this.onDispatchEvent(e)}}onMove(e){const t=e.pointerId,i=this.getPointerPressed(t);i===!1&&!this.isInRect(e)||e.pointerType==="touch"&&!i||(this.updatePointerPosition(e),this.setPointerStateT(t,this._pointerEvent,e.source),this.onDispatchEvent(e))}onUp(e){const t=e.pointerId;if(!this.getPointerPressed(t)){Xe&&console.log(e.pointerType,"UP",t,"was not down");return}Xe&&console.log(e.pointerType,"UP",t),this.setPointerState(t,this._pointerPressed,!1),this.setPointerStateT(t,this._pointerEvent,e.source),this.setPointerState(t,this._pointerUp,!0),this.updatePointerPosition(e);for(let l=this._pointerEventsPressed.length-1;l>=0;l--)if(this._pointerEventsPressed[l].pointerId===t){this._pointerEventsPressed.splice(l,1);break}if(!this._pointerPositionDown[t]){Xe&&de("Received pointer up event without matching down event for button: "+t),console.warn("Received pointer up event without matching down event for button: "+t);return}const n=this._pointerUpTime[t],o=this._pointerDownTime[t],r=this.context.time.realtimeSinceStartup,a=r-o;if(t>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),this._pointerUpTime[t]=r,a<1){let l=e.clientX-this._pointerPositionDown[t].x,h=e.clientY-this._pointerPositionDown[t].y,d=0;if(e.isSpatial&&e.clientZ!=null&&(d=e.clientZ-this._pointerPositionDown[t].z,l*=200,h*=200,d*=200),Math.abs(l)<5&&Math.abs(h)<5&&Math.abs(d)<5){this.setPointerState(t,this._pointerClick,!0),e.isClick=!0;const u=r-n;Xe&&console.log("CLICK",t,l,h,d,u),u<this._doubleClickTimeThreshold&&u>0&&(this.setPointerState(t,this._pointerDoubleClick,!0),e.isDoubleClick=!0)}}this.onDispatchEvent(e)}updatePointerPosition(e){const t=e.pointerId;for(;t>=this._pointerPositions.length;)this._pointerPositions.push(new c.Vector2);for(;t>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new c.Vector2);for(;t>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new c.Vector2);const i=this._pointerPositionsLastFrame[t];i.copy(this._pointerPositions[t]);const n=this._pointerPositionsDelta[t];let o=e.clientX-i.x,r=e.clientY-i.y;if(e.source instanceof MouseEvent||e.source instanceof TouchEvent){const d=e.source;o===0&&d.movementX!==0&&(o=d.movementX||0),r===0&&d.movementY!==0&&(r=d.movementY||0)}n.x+=o,n.y+=r,this._pointerPositions[t].x=e.clientX,this._pointerPositions[t].y=e.clientY;const a=e.clientX,l=e.clientY;for(;t>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new c.Vector2);const h=this._pointerPositionsRC[t];h.set(a,l),this.convertScreenspaceToRaycastSpace(h)}getPointerIndex(e){let t=-1;for(let i=0;i<this._pointerIds.length;i++){if(this._pointerIds[i]===e)return i;t===-1&&this._pointerIds[i]===-1&&(t=i)}return t!==-1?(this._pointerIds[t]=e,t):(Xe&&console.log("PUSH pointerId:",e),this._pointerIds.push(e),this._pointerIds.length-1)}setPointerState(e,t,i){t[e]=i}setPointerStateT(e,t,i){return t[e]=i,i}onDispatchEvent(e){const t=z.Current;try{z.Current=this.context,this.dispatchEvent(e)}finally{z.Current=t}}}const oa=new c.Matrix4().makeRotationY(Math.PI),ki=new c.Quaternion().setFromAxisAngle(new c.Vector3(0,1,0),Math.PI),US=x("debugwebxr");class zS{priority=-1e5;gameObject;isXRRig(){return!0}get isActive(){return this.gameObject.visible}constructor(){if(this.gameObject=new c.Object3D,this.gameObject.name="Implicit XR Rig",US){const e=Rm(16733661);e.position.y+=.5,this.gameObject.add(e)}}}const $n=x("debugwebxr"),bh=x("debugcustomgesture"),NS="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",VS="generic-trigger",$S=new c.Quaternion().setFromEuler(new c.Euler(c.MathUtils.degToRad(0),c.MathUtils.degToRad(-90),c.MathUtils.degToRad(-90))),WS=new c.Vector3(.04,-.04,0);class Cm{xr;get context(){return this.xr.context}inputSource;index=0;emitEvents=!0;get connected(){return this._connected}_connected=!0;get isTracking(){return this._isTracking}_isTracking=!1;get gamepad(){return this.__gamepad??=this.inputSource.gamepad}__gamepad;get isHand(){return this.hand!=null}get hand(){return this.__hand??=this.inputSource.hand}__hand;get handObject(){return this.context.renderer.xr.getHand(this.index)}get profiles(){return this.inputSource.profiles}get layout(){return this._layout}get targetRayMode(){return this.inputSource.targetRayMode}get targetRaySpace(){return this.inputSource.targetRaySpace}get gripSpace(){return this.inputSource.gripSpace}get side(){return this.__side??=this.inputSource.handedness}__side=void 0;get isRight(){return this.side==="right"}get isLeft(){return this.side==="left"}get isStylus(){return this._isMxInk}getHitTestSource(){return this._hitTestSource||this._requestHitTestSource(),this._hitTestSource}get hasHitTestSource(){return this._hitTestSource}cancelHitTestSource(){this._hitTestSource&&(this._hitTestSource.cancel(),this._hitTestSource=void 0)}_hitTestSource=void 0;_hasSelectEvent=!1;get hasSelectEvent(){return this._hasSelectEvent}_isMxInk=!1;_isMetaQuestTouchController=!1;getHitTest(){return this.xr.getHitTest(this)}_handJointPoses=new Map;getHandJointPose(e,t){if(t=t||this.xr.frame,!this.hand||!t?.getJointPose||!this.xr.referenceSpace)return null;let i=this._handJointPoses?.get(e);return i||(i=t.getJointPose(e,this.xr.referenceSpace),i&&this._handJointPoses.set(e,i),i)}_gripMatrix=new c.Matrix4;_gripPosition=new c.Vector3;_gripQuaternion=new c.Quaternion;_linearVelocity=new c.Vector3;_rayPositionRaw=new c.Vector3;_rayRotationRaw=new c.Quaternion;_rayMatrix=new c.Matrix4;_rayPosition=new c.Vector3;_rayQuaternion=new c.Quaternion;get gripPosition(){return j(this._gripPosition)}get gripQuaternion(){return qt(this._gripQuaternion)}get gripMatrix(){return this._gripMatrix}get gripLinearVelocity(){return j(this._linearVelocity).applyQuaternion(ki)}get rayPosition(){return j(this._rayPosition)}get rayQuaternion(){return qt(this._rayQuaternion)}get gripWorldPosition(){return j(this._gripWorldPosition)}_gripWorldPosition=new c.Vector3;get gripWorldQuaternion(){return qt(this._gripWorldQuaternion)}_gripWorldQuaternion=new c.Quaternion;get rayWorldPosition(){return j(this._rayWorldPosition)}_rayWorldPosition=new c.Vector3;updateRayWorldPosition(){const e=this.xr.context.mainCamera?.parent;this._rayWorldPosition.copy(this._rayPositionRaw),e&&this._rayWorldPosition.applyMatrix4(e.matrixWorld)}get rayWorldQuaternion(){return qt(this._rayWorldQuaternion)}_rayWorldQuaternion=new c.Quaternion;get pinchPosition(){return j(this._pinchPosition)}_pinchPosition=new c.Vector3;updateRayWorldQuaternion(){const e=this.xr.context.mainCamera?.parent,t=e?ue(e):void 0;this._rayWorldQuaternion.copy(this._rayRotationRaw).multiply(ki),t&&this._rayWorldQuaternion.premultiply(t)}get ray(){return this._ray.origin.copy(this.rayWorldPosition),this._ray.direction.copy(j(0,0,1).applyQuaternion(this.rayWorldQuaternion)),this._ray}_ray;_hand_wristDotUp=void 0;get handWristDotUp(){if(this._hand_wristDotUp!==void 0)return this._hand_wristDotUp;const e=this.handObject?.joints.wrist;if(e){const t=j(0,1,0).applyQuaternion(e.quaternion),i=j(0,1,0).dot(t);return this._hand_wristDotUp=i}}get isHandUpsideDown(){return this.handWristDotUp!==void 0?this.handWristDotUp<-.7:!1}get isTeleportGesture(){return this.isHandUpsideDown&&this.getGesture("pinch")?.isDown}get object(){return this._object}_object;_gripSpaceObject;_raySpaceObject;model=null;_debugAxesHelper=new c.AxesHelper(.15);_debugGripAxesHelper=new c.AxesHelper(.07);_debugRayAxesHelper=new c.AxesHelper(.07);async getModelUrl(){return this.getMotionController?.then(e=>e?.assetUrl||null)}constructor(e,t,i){this.xr=e,this.inputSource=t,this.index=i,this._object=new c.Object3D,this._object.name=`NeedleXRController_${i}`,$n&&(this._object.add(this._debugAxesHelper),this._gripSpaceObject=new c.Object3D,this._raySpaceObject=new c.Object3D,this._gripSpaceObject.name=`NeedleXRController_${i}_gripSpace`,this._raySpaceObject.name=`NeedleXRController_${i}_raySpace`,this._gripSpaceObject.add(this._debugGripAxesHelper),this._raySpaceObject.add(this._debugRayAxesHelper),this.xr.context.scene.add(this._gripSpaceObject),this.xr.context.scene.add(this._raySpaceObject)),this.xr.context.scene.add(this._object),this._ray=new c.Ray,this.pointerInit={origin:this,pointerType:this.hand?"hand":"controller",deviceIndex:this.index,pointerId:-1,mode:this.inputSource.targetRayMode,ray:this._ray,device:this._object,buttonName:"none"},this.initialize(),this.subscribeEvents()}_hitTestSourcePromise=null;_requestHitTestSource(){return this._hitTestSourcePromise?this._hitTestSourcePromise:this.xr.mode==="immersive-ar"&&this.inputSource.targetRayMode==="tracked-pointer"&&this.xr.session.requestHitTestSourceForTransientInput?this._hitTestSourcePromise=this.xr.session.requestHitTestSourceForTransientInput({profile:this.inputSource.profiles[0],offsetRay:new XRRay})?.then(e=>(this._hitTestSourcePromise=null,this.connected?this._hitTestSource=e:(e.cancel(),null)))??null:null}onPointerHits=e=>{};onUpdate(e){this.onUpdateFrame(e),this.updateInputEvents(),this.onUpdateMove()}onRenderDebug(){B.DrawSphere(this.rayWorldPosition,.003),B.DrawDirection(this.rayWorldPosition,j(0,0,10).applyQuaternion(this.rayWorldQuaternion));const t=(this.inputSource.gripSpace?this.gripWorldPosition:this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(.1)),i=this.inputSource.profiles.join(`
|
|
146
146
|
`);let n=`Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
|
|
147
147
|
C:${this.connected?"x":"-"} T:${this.isTracking?"x":"-"} Hand:${this.inputSource.hand?"x":"-"} Pen: ${this._isMxInk?"x":"-"}`;if(this.inputSource.hand&&(n+=`
|
|
@@ -1399,7 +1399,7 @@ If you need multisampling consider changing 'auto' to a fixed value (e.g. 4).`))
|
|
|
1399
1399
|
}
|
|
1400
1400
|
}
|
|
1401
1401
|
`}}var uE=Object.defineProperty,fE=Object.getOwnPropertyDescriptor,sh=(s,e,t,i)=>{for(var n=i>1?void 0:i?fE(e,t):e,o=s.length-1,r;o>=0;o--)(r=s[o])&&(n=(i?r(e,t,n):r(n))||n);return i&&n&&uE(e,t,n),n};const dt=x("debugscreensharing");var Fw=(s=>(s[s.Screen=0]="Screen",s[s.Camera=1]="Camera",s[s.Canvas=2]="Canvas",s[s.Microphone=3]="Microphone",s))(Fw||{});class bo extends M{allowStartOnClick=!0;onPointerEnter(){this.context.connection.allowEditing!=!1&&this.allowStartOnClick&&this.context.input.setCursor("pointer")}onPointerExit(){this.context.connection.allowEditing!=!1&&this.allowStartOnClick&&this.context.input.unsetCursor("pointer")}onPointerClick(e){if(this.context.connection.allowEditing!=!1&&this.allowStartOnClick&&!(e&&e.pointerId!==0)){if(this.isReceiving&&this.videoPlayer?.isPlaying){this.videoPlayer&&(this.videoPlayer.screenspace=!this.videoPlayer.screenspace);return}if(this.isSending){this.close();return}this.share()}}autoConnect=!1;set videoPlayer(e){this._videoPlayer&&(this.isSending||this.isReceiving)&&this._videoPlayer.stop(),this._videoPlayer=e,this._videoPlayer&&this._currentStream&&(this.isSending||this.isReceiving)&&this._videoPlayer.setVideo(this._currentStream)}get videoPlayer(){return this._videoPlayer}_videoPlayer;_audioSource;get screenspace(){return this.videoPlayer?.screenspace??!1}set screenspace(e){this.videoPlayer&&(this.videoPlayer.screenspace=e)}device="Screen";deviceName;deviceFilter;get currentScream(){return this._currentStream}get currentMode(){return this._currentMode}get isSending(){return this._currentStream?.active&&this._currentMode===1}get isReceiving(){if(this._currentMode===2){if(!this._currentStream||this._currentStream.active===!1)return!1;const e=this._currentStream.getTracks();for(const t of e)if(t.readyState==="live")return!0}return!1}get requiresVideoPlayer(){return this.device!=="Microphone"}_net;_requestOpen=!1;_currentStream=null;_currentMode=0;awake(){typeof this.device=="number"&&(this.device=Fw[this.device]),dt&&console.log("Screensharing",this.name,this),pi.registerWaitForAllowAudio(()=>{this._videoPlayer&&this._currentStream&&this._currentMode===2&&(this._videoPlayer.playInBackground=!0,this._videoPlayer.setVideo(this._currentStream))}),this._net=new Lc(this)}onEnable(){this._net?.enable(),this._net?.addEventListener(kn.StreamReceived,this.onReceiveStream),this._net?.addEventListener(kn.StreamEnded,this.onCallEnded),this.context.connection.beginListen(Q.JoinedRoom,this.onJoinedRoom),this.autoConnect&&In(1e3).then(()=>(this.enabled&&this.autoConnect&&!this.isReceiving&&!this.isSending&&this.context.connection.isInRoom&&this.share(),0))}onDisable(){this._net?.removeEventListener(kn.StreamReceived,this.onReceiveStream),this._net?.removeEventListener(kn.StreamEnded,this.onCallEnded),this.context.connection.stopListen(Q.JoinedRoom,this.onJoinedRoom),this._net?.disable(),this.close()}onJoinedRoom=async()=>{await In(1e3),this.autoConnect&&!this.isSending&&!this.isReceiving&&this.context.connection.isInRoom&&this.share()};_ensureVideoPlayer(){const e=new Ze;e.aspectMode=Iw.AdjustWidth,S.addComponent(this.gameObject,e),this._videoPlayer=e}_activeShareRequest=null;async share(e){return this._activeShareRequest?this._activeShareRequest:(this._activeShareRequest=this.internalShare(e),this._activeShareRequest.then(()=>this._activeShareRequest=null))}async internalShare(e){if(this.context.connection.isInRoom===!1){console.warn("Can not start screensharing: requires network connection"),T()&&de("Can not start screensharing: requires network connection. Add a SyncedRoom component or join a room first.");return}if(e?.device&&(this.device=e.device),!this.videoPlayer&&this.requiresVideoPlayer&&(this._videoPlayer||(this._videoPlayer=S.getComponent(this.gameObject,Ze)??void 0),this.videoPlayer||this._ensureVideoPlayer(),!this.videoPlayer)){console.warn("Can not share video without a videoPlayer assigned");return}this._requestOpen=!0;try{const t=e?.constraints??{echoCancellation:!0,autoGainControl:!1},i={video:t,audio:t},n=i.video;switch(n!==void 0&&typeof n!="boolean"&&(n.width||(n.width={max:1920}),n.height||(n.height={max:1920}),n.aspectRatio||(n.aspectRatio={ideal:1.7777777778}),n.frameRate||(n.frameRate={ideal:24}),n.facingMode||(n.facingMode={ideal:"user"})),this.device){case"Camera":this.tryShareUserCamera(i,e);break;case"Screen":{if(!navigator.mediaDevices.getDisplayMedia){console.error("No getDisplayMedia support");return}const a=await navigator.mediaDevices.getDisplayMedia(i);this._requestOpen?this.setStream(a,1):En(a)}break;case"Canvas":const r=this.context.renderer.domElement.captureStream(0);this.setStream(r,1);break;case"Microphone":{if(!navigator.mediaDevices.getUserMedia){console.error("No getDisplayMedia support");return}i.video=!1;const a=await navigator.mediaDevices.getUserMedia(i);this._requestOpen?this.setStream(a,1):En(a)}break;default:console.error("Can not start screen sharing: Unknown device type",this.device)}}catch(t){if(t.name==="NotAllowedError"){console.log("Selection cancelled"),this._requestOpen=!1;return}console.error("Error opening video",t)}}close(){this._requestOpen=!1,this._currentStream&&(dt&&console.warn("Close current stream / disposing resources, stream was active?",this._currentStream.active),this._net?.stopSendingStream(this._currentStream),En(this._currentStream),this._currentMode=0,this._currentStream=null)}setStream(e,t){if(e===this._currentStream||(this.close(),!e))return;this._currentStream=e,this._requestOpen=!0,this._currentMode=t;const i=this.device!=="Microphone",n=t===1;i?(this._videoPlayer||this._ensureVideoPlayer(),this._videoPlayer?this._videoPlayer.setVideo(e):console.error("No video player assigned for video stream")):(this._audioSource||(this._audioSource=new pi,this._audioSource.spatialBlend=0,this._audioSource.volume=1,this.gameObject.addComponent(this._audioSource)),n||(dt&&console.log("PLAY",e.getAudioTracks()),this._audioSource.volume=1,this._audioSource?.play(e))),n&&this._net?.startSendingStream(e),n&&(this._videoPlayer&&(this._videoPlayer.muted=!0),this._audioSource?.stop());for(const o of e.getTracks())o.addEventListener("ended",()=>{dt&&console.log("Track ended",o),this.close()}),dt&&o.kind==="video"&&console.log(n?"Video →":"Video ←",o.getSettings())}onReceiveStream=e=>{e.stream?.active===!0&&this.setStream(e.stream,2)};onCallEnded=e=>{dt&&console.log("CALL ENDED",this.isReceiving,this?.screenspace),this.isReceiving&&(this.screenspace=!1)};async tryShareUserCamera(e,t){const i=(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput");dt&&console.log(`Request camera. These are your kind:videoinput devices:
|
|
1402
|
-
`,i);let n=!1;for(const o of i)try{if(!this._requestOpen){dt&&console.log("Camera selection cancelled");break}if(o.kind!=="videoinput"){dt&&console.log("Skipping non-video device",o);continue}const r=o.deviceId;if(t?.deviceId!=null||t?.deviceFilter!=null){if(t?.deviceId!==void 0&&r!==t.deviceId){dt&&console.log("Skipping device due to options.deviceId: "+o.label+"; "+o.deviceId);continue}if(t?.deviceFilter&&t.deviceFilter(o)===!1){dt&&console.log("Skipping device due to options.deviceFilter: "+o.label+"; "+o.deviceId);continue}}else if(this.deviceFilter)if(this.deviceFilter(o)===!1){dt&&console.log("Skipping device due to ScreenShare.deviceFilter: "+o.label+"; "+o.deviceId);continue}else dt&&console.log("Selected device by filter",o);else if(this.deviceName){const h=o.label.toLowerCase(),d=this.deviceName.toLowerCase(),u=h.includes(d),p=o.deviceId===this.deviceName;if(!u&&!p){dt&&console.log("Skipping device due to ScreenShare.deviceName: "+o.label+"; "+o.deviceId);continue}else dt&&console.log("Selected device by name",o)}e.video!==!1&&((typeof e.video>"u"||typeof e.video=="boolean")&&(e.video={}),e.video.deviceId=r),n=!0;const l=await navigator.mediaDevices.getUserMedia(e).catch(h=>(console.error("Failed to get user media",h),null));if(l===null)continue;this._requestOpen?(this.setStream(l,1),dt&&console.log("Selected camera",o)):(En(l),dt&&console.log("Camera selection cancelled"));break}catch(r){if(r.message==="Failed to allocate videosource"||r.message==="Could not start video source"){de("Failed to start video: Try another camera (Code "+r.code+")"),console.warn(r);continue}else console.error("Failed to get user media",r.message,r.code,r)}!n&&T()&&(de("No camera found for sharing. Please connect a camera (see console for more information)"),console.warn("No camera found for sharing. Please connect a camera",i,this.deviceName,"Using deviceFilter? "+this.deviceFilter!=null,"Using options? "+t!=null,"Using deviceName? "+this.deviceName!=null,"Using options.deviceId? "+t?.deviceId!=null,"Using options.deviceFilter? "+t?.deviceFilter!=null))}}sh([f()],bo.prototype,"allowStartOnClick",2);sh([f()],bo.prototype,"autoConnect",2);sh([f(Ze)],bo.prototype,"videoPlayer",1);sh([f()],bo.prototype,"device",2);sh([f()],bo.prototype,"deviceName",2);var pE=Object.defineProperty,Wa=(s,e,t,i)=>{for(var n=void 0,o=s.length-1,r;o>=0;o--)(r=s[o])&&(n=r(e,t,n)||n);return n&&pE(e,t,n),n};const mE=x("debugseethrough");let gE=0;class ws extends M{referencePoint=null;fadeDuration=.05;minAlpha=0;useAlphaHash=!0;set needsUpdate(e){this._needsUpdate=e}get needsUpdate(){return this._needsUpdate}overrideAlpha=-1;autoUpdate=!0;_referencePointVector=new c.Vector3;_referencePointDir=new c.Vector3;_distance=0;_renderer=null;_needsUpdate=!0;_id=gE++;onEnable(){this._needsUpdate=!0,this._renderer=null,Ql.components.push(this)}onDisable(){this._renderer?.forEach(t=>{const i=this.rendererMaterialsOriginal.get(t);for(let n=0;n<t.sharedMaterials.length;n++)t.sharedMaterials[n]&&i&&i[n]&&(t.sharedMaterials[n]=i[n]);this.rendererMaterials.delete(t),this.rendererMaterialsOriginal.delete(t)});const e=Ql.components.indexOf(this);e!==-1&&Ql.components.splice(e,1)}update(){if(this._needsUpdate?(this._needsUpdate=!1,this._renderer=this.gameObject.getComponentsInChildren(Ut),this.updateDirection()):this.autoUpdate&&(this.context.time.frame+this._id)%20===0&&this.updateDirection(),!this.autoUpdate||!this.referencePoint)return;const t=this._referencePointDir.dot(this.context.mainCamera.worldForward)>.2;if(mE&&this.referencePoint){const i=this.gameObject.worldPosition;B.DrawArrow(j(i),i.sub(this._referencePointDir),t?16711680:65280),B.DrawWireSphere(this.referencePoint.worldPosition,.05,255)}t?this.updateAlpha(this.minAlpha,this.fadeDuration):this.updateAlpha(1,this.fadeDuration)}rendererMaterials=new WeakMap;rendererMaterialsOriginal=new WeakMap;updateDirection(){this.referencePoint??=this.context.scene,this._referencePointVector.copy(this.gameObject.worldPosition.sub(this.referencePoint.worldPosition)),this._distance=this._referencePointVector.length(),this._referencePointDir.copy(this._referencePointVector).multiply(j(1,.5,1)).normalize()}updateAlpha(e,t=this.fadeDuration){this.overrideAlpha!==void 0&&this.overrideAlpha!==-1&&(e=this.overrideAlpha),this._renderer?.forEach(i=>{if(e<.9?i.gameObject.raycastAllowed=!1:i.gameObject.raycastAllowed=!0,!this.rendererMaterials.has(i)){const o=new Array,r=new Array;for(let a=0;a<i.sharedMaterials.length;a++){const l=i.sharedMaterials[a];if(!l)continue;o.push(l);const h=l.clone();h.userData=l.userData||{},h.userData.seeThrough={initial:{opacity:h.opacity,transparent:h.transparent,alphaHash:h.alphaHash}},r.push(h),i.sharedMaterials[a]=h}this.rendererMaterials.set(i,r),this.rendererMaterialsOriginal.set(i,o)}const n=i.hasLightmap?i.sharedMaterials:this.rendererMaterials.get(i);if(n)for(const o of n){if(!o)continue;let r=I.lerp(o.opacity,e,t<=0?1:this.context.time.deltaTime/t);r>=.99?r=1:r<=.01&&(r=0);const a=o.transparent,l=o.alphaHash;if(o.alphaHash=this.useAlphaHash,o.userData&&"seeThrough"in o.userData){const
|
|
1402
|
+
`,i);let n=!1;for(const o of i)try{if(!this._requestOpen){dt&&console.log("Camera selection cancelled");break}if(o.kind!=="videoinput"){dt&&console.log("Skipping non-video device",o);continue}const r=o.deviceId;if(t?.deviceId!=null||t?.deviceFilter!=null){if(t?.deviceId!==void 0&&r!==t.deviceId){dt&&console.log("Skipping device due to options.deviceId: "+o.label+"; "+o.deviceId);continue}if(t?.deviceFilter&&t.deviceFilter(o)===!1){dt&&console.log("Skipping device due to options.deviceFilter: "+o.label+"; "+o.deviceId);continue}}else if(this.deviceFilter)if(this.deviceFilter(o)===!1){dt&&console.log("Skipping device due to ScreenShare.deviceFilter: "+o.label+"; "+o.deviceId);continue}else dt&&console.log("Selected device by filter",o);else if(this.deviceName){const h=o.label.toLowerCase(),d=this.deviceName.toLowerCase(),u=h.includes(d),p=o.deviceId===this.deviceName;if(!u&&!p){dt&&console.log("Skipping device due to ScreenShare.deviceName: "+o.label+"; "+o.deviceId);continue}else dt&&console.log("Selected device by name",o)}e.video!==!1&&((typeof e.video>"u"||typeof e.video=="boolean")&&(e.video={}),e.video.deviceId=r),n=!0;const l=await navigator.mediaDevices.getUserMedia(e).catch(h=>(console.error("Failed to get user media",h),null));if(l===null)continue;this._requestOpen?(this.setStream(l,1),dt&&console.log("Selected camera",o)):(En(l),dt&&console.log("Camera selection cancelled"));break}catch(r){if(r.message==="Failed to allocate videosource"||r.message==="Could not start video source"){de("Failed to start video: Try another camera (Code "+r.code+")"),console.warn(r);continue}else console.error("Failed to get user media",r.message,r.code,r)}!n&&T()&&(de("No camera found for sharing. Please connect a camera (see console for more information)"),console.warn("No camera found for sharing. Please connect a camera",i,this.deviceName,"Using deviceFilter? "+this.deviceFilter!=null,"Using options? "+t!=null,"Using deviceName? "+this.deviceName!=null,"Using options.deviceId? "+t?.deviceId!=null,"Using options.deviceFilter? "+t?.deviceFilter!=null))}}sh([f()],bo.prototype,"allowStartOnClick",2);sh([f()],bo.prototype,"autoConnect",2);sh([f(Ze)],bo.prototype,"videoPlayer",1);sh([f()],bo.prototype,"device",2);sh([f()],bo.prototype,"deviceName",2);var pE=Object.defineProperty,Wa=(s,e,t,i)=>{for(var n=void 0,o=s.length-1,r;o>=0;o--)(r=s[o])&&(n=r(e,t,n)||n);return n&&pE(e,t,n),n};const mE=x("debugseethrough");let gE=0;class ws extends M{referencePoint=null;fadeDuration=.05;minAlpha=0;useAlphaHash=!0;set needsUpdate(e){this._needsUpdate=e}get needsUpdate(){return this._needsUpdate}overrideAlpha=-1;autoUpdate=!0;_referencePointVector=new c.Vector3;_referencePointDir=new c.Vector3;_distance=0;_renderer=null;_needsUpdate=!0;_id=gE++;onEnable(){this._needsUpdate=!0,this._renderer=null,Ql.components.push(this)}onDisable(){this._renderer?.forEach(t=>{const i=this.rendererMaterialsOriginal.get(t);for(let n=0;n<t.sharedMaterials.length;n++)t.sharedMaterials[n]&&i&&i[n]&&(t.sharedMaterials[n]=i[n]);this.rendererMaterials.delete(t),this.rendererMaterialsOriginal.delete(t)});const e=Ql.components.indexOf(this);e!==-1&&Ql.components.splice(e,1)}update(){if(this._needsUpdate?(this._needsUpdate=!1,this._renderer=this.gameObject.getComponentsInChildren(Ut),this.updateDirection()):this.autoUpdate&&(this.context.time.frame+this._id)%20===0&&this.updateDirection(),!this.autoUpdate||!this.referencePoint)return;const t=this._referencePointDir.dot(this.context.mainCamera.worldForward)>.2;if(mE&&this.referencePoint){const i=this.gameObject.worldPosition;B.DrawArrow(j(i),i.sub(this._referencePointDir),t?16711680:65280),B.DrawWireSphere(this.referencePoint.worldPosition,.05,255)}t?this.updateAlpha(this.minAlpha,this.fadeDuration):this.updateAlpha(1,this.fadeDuration)}rendererMaterials=new WeakMap;rendererMaterialsOriginal=new WeakMap;updateDirection(){this.referencePoint??=this.context.scene,this._referencePointVector.copy(this.gameObject.worldPosition.sub(this.referencePoint.worldPosition)),this._distance=this._referencePointVector.length(),this._referencePointDir.copy(this._referencePointVector).multiply(j(1,.5,1)).normalize()}updateAlpha(e,t=this.fadeDuration){this.overrideAlpha!==void 0&&this.overrideAlpha!==-1&&(e=this.overrideAlpha),this._renderer?.forEach(i=>{if(e<.9?i.gameObject.raycastAllowed=!1:i.gameObject.raycastAllowed=!0,!this.rendererMaterials.has(i)){const o=new Array,r=new Array;for(let a=0;a<i.sharedMaterials.length;a++){const l=i.sharedMaterials[a];if(!l)continue;o.push(l);const h=l.clone();h.userData=l.userData||{},h.userData.seeThrough={initial:{opacity:h.opacity,transparent:h.transparent,alphaHash:h.alphaHash}},r.push(h),i.sharedMaterials[a]=h}this.rendererMaterials.set(i,r),this.rendererMaterialsOriginal.set(i,o)}const n=i.hasLightmap?i.sharedMaterials:this.rendererMaterials.get(i);if(n)for(const o of n){if(!o)continue;let r=I.lerp(o.opacity,e,t<=0?1:this.context.time.deltaTime/t);r>=.99?r=1:r<=.01&&(r=0);const a=o.transparent,l=o.alphaHash,h=o.opacity;if(o.alphaHash=this.useAlphaHash,o.userData&&"seeThrough"in o.userData){const d=o.userData.seeThrough.initial;o.opacity=d.opacity*r,o.transparent=o.opacity>=1?d.transparent:!this.useAlphaHash}else o.transparent=o.opacity>=1?!1:!this.useAlphaHash;(a!==o.transparent||l!==o.alphaHash||o.opacity!==h)&&(o.needsUpdate=!0)}})}}Wa([f(c.Object3D)],ws.prototype,"referencePoint");Wa([f()],ws.prototype,"fadeDuration");Wa([f()],ws.prototype,"minAlpha");Wa([f()],ws.prototype,"useAlphaHash");Wa([f()],ws.prototype,"overrideAlpha");Wa([f()],ws.prototype,"autoUpdate");class Ql{static components=[];get extensionName(){return"SeeThrough"}}const rb=new Ql;nn.beforeExport.addEventListener(s=>{Ql.components.length!==0&&s.exporter.extensions.includes(rb)===!1&&s.exporter.extensions.push(rb)});var yE=Object.defineProperty,Uw=(s,e,t,i)=>{for(var n=void 0,o=s.length-1,r;o>=0;o--)(r=s[o])&&(n=r(e,t,n)||n);return n&&yE(e,t,n),n};class oh extends M{mode=0;shadowColor=new Z(0,0,0,1);targetMesh;start(){if(this.gameObject instanceof c.Mesh)this.gameObject instanceof c.Mesh&&this.gameObject.material&&(this.gameObject.material=this.gameObject.material.clone(),this.targetMesh=this.gameObject,this.targetMesh.receiveShadow=!0);else{const e=hr.createPrimitive(Jo.Quad,{name:"ShadowCatcher",material:new c.MeshStandardMaterial({color:10066329,roughness:1,metalness:0,transparent:!0})});e.receiveShadow=!0,e.geometry.rotateX(-Math.PI/2),this.gameObject.add(e),this.targetMesh=e}if(!this.targetMesh){console.warn("ShadowCatcher: no mesh to apply shadow catching to. Groups are currently not supported.");return}switch(this.targetMesh.layers.set(2),this.mode){case 0:this.applyShadowMaterial();break;case 1:this.applyLightBlendMaterial();break;case 2:this.applyOccluderMaterial();break}}applyLightBlendMaterial(){if(!this.targetMesh)return;const e=this.targetMesh.material;e.blending=c.AdditiveBlending,this.applyMaterialOptions(e),e.onBeforeCompile=t=>{t.fragmentShader=t.fragmentShader.replace("vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;",`vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
|
|
1403
1403
|
// diffuse-only lighting with overdrive to somewhat compensate
|
|
1404
1404
|
// for the loss of indirect lighting and to make it more visible.
|
|
1405
1405
|
vec3 direct = (reflectedLight.directDiffuse + reflectedLight.directSpecular) * 6.6;
|
|
@@ -1649,4 +1649,4 @@ Error:`,r),null}}updateColliderCollisionGroups(e){const t=e[wt],i=e.membership;l
|
|
|
1649
1649
|
justify-content: center;
|
|
1650
1650
|
gap: .5rem;
|
|
1651
1651
|
}
|
|
1652
|
-
`),this.#n.innerHTML=this.#e.innerHTML,this.#n.style.cssText="display: flex; align-items: center; justify-content: center;",this.#e.innerHTML=this.#n.outerHTML,this.#t.innerHTML=this.#e.outerHTML,this.#t.prepend(this.#s),Rd(Dp,{element:this.#t}),this.#o?.disconnect(),this.#o??=new MutationObserver(()=>this.#l()),this.#o.observe(this.#e,{attributes:!0}),cp&&console.log("Needle Button updated")}#l(){this.#e&&(this.#e.style.display==="none"?this.style.display="none":this.style.display==="none"&&(this.style.display=""))}#r=e=>{cp&&console.log("Needle Button clicked"),!e.defaultPrevented&&this.#e&&this.#e.click()}}typeof window<"u"&&!window.customElements.get(wb)&&window.customElements.define(wb,rx);const vl=x("debugavatar");class _y{root;head;leftHand;rigthHand;get isValid(){return this.head!==null&&this.head!==void 0}constructor(e,t,i,n){this.root=e,this.head=t,this.leftHand=i,this.rigthHand=n,this.root?.traverse(o=>o.layers.set(2))}}class ax{avatarRegistryUrl=null;async getOrCreateNewAvatarInstance(e,t){if(!t)return console.error("Can not create avatar: failed to provide id or root object"),null;let i=null;if(typeof t=="string"){if(i=await this.loadAvatar(e,t),!i){const o=new cn;i=S.instantiate(fa(t,e.scene),o)}}else i=t;if(!i)return null;const n=this.findAvatar(i);return n.isValid?(vl&&console.log("[Custom Avatar] valid config",t,vl?n:""),n):(console.warn("[Custom Avatar] config isn't valid",t,vl?n:""),null)}async loadAvatar(e,t){if(console.assert(t!=null&&typeof t=="string","Avatar id must not be null"),t.length<=0||!t)return null;if(vl&&console.log("[Custom Avatar] "+t+", loading..."),t.endsWith(".glb")||(t+=".glb"),this.avatarRegistryUrl===null){const n=await fetch("./"+t);let o=null;if(n.ok){const a=await n.blob();a&&(o=await a.arrayBuffer())}return o?(await on().parseSync(e,o,null,0))?.scene??null:null}const i=new q.GLTFLoader;return Hm(i,e),new Promise((n,o)=>{const r=this.avatarRegistryUrl+"/"+t;i.load(r,async a=>{await on().createBuiltinComponents(e,r,a,null,void 0),n(a.scene)},a=>{vl&&console.log("[Custom Avatar] "+a.loaded/a.total*100+"% loaded of "+a.total/1024+"kB")},a=>{console.error("[Custom Avatar] Error when loading: "+a),n(null)})})}cacheModel(e,t){}findAvatar(e){const t=e;let i=t;i.children.length==1&&(i=e.children[0]);let n=this.findAvatarPart(i,["head"]);const o=this.findAvatarPart(i,["left","hand"]),r=this.findAvatarPart(i,["right","hand"]);if(!n){n=t;const l=new c.Vector3;new c.Box3().setFromObject(n).getSize(l);const h=Math.max(l.x,l.y,l.z);console.warn("[Custom Avatar] Normalizing head scale, it's too big: "+h+" meters! Should be < 0.3m"),h>.3&&n.scale.multiplyScalar(1/h*.3)}return new _y(t,n,o,r)}findAvatarPart(e,t){const i=e.name.toLowerCase();let n=!0;for(const o of t){if(!n)break;i.indexOf(o)===-1&&(n=!1)}if(n)return e;if(e.children)for(const o of e.children){const r=this.findAvatarPart(o,t);if(r)return r}return null}handleCustomAvatarErrors(e){if(!e.ok)throw Error(e.statusText);return e}}class lx{get extensionName(){return"DocumentExtension"}onAfterBuildDocument(e){}}class cx{}const nT=Object.freeze(Object.defineProperty({__proto__:null,ActionBuilder:le,ActionCollection:fw,ActionModel:Gt,AlignmentConstraint:Tc,Animation:Ct,AnimationCurve:Kc,AnimationExtension:vu,AnimationTrackHandler:pc,Animator:rt,AnimatorController:Li,Antialiasing:Jc,Attractor:Na,AudioExtension:br,AudioListener:ss,AudioSource:pi,AudioTrackHandler:rs,Avatar:io,AvatarBlink_Simple:mr,AvatarEyeLook_Rotation:eg,AvatarLoader:ax,AvatarMarker:Se,AvatarModel:_y,Avatar_Brain_LookAt:lc,Avatar_MouthShapes:Ic,Avatar_MustacheShake:Zm,Avatar_POI:Yo,AxesHelper:ka,BaseUIComponent:Bi,BasicIKConstraint:ig,BehaviorExtension:Ag,BehaviorModel:gt,BloomEffect:Du,BoxCollider:mu,BoxGizmo:Sr,BoxHelperComponent:nt,Button:xs,CallInfo:ns,Camera:Qt,CameraTargetReachedEvent:ac,Canvas:xa,CanvasGroup:no,CapsuleCollider:cs,ChangeMaterialOnClick:Sg,ChangeTransformOnClick:vr,CharacterController:gr,CharacterControllerInput:fs,ChromaticAberration:eh,ClickThrough:Yu,Collider:Jt,ColorAdjustments:_o,ColorBySpeedModule:za,ColorOverLifetimeModule:Ru,ContactShadows:jc,ControlTrackHandler:$u,CursorFollow:Dr,CustomBranding:xr,Deletable:rg,DeleteBox:Ys,DepthOfField:un,DeviceFlag:gu,DocumentExtension:lx,DragControls:Fo,DropListener:ms,Duplicatable:pg,EffectWrapper:fc,EmissionModule:bs,EmphasizeOnClick:Aa,EnvironmentScene:Xu,EventList:oe,EventListEvent:hu,EventSystem:Bt,EventTrigger:_u,FieldWithDefault:Xv,FixedJoint:Gg,Fog:Ba,GltfExport:bg,GltfExportBox:yg,Gradient:Pr,Graphic:Hc,GraphicRaycaster:du,GridHelper:Fa,GridLayoutGroup:Fg,GroundProjectedEnv:Bn,GroupActionModel:Uo,HideOnStart:Ei,HingeJoint:qc,HorizontalLayoutGroup:Bg,get HoverAnimation(){return exports.HoverAnimation},Image:qa,InheritVelocityModule:Yg,InputField:hy,InstanceHandle:Ko,InstancingHandler:or,Interactable:og,Keyframe:Yt,LODGroup:Qc,LODModel:Ua,Light:ii,LimitVelocityOverLifetimeModule:et,LogStats:sg,LookAt:dy,LookAtConstraint:pr,MainModule:Mt,MarkerTrackHandler:Vu,MaskableGraphic:Gc,MeshCollider:ho,MeshRenderer:Fc,MinMaxCurve:H,MinMaxGradient:Or,NeedleMenu:Un,NestedGltf:Yc,Networking:Xg,NoiseModule:fe,ObjectRaycaster:fi,OffsetConstraint:Cr,OpenURL:Xa,OrbitControls:ce,Outline:ja,Padding:wr,ParticleBurst:Vd,ParticleSubEmitter:Kg,ParticleSystem:uc,ParticleSystemRenderer:Vi,PhysicsExtension:Dg,PixelationEffect:th,PlayAnimationOnClick:hc,PlayAudioOnClick:to,PlayableDirector:lr,PlayerColor:Sa,PointerEventData:Dc,PostProcessingHandler:iy,PreliminaryAction:Da,PreliminaryTrigger:Nc,RawImage:Gu,Rect:_w,RectTransform:ln,ReflectionProbe:cc,RegisteredAnimationInfo:Gs,RemoteSkybox:Iu,Renderer:Ut,RendererLightmap:dg,Rigidbody:Ve,RotationBySpeedModule:Ni,RotationOverLifetimeModule:dn,SceneSwitcher:Fe,ScreenCapture:bo,ScreenSpaceAmbientOcclusion:vs,ScreenSpaceAmbientOcclusionN8:fn,ScrollFollow:Ss,SeeThrough:ws,SetActiveOnClick:Cg,ShadowCatcher:oh,ShapeModule:Qg,SharpeningEffect:nh,SignalAsset:Nu,SignalReceiver:hh,SignalReceiverEvent:ch,SignalTrackHandler:mc,Size:yw,SizeBySpeedModule:ni,SizeOverLifetimeModule:Mr,SkinnedMeshRenderer:ug,SmoothFollow:Bu,SpatialGrabRaycaster:nr,SpatialHtml:uh,SpatialTrigger:Fu,SpatialTriggerReceiver:Ln,SpectatorCamera:Uu,SphereCollider:Ea,SplineContainer:Tr,SplineData:jn,SplineWalker:Wi,Sprite:gs,SpriteData:da,SpriteRenderer:ei,SpriteSheet:wa,SubEmitterSystem:$d,SyncedCamera:sy,SyncedRoom:pn,SyncedTransform:an,TapGestureTrigger:Og,TeleportTarget:Pu,TestRunner:oy,TestSimulateUserData:ry,Text:Ot,TextBuilder:Ig,TextExtension:Mu,TextureSheetAnimationModule:kt,TiltShiftEffect:Vn,ToneMappingEffect:so,TrailModule:Re,TransformData:ke,TransformGizmo:Ar,TriggerBuilder:St,TriggerModel:Ks,UIRaycastUtils:Xm,UIRootComponent:$c,USDZExporter:nn,USDZText:na,USDZUIExtension:zg,UsageMarker:Bc,VariantAction:xg,VelocityOverLifetimeModule:De,VerticalLayoutGroup:jg,VideoPlayer:Ze,get ViewBox(){return exports.ViewBox},Vignette:Rr,VisibilityAction:Vc,Voip:co,Volume:$a,VolumeParameter:F,VolumeProfile:Tu,WebARCameraBackground:ph,WebARSessionRoot:di,WebXR:Ou,WebXRImageTracking:mh,WebXRImageTrackingModel:Ps,WebXRPlaneTracking:Os,WebXRTrackedImage:Ca,XRControllerFollow:Cs,XRControllerModel:hs,XRControllerMovement:gi,XRFlag:Ti,XRRig:Ju,XRState:jt,__Ignore:cx},Symbol.toStringTag,{value:"Module"})),yc=x("debugmissingcamera");ae.registerCallback(re.MissingCamera,s=>{yc&&console.warn("Creating missing camera");const e=s.context.scene,t=new c.PerspectiveCamera;t.name="Default Fallback Camera",e.add(t);const i=new Qt;if(i.sourceId=s.files?.[0]?.src??"unknown",i.fieldOfView=35,s.context.domElement.getAttribute("transparent")!=null)i.clearFlags=Qo.Uninitialized;else if(s.context.domElement.getAttribute("background-image")?.length||s.context.lightmaps.tryGetSkybox(i.sourceId))i.clearFlags=Qo.Skybox;else{if(i.clearFlags=Qo.SolidColor,!s.context.domElement.getAttribute("background-color")){let a="#efefef";typeof window!==void 0&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(a="#1f1f1f"),e.background=new c.Color(a)}if(!e.environment){const a=new c.PMREMGenerator$1(s.context.renderer),l=new Xu("neutral");e.environment=a.fromScene(l,.025).texture}}const o=Wo(t,i,!0);return t.position.x=0,t.position.y=1,t.position.z=2,s.context.domElement?.cameraControls!=!1&&hx(s.context,o),o});ae.registerCallback(re.ContextCreated,s=>{if(!s.context.mainCamera){yc&&console.log("Will not auto-fit because a default camera exists");return}if(s.context.domElement?.cameraControls==!0){if(Ib(s.context.mainCamera)?.isCameraController==!0){yc&&console.log("Will not auto-fit because a camera controller exists");return}hx(s.context)}});function hx(s,e){e=e??s.mainCameraComponent;const t=e?.gameObject;if(yc&&console.log("Creating default camera controls",e?.name),t){const i=Oc(t,ce);i.sourceId=e?.sourceId??"unknown";const n=s.domElement.getAttribute("auto-rotate");i.autoRotate=n!="0"&&n?.toLowerCase()!="false";const o=Number.parseFloat(n||".5");i.autoRotateSpeed=isNaN(o)?.5:o,yc&&console.log("Auto-rotate",i.autoRotate,"speed:",i.autoRotateSpeed);const r=s.domElement.getAttribute("auto-fit");i.autoFit=r!=="0"&&r?.toLowerCase()!="false",i.autoTarget=!0}else console.warn("Missing camera object, can not add orbit controls")}ae.registerCallback(re.ContextCreated,s=>{const e=s.context.domElement.getAttribute("autoplay");if(e!==void 0&&(e===""||e==="true"||e==="1")&&s.files)for(const t of s.files)S.foreachComponent(t.file.scene,n=>{if(n.enabled!==!1){if(n instanceof Ct&&n.playAutomatically||n instanceof rt||n instanceof lr&&n.playOnAwake===!0)return!0;if(n instanceof Ct)return n.playAutomatically=!0,!0;if(n instanceof lr)return n.playOnAwake=!0,!0}},!0)!==!0&&eo.autoplayAnimations(t.file)});exports.SplineUtils=void 0;(s=>{function e(t,i=!1,n=.75){const o=new Tr,r=1-I.clamp(n,0,1);return t.forEach((a,l)=>{const h=new c.Vector3;l<t.length-1?h.subVectors(t[l+1],a).normalize().multiplyScalar(r):i&&t.length>1&&h.subVectors(t[0],a).normalize().multiplyScalar(r);const d=new jn;d.position.copy(a),d.tangentIn.copy(h),d.tangentOut.copy(h),o.addKnot(d)}),o.closed=i,o}s.createFromPoints=e})(exports.SplineUtils||(exports.SplineUtils={}));class sT extends se.WorkerBase{constructor(){super(new Worker(new URL("/generateMeshBVH.worker-2qGLkQjg.js",typeof document>"u"?require("url").pathToFileURL(__filename).href:tf&&tf.tagName.toUpperCase()==="SCRIPT"&&tf.src||new URL("needle-engine.bundle-Ci2JE5sk.umd.cjs",document.baseURI).href),{type:"module"})),this.name="GenerateMeshBVHWorker"}runTask(e,t,i={}){return new Promise((n,o)=>{if(t.getAttribute("position").isInterleavedBufferAttribute||t.index&&t.index.isInterleavedBufferAttribute)throw new Error("GenerateMeshBVHWorker: InterleavedBufferAttribute are not supported for the geometry attributes.");e.onerror=h=>{o(new Error(`[GenerateMeshBVHWorker] ${h.message||"Unknown error. Please check the server console. If you're using vite try adding 'three-mesh-bvh' to 'optimizeDeps.exclude' in your vite.config.js"}`))},e.onmessage=h=>{const{data:d}=h;if(d.error)o(new Error(d.error)),e.onmessage=null;else if(d.serialized){const{serialized:u,position:p}=d,m=se.MeshBVH.deserialize(u,t,{setIndex:!1}),y=Object.assign({setBoundingBox:!0},i);if(t.attributes.position.array=p,u.index)if(t.index)t.index.array=u.index;else{const _=new c.BufferAttribute(u.index,1,!1);t.setIndex(_)}y.setBoundingBox&&(t.boundingBox=m.getBoundingBox(new c.Box3)),i.onProgress&&i.onProgress(d.progress),n(m),e.onmessage=null}else i.onProgress&&i.onProgress(d.progress)};const r=t.index?t.index.array:null,a=t.attributes.position.array,l=[a];r&&l.push(r),e.postMessage({index:r,position:a,options:{...i,onProgress:null,includedProgressCallback:!!i.onProgress,groups:[...t.groups]}},l.map(h=>h.buffer).filter(h=>typeof SharedArrayBuffer>"u"||!(h instanceof SharedArrayBuffer)))})}}const oT=Object.freeze(Object.defineProperty({__proto__:null,GenerateMeshBVHWorker:sT},Symbol.toStringTag,{value:"Module"}));exports.$physicsKey=AP;exports.ActionBuilder=le;exports.ActionCollection=fw;exports.ActionModel=Gt;exports.Addressables=Y0;exports.AlignmentConstraint=Tc;exports.AmbientMode=ca;exports.Animation=Ct;exports.AnimationCurve=Kc;exports.AnimationExtension=vu;exports.AnimationTrackHandler=pc;exports.AnimationUtils=eo;exports.Animator=rt;exports.AnimatorConditionMode=Ns;exports.AnimatorController=Li;exports.AnimatorControllerParameterType=Gm;exports.AnimatorStateInfo=Pl;exports.Antialiasing=Jc;exports.Application=rn;exports.AssetDatabase=f0;exports.AssetReference=Y;exports.Attractor=Na;exports.AudioExtension=br;exports.AudioListener=ss;exports.AudioSource=pi;exports.AudioTrackHandler=rs;exports.Avatar=io;exports.AvatarBlink_Simple=mr;exports.AvatarEyeLook_Rotation=eg;exports.AvatarLoader=ax;exports.AvatarMarker=Se;exports.AvatarModel=_y;exports.Avatar_Brain_LookAt=lc;exports.Avatar_MouthShapes=Ic;exports.Avatar_MustacheShake=Zm;exports.Avatar_POI=Yo;exports.Axes=ta;exports.AxesHelper=ka;exports.BUILD_TIME=vm;exports.BaseUIComponent=Bi;exports.BasicIKConstraint=ig;exports.BehaviorExtension=Ag;exports.BehaviorModel=gt;exports.BloomEffect=Du;exports.BoxCollider=mu;exports.BoxGizmo=Sr;exports.BoxHelperComponent=nt;exports.Button=xs;exports.ButtonsFactory=Zi;exports.CallDirection=Av;exports.CallInfo=ns;exports.Camera=Qt;exports.CameraTargetReachedEvent=ac;exports.Canvas=xa;exports.CanvasGroup=no;exports.CapsuleCollider=cs;exports.ChangeMaterialOnClick=Sg;exports.ChangeTransformOnClick=vr;exports.CharacterController=gr;exports.CharacterControllerInput=fs;exports.ChromaticAberration=eh;exports.CircularBuffer=ui;exports.ClearFlags=Qo;exports.ClickThrough=Yu;exports.ClipExtrapolation=vn;exports.Collider=Jt;exports.Collision=Ev;exports.CollisionDetectionMode=cu;exports.ColorAdjustments=_o;exports.ColorBySpeedModule=za;exports.ColorOverLifetimeModule=Ru;exports.Component=U1;exports.Component$1=M;exports.ComponentLifecycleEvents=eu;exports.Components=nT;exports.ConnectionEvents=a0;exports.ContactPoint=kv;exports.ContactShadows=jc;exports.Context=z;exports.ContextArgs=C1;exports.ContextEvent=re;exports.ContextRegistry=ae;exports.ControlTrackHandler=$u;exports.CursorFollow=Dr;exports.CustomBranding=xr;exports.CustomShader=ye;exports.DefaultReflectionMode=Ed;exports.Deletable=rg;exports.DeleteBox=Ys;exports.DepthOfField=un;exports.DeviceFlag=gu;exports.DocumentExtension=lx;exports.DragControls=Fo;exports.DragMode=ag;exports.DropListener=ms;exports.Duplicatable=pg;exports.EffectWrapper=fc;exports.EmissionModule=bs;exports.EmphasizeOnClick=Aa;exports.EngineLoadingView=gc;exports.EnvironmentScene=Xu;exports.EventList=oe;exports.EventListEvent=hu;exports.EventSystem=Bt;exports.EventTrigger=_u;exports.FieldWithDefault=Xv;exports.FileReference=qo;exports.FileReferenceSerializer=Z0;exports.FileSpawnModel=tO;exports.File_Event=Uv;exports.FixedJoint=Gg;exports.Fog=Ba;exports.FrameEvent=pe;exports.GENERATOR=Qd;exports.GameObject=S;exports.Gizmos=B;exports.GltfExport=bg;exports.GltfExportBox=yg;exports.Gradient=Pr;exports.Graphic=Hc;exports.GraphicRaycaster=du;exports.Graphics=Js;exports.GridHelper=Fa;exports.GridLayoutGroup=Fg;exports.GroundProjectedEnv=Bn;exports.GroupActionModel=Uo;exports.HideFlags=uu;exports.HideOnStart=Ei;exports.HingeJoint=qc;exports.HorizontalLayoutGroup=Bg;exports.HostData=PC;exports.Image=qa;exports.ImageReference=Go;exports.ImageReferenceSerializer=K0;exports.InheritVelocityModule=Yg;exports.Input=t0;exports.InputEventQueue=Xt;exports.InputEvents=xe;exports.InputField=hy;exports.InstanceHandle=Ko;exports.InstancingHandler=or;exports.InstancingUtil=Di;exports.InstantiateEvent=C0;exports.InstantiateIdProvider=mt;exports.InstantiateOptions=cn;exports.Interactable=og;exports.JoinedRoomResponse=QS;exports.KeyEventArgs=FS;exports.Keyframe=Yt;exports.LODGroup=Qc;exports.LODModel=Ua;exports.LeftRoomResponse=YS;exports.Light=ii;exports.LightData=nv;exports.LimitVelocityOverLifetimeModule=et;exports.LoadingElementOptions=VR;exports.LogStats=sg;exports.LogType=hi;exports.LookAt=dy;exports.LookAtConstraint=pr;exports.MainModule=Mt;exports.MarkerTrackHandler=Vu;exports.MarkerType=ay;exports.MaskableGraphic=Gc;exports.Mathf=I;exports.MeshCollider=ho;exports.MeshRenderer=Fc;exports.MinMaxCurve=H;exports.MinMaxGradient=Or;exports.NEKeyboardEvent=wl;exports.NEPointerEvent=Zn;exports.NeedleButtonElement=rx;exports.NeedleEngineWebComponent=yy;exports.NeedleMenu=Un;exports.NeedlePatchesKey=Zh;exports.NeedleXRController=Cm;exports.NeedleXRSession=G;exports.NeedleXRSync=h0;exports.NeedleXRUtils=u0;exports.NestedGltf=Yc;exports.NetworkConnection=c0;exports.NetworkedStreamEvents=kn;exports.NetworkedStreams=Lc;exports.Networking=Xg;exports.NewInstanceModel=O0;exports.NoiseModule=fe;exports.ObjectRaycaster=fi;exports.ObjectUtils=hr;exports.OffsetConstraint=Cr;exports.OneEuroFilter=Yh;exports.OneEuroFilterXYZ=um;exports.OpenURL=Xa;exports.OrbitControls=ce;exports.Outline=ja;exports.OwnershipEvent=l0;exports.OwnershipModel=km;exports.PUBLIC_KEY=Zr;exports.Padding=wr;exports.ParticleBurst=Vd;exports.ParticleSubEmitter=Kg;exports.ParticleSystem=uc;exports.ParticleSystemBaseBehaviour=yo;exports.ParticleSystemRenderer=Vi;exports.ParticleSystemShapeType=Nd;exports.PeerHandle=os;exports.PeerNetworking=r0;exports.Physics=_a;exports.PhysicsExtension=Dg;exports.PhysicsMaterialCombine=it;exports.PixelationEffect=th;exports.PlayAnimationOnClick=hc;exports.PlayAudioOnClick=to;exports.PlayableDirector=lr;exports.PlayerColor=Sa;exports.PlayerState=Ji;exports.PlayerStateEvent=gw;exports.PlayerSync=Rg;exports.PlayerView=ev;exports.PlayerViewManager=tv;exports.PointerEventData=Dc;exports.PointerType=Zd;exports.PostProcessingEffect=$e;exports.PostProcessingEffectOrder=Ke;exports.PostProcessingHandler=iy;exports.PreliminaryAction=Da;exports.PreliminaryTrigger=Nc;exports.PrimitiveType=Jo;exports.Progress=ie;exports.PromiseAllWithErrors=hm;exports.PromiseErrorResult=up;exports.RGBAColor=Z;exports.RapierPhysics=ua;exports.RawImage=Gu;exports.RaycastOptions=lo;exports.Rect=_w;exports.RectTransform=ln;exports.ReflectionProbe=cc;exports.RegisteredAnimationInfo=Gs;exports.RemoteSkybox=Iu;exports.RenderTexture=Mn;exports.RenderTextureSerializer=Cv;exports.Renderer=Ut;exports.RendererData=iv;exports.RendererLightmap=dg;exports.Rigidbody=Ve;exports.RigidbodyConstraints=Ie;exports.RoomEvents=Q;exports.RotationBySpeedModule=Ni;exports.RotationOverLifetimeModule=dn;exports.SceneLightSettings=jd;exports.SceneSwitcher=Fe;exports.ScreenCapture=bo;exports.ScreenSpaceAmbientOcclusion=vs;exports.ScreenSpaceAmbientOcclusionN8=fn;exports.ScrollFollow=Ss;exports.SeeThrough=ws;exports.SendQueue=Ki;exports.SerializationContext=Um;exports.SetActiveOnClick=Cg;exports.ShadowCatcher=oh;exports.ShapeModule=Qg;exports.ShapeOverlapResult=Rv;exports.SharpeningEffect=nh;exports.SignalAsset=Nu;exports.SignalReceiver=hh;exports.SignalReceiverEvent=ch;exports.SignalTrackHandler=mc;exports.Size=yw;exports.SizeBySpeedModule=ni;exports.SizeOverLifetimeModule=Mr;exports.SkinnedMeshRenderer=ug;exports.SmoothFollow=Bu;exports.SpatialGrabRaycaster=nr;exports.SpatialHtml=uh;exports.SpatialTrigger=Fu;exports.SpatialTriggerReceiver=Ln;exports.SpectatorCamera=Uu;exports.SphereCollider=Ea;exports.SphereIntersection=Tm;exports.SplineContainer=Tr;exports.SplineData=jn;exports.SplineWalker=Wi;exports.Sprite=gs;exports.SpriteData=da;exports.SpriteRenderer=ei;exports.SpriteSheet=wa;exports.StateMachineBehaviour=H1;exports.StreamEndedEvent=Ym;exports.StreamReceivedEvent=Tv;exports.SubEmitterSystem=$d;exports.SyncedCamera=sy;exports.SyncedRoom=pn;exports.SyncedTransform=an;exports.TapGestureTrigger=Og;exports.TeleportTarget=Pu;exports.TestRunner=oy;exports.TestSceneUtils=KR;exports.TestSimulateUserData=ry;exports.Text=Ot;exports.TextBuilder=Ig;exports.TextExtension=Mu;exports.TextureSheetAnimationModule=kt;exports.TiltShiftEffect=Vn;exports.Time=sv;exports.ToneMappingEffect=so;exports.TrackHandler=Ga;exports.TrackType=ri;exports.TrailModule=Re;exports.TransformData=ke;exports.TransformGizmo=Ar;exports.TriggerBuilder=St;exports.TriggerModel=Ks;exports.TypeStore=P;exports.UIRaycastUtils=Xm;exports.UIRootComponent=$c;exports.USDDocument=vg;exports.USDObject=Ne;exports.USDWriter=sw;exports.USDZExporter=nn;exports.USDZExporter$1=ow;exports.USDZText=na;exports.USDZUIExtension=zg;exports.UriSerializer=Pv;exports.UsageMarker=Bc;exports.UserJoinedOrLeftRoomModel=KS;exports.VERSION=en;exports.VariantAction=xg;exports.VelocityOverLifetimeModule=De;exports.VerticalLayoutGroup=jg;exports.VideoPlayer=Ze;exports.ViewDevice=qs;exports.Vignette=Rr;exports.VisibilityAction=Vc;exports.Voip=co;exports.Volume=$a;exports.VolumeParameter=F;exports.VolumeProfile=Tu;exports.WaitForFrames=n1;exports.WaitForPromise=J0;exports.WaitForSeconds=Vm;exports.Watch=as;exports.WebARCameraBackground=ph;exports.WebARSessionRoot=di;exports.WebXR=Ou;exports.WebXRButtonFactory=Zs;exports.WebXRImageTracking=mh;exports.WebXRImageTrackingModel=Ps;exports.WebXRPlaneTracking=Os;exports.WebXRTrackedImage=Ca;exports.XRControllerFollow=Cs;exports.XRControllerModel=hs;exports.XRControllerMovement=gi;exports.XRFlag=Ti;exports.XRRig=Ju;exports.XRState=jt;exports.XRStateFlag=Pn;exports.__Ignore=cx;exports.__internalNotifyObjectDestroyed=pC;exports.activeInHierarchyFieldName=ls;exports.addAttributeChangeCallback=lm;exports.addComponent=tn;exports.addCustomExtensionPlugin=yO;exports.addNewComponent=Wo;exports.addPatch=Yd;exports.apply=iu;exports.applyHMRChanges=F1;exports.applyPrototypeExtensions=F0;exports.beginListenDestroy=P0;exports.beginListenInstantiate=k0;exports.binaryIdentifierCasts=Pm;exports.build_scene_functions=S1;exports.builtinComponentKeyName=Do;exports.calculateProgress01=gy;exports.clearMessages=qx;exports.colorSerializer=lP;exports.compareAssociation=A0;exports.componentSerializer=ad;exports.copyTexture=Vb;exports.createMotion=bv;exports.debugNet=Nt;exports.debugOwner=xl;exports.decompressGpuTexture=cw;exports.deepClone=bc;exports.delay=In;exports.delayForFrames=vc;exports.deserializeObject=Md;exports.destroy=ji;exports.destroyComponentInstance=N0;exports.determineMimeTypeFromExtension=zv;exports.disposeObjectResources=_e;exports.disposeStream=En;exports.editorGuidKeyName=Ul;exports.enableSpatialConsole=No;exports.euler=hP;exports.eventListSerializer=pP;exports.exportAsGLTF=eT;exports.findByGuid=Nm;exports.findObjectOfType=Oa;exports.findObjectsOfType=$0;exports.findResourceUsers=Am;exports.fitCamera=vv;exports.fitObjectIntoVolume=Wb;exports.foreachComponent=tr;exports.foreachComponentEnumerator=su;exports.forward=dS;exports.generateQRCode=Eb;exports.generateSeed=M0;exports.getBoundingBox=Ft;exports.getCameraController=Ib;exports.getComponent=ur;exports.getComponentInChildren=kc;exports.getComponentInParent=sc;exports.getComponents=Mc;exports.getComponentsInChildren=Pa;exports.getComponentsInParent=tu;exports.getFormattedDate=ew;exports.getIconElement=pt;exports.getIconTexture=Ap;exports.getLoader=on;exports.getOrAddComponent=Oc;exports.getParam=x;exports.getParentHierarchyPath=pS;exports.getPath=Cx;exports.getPeerOptions=HS;exports.getPeerjsInstance=o0;exports.getResourceUserCount=gC;exports.getTempColor=Fb;exports.getTempQuaternion=qt;exports.getTempVector=j;exports.getUrlParams=_c;exports.getVisibleInCustomShadowRendering=$b;exports.getWorldDirection=Ub;exports.getWorldEuler=mm;exports.getWorldPosition=X;exports.getWorldQuaternion=ue;exports.getWorldRotation=Xd;exports.getWorldScale=je;exports.hasCommercialLicense=Xs;exports.hasIndieLicense=Rc;exports.hasPointerEventComponent=Dd;exports.hasProLicense=Dn;exports.hideDebugConsole=Xb;exports.imageToCanvas=hw;exports.instantiate=ir;exports.invokeLoadedImportPluginHooks=qv;exports.invokeXRSessionEnd=e0;exports.invokeXRSessionStart=Jb;exports.isActiveInHierarchy=W0;exports.isActiveSelf=Ma;exports.isAndroidDevice=Rx;exports.isAnimationAction=Nb;exports.isComponent=Mv;exports.isDebugMode=vx;exports.isDesktop=Ox;exports.isDestroyed=er;exports.isDevEnvironment=T;exports.isDisposed=fC;exports.isExporting=ZR;exports.isGLTFModel=Ov;exports.isHostedOnGlitch=xb;exports.isHotReloadEnabled=Bp;exports.isHotReloading=j1;exports.isIPad=kx;exports.isIconElement=av;exports.isLocalNetwork=Ii;exports.isMacOS=Ax;exports.isMobileDevice=Mx;exports.isMozillaXR=Tx;exports.isQuest=Ix;exports.isResourceTrackingEnabled=m0;exports.isSafari=Lx;exports.isUsingInstancing=nu;exports.isiOS=Dx;exports.isiPad=Ex;exports.loadAsset=jR;exports.loadPMREM=zw;exports.loadSync=my;exports.logHierarchy=bd;exports.lookAtInverse=nS;exports.lookAtObject=wc;exports.lookAtScreenPoint=sS;exports.makeId=xx;exports.makeIdFromRandomWords=Pb;exports.makeNameSafe=mi;exports.markAsInstancedRendered=H0;exports.microphonePermissionsGranted=jx;exports.nameof=bx;exports.nameofFactory=Sb;exports.objectSerializer=Sv;exports.offXRSessionEnd=BS;exports.offXRSessionStart=jS;exports.onAfterRender=L1;exports.onBeforeRender=D1;exports.onClear=T1;exports.onDestroy=A1;exports.onInitialized=uv;exports.onStart=au;exports.onUpdate=fv;exports.onXRSessionEnd=Sm;exports.onXRSessionStart=Kd;exports.parseSync=tx;exports.placeOnSurface=Hb;exports.postprocessFBXMaterials=_m;exports.prefix=iP;exports.pushState=Cb;exports.randomNumber=Sx;exports.registerBinaryType=Om;exports.registerComponent=ru;exports.registerComponentExtension=cg;exports.registerCustomEffectType=$i;exports.registerExportExtensions=hg;exports.registerExtensions=Fd;exports.registerHotReloadType=mv;exports.registerLoader=wm;exports.registerPrefabProvider=R0;exports.registerPrototypeExtensions=U0;exports.registerType=jm;exports.relativePathPrefix=Mb;exports.removeAttributeChangeCallback=cm;exports.removeComponent=zm;exports.removeCustomImportExtensionType=_O;exports.removePatch=LS;exports.resolveUrl=oo;exports.sanitizeString=Ob;exports.saveImage=Kw;exports.screenshot=bR;exports.screenshot2=py;exports.sendDestroyed=Lm;exports.serializable=f;exports.serializeObject=L0;exports.serializeable=Be;exports.setActive=Vl;exports.setAllowBalloonMessages=Ab;exports.setAllowOverlayMessages=$x;exports.setAutoFitEnabled=yd;exports.setCameraController=pp;exports.setDestroyed=q0;exports.setDevEnvironment=xS;exports.setDisposable=y0;exports.setDontDestroy=Hr;exports.setOrAddParamsToUrl=dp;exports.setParam=wx;exports.setParamWithoutReload=ec;exports.setPeerOptions=GS;exports.setResourceTrackingEnabled=uC;exports.setState=rm;exports.setVisibleInCustomShadowRendering=ym;exports.setWorldEuler=gm;exports.setWorldPosition=ot;exports.setWorldPositionXYZ=Zo;exports.setWorldQuaternion=sn;exports.setWorldQuaternionXYZW=pm;exports.setWorldRotation=zb;exports.setWorldRotationXYZ=xc;exports.setWorldScale=pa;exports.showBalloonError=Sc;exports.showBalloonMessage=Ce;exports.showBalloonWarning=de;exports.showDebugConsole=bm;exports.slerp=iS;exports.syncDestroy=Cc;exports.syncField=Eg;exports.syncInstantiate=Im;exports.textureToCanvas=mS;exports.toSourceId=kb;exports.tryCastBinary=n0;exports.tryDetermineMimetypeFromBinary=Vv;exports.tryDetermineMimetypeFromURL=Nv;exports.tryFindObject=fa;exports.tryGetGuid=s0;exports.unregisterHotReloadType=gv;exports.unwatchWrite=am;exports.useForAutoFit=jb;exports.validate=yt;exports.watchWrite=qd;
|
|
1652
|
+
`),this.#n.innerHTML=this.#e.innerHTML,this.#n.style.cssText="display: flex; align-items: center; justify-content: center;",this.#e.innerHTML=this.#n.outerHTML,this.#t.innerHTML=this.#e.outerHTML,this.#t.prepend(this.#s),Rd(Dp,{element:this.#t}),this.#o?.disconnect(),this.#o??=new MutationObserver(()=>this.#l()),this.#o.observe(this.#e,{attributes:!0}),cp&&console.log("Needle Button updated")}#l(){this.#e&&(this.#e.style.display==="none"?this.style.display="none":this.style.display==="none"&&(this.style.display=""))}#r=e=>{cp&&console.log("Needle Button clicked"),!e.defaultPrevented&&this.#e&&this.#e.click()}}typeof window<"u"&&!window.customElements.get(wb)&&window.customElements.define(wb,rx);const vl=x("debugavatar");class _y{root;head;leftHand;rigthHand;get isValid(){return this.head!==null&&this.head!==void 0}constructor(e,t,i,n){this.root=e,this.head=t,this.leftHand=i,this.rigthHand=n,this.root?.traverse(o=>o.layers.set(2))}}class ax{avatarRegistryUrl=null;async getOrCreateNewAvatarInstance(e,t){if(!t)return console.error("Can not create avatar: failed to provide id or root object"),null;let i=null;if(typeof t=="string"){if(i=await this.loadAvatar(e,t),!i){const o=new cn;i=S.instantiate(fa(t,e.scene),o)}}else i=t;if(!i)return null;const n=this.findAvatar(i);return n.isValid?(vl&&console.log("[Custom Avatar] valid config",t,vl?n:""),n):(console.warn("[Custom Avatar] config isn't valid",t,vl?n:""),null)}async loadAvatar(e,t){if(console.assert(t!=null&&typeof t=="string","Avatar id must not be null"),t.length<=0||!t)return null;if(vl&&console.log("[Custom Avatar] "+t+", loading..."),t.endsWith(".glb")||(t+=".glb"),this.avatarRegistryUrl===null){const n=await fetch("./"+t);let o=null;if(n.ok){const a=await n.blob();a&&(o=await a.arrayBuffer())}return o?(await on().parseSync(e,o,null,0))?.scene??null:null}const i=new q.GLTFLoader;return Hm(i,e),new Promise((n,o)=>{const r=this.avatarRegistryUrl+"/"+t;i.load(r,async a=>{await on().createBuiltinComponents(e,r,a,null,void 0),n(a.scene)},a=>{vl&&console.log("[Custom Avatar] "+a.loaded/a.total*100+"% loaded of "+a.total/1024+"kB")},a=>{console.error("[Custom Avatar] Error when loading: "+a),n(null)})})}cacheModel(e,t){}findAvatar(e){const t=e;let i=t;i.children.length==1&&(i=e.children[0]);let n=this.findAvatarPart(i,["head"]);const o=this.findAvatarPart(i,["left","hand"]),r=this.findAvatarPart(i,["right","hand"]);if(!n){n=t;const l=new c.Vector3;new c.Box3().setFromObject(n).getSize(l);const h=Math.max(l.x,l.y,l.z);console.warn("[Custom Avatar] Normalizing head scale, it's too big: "+h+" meters! Should be < 0.3m"),h>.3&&n.scale.multiplyScalar(1/h*.3)}return new _y(t,n,o,r)}findAvatarPart(e,t){const i=e.name.toLowerCase();let n=!0;for(const o of t){if(!n)break;i.indexOf(o)===-1&&(n=!1)}if(n)return e;if(e.children)for(const o of e.children){const r=this.findAvatarPart(o,t);if(r)return r}return null}handleCustomAvatarErrors(e){if(!e.ok)throw Error(e.statusText);return e}}class lx{get extensionName(){return"DocumentExtension"}onAfterBuildDocument(e){}}class cx{}const nT=Object.freeze(Object.defineProperty({__proto__:null,ActionBuilder:le,ActionCollection:fw,ActionModel:Gt,AlignmentConstraint:Tc,Animation:Ct,AnimationCurve:Kc,AnimationExtension:vu,AnimationTrackHandler:pc,Animator:rt,AnimatorController:Li,Antialiasing:Jc,Attractor:Na,AudioExtension:br,AudioListener:ss,AudioSource:pi,AudioTrackHandler:rs,Avatar:io,AvatarBlink_Simple:mr,AvatarEyeLook_Rotation:eg,AvatarLoader:ax,AvatarMarker:Se,AvatarModel:_y,Avatar_Brain_LookAt:lc,Avatar_MouthShapes:Ic,Avatar_MustacheShake:Zm,Avatar_POI:Yo,AxesHelper:ka,BaseUIComponent:Bi,BasicIKConstraint:ig,BehaviorExtension:Ag,BehaviorModel:gt,BloomEffect:Du,BoxCollider:mu,BoxGizmo:Sr,BoxHelperComponent:nt,Button:xs,CallInfo:ns,Camera:Qt,CameraTargetReachedEvent:ac,Canvas:xa,CanvasGroup:no,CapsuleCollider:cs,ChangeMaterialOnClick:Sg,ChangeTransformOnClick:vr,CharacterController:gr,CharacterControllerInput:fs,ChromaticAberration:eh,ClickThrough:Yu,Collider:Jt,ColorAdjustments:_o,ColorBySpeedModule:za,ColorOverLifetimeModule:Ru,ContactShadows:jc,ControlTrackHandler:$u,CursorFollow:Dr,CustomBranding:xr,Deletable:rg,DeleteBox:Ys,DepthOfField:un,DeviceFlag:gu,DocumentExtension:lx,DragControls:Fo,DropListener:ms,Duplicatable:pg,EffectWrapper:fc,EmissionModule:bs,EmphasizeOnClick:Aa,EnvironmentScene:Xu,EventList:oe,EventListEvent:hu,EventSystem:Bt,EventTrigger:_u,FieldWithDefault:Xv,FixedJoint:Gg,Fog:Ba,GltfExport:bg,GltfExportBox:yg,Gradient:Pr,Graphic:Hc,GraphicRaycaster:du,GridHelper:Fa,GridLayoutGroup:Fg,GroundProjectedEnv:Bn,GroupActionModel:Uo,HideOnStart:Ei,HingeJoint:qc,HorizontalLayoutGroup:Bg,get HoverAnimation(){return exports.HoverAnimation},Image:qa,InheritVelocityModule:Yg,InputField:hy,InstanceHandle:Ko,InstancingHandler:or,Interactable:og,Keyframe:Yt,LODGroup:Qc,LODModel:Ua,Light:ii,LimitVelocityOverLifetimeModule:et,LogStats:sg,LookAt:dy,LookAtConstraint:pr,MainModule:Mt,MarkerTrackHandler:Vu,MaskableGraphic:Gc,MeshCollider:ho,MeshRenderer:Fc,MinMaxCurve:H,MinMaxGradient:Or,NeedleMenu:Un,NestedGltf:Yc,Networking:Xg,NoiseModule:fe,ObjectRaycaster:fi,OffsetConstraint:Cr,OpenURL:Xa,OrbitControls:ce,Outline:ja,Padding:wr,ParticleBurst:Vd,ParticleSubEmitter:Kg,ParticleSystem:uc,ParticleSystemRenderer:Vi,PhysicsExtension:Dg,PixelationEffect:th,PlayAnimationOnClick:hc,PlayAudioOnClick:to,PlayableDirector:lr,PlayerColor:Sa,PointerEventData:Dc,PostProcessingHandler:iy,PreliminaryAction:Da,PreliminaryTrigger:Nc,RawImage:Gu,Rect:_w,RectTransform:ln,ReflectionProbe:cc,RegisteredAnimationInfo:Gs,RemoteSkybox:Iu,Renderer:Ut,RendererLightmap:dg,Rigidbody:Ve,RotationBySpeedModule:Ni,RotationOverLifetimeModule:dn,SceneSwitcher:Fe,ScreenCapture:bo,ScreenSpaceAmbientOcclusion:vs,ScreenSpaceAmbientOcclusionN8:fn,ScrollFollow:Ss,SeeThrough:ws,SetActiveOnClick:Cg,ShadowCatcher:oh,ShapeModule:Qg,SharpeningEffect:nh,SignalAsset:Nu,SignalReceiver:hh,SignalReceiverEvent:ch,SignalTrackHandler:mc,Size:yw,SizeBySpeedModule:ni,SizeOverLifetimeModule:Mr,SkinnedMeshRenderer:ug,SmoothFollow:Bu,SpatialGrabRaycaster:nr,SpatialHtml:uh,SpatialTrigger:Fu,SpatialTriggerReceiver:Ln,SpectatorCamera:Uu,SphereCollider:Ea,SplineContainer:Tr,SplineData:jn,SplineWalker:Wi,Sprite:gs,SpriteData:da,SpriteRenderer:ei,SpriteSheet:wa,SubEmitterSystem:$d,SyncedCamera:sy,SyncedRoom:pn,SyncedTransform:an,TapGestureTrigger:Og,TeleportTarget:Pu,TestRunner:oy,TestSimulateUserData:ry,Text:Ot,TextBuilder:Ig,TextExtension:Mu,TextureSheetAnimationModule:kt,TiltShiftEffect:Vn,ToneMappingEffect:so,TrailModule:Re,TransformData:ke,TransformGizmo:Ar,TriggerBuilder:St,TriggerModel:Ks,UIRaycastUtils:Xm,UIRootComponent:$c,USDZExporter:nn,USDZText:na,USDZUIExtension:zg,UsageMarker:Bc,VariantAction:xg,VelocityOverLifetimeModule:De,VerticalLayoutGroup:jg,VideoPlayer:Ze,get ViewBox(){return exports.ViewBox},Vignette:Rr,VisibilityAction:Vc,Voip:co,Volume:$a,VolumeParameter:F,VolumeProfile:Tu,WebARCameraBackground:ph,WebARSessionRoot:di,WebXR:Ou,WebXRImageTracking:mh,WebXRImageTrackingModel:Ps,WebXRPlaneTracking:Os,WebXRTrackedImage:Ca,XRControllerFollow:Cs,XRControllerModel:hs,XRControllerMovement:gi,XRFlag:Ti,XRRig:Ju,XRState:jt,__Ignore:cx},Symbol.toStringTag,{value:"Module"})),yc=x("debugmissingcamera");ae.registerCallback(re.MissingCamera,s=>{yc&&console.warn("Creating missing camera");const e=s.context.scene,t=new c.PerspectiveCamera;t.name="Default Fallback Camera",e.add(t);const i=new Qt;if(i.sourceId=s.files?.[0]?.src??"unknown",i.fieldOfView=35,s.context.domElement.getAttribute("transparent")!=null)i.clearFlags=Qo.Uninitialized;else if(s.context.domElement.getAttribute("background-image")?.length||s.context.lightmaps.tryGetSkybox(i.sourceId))i.clearFlags=Qo.Skybox;else{if(i.clearFlags=Qo.SolidColor,!s.context.domElement.getAttribute("background-color")){let a="#efefef";typeof window!==void 0&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(a="#1f1f1f"),e.background=new c.Color(a)}if(!e.environment){const a=new c.PMREMGenerator$1(s.context.renderer),l=new Xu("neutral");e.environment=a.fromScene(l,.025).texture}}const o=Wo(t,i,!0);return t.position.x=0,t.position.y=1,t.position.z=2,s.context.domElement?.cameraControls!=!1&&hx(s.context,o),o});ae.registerCallback(re.ContextCreated,s=>{if(!s.context.mainCamera){yc&&console.log("Will not auto-fit because a default camera exists");return}if(s.context.domElement?.cameraControls==!0){if(Ib(s.context.mainCamera)?.isCameraController==!0){yc&&console.log("Will not auto-fit because a camera controller exists");return}hx(s.context)}});function hx(s,e){e=e??s.mainCameraComponent;const t=e?.gameObject;if(yc&&console.log("Creating default camera controls",e?.name),t){const i=Oc(t,ce);i.sourceId=e?.sourceId??"unknown";const n=s.domElement.getAttribute("auto-rotate");i.autoRotate=n!="0"&&n?.toLowerCase()!="false";const o=Number.parseFloat(n||".5");i.autoRotateSpeed=isNaN(o)?.5:o,yc&&console.log("Auto-rotate",i.autoRotate,"speed:",i.autoRotateSpeed);const r=s.domElement.getAttribute("auto-fit");i.autoFit=r!=="0"&&r?.toLowerCase()!="false",i.autoTarget=!0}else console.warn("Missing camera object, can not add orbit controls")}ae.registerCallback(re.ContextCreated,s=>{const e=s.context.domElement.getAttribute("autoplay");if(e!==void 0&&(e===""||e==="true"||e==="1")&&s.files)for(const t of s.files)S.foreachComponent(t.file.scene,n=>{if(n.enabled!==!1){if(n instanceof Ct&&n.playAutomatically||n instanceof rt||n instanceof lr&&n.playOnAwake===!0)return!0;if(n instanceof Ct)return n.playAutomatically=!0,!0;if(n instanceof lr)return n.playOnAwake=!0,!0}},!0)!==!0&&eo.autoplayAnimations(t.file)});exports.SplineUtils=void 0;(s=>{function e(t,i=!1,n=.75){const o=new Tr,r=1-I.clamp(n,0,1);return t.forEach((a,l)=>{const h=new c.Vector3;l<t.length-1?h.subVectors(t[l+1],a).normalize().multiplyScalar(r):i&&t.length>1&&h.subVectors(t[0],a).normalize().multiplyScalar(r);const d=new jn;d.position.copy(a),d.tangentIn.copy(h),d.tangentOut.copy(h),o.addKnot(d)}),o.closed=i,o}s.createFromPoints=e})(exports.SplineUtils||(exports.SplineUtils={}));class sT extends se.WorkerBase{constructor(){super(new Worker(new URL("/generateMeshBVH.worker-2qGLkQjg.js",typeof document>"u"?require("url").pathToFileURL(__filename).href:tf&&tf.tagName.toUpperCase()==="SCRIPT"&&tf.src||new URL("needle-engine.bundle-YQ3I1QD8.umd.cjs",document.baseURI).href),{type:"module"})),this.name="GenerateMeshBVHWorker"}runTask(e,t,i={}){return new Promise((n,o)=>{if(t.getAttribute("position").isInterleavedBufferAttribute||t.index&&t.index.isInterleavedBufferAttribute)throw new Error("GenerateMeshBVHWorker: InterleavedBufferAttribute are not supported for the geometry attributes.");e.onerror=h=>{o(new Error(`[GenerateMeshBVHWorker] ${h.message||"Unknown error. Please check the server console. If you're using vite try adding 'three-mesh-bvh' to 'optimizeDeps.exclude' in your vite.config.js"}`))},e.onmessage=h=>{const{data:d}=h;if(d.error)o(new Error(d.error)),e.onmessage=null;else if(d.serialized){const{serialized:u,position:p}=d,m=se.MeshBVH.deserialize(u,t,{setIndex:!1}),y=Object.assign({setBoundingBox:!0},i);if(t.attributes.position.array=p,u.index)if(t.index)t.index.array=u.index;else{const _=new c.BufferAttribute(u.index,1,!1);t.setIndex(_)}y.setBoundingBox&&(t.boundingBox=m.getBoundingBox(new c.Box3)),i.onProgress&&i.onProgress(d.progress),n(m),e.onmessage=null}else i.onProgress&&i.onProgress(d.progress)};const r=t.index?t.index.array:null,a=t.attributes.position.array,l=[a];r&&l.push(r),e.postMessage({index:r,position:a,options:{...i,onProgress:null,includedProgressCallback:!!i.onProgress,groups:[...t.groups]}},l.map(h=>h.buffer).filter(h=>typeof SharedArrayBuffer>"u"||!(h instanceof SharedArrayBuffer)))})}}const oT=Object.freeze(Object.defineProperty({__proto__:null,GenerateMeshBVHWorker:sT},Symbol.toStringTag,{value:"Module"}));exports.$physicsKey=AP;exports.ActionBuilder=le;exports.ActionCollection=fw;exports.ActionModel=Gt;exports.Addressables=Y0;exports.AlignmentConstraint=Tc;exports.AmbientMode=ca;exports.Animation=Ct;exports.AnimationCurve=Kc;exports.AnimationExtension=vu;exports.AnimationTrackHandler=pc;exports.AnimationUtils=eo;exports.Animator=rt;exports.AnimatorConditionMode=Ns;exports.AnimatorController=Li;exports.AnimatorControllerParameterType=Gm;exports.AnimatorStateInfo=Pl;exports.Antialiasing=Jc;exports.Application=rn;exports.AssetDatabase=f0;exports.AssetReference=Y;exports.Attractor=Na;exports.AudioExtension=br;exports.AudioListener=ss;exports.AudioSource=pi;exports.AudioTrackHandler=rs;exports.Avatar=io;exports.AvatarBlink_Simple=mr;exports.AvatarEyeLook_Rotation=eg;exports.AvatarLoader=ax;exports.AvatarMarker=Se;exports.AvatarModel=_y;exports.Avatar_Brain_LookAt=lc;exports.Avatar_MouthShapes=Ic;exports.Avatar_MustacheShake=Zm;exports.Avatar_POI=Yo;exports.Axes=ta;exports.AxesHelper=ka;exports.BUILD_TIME=vm;exports.BaseUIComponent=Bi;exports.BasicIKConstraint=ig;exports.BehaviorExtension=Ag;exports.BehaviorModel=gt;exports.BloomEffect=Du;exports.BoxCollider=mu;exports.BoxGizmo=Sr;exports.BoxHelperComponent=nt;exports.Button=xs;exports.ButtonsFactory=Zi;exports.CallDirection=Av;exports.CallInfo=ns;exports.Camera=Qt;exports.CameraTargetReachedEvent=ac;exports.Canvas=xa;exports.CanvasGroup=no;exports.CapsuleCollider=cs;exports.ChangeMaterialOnClick=Sg;exports.ChangeTransformOnClick=vr;exports.CharacterController=gr;exports.CharacterControllerInput=fs;exports.ChromaticAberration=eh;exports.CircularBuffer=ui;exports.ClearFlags=Qo;exports.ClickThrough=Yu;exports.ClipExtrapolation=vn;exports.Collider=Jt;exports.Collision=Ev;exports.CollisionDetectionMode=cu;exports.ColorAdjustments=_o;exports.ColorBySpeedModule=za;exports.ColorOverLifetimeModule=Ru;exports.Component=U1;exports.Component$1=M;exports.ComponentLifecycleEvents=eu;exports.Components=nT;exports.ConnectionEvents=a0;exports.ContactPoint=kv;exports.ContactShadows=jc;exports.Context=z;exports.ContextArgs=C1;exports.ContextEvent=re;exports.ContextRegistry=ae;exports.ControlTrackHandler=$u;exports.CursorFollow=Dr;exports.CustomBranding=xr;exports.CustomShader=ye;exports.DefaultReflectionMode=Ed;exports.Deletable=rg;exports.DeleteBox=Ys;exports.DepthOfField=un;exports.DeviceFlag=gu;exports.DocumentExtension=lx;exports.DragControls=Fo;exports.DragMode=ag;exports.DropListener=ms;exports.Duplicatable=pg;exports.EffectWrapper=fc;exports.EmissionModule=bs;exports.EmphasizeOnClick=Aa;exports.EngineLoadingView=gc;exports.EnvironmentScene=Xu;exports.EventList=oe;exports.EventListEvent=hu;exports.EventSystem=Bt;exports.EventTrigger=_u;exports.FieldWithDefault=Xv;exports.FileReference=qo;exports.FileReferenceSerializer=Z0;exports.FileSpawnModel=tO;exports.File_Event=Uv;exports.FixedJoint=Gg;exports.Fog=Ba;exports.FrameEvent=pe;exports.GENERATOR=Qd;exports.GameObject=S;exports.Gizmos=B;exports.GltfExport=bg;exports.GltfExportBox=yg;exports.Gradient=Pr;exports.Graphic=Hc;exports.GraphicRaycaster=du;exports.Graphics=Js;exports.GridHelper=Fa;exports.GridLayoutGroup=Fg;exports.GroundProjectedEnv=Bn;exports.GroupActionModel=Uo;exports.HideFlags=uu;exports.HideOnStart=Ei;exports.HingeJoint=qc;exports.HorizontalLayoutGroup=Bg;exports.HostData=PC;exports.Image=qa;exports.ImageReference=Go;exports.ImageReferenceSerializer=K0;exports.InheritVelocityModule=Yg;exports.Input=t0;exports.InputEventQueue=Xt;exports.InputEvents=xe;exports.InputField=hy;exports.InstanceHandle=Ko;exports.InstancingHandler=or;exports.InstancingUtil=Di;exports.InstantiateEvent=C0;exports.InstantiateIdProvider=mt;exports.InstantiateOptions=cn;exports.Interactable=og;exports.JoinedRoomResponse=QS;exports.KeyEventArgs=FS;exports.Keyframe=Yt;exports.LODGroup=Qc;exports.LODModel=Ua;exports.LeftRoomResponse=YS;exports.Light=ii;exports.LightData=nv;exports.LimitVelocityOverLifetimeModule=et;exports.LoadingElementOptions=VR;exports.LogStats=sg;exports.LogType=hi;exports.LookAt=dy;exports.LookAtConstraint=pr;exports.MainModule=Mt;exports.MarkerTrackHandler=Vu;exports.MarkerType=ay;exports.MaskableGraphic=Gc;exports.Mathf=I;exports.MeshCollider=ho;exports.MeshRenderer=Fc;exports.MinMaxCurve=H;exports.MinMaxGradient=Or;exports.NEKeyboardEvent=wl;exports.NEPointerEvent=Zn;exports.NeedleButtonElement=rx;exports.NeedleEngineWebComponent=yy;exports.NeedleMenu=Un;exports.NeedlePatchesKey=Zh;exports.NeedleXRController=Cm;exports.NeedleXRSession=G;exports.NeedleXRSync=h0;exports.NeedleXRUtils=u0;exports.NestedGltf=Yc;exports.NetworkConnection=c0;exports.NetworkedStreamEvents=kn;exports.NetworkedStreams=Lc;exports.Networking=Xg;exports.NewInstanceModel=O0;exports.NoiseModule=fe;exports.ObjectRaycaster=fi;exports.ObjectUtils=hr;exports.OffsetConstraint=Cr;exports.OneEuroFilter=Yh;exports.OneEuroFilterXYZ=um;exports.OpenURL=Xa;exports.OrbitControls=ce;exports.Outline=ja;exports.OwnershipEvent=l0;exports.OwnershipModel=km;exports.PUBLIC_KEY=Zr;exports.Padding=wr;exports.ParticleBurst=Vd;exports.ParticleSubEmitter=Kg;exports.ParticleSystem=uc;exports.ParticleSystemBaseBehaviour=yo;exports.ParticleSystemRenderer=Vi;exports.ParticleSystemShapeType=Nd;exports.PeerHandle=os;exports.PeerNetworking=r0;exports.Physics=_a;exports.PhysicsExtension=Dg;exports.PhysicsMaterialCombine=it;exports.PixelationEffect=th;exports.PlayAnimationOnClick=hc;exports.PlayAudioOnClick=to;exports.PlayableDirector=lr;exports.PlayerColor=Sa;exports.PlayerState=Ji;exports.PlayerStateEvent=gw;exports.PlayerSync=Rg;exports.PlayerView=ev;exports.PlayerViewManager=tv;exports.PointerEventData=Dc;exports.PointerType=Zd;exports.PostProcessingEffect=$e;exports.PostProcessingEffectOrder=Ke;exports.PostProcessingHandler=iy;exports.PreliminaryAction=Da;exports.PreliminaryTrigger=Nc;exports.PrimitiveType=Jo;exports.Progress=ie;exports.PromiseAllWithErrors=hm;exports.PromiseErrorResult=up;exports.RGBAColor=Z;exports.RapierPhysics=ua;exports.RawImage=Gu;exports.RaycastOptions=lo;exports.Rect=_w;exports.RectTransform=ln;exports.ReflectionProbe=cc;exports.RegisteredAnimationInfo=Gs;exports.RemoteSkybox=Iu;exports.RenderTexture=Mn;exports.RenderTextureSerializer=Cv;exports.Renderer=Ut;exports.RendererData=iv;exports.RendererLightmap=dg;exports.Rigidbody=Ve;exports.RigidbodyConstraints=Ie;exports.RoomEvents=Q;exports.RotationBySpeedModule=Ni;exports.RotationOverLifetimeModule=dn;exports.SceneLightSettings=jd;exports.SceneSwitcher=Fe;exports.ScreenCapture=bo;exports.ScreenSpaceAmbientOcclusion=vs;exports.ScreenSpaceAmbientOcclusionN8=fn;exports.ScrollFollow=Ss;exports.SeeThrough=ws;exports.SendQueue=Ki;exports.SerializationContext=Um;exports.SetActiveOnClick=Cg;exports.ShadowCatcher=oh;exports.ShapeModule=Qg;exports.ShapeOverlapResult=Rv;exports.SharpeningEffect=nh;exports.SignalAsset=Nu;exports.SignalReceiver=hh;exports.SignalReceiverEvent=ch;exports.SignalTrackHandler=mc;exports.Size=yw;exports.SizeBySpeedModule=ni;exports.SizeOverLifetimeModule=Mr;exports.SkinnedMeshRenderer=ug;exports.SmoothFollow=Bu;exports.SpatialGrabRaycaster=nr;exports.SpatialHtml=uh;exports.SpatialTrigger=Fu;exports.SpatialTriggerReceiver=Ln;exports.SpectatorCamera=Uu;exports.SphereCollider=Ea;exports.SphereIntersection=Tm;exports.SplineContainer=Tr;exports.SplineData=jn;exports.SplineWalker=Wi;exports.Sprite=gs;exports.SpriteData=da;exports.SpriteRenderer=ei;exports.SpriteSheet=wa;exports.StateMachineBehaviour=H1;exports.StreamEndedEvent=Ym;exports.StreamReceivedEvent=Tv;exports.SubEmitterSystem=$d;exports.SyncedCamera=sy;exports.SyncedRoom=pn;exports.SyncedTransform=an;exports.TapGestureTrigger=Og;exports.TeleportTarget=Pu;exports.TestRunner=oy;exports.TestSceneUtils=KR;exports.TestSimulateUserData=ry;exports.Text=Ot;exports.TextBuilder=Ig;exports.TextExtension=Mu;exports.TextureSheetAnimationModule=kt;exports.TiltShiftEffect=Vn;exports.Time=sv;exports.ToneMappingEffect=so;exports.TrackHandler=Ga;exports.TrackType=ri;exports.TrailModule=Re;exports.TransformData=ke;exports.TransformGizmo=Ar;exports.TriggerBuilder=St;exports.TriggerModel=Ks;exports.TypeStore=P;exports.UIRaycastUtils=Xm;exports.UIRootComponent=$c;exports.USDDocument=vg;exports.USDObject=Ne;exports.USDWriter=sw;exports.USDZExporter=nn;exports.USDZExporter$1=ow;exports.USDZText=na;exports.USDZUIExtension=zg;exports.UriSerializer=Pv;exports.UsageMarker=Bc;exports.UserJoinedOrLeftRoomModel=KS;exports.VERSION=en;exports.VariantAction=xg;exports.VelocityOverLifetimeModule=De;exports.VerticalLayoutGroup=jg;exports.VideoPlayer=Ze;exports.ViewDevice=qs;exports.Vignette=Rr;exports.VisibilityAction=Vc;exports.Voip=co;exports.Volume=$a;exports.VolumeParameter=F;exports.VolumeProfile=Tu;exports.WaitForFrames=n1;exports.WaitForPromise=J0;exports.WaitForSeconds=Vm;exports.Watch=as;exports.WebARCameraBackground=ph;exports.WebARSessionRoot=di;exports.WebXR=Ou;exports.WebXRButtonFactory=Zs;exports.WebXRImageTracking=mh;exports.WebXRImageTrackingModel=Ps;exports.WebXRPlaneTracking=Os;exports.WebXRTrackedImage=Ca;exports.XRControllerFollow=Cs;exports.XRControllerModel=hs;exports.XRControllerMovement=gi;exports.XRFlag=Ti;exports.XRRig=Ju;exports.XRState=jt;exports.XRStateFlag=Pn;exports.__Ignore=cx;exports.__internalNotifyObjectDestroyed=pC;exports.activeInHierarchyFieldName=ls;exports.addAttributeChangeCallback=lm;exports.addComponent=tn;exports.addCustomExtensionPlugin=yO;exports.addNewComponent=Wo;exports.addPatch=Yd;exports.apply=iu;exports.applyHMRChanges=F1;exports.applyPrototypeExtensions=F0;exports.beginListenDestroy=P0;exports.beginListenInstantiate=k0;exports.binaryIdentifierCasts=Pm;exports.build_scene_functions=S1;exports.builtinComponentKeyName=Do;exports.calculateProgress01=gy;exports.clearMessages=qx;exports.colorSerializer=lP;exports.compareAssociation=A0;exports.componentSerializer=ad;exports.copyTexture=Vb;exports.createMotion=bv;exports.debugNet=Nt;exports.debugOwner=xl;exports.decompressGpuTexture=cw;exports.deepClone=bc;exports.delay=In;exports.delayForFrames=vc;exports.deserializeObject=Md;exports.destroy=ji;exports.destroyComponentInstance=N0;exports.determineMimeTypeFromExtension=zv;exports.disposeObjectResources=_e;exports.disposeStream=En;exports.editorGuidKeyName=Ul;exports.enableSpatialConsole=No;exports.euler=hP;exports.eventListSerializer=pP;exports.exportAsGLTF=eT;exports.findByGuid=Nm;exports.findObjectOfType=Oa;exports.findObjectsOfType=$0;exports.findResourceUsers=Am;exports.fitCamera=vv;exports.fitObjectIntoVolume=Wb;exports.foreachComponent=tr;exports.foreachComponentEnumerator=su;exports.forward=dS;exports.generateQRCode=Eb;exports.generateSeed=M0;exports.getBoundingBox=Ft;exports.getCameraController=Ib;exports.getComponent=ur;exports.getComponentInChildren=kc;exports.getComponentInParent=sc;exports.getComponents=Mc;exports.getComponentsInChildren=Pa;exports.getComponentsInParent=tu;exports.getFormattedDate=ew;exports.getIconElement=pt;exports.getIconTexture=Ap;exports.getLoader=on;exports.getOrAddComponent=Oc;exports.getParam=x;exports.getParentHierarchyPath=pS;exports.getPath=Cx;exports.getPeerOptions=HS;exports.getPeerjsInstance=o0;exports.getResourceUserCount=gC;exports.getTempColor=Fb;exports.getTempQuaternion=qt;exports.getTempVector=j;exports.getUrlParams=_c;exports.getVisibleInCustomShadowRendering=$b;exports.getWorldDirection=Ub;exports.getWorldEuler=mm;exports.getWorldPosition=X;exports.getWorldQuaternion=ue;exports.getWorldRotation=Xd;exports.getWorldScale=je;exports.hasCommercialLicense=Xs;exports.hasIndieLicense=Rc;exports.hasPointerEventComponent=Dd;exports.hasProLicense=Dn;exports.hideDebugConsole=Xb;exports.imageToCanvas=hw;exports.instantiate=ir;exports.invokeLoadedImportPluginHooks=qv;exports.invokeXRSessionEnd=e0;exports.invokeXRSessionStart=Jb;exports.isActiveInHierarchy=W0;exports.isActiveSelf=Ma;exports.isAndroidDevice=Rx;exports.isAnimationAction=Nb;exports.isComponent=Mv;exports.isDebugMode=vx;exports.isDesktop=Ox;exports.isDestroyed=er;exports.isDevEnvironment=T;exports.isDisposed=fC;exports.isExporting=ZR;exports.isGLTFModel=Ov;exports.isHostedOnGlitch=xb;exports.isHotReloadEnabled=Bp;exports.isHotReloading=j1;exports.isIPad=kx;exports.isIconElement=av;exports.isLocalNetwork=Ii;exports.isMacOS=Ax;exports.isMobileDevice=Mx;exports.isMozillaXR=Tx;exports.isQuest=Ix;exports.isResourceTrackingEnabled=m0;exports.isSafari=Lx;exports.isUsingInstancing=nu;exports.isiOS=Dx;exports.isiPad=Ex;exports.loadAsset=jR;exports.loadPMREM=zw;exports.loadSync=my;exports.logHierarchy=bd;exports.lookAtInverse=nS;exports.lookAtObject=wc;exports.lookAtScreenPoint=sS;exports.makeId=xx;exports.makeIdFromRandomWords=Pb;exports.makeNameSafe=mi;exports.markAsInstancedRendered=H0;exports.microphonePermissionsGranted=jx;exports.nameof=bx;exports.nameofFactory=Sb;exports.objectSerializer=Sv;exports.offXRSessionEnd=BS;exports.offXRSessionStart=jS;exports.onAfterRender=L1;exports.onBeforeRender=D1;exports.onClear=T1;exports.onDestroy=A1;exports.onInitialized=uv;exports.onStart=au;exports.onUpdate=fv;exports.onXRSessionEnd=Sm;exports.onXRSessionStart=Kd;exports.parseSync=tx;exports.placeOnSurface=Hb;exports.postprocessFBXMaterials=_m;exports.prefix=iP;exports.pushState=Cb;exports.randomNumber=Sx;exports.registerBinaryType=Om;exports.registerComponent=ru;exports.registerComponentExtension=cg;exports.registerCustomEffectType=$i;exports.registerExportExtensions=hg;exports.registerExtensions=Fd;exports.registerHotReloadType=mv;exports.registerLoader=wm;exports.registerPrefabProvider=R0;exports.registerPrototypeExtensions=U0;exports.registerType=jm;exports.relativePathPrefix=Mb;exports.removeAttributeChangeCallback=cm;exports.removeComponent=zm;exports.removeCustomImportExtensionType=_O;exports.removePatch=LS;exports.resolveUrl=oo;exports.sanitizeString=Ob;exports.saveImage=Kw;exports.screenshot=bR;exports.screenshot2=py;exports.sendDestroyed=Lm;exports.serializable=f;exports.serializeObject=L0;exports.serializeable=Be;exports.setActive=Vl;exports.setAllowBalloonMessages=Ab;exports.setAllowOverlayMessages=$x;exports.setAutoFitEnabled=yd;exports.setCameraController=pp;exports.setDestroyed=q0;exports.setDevEnvironment=xS;exports.setDisposable=y0;exports.setDontDestroy=Hr;exports.setOrAddParamsToUrl=dp;exports.setParam=wx;exports.setParamWithoutReload=ec;exports.setPeerOptions=GS;exports.setResourceTrackingEnabled=uC;exports.setState=rm;exports.setVisibleInCustomShadowRendering=ym;exports.setWorldEuler=gm;exports.setWorldPosition=ot;exports.setWorldPositionXYZ=Zo;exports.setWorldQuaternion=sn;exports.setWorldQuaternionXYZW=pm;exports.setWorldRotation=zb;exports.setWorldRotationXYZ=xc;exports.setWorldScale=pa;exports.showBalloonError=Sc;exports.showBalloonMessage=Ce;exports.showBalloonWarning=de;exports.showDebugConsole=bm;exports.slerp=iS;exports.syncDestroy=Cc;exports.syncField=Eg;exports.syncInstantiate=Im;exports.textureToCanvas=mS;exports.toSourceId=kb;exports.tryCastBinary=n0;exports.tryDetermineMimetypeFromBinary=Vv;exports.tryDetermineMimetypeFromURL=Nv;exports.tryFindObject=fa;exports.tryGetGuid=s0;exports.unregisterHotReloadType=gv;exports.unwatchWrite=am;exports.useForAutoFit=jb;exports.validate=yt;exports.watchWrite=qd;
|
package/dist/needle-engine.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GameObject as r, onClear as i, onDestroy as a, onInitialized as s, onAfterRender as l, onBeforeRender as d, onUpdate as c, onStart as m, loadAsset as p, NeedleXRSession as g, Context as u, VERSION as S, Component as C, Components as y } from "./needle-engine.bundle-
|
|
2
|
-
import { $physicsKey as P, ActionBuilder as T, ActionCollection as A, ActionModel as b, Addressables as M, AlignmentConstraint as I, AmbientMode as D, Animation as O, AnimationCurve as x, AnimationExtension as k, AnimationTrackHandler as L, AnimationUtils as N, Animator as B, AnimatorConditionMode as F, AnimatorController as w, AnimatorControllerParameterType as U, AnimatorStateInfo as G, Antialiasing as W, Application as H, AssetDatabase as X, AssetReference as z, Attractor as V, AudioExtension as _, AudioListener as j, AudioSource as K, AudioTrackHandler as Z, Avatar as Q, AvatarBlink_Simple as Y, AvatarEyeLook_Rotation as $, AvatarLoader as J, AvatarMarker as q, AvatarModel as ee, Avatar_Brain_LookAt as te, Avatar_MouthShapes as oe, Avatar_MustacheShake as re, Avatar_POI as ne, Axes as ie, AxesHelper as ae, BUILD_TIME as se, BaseUIComponent as le, BasicIKConstraint as de, BehaviorExtension as ce, BehaviorModel as me, Component$1 as pe, BlobStorage as ge, BloomEffect as ue, BoxCollider as Se, BoxGizmo as Ce, BoxHelperComponent as ye, Button as Ee, ButtonsFactory as Re, CallDirection as he, CallInfo as fe, Camera as ve, CameraTargetReachedEvent as Pe, Canvas as Te, CanvasGroup as Ae, CapsuleCollider as be, ChangeMaterialOnClick as Me, ChangeTransformOnClick as Ie, CharacterController as De, CharacterControllerInput as Oe, ChromaticAberration as xe, CircularBuffer as ke, ClearFlags as Le, ClickThrough as Ne, ClipExtrapolation as Be, Collider as Fe, Collision as we, CollisionDetectionMode as Ue, ColorAdjustments as Ge, ColorBySpeedModule as We, ColorOverLifetimeModule as He, Component$1 as Xe, ComponentLifecycleEvents as ze, ConnectionEvents as Ve, ContactPoint as _e, ContactShadows as je, ContextArgs as Ke, ContextEvent as Ze, ContextRegistry as Qe, ControlTrackHandler as Ye, CursorFollow as $e, CustomBranding as Je, CustomShader as qe, DefaultReflectionMode as et, Deletable as tt, DeleteBox as ot, DepthOfField as rt, DeviceFlag as nt, DeviceUtilities as it, DocumentExtension as at, DragControls as st, DragMode as lt, DropListener as dt, Duplicatable as ct, EffectWrapper as mt, EmissionModule as pt, EmphasizeOnClick as gt, EngineLoadingView as ut, EnvironmentScene as St, EventList as Ct, EventListEvent as yt, EventSystem as Et, EventTrigger as Rt, FieldWithDefault as ht, FileReference as ft, FileReferenceSerializer as vt, FileSpawnModel as Pt, File_Event as Tt, FixedJoint as At, Fog as bt, FrameEvent as Mt, GENERATOR as It, Gizmos as Dt, GltfExport as Ot, GltfExportBox as xt, Gradient as kt, Graphic as Lt, GraphicRaycaster as Nt, Graphics as Bt, GridHelper as Ft, GridLayoutGroup as wt, GroundProjectedEnv as Ut, GroupActionModel as Gt, HideFlags as Wt, HideOnStart as Ht, HingeJoint as Xt, HorizontalLayoutGroup as zt, HostData as Vt, HoverAnimation as _t, Image as jt, ImageReference as Kt, ImageReferenceSerializer as Zt, InheritVelocityModule as Qt, Input as Yt, InputEventQueue as $t, InputEvents as Jt, InputField as qt, InstanceHandle as eo, InstancingHandler as to, InstancingUtil as oo, InstantiateEvent as ro, InstantiateIdProvider as no, InstantiateOptions as io, Interactable as ao, InternalScreenshotUtils as so, JoinedRoomResponse as lo, KeyEventArgs as co, Keyframe as mo, LODGroup as po, LODModel as go, LeftRoomResponse as uo, Light as So, LightData as Co, LimitVelocityOverLifetimeModule as yo, LoadingElementOptions as Eo, LogStats as Ro, LogType as ho, LookAt as fo, LookAtConstraint as vo, MainModule as Po, MarkerTrackHandler as To, MarkerType as Ao, MaskableGraphic as bo, Mathf as Mo, MeshCollider as Io, MeshRenderer as Do, MinMaxCurve as Oo, MinMaxGradient as xo, NEEDLE_ENGINE_FEATURE_FLAGS as ko, MODULES as Lo, NEKeyboardEvent as No, NEPointerEvent as Bo, NeedleButtonElement as Fo, ContextRegistry as wo, NeedleEngineModelLoader as Uo, NeedleEngineWebComponent as Go, NeedleMenu as Wo, NeedlePatchesKey as Ho, USDZExporter$1 as Xo, NeedleXRController as zo, NeedleXRSync as Vo, NeedleXRUtils as _o, NestedGltf as jo, NetworkConnection as Ko, NetworkedStreamEvents as Zo, NetworkedStreams as Qo, Networking as Yo, NewInstanceModel as $o, NoiseModule as Jo, ObjectRaycaster as qo, ObjectUtils as er, OffsetConstraint as tr, OneEuroFilter as or, OneEuroFilterXYZ as rr, OpenURL as nr, OrbitControls as ir, Outline as ar, OwnershipEvent as sr, OwnershipModel as lr, PUBLIC_KEY as dr, Padding as cr, ParticleBurst as mr, ParticleSubEmitter as pr, ParticleSystem as gr, ParticleSystemBaseBehaviour as ur, ParticleSystemRenderer as Sr, ParticleSystemShapeType as Cr, PeerHandle as yr, PeerNetworking as Er, Physics as Rr, PhysicsExtension as hr, PhysicsMaterialCombine as fr, PixelationEffect as vr, PlayAnimationOnClick as Pr, PlayAudioOnClick as Tr, PlayableDirector as Ar, PlayerColor as br, PlayerState as Mr, PlayerStateEvent as Ir, PlayerSync as Dr, PlayerView as Or, PlayerViewManager as xr, PointerEventData as kr, PointerType as Lr, PostProcessingEffect as Nr, PostProcessingEffectOrder as Br, PostProcessingHandler as Fr, Volume as wr, PreliminaryAction as Ur, PreliminaryTrigger as Gr, PreviewHelper as Wr, PrimitiveType as Hr, Progress as Xr, PromiseAllWithErrors as zr, PromiseErrorResult as Vr, RGBAColor as _r, RapierPhysics as jr, RawImage as Kr, RaycastOptions as Zr, Rect as Qr, RectTransform as Yr, ReflectionProbe as $r, RegisteredAnimationInfo as Jr, RemoteSkybox as qr, RenderTexture as en, RenderTextureSerializer as tn, Renderer as on, RendererData as rn, RendererLightmap as nn, Rigidbody as an, RigidbodyConstraints as sn, RoomEvents as ln, RotationBySpeedModule as dn, RotationOverLifetimeModule as cn, SceneLightSettings as mn, SceneSwitcher as pn, ScreenCapture as gn, ScreenSpaceAmbientOcclusion as un, ScreenSpaceAmbientOcclusionN8 as Sn, ScrollFollow as Cn, SeeThrough as yn, SendQueue as En, SerializationContext as Rn, SetActiveOnClick as hn, ShadowCatcher as fn, ShapeModule as vn, ShapeOverlapResult as Pn, SharpeningEffect as Tn, SignalAsset as An, SignalReceiver as bn, SignalReceiverEvent as Mn, SignalTrackHandler as In, Size as Dn, SizeBySpeedModule as On, SizeOverLifetimeModule as xn, SkinnedMeshRenderer as kn, SmoothFollow as Ln, SpatialGrabRaycaster as Nn, SpatialHtml as Bn, SpatialTrigger as Fn, SpatialTriggerReceiver as wn, SpectatorCamera as Un, SphereCollider as Gn, SphereIntersection as Wn, SplineContainer as Hn, SplineData as Xn, SplineUtils as zn, SplineWalker as Vn, Sprite as _n, SpriteData as jn, SpriteRenderer as Kn, SpriteSheet as Zn, StateMachineBehaviour as Qn, StreamEndedEvent as Yn, StreamReceivedEvent as $n, SubEmitterSystem as Jn, SyncedCamera as qn, SyncedRoom as ei, SyncedTransform as ti, TapGestureTrigger as oi, TeleportTarget as ri, TestRunner as ni, TestSceneUtils as ii, TestSimulateUserData as ai, Text as si, TextBuilder as li, TextExtension as di, TextureSheetAnimationModule as ci, TiltShiftEffect as mi, Time as pi, ToneMappingEffect as gi, TrackHandler as ui, TrackType as Si, TrailModule as Ci, TransformData as yi, TransformGizmo as Ei, TriggerBuilder as Ri, TriggerModel as hi, TypeStore as fi, UIRaycastUtils as vi, UIRootComponent as Pi, USDDocument as Ti, USDObject as Ai, USDWriter as bi, USDZExporter as Mi, USDZText as Ii, USDZUIExtension as Di, UriSerializer as Oi, UsageMarker as xi, UserJoinedOrLeftRoomModel as ki, VariantAction as Li, VelocityOverLifetimeModule as Ni, VerticalLayoutGroup as Bi, VideoPlayer as Fi, ViewBox as wi, ViewDevice as Ui, Vignette as Gi, VisibilityAction as Wi, Voip as Hi, Volume as Xi, VolumeParameter as zi, VolumeProfile as Vi, WaitForFrames as _i, WaitForPromise as ji, WaitForSeconds as Ki, Watch as Zi, WebARCameraBackground as Qi, WebARSessionRoot as Yi, WebXR as $i, WebXRButtonFactory as Ji, WebXRImageTracking as qi, WebXRImageTrackingModel as ea, WebXRPlaneTracking as ta, WebXRTrackedImage as oa, XRControllerFollow as ra, XRControllerModel as na, XRControllerMovement as ia, XRFlag as aa, XRRig as sa, XRState as la, XRStateFlag as da, __Ignore as ca, __internalNotifyObjectDestroyed as ma, activeInHierarchyFieldName as pa, addAttributeChangeCallback as ga, addComponent as ua, addCustomExtensionPlugin as Sa, addNewComponent as Ca, addPatch as ya, apply as Ea, applyHMRChanges as Ra, applyPrototypeExtensions as ha, beginListenDestroy as fa, beginListenInstantiate as va, binaryIdentifierCasts as Pa, build_scene_functions as Ta, builtinComponentKeyName as Aa, calculateProgress01 as ba, clearMessages as Ma, clearMessages as Ia, colorSerializer as Da, compareAssociation as Oa, componentSerializer as xa, copyTexture as ka, createMotion as La, debugNet as Na, debugOwner as Ba, decompressGpuTexture as Fa, deepClone as wa, delay as Ua, delayForFrames as Ga, deserializeObject as Wa, destroy as Ha, destroyComponentInstance as Xa, determineMimeTypeFromExtension as za, disposeObjectResources as Va, disposeStream as _a, editorGuidKeyName as ja, enableSpatialConsole as Ka, euler as Za, eventListSerializer as Qa, exportAsGLTF as Ya, findByGuid as $a, findObjectOfType as Ja, findObjectsOfType as qa, findResourceUsers as es, fitCamera as ts, fitObjectIntoVolume as os, foreachComponent as rs, foreachComponentEnumerator as ns, forward as is, generateQRCode as as, generateSeed as ss, getBoundingBox as ls, getCameraController as ds, getComponent as cs, getComponentInChildren as ms, getComponentInParent as ps, getComponents as gs, getComponentsInChildren as us, getComponentsInParent as Ss, getFormattedDate as Cs, getIconElement as ys, getIconTexture as Es, getLoader as Rs, getOrAddComponent as hs, getParam as fs, getParentHierarchyPath as vs, getPath as Ps, getPeerOptions as Ts, getPeerjsInstance as As, getResourceUserCount as bs, getTempColor as Ms, getTempQuaternion as Is, getTempVector as Ds, getUrlParams as Os, getVisibleInCustomShadowRendering as xs, getWorldDirection as ks, getWorldEuler as Ls, getWorldPosition as Ns, getWorldQuaternion as Bs, getWorldRotation as Fs, getWorldScale as ws, hasCommercialLicense as Us, hasIndieLicense as Gs, hasPointerEventComponent as Ws, hasProLicense as Hs, hideDebugConsole as Xs, imageToCanvas as zs, instantiate as Vs, invokeLoadedImportPluginHooks as _s, invokeXRSessionEnd as js, invokeXRSessionStart as Ks, isActiveInHierarchy as Zs, isActiveSelf as Qs, isAndroidDevice as Ys, isAnimationAction as $s, isComponent as Js, isDebugMode as qs, isDesktop as el, isDestroyed as tl, isDevEnvironment as ol, isDisposed as rl, isExporting as nl, isGLTFModel as il, isHostedOnGlitch as al, isHotReloadEnabled as sl, isHotReloading as ll, isIPad as dl, isIconElement as cl, isLocalNetwork as ml, isMacOS as pl, isMobileDevice as gl, isMozillaXR as ul, isQuest as Sl, isResourceTrackingEnabled as Cl, isSafari as yl, isUsingInstancing as El, isiOS as Rl, isiPad as hl, loadPMREM as fl, loadSync as vl, logHierarchy as Pl, lookAtInverse as Tl, lookAtObject as Al, lookAtScreenPoint as bl, makeId as Ml, makeIdFromRandomWords as Il, makeNameSafe as Dl, markAsInstancedRendered as Ol, microphonePermissionsGranted as xl, nameof as kl, nameofFactory as Ll, objectSerializer as Nl, offXRSessionEnd as Bl, offXRSessionStart as Fl, onXRSessionEnd as wl, onXRSessionStart as Ul, parseSync as Gl, placeOnSurface as Wl, postprocessFBXMaterials as Hl, prefix as Xl, pushState as zl, randomNumber as Vl, registerBinaryType as _l, registerComponent as jl, registerComponentExtension as Kl, registerCustomEffectType as Zl, registerExportExtensions as Ql, registerExtensions as Yl, registerHotReloadType as $l, registerLoader as Jl, registerPrefabProvider as ql, registerPrototypeExtensions as ed, registerType as td, relativePathPrefix as od, removeAttributeChangeCallback as rd, removeComponent as nd, removeCustomImportExtensionType as id, removePatch as ad, resolveUrl as sd, sanitizeString as ld, saveImage as dd, screenshot as cd, screenshot2 as md, sendDestroyed as pd, serializable as gd, serializeObject as ud, serializeable as Sd, setActive as Cd, setAllowBalloonMessages as yd, setAllowOverlayMessages as Ed, setAutoFitEnabled as Rd, setCameraController as hd, setDestroyed as fd, setDevEnvironment as vd, setDisposable as Pd, setDontDestroy as Td, setOrAddParamsToUrl as Ad, setParam as bd, setParamWithoutReload as Md, setPeerOptions as Id, setResourceTrackingEnabled as Dd, setState as Od, setVisibleInCustomShadowRendering as xd, setWorldEuler as kd, setWorldPosition as Ld, setWorldPositionXYZ as Nd, setWorldQuaternion as Bd, setWorldQuaternionXYZW as Fd, setWorldRotation as wd, setWorldRotationXYZ as Ud, setWorldScale as Gd, showBalloonError as Wd, showBalloonMessage as Hd, showBalloonWarning as Xd, showDebugConsole as zd, slerp as Vd, syncDestroy as _d, syncField as jd, syncInstantiate as Kd, textureToCanvas as Zd, toSourceId as Qd, tryCastBinary as Yd, tryDetermineMimetypeFromBinary as $d, tryDetermineMimetypeFromURL as Jd, tryFindObject as qd, tryGetGuid as ec, unregisterHotReloadType as tc, unwatchWrite as oc, useForAutoFit as rc, validate as nc, watchWrite as ic } from "./needle-engine.bundle-DxIfYnRl.js";
|
|
1
|
+
import { GameObject as r, onClear as i, onDestroy as a, onInitialized as s, onAfterRender as l, onBeforeRender as d, onUpdate as c, onStart as m, loadAsset as p, NeedleXRSession as g, Context as u, VERSION as S, Component as C, Components as y } from "./needle-engine.bundle-B_aGaFmh.js";
|
|
2
|
+
import { $physicsKey as P, ActionBuilder as T, ActionCollection as A, ActionModel as b, Addressables as M, AlignmentConstraint as I, AmbientMode as D, Animation as O, AnimationCurve as x, AnimationExtension as k, AnimationTrackHandler as L, AnimationUtils as N, Animator as B, AnimatorConditionMode as F, AnimatorController as w, AnimatorControllerParameterType as U, AnimatorStateInfo as G, Antialiasing as W, Application as H, AssetDatabase as X, AssetReference as z, Attractor as V, AudioExtension as _, AudioListener as j, AudioSource as K, AudioTrackHandler as Z, Avatar as Q, AvatarBlink_Simple as Y, AvatarEyeLook_Rotation as $, AvatarLoader as J, AvatarMarker as q, AvatarModel as ee, Avatar_Brain_LookAt as te, Avatar_MouthShapes as oe, Avatar_MustacheShake as re, Avatar_POI as ne, Axes as ie, AxesHelper as ae, BUILD_TIME as se, BaseUIComponent as le, BasicIKConstraint as de, BehaviorExtension as ce, BehaviorModel as me, Component$1 as pe, BlobStorage as ge, BloomEffect as ue, BoxCollider as Se, BoxGizmo as Ce, BoxHelperComponent as ye, Button as Ee, ButtonsFactory as Re, CallDirection as he, CallInfo as fe, Camera as ve, CameraTargetReachedEvent as Pe, Canvas as Te, CanvasGroup as Ae, CapsuleCollider as be, ChangeMaterialOnClick as Me, ChangeTransformOnClick as Ie, CharacterController as De, CharacterControllerInput as Oe, ChromaticAberration as xe, CircularBuffer as ke, ClearFlags as Le, ClickThrough as Ne, ClipExtrapolation as Be, Collider as Fe, Collision as we, CollisionDetectionMode as Ue, ColorAdjustments as Ge, ColorBySpeedModule as We, ColorOverLifetimeModule as He, Component$1 as Xe, ComponentLifecycleEvents as ze, ConnectionEvents as Ve, ContactPoint as _e, ContactShadows as je, ContextArgs as Ke, ContextEvent as Ze, ContextRegistry as Qe, ControlTrackHandler as Ye, CursorFollow as $e, CustomBranding as Je, CustomShader as qe, DefaultReflectionMode as et, Deletable as tt, DeleteBox as ot, DepthOfField as rt, DeviceFlag as nt, DeviceUtilities as it, DocumentExtension as at, DragControls as st, DragMode as lt, DropListener as dt, Duplicatable as ct, EffectWrapper as mt, EmissionModule as pt, EmphasizeOnClick as gt, EngineLoadingView as ut, EnvironmentScene as St, EventList as Ct, EventListEvent as yt, EventSystem as Et, EventTrigger as Rt, FieldWithDefault as ht, FileReference as ft, FileReferenceSerializer as vt, FileSpawnModel as Pt, File_Event as Tt, FixedJoint as At, Fog as bt, FrameEvent as Mt, GENERATOR as It, Gizmos as Dt, GltfExport as Ot, GltfExportBox as xt, Gradient as kt, Graphic as Lt, GraphicRaycaster as Nt, Graphics as Bt, GridHelper as Ft, GridLayoutGroup as wt, GroundProjectedEnv as Ut, GroupActionModel as Gt, HideFlags as Wt, HideOnStart as Ht, HingeJoint as Xt, HorizontalLayoutGroup as zt, HostData as Vt, HoverAnimation as _t, Image as jt, ImageReference as Kt, ImageReferenceSerializer as Zt, InheritVelocityModule as Qt, Input as Yt, InputEventQueue as $t, InputEvents as Jt, InputField as qt, InstanceHandle as eo, InstancingHandler as to, InstancingUtil as oo, InstantiateEvent as ro, InstantiateIdProvider as no, InstantiateOptions as io, Interactable as ao, InternalScreenshotUtils as so, JoinedRoomResponse as lo, KeyEventArgs as co, Keyframe as mo, LODGroup as po, LODModel as go, LeftRoomResponse as uo, Light as So, LightData as Co, LimitVelocityOverLifetimeModule as yo, LoadingElementOptions as Eo, LogStats as Ro, LogType as ho, LookAt as fo, LookAtConstraint as vo, MainModule as Po, MarkerTrackHandler as To, MarkerType as Ao, MaskableGraphic as bo, Mathf as Mo, MeshCollider as Io, MeshRenderer as Do, MinMaxCurve as Oo, MinMaxGradient as xo, NEEDLE_ENGINE_FEATURE_FLAGS as ko, MODULES as Lo, NEKeyboardEvent as No, NEPointerEvent as Bo, NeedleButtonElement as Fo, ContextRegistry as wo, NeedleEngineModelLoader as Uo, NeedleEngineWebComponent as Go, NeedleMenu as Wo, NeedlePatchesKey as Ho, USDZExporter$1 as Xo, NeedleXRController as zo, NeedleXRSync as Vo, NeedleXRUtils as _o, NestedGltf as jo, NetworkConnection as Ko, NetworkedStreamEvents as Zo, NetworkedStreams as Qo, Networking as Yo, NewInstanceModel as $o, NoiseModule as Jo, ObjectRaycaster as qo, ObjectUtils as er, OffsetConstraint as tr, OneEuroFilter as or, OneEuroFilterXYZ as rr, OpenURL as nr, OrbitControls as ir, Outline as ar, OwnershipEvent as sr, OwnershipModel as lr, PUBLIC_KEY as dr, Padding as cr, ParticleBurst as mr, ParticleSubEmitter as pr, ParticleSystem as gr, ParticleSystemBaseBehaviour as ur, ParticleSystemRenderer as Sr, ParticleSystemShapeType as Cr, PeerHandle as yr, PeerNetworking as Er, Physics as Rr, PhysicsExtension as hr, PhysicsMaterialCombine as fr, PixelationEffect as vr, PlayAnimationOnClick as Pr, PlayAudioOnClick as Tr, PlayableDirector as Ar, PlayerColor as br, PlayerState as Mr, PlayerStateEvent as Ir, PlayerSync as Dr, PlayerView as Or, PlayerViewManager as xr, PointerEventData as kr, PointerType as Lr, PostProcessingEffect as Nr, PostProcessingEffectOrder as Br, PostProcessingHandler as Fr, Volume as wr, PreliminaryAction as Ur, PreliminaryTrigger as Gr, PreviewHelper as Wr, PrimitiveType as Hr, Progress as Xr, PromiseAllWithErrors as zr, PromiseErrorResult as Vr, RGBAColor as _r, RapierPhysics as jr, RawImage as Kr, RaycastOptions as Zr, Rect as Qr, RectTransform as Yr, ReflectionProbe as $r, RegisteredAnimationInfo as Jr, RemoteSkybox as qr, RenderTexture as en, RenderTextureSerializer as tn, Renderer as on, RendererData as rn, RendererLightmap as nn, Rigidbody as an, RigidbodyConstraints as sn, RoomEvents as ln, RotationBySpeedModule as dn, RotationOverLifetimeModule as cn, SceneLightSettings as mn, SceneSwitcher as pn, ScreenCapture as gn, ScreenSpaceAmbientOcclusion as un, ScreenSpaceAmbientOcclusionN8 as Sn, ScrollFollow as Cn, SeeThrough as yn, SendQueue as En, SerializationContext as Rn, SetActiveOnClick as hn, ShadowCatcher as fn, ShapeModule as vn, ShapeOverlapResult as Pn, SharpeningEffect as Tn, SignalAsset as An, SignalReceiver as bn, SignalReceiverEvent as Mn, SignalTrackHandler as In, Size as Dn, SizeBySpeedModule as On, SizeOverLifetimeModule as xn, SkinnedMeshRenderer as kn, SmoothFollow as Ln, SpatialGrabRaycaster as Nn, SpatialHtml as Bn, SpatialTrigger as Fn, SpatialTriggerReceiver as wn, SpectatorCamera as Un, SphereCollider as Gn, SphereIntersection as Wn, SplineContainer as Hn, SplineData as Xn, SplineUtils as zn, SplineWalker as Vn, Sprite as _n, SpriteData as jn, SpriteRenderer as Kn, SpriteSheet as Zn, StateMachineBehaviour as Qn, StreamEndedEvent as Yn, StreamReceivedEvent as $n, SubEmitterSystem as Jn, SyncedCamera as qn, SyncedRoom as ei, SyncedTransform as ti, TapGestureTrigger as oi, TeleportTarget as ri, TestRunner as ni, TestSceneUtils as ii, TestSimulateUserData as ai, Text as si, TextBuilder as li, TextExtension as di, TextureSheetAnimationModule as ci, TiltShiftEffect as mi, Time as pi, ToneMappingEffect as gi, TrackHandler as ui, TrackType as Si, TrailModule as Ci, TransformData as yi, TransformGizmo as Ei, TriggerBuilder as Ri, TriggerModel as hi, TypeStore as fi, UIRaycastUtils as vi, UIRootComponent as Pi, USDDocument as Ti, USDObject as Ai, USDWriter as bi, USDZExporter as Mi, USDZText as Ii, USDZUIExtension as Di, UriSerializer as Oi, UsageMarker as xi, UserJoinedOrLeftRoomModel as ki, VariantAction as Li, VelocityOverLifetimeModule as Ni, VerticalLayoutGroup as Bi, VideoPlayer as Fi, ViewBox as wi, ViewDevice as Ui, Vignette as Gi, VisibilityAction as Wi, Voip as Hi, Volume as Xi, VolumeParameter as zi, VolumeProfile as Vi, WaitForFrames as _i, WaitForPromise as ji, WaitForSeconds as Ki, Watch as Zi, WebARCameraBackground as Qi, WebARSessionRoot as Yi, WebXR as $i, WebXRButtonFactory as Ji, WebXRImageTracking as qi, WebXRImageTrackingModel as ea, WebXRPlaneTracking as ta, WebXRTrackedImage as oa, XRControllerFollow as ra, XRControllerModel as na, XRControllerMovement as ia, XRFlag as aa, XRRig as sa, XRState as la, XRStateFlag as da, __Ignore as ca, __internalNotifyObjectDestroyed as ma, activeInHierarchyFieldName as pa, addAttributeChangeCallback as ga, addComponent as ua, addCustomExtensionPlugin as Sa, addNewComponent as Ca, addPatch as ya, apply as Ea, applyHMRChanges as Ra, applyPrototypeExtensions as ha, beginListenDestroy as fa, beginListenInstantiate as va, binaryIdentifierCasts as Pa, build_scene_functions as Ta, builtinComponentKeyName as Aa, calculateProgress01 as ba, clearMessages as Ma, clearMessages as Ia, colorSerializer as Da, compareAssociation as Oa, componentSerializer as xa, copyTexture as ka, createMotion as La, debugNet as Na, debugOwner as Ba, decompressGpuTexture as Fa, deepClone as wa, delay as Ua, delayForFrames as Ga, deserializeObject as Wa, destroy as Ha, destroyComponentInstance as Xa, determineMimeTypeFromExtension as za, disposeObjectResources as Va, disposeStream as _a, editorGuidKeyName as ja, enableSpatialConsole as Ka, euler as Za, eventListSerializer as Qa, exportAsGLTF as Ya, findByGuid as $a, findObjectOfType as Ja, findObjectsOfType as qa, findResourceUsers as es, fitCamera as ts, fitObjectIntoVolume as os, foreachComponent as rs, foreachComponentEnumerator as ns, forward as is, generateQRCode as as, generateSeed as ss, getBoundingBox as ls, getCameraController as ds, getComponent as cs, getComponentInChildren as ms, getComponentInParent as ps, getComponents as gs, getComponentsInChildren as us, getComponentsInParent as Ss, getFormattedDate as Cs, getIconElement as ys, getIconTexture as Es, getLoader as Rs, getOrAddComponent as hs, getParam as fs, getParentHierarchyPath as vs, getPath as Ps, getPeerOptions as Ts, getPeerjsInstance as As, getResourceUserCount as bs, getTempColor as Ms, getTempQuaternion as Is, getTempVector as Ds, getUrlParams as Os, getVisibleInCustomShadowRendering as xs, getWorldDirection as ks, getWorldEuler as Ls, getWorldPosition as Ns, getWorldQuaternion as Bs, getWorldRotation as Fs, getWorldScale as ws, hasCommercialLicense as Us, hasIndieLicense as Gs, hasPointerEventComponent as Ws, hasProLicense as Hs, hideDebugConsole as Xs, imageToCanvas as zs, instantiate as Vs, invokeLoadedImportPluginHooks as _s, invokeXRSessionEnd as js, invokeXRSessionStart as Ks, isActiveInHierarchy as Zs, isActiveSelf as Qs, isAndroidDevice as Ys, isAnimationAction as $s, isComponent as Js, isDebugMode as qs, isDesktop as el, isDestroyed as tl, isDevEnvironment as ol, isDisposed as rl, isExporting as nl, isGLTFModel as il, isHostedOnGlitch as al, isHotReloadEnabled as sl, isHotReloading as ll, isIPad as dl, isIconElement as cl, isLocalNetwork as ml, isMacOS as pl, isMobileDevice as gl, isMozillaXR as ul, isQuest as Sl, isResourceTrackingEnabled as Cl, isSafari as yl, isUsingInstancing as El, isiOS as Rl, isiPad as hl, loadPMREM as fl, loadSync as vl, logHierarchy as Pl, lookAtInverse as Tl, lookAtObject as Al, lookAtScreenPoint as bl, makeId as Ml, makeIdFromRandomWords as Il, makeNameSafe as Dl, markAsInstancedRendered as Ol, microphonePermissionsGranted as xl, nameof as kl, nameofFactory as Ll, objectSerializer as Nl, offXRSessionEnd as Bl, offXRSessionStart as Fl, onXRSessionEnd as wl, onXRSessionStart as Ul, parseSync as Gl, placeOnSurface as Wl, postprocessFBXMaterials as Hl, prefix as Xl, pushState as zl, randomNumber as Vl, registerBinaryType as _l, registerComponent as jl, registerComponentExtension as Kl, registerCustomEffectType as Zl, registerExportExtensions as Ql, registerExtensions as Yl, registerHotReloadType as $l, registerLoader as Jl, registerPrefabProvider as ql, registerPrototypeExtensions as ed, registerType as td, relativePathPrefix as od, removeAttributeChangeCallback as rd, removeComponent as nd, removeCustomImportExtensionType as id, removePatch as ad, resolveUrl as sd, sanitizeString as ld, saveImage as dd, screenshot as cd, screenshot2 as md, sendDestroyed as pd, serializable as gd, serializeObject as ud, serializeable as Sd, setActive as Cd, setAllowBalloonMessages as yd, setAllowOverlayMessages as Ed, setAutoFitEnabled as Rd, setCameraController as hd, setDestroyed as fd, setDevEnvironment as vd, setDisposable as Pd, setDontDestroy as Td, setOrAddParamsToUrl as Ad, setParam as bd, setParamWithoutReload as Md, setPeerOptions as Id, setResourceTrackingEnabled as Dd, setState as Od, setVisibleInCustomShadowRendering as xd, setWorldEuler as kd, setWorldPosition as Ld, setWorldPositionXYZ as Nd, setWorldQuaternion as Bd, setWorldQuaternionXYZW as Fd, setWorldRotation as wd, setWorldRotationXYZ as Ud, setWorldScale as Gd, showBalloonError as Wd, showBalloonMessage as Hd, showBalloonWarning as Xd, showDebugConsole as zd, slerp as Vd, syncDestroy as _d, syncField as jd, syncInstantiate as Kd, textureToCanvas as Zd, toSourceId as Qd, tryCastBinary as Yd, tryDetermineMimetypeFromBinary as $d, tryDetermineMimetypeFromURL as Jd, tryFindObject as qd, tryGetGuid as ec, unregisterHotReloadType as tc, unwatchWrite as oc, useForAutoFit as rc, validate as nc, watchWrite as ic } from "./needle-engine.bundle-B_aGaFmh.js";
|
|
3
3
|
import { NEEDLE_progressive as sc } from "./gltf-progressive-BvlZQAkt.js";
|
|
4
4
|
import { THREE as E } from "./three-MHVqtJYj.js";
|
|
5
5
|
const t = {
|