@needle-tools/engine 4.16.4-alpha → 4.16.4-next.ea29ba9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{needle-engine.bundle-LGUii273.js → needle-engine.bundle-ClGOg7Mj.js} +6 -6
- package/dist/{needle-engine.bundle-C_iC-4wt.min.js → needle-engine.bundle-Dj83WU7C.min.js} +3 -3
- package/dist/{needle-engine.bundle-BQv3gp3d.umd.cjs → needle-engine.bundle-DkY-7g1c.umd.cjs} +5 -5
- package/dist/needle-engine.d.ts +15 -15
- package/dist/needle-engine.js +2 -2
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-C-WOZQC5.js → postprocessing-BUS23YkY.js} +2 -2
- package/dist/{postprocessing-CtXfLXvp.umd.cjs → postprocessing-C_736uMz.umd.cjs} +2 -2
- package/dist/{postprocessing-DXm8YKbQ.min.js → postprocessing-CaEfRjRY.min.js} +2 -2
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import { createLoaders as og, getRaycastMesh as Pv, LODsManager as Zo, NEEDLE_pr
|
|
|
3
3
|
import { GroundedSkybox as $a, Font as CC, TextGeometry as PC, FontLoader as kC, GLTFLoader as Ls, TransformControlsGizmo as kv, EXRLoader as rg, RGBELoader as Ov, Stats as OC, nodeFrame as Vy, OrbitControls as MC, PositionalAudioHelper as EC, HorizontalBlurShader as RC, VerticalBlurShader as TC, GLTFExporter as Mv, strToU8 as Ev, zipSync as AC, XRControllerModelFactory as IC, XRHandMeshModel as LC, Line2 as DC, LineGeometry as jC, LineMaterial as BC, TransformControls as FC, InteractiveGroup as zC, HTMLMesh as UC, VertexNormalsHelper as NC, OBJLoader as ag, FBXLoader as Rv, mergeVertices as $C } from "./three-examples.js";
|
|
4
4
|
import { fetchProfile as WC, MotionController as VC, $70d766613f57b014$export$2e2bcd8739ae039 as Hy, ByteBuffer as HC, v5 as Gy, md5 as qy, SIZE_PREFIX_LENGTH as Tv, Builder as lg, createNoise4D as GC, Matrix4 as Tf, BatchedParticleRenderer as qC, ParticleSystem as XC, RenderMode as ps, ConstantColor as QC, Vector4 as YC, ConstantValue as KC, TrailParticle as Xy, WorkerBase as ZC, MeshBVH as JC } from "./vendor-BsRxp-FT.js";
|
|
5
5
|
import { __webpack_exports__default as Pe, __webpack_exports__Text as Av, __webpack_exports__Block as Iv, __webpack_exports__update as e1, SimpleStateBehavior as t1, __webpack_exports__Inline as Af, __webpack_exports__FontLibrary as Qy, ThreeMeshUI as Yy } from "./three-mesh-ui-B-lqrZWj.js";
|
|
6
|
-
import { EffectAttribute as i1 } from "./postprocessing-
|
|
6
|
+
import { EffectAttribute as i1 } from "./postprocessing-BUS23YkY.js";
|
|
7
7
|
const If = /* @__PURE__ */ new Map();
|
|
8
8
|
function Qi(s = globalThis.location?.hostname) {
|
|
9
9
|
if (If.has(s)) return If.get(s);
|
|
@@ -1988,11 +1988,11 @@ Ro('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"]
|
|
|
1988
1988
|
Ro('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');
|
|
1989
1989
|
Ro('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');
|
|
1990
1990
|
Ro('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
|
|
1991
|
-
Ro('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.16.4-alpha";');
|
|
1991
|
+
Ro('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.16.4-alpha.1";');
|
|
1992
1992
|
Ro('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
|
|
1993
|
-
Ro('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Sun Mar 15 2026 15:
|
|
1993
|
+
Ro('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Sun Mar 15 2026 15:47:33 GMT+0000 (Coordinated Universal Time)";');
|
|
1994
1994
|
Ro('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
|
|
1995
|
-
const qi = "4.16.4-alpha", Rc = "undefined", Fd = "Sun Mar 15 2026 15:
|
|
1995
|
+
const qi = "4.16.4-alpha.1", Rc = "undefined", Fd = "Sun Mar 15 2026 15:47:33 GMT+0000 (Coordinated Universal Time)";
|
|
1996
1996
|
i0 && console.log(`Engine version: ${qi} (generator: ${Rc})
|
|
1997
1997
|
Project built at ${Fd}`);
|
|
1998
1998
|
const mr = NEEDLE_PUBLIC_KEY, bo = "needle_isActiveInHierarchy", ha = "builtin_components", hd = "needle_editor_guid";
|
|
@@ -15565,7 +15565,7 @@ var A;
|
|
|
15565
15565
|
e.ready = i;
|
|
15566
15566
|
async function n() {
|
|
15567
15567
|
if (e.MODULE) return e.MODULE;
|
|
15568
|
-
const o = await import("./postprocessing-
|
|
15568
|
+
const o = await import("./postprocessing-BUS23YkY.js").then((r) => r.index);
|
|
15569
15569
|
return e.MODULE = o, e.MAYBEMODULE = o, t.forEach((r) => r(o)), t.length = 0, o;
|
|
15570
15570
|
}
|
|
15571
15571
|
e.load = n;
|
|
@@ -15580,7 +15580,7 @@ var A;
|
|
|
15580
15580
|
e.ready = i;
|
|
15581
15581
|
async function n() {
|
|
15582
15582
|
if (e.MODULE) return e.MODULE;
|
|
15583
|
-
const o = await import("./postprocessing-
|
|
15583
|
+
const o = await import("./postprocessing-BUS23YkY.js").then((r) => r.N8AO);
|
|
15584
15584
|
return e.MODULE = o, e.MAYBEMODULE = o, t.forEach((r) => r(o)), t.length = 0, o;
|
|
15585
15585
|
}
|
|
15586
15586
|
e.load = n;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Vector2 as K,Vector3 as b,Vector4 as ye,Quaternion as N,PlaneGeometry as vn,WebGLRenderer as yr,PerspectiveCamera as de,OrthographicCamera as Cd,Scene as Hi,Mesh as H,Texture as Se,Uniform$1 as Gi,Color as oe,ShaderMaterial as Vn,Box3 as Yt,ShadowMaterial as gb,Euler as at,MeshStandardMaterial as gt,Box3Helper as GS,GridHelper as fb,Object3D as M,Material as we,Matrix3 as yb,Matrix4 as J,Layers as _s,Ray as So,MathUtils as Co,AxesHelper as Pi,MeshBasicMaterial as Ce,DoubleSide as Oi,BufferGeometry as wn,Group as Po,CylinderGeometry as bb,SphereGeometry as Pd,BoxGeometry as Aa,SpriteMaterial as qS,Sprite as XS,Shape as QS,ExtrudeGeometry as YS,Fog as _b,DirectionalLight as km,PointLight as Mm,TextureLoader as br,EdgesGeometry as ZS,LineSegments as vb,LineBasicMaterial as Em,Line as Ia,BufferAttribute as ft,Raycaster as Od,Sphere as kd,ArrayCamera as KS,Plane as _r,SkinnedMesh as vs,InterleavedBufferAttribute as wb,Skeleton as JS,Bone as eC,WebGLCubeRenderTarget as tC,CubeCamera as iC,AnimationClip as ki,FileLoader as Rm,PropertyBinding as La,KeyframeTrack as nC,LinearSRGBColorSpace as Oo,ShaderChunk as Zt,DataTexture as Tm,RGBAFormat as Md,EquirectangularReflectionMapping as ko,SRGBColorSpace as Mo,Clock as oC,NeutralToneMapping as ja,AgXToneMapping as Ed,ACESFilmicToneMapping as Rd,NoToneMapping as Td,PCFSoftShadowMap$1 as sC,BasicNodeLibrary as rC,WebGLRenderTarget as $n,DepthTexture as xb,NearestFilter as Ad,LoopRepeat as aC,LoopOnce as Am,AnimationMixer as Im,CompressedTexture as lC,FrontSide as ws,Camera as cC,Frustum as Sb,AudioListener as hC,PositionalAudio as dC,AudioLoader as Lm,EventDispatcher as jm,BackSide as Id,MeshDepthMaterial as uC,CustomBlending as pC,MaxEquation as mC,AlwaysStencilFunc as gC,GreaterEqualStencilFunc as fC,NotEqualStencilFunc as yC,GreaterStencilFunc as bC,LessEqualStencilFunc as _C,EqualStencilFunc as vC,LessStencilFunc as wC,NeverStencilFunc as Cb,InvertStencilOp as xC,DecrementWrapStencilOp as SC,IncrementWrapStencilOp as CC,DecrementStencilOp as PC,IncrementStencilOp as OC,ReplaceStencilOp as kC,ZeroStencilOp as MC,KeepStencilOp as EC,CubeUVReflectionMapping as Pb,CubeTexture as Ob,AmbientLight as RC,HemisphereLight as TC,Loader as AC,RawShaderMaterial as kb,GLSL3 as IC,AlwaysDepth as LC,GreaterEqualDepth as jC,GreaterDepth as DC,LessEqualDepth as BC,LessDepth as FC,NotEqualDepth as UC,EqualDepth as zC,BatchedMesh as Mb,LinearFilter as Ld,UnsignedByteType as NC,MeshPhysicalMaterial as Eb,RingGeometry as WC,Line3 as VC,AdditiveBlending as Rb,BoxHelper as $C,SpotLight as HC,DirectionalLightHelper as GC,CameraHelper as qC,LOD as XC,Triangle as QC,NormalBlending as YC,ReinhardToneMapping as Dm,LinearToneMapping as Bm,HalfFloatType as Fm,VideoTexture as ZC,CompressedCubeTexture as KC,EquirectangularRefractionMapping as JC,CatmullRomCurve3 as eP,VectorKeyframeTrack as tP,QuaternionKeyframeTrack as iP,Audio as nP,ShaderLib as jd,UniformsUtils as Tb,MirroredRepeatWrapping as Ab,MeshNormalMaterial as oP,AudioContext as sP,PMREMGenerator$1 as rP}from"./three.min.js";import{createLoaders as Um,getRaycastMesh as Ib,LODsManager as vr,NEEDLE_progressive as Ve,addDracoAndKTX2Loaders as aP,configureLoader as lP,setKTX2TranscoderLocation as cP,setDracoDecoderLocation as hP}from"./gltf-progressive-DQa78GTA.min.js";import{GroundedSkybox as Da,Font as dP,TextGeometry as uP,FontLoader as pP,GLTFLoader as Eo,TransformControlsGizmo as Lb,EXRLoader as zm,RGBELoader as jb,Stats as mP,nodeFrame as Db,OrbitControls as gP,PositionalAudioHelper as fP,HorizontalBlurShader as yP,VerticalBlurShader as bP,GLTFExporter as Bb,strToU8 as Fb,zipSync as _P,XRControllerModelFactory as vP,XRHandMeshModel as wP,Line2 as xP,LineGeometry as SP,LineMaterial as CP,TransformControls as PP,InteractiveGroup as OP,HTMLMesh as kP,VertexNormalsHelper as MP,OBJLoader as Nm,FBXLoader as Ub,mergeVertices as EP}from"./three-examples.min.js";import{fetchProfile as RP,MotionController as TP,$70d766613f57b014$export$2e2bcd8739ae039 as zb,ByteBuffer as AP,v5 as Nb,md5 as Wb,SIZE_PREFIX_LENGTH as Vb,Builder as Wm,createNoise4D as IP,Matrix4 as Vm,BatchedParticleRenderer as LP,ParticleSystem as jP,RenderMode as Ro,ConstantColor as DP,Vector4 as BP,ConstantValue as FP,TrailParticle as $b,WorkerBase as UP,MeshBVH as zP}from"./vendor-DZ45lcA8.min.js";import{__webpack_exports__default as Pe,__webpack_exports__Text as Hb,__webpack_exports__Block as Gb,__webpack_exports__update as NP,SimpleStateBehavior as WP,__webpack_exports__Inline as $m,__webpack_exports__FontLibrary as qb,ThreeMeshUI as Xb}from"./three-mesh-ui-n3JU4M2W.min.js";import{EffectAttribute as VP}from"./postprocessing-
|
|
1
|
+
import{Vector2 as K,Vector3 as b,Vector4 as ye,Quaternion as N,PlaneGeometry as vn,WebGLRenderer as yr,PerspectiveCamera as de,OrthographicCamera as Cd,Scene as Hi,Mesh as H,Texture as Se,Uniform$1 as Gi,Color as oe,ShaderMaterial as Vn,Box3 as Yt,ShadowMaterial as gb,Euler as at,MeshStandardMaterial as gt,Box3Helper as GS,GridHelper as fb,Object3D as M,Material as we,Matrix3 as yb,Matrix4 as J,Layers as _s,Ray as So,MathUtils as Co,AxesHelper as Pi,MeshBasicMaterial as Ce,DoubleSide as Oi,BufferGeometry as wn,Group as Po,CylinderGeometry as bb,SphereGeometry as Pd,BoxGeometry as Aa,SpriteMaterial as qS,Sprite as XS,Shape as QS,ExtrudeGeometry as YS,Fog as _b,DirectionalLight as km,PointLight as Mm,TextureLoader as br,EdgesGeometry as ZS,LineSegments as vb,LineBasicMaterial as Em,Line as Ia,BufferAttribute as ft,Raycaster as Od,Sphere as kd,ArrayCamera as KS,Plane as _r,SkinnedMesh as vs,InterleavedBufferAttribute as wb,Skeleton as JS,Bone as eC,WebGLCubeRenderTarget as tC,CubeCamera as iC,AnimationClip as ki,FileLoader as Rm,PropertyBinding as La,KeyframeTrack as nC,LinearSRGBColorSpace as Oo,ShaderChunk as Zt,DataTexture as Tm,RGBAFormat as Md,EquirectangularReflectionMapping as ko,SRGBColorSpace as Mo,Clock as oC,NeutralToneMapping as ja,AgXToneMapping as Ed,ACESFilmicToneMapping as Rd,NoToneMapping as Td,PCFSoftShadowMap$1 as sC,BasicNodeLibrary as rC,WebGLRenderTarget as $n,DepthTexture as xb,NearestFilter as Ad,LoopRepeat as aC,LoopOnce as Am,AnimationMixer as Im,CompressedTexture as lC,FrontSide as ws,Camera as cC,Frustum as Sb,AudioListener as hC,PositionalAudio as dC,AudioLoader as Lm,EventDispatcher as jm,BackSide as Id,MeshDepthMaterial as uC,CustomBlending as pC,MaxEquation as mC,AlwaysStencilFunc as gC,GreaterEqualStencilFunc as fC,NotEqualStencilFunc as yC,GreaterStencilFunc as bC,LessEqualStencilFunc as _C,EqualStencilFunc as vC,LessStencilFunc as wC,NeverStencilFunc as Cb,InvertStencilOp as xC,DecrementWrapStencilOp as SC,IncrementWrapStencilOp as CC,DecrementStencilOp as PC,IncrementStencilOp as OC,ReplaceStencilOp as kC,ZeroStencilOp as MC,KeepStencilOp as EC,CubeUVReflectionMapping as Pb,CubeTexture as Ob,AmbientLight as RC,HemisphereLight as TC,Loader as AC,RawShaderMaterial as kb,GLSL3 as IC,AlwaysDepth as LC,GreaterEqualDepth as jC,GreaterDepth as DC,LessEqualDepth as BC,LessDepth as FC,NotEqualDepth as UC,EqualDepth as zC,BatchedMesh as Mb,LinearFilter as Ld,UnsignedByteType as NC,MeshPhysicalMaterial as Eb,RingGeometry as WC,Line3 as VC,AdditiveBlending as Rb,BoxHelper as $C,SpotLight as HC,DirectionalLightHelper as GC,CameraHelper as qC,LOD as XC,Triangle as QC,NormalBlending as YC,ReinhardToneMapping as Dm,LinearToneMapping as Bm,HalfFloatType as Fm,VideoTexture as ZC,CompressedCubeTexture as KC,EquirectangularRefractionMapping as JC,CatmullRomCurve3 as eP,VectorKeyframeTrack as tP,QuaternionKeyframeTrack as iP,Audio as nP,ShaderLib as jd,UniformsUtils as Tb,MirroredRepeatWrapping as Ab,MeshNormalMaterial as oP,AudioContext as sP,PMREMGenerator$1 as rP}from"./three.min.js";import{createLoaders as Um,getRaycastMesh as Ib,LODsManager as vr,NEEDLE_progressive as Ve,addDracoAndKTX2Loaders as aP,configureLoader as lP,setKTX2TranscoderLocation as cP,setDracoDecoderLocation as hP}from"./gltf-progressive-DQa78GTA.min.js";import{GroundedSkybox as Da,Font as dP,TextGeometry as uP,FontLoader as pP,GLTFLoader as Eo,TransformControlsGizmo as Lb,EXRLoader as zm,RGBELoader as jb,Stats as mP,nodeFrame as Db,OrbitControls as gP,PositionalAudioHelper as fP,HorizontalBlurShader as yP,VerticalBlurShader as bP,GLTFExporter as Bb,strToU8 as Fb,zipSync as _P,XRControllerModelFactory as vP,XRHandMeshModel as wP,Line2 as xP,LineGeometry as SP,LineMaterial as CP,TransformControls as PP,InteractiveGroup as OP,HTMLMesh as kP,VertexNormalsHelper as MP,OBJLoader as Nm,FBXLoader as Ub,mergeVertices as EP}from"./three-examples.min.js";import{fetchProfile as RP,MotionController as TP,$70d766613f57b014$export$2e2bcd8739ae039 as zb,ByteBuffer as AP,v5 as Nb,md5 as Wb,SIZE_PREFIX_LENGTH as Vb,Builder as Wm,createNoise4D as IP,Matrix4 as Vm,BatchedParticleRenderer as LP,ParticleSystem as jP,RenderMode as Ro,ConstantColor as DP,Vector4 as BP,ConstantValue as FP,TrailParticle as $b,WorkerBase as UP,MeshBVH as zP}from"./vendor-DZ45lcA8.min.js";import{__webpack_exports__default as Pe,__webpack_exports__Text as Hb,__webpack_exports__Block as Gb,__webpack_exports__update as NP,SimpleStateBehavior as WP,__webpack_exports__Inline as $m,__webpack_exports__FontLibrary as qb,ThreeMeshUI as Xb}from"./three-mesh-ui-n3JU4M2W.min.js";import{EffectAttribute as VP}from"./postprocessing-CaEfRjRY.min.js";const Hm=new Map;function Mi(o=globalThis.location?.hostname){if(Hm.has(o))return Hm.get(o);const e=/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|localhost/.test(o);return Hm.set(o,e),e===!0}function Qb(){return window.location.hostname.includes("glitch.me")}const Yb=typeof window!==void 0?window.location.search.includes("debugcontext"):!1;var ue=(o=>(o.ContextRegistered="ContextRegistered",o.ContextCreationStart="ContextCreationStart",o.ContextCreated="ContextCreated",o.ContextFirstFrameRendered="ContextFirstFrameRendered",o.ContextDestroying="ContextDestroying",o.ContextDestroyed="ContextDestroyed",o.MissingCamera="MissingCamera",o.ContextClearing="ContextClearing",o.ContextCleared="ContextCleared",o))(ue||{});class pe{static get Current(){return globalThis["NeedleEngine.Context.Current"]}static set Current(e){globalThis["NeedleEngine.Context.Current"]=e}static get All(){return this.Registered}static Registered=[];static register(e){this.Registered.indexOf(e)===-1&&(Yb&&console.warn("Registering context"),this.Registered.push(e),this.dispatchCallback("ContextRegistered",e))}static unregister(e){const t=this.Registered.indexOf(e);t!==-1&&(Yb&&console.warn("Unregistering context"),this.Registered.splice(t,1))}static _callbacks={};static registerCallback(e,t){this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t)}static unregisterCallback(e,t){if(!this._callbacks[e])return;const i=this._callbacks[e].indexOf(t);i!==-1&&this._callbacks[e].splice(i,1)}static dispatchCallback(e,t,i){if(!this._callbacks[e])return!0;const n={event:e,context:t};if(i)for(const r in i)n[r]=i[r];const s=new Array;return this._callbacks[e].forEach(r=>{const a=r(n);a instanceof Promise&&s.push(a)}),Promise.all(s)}static addContextCreatedCallback(e){this.registerCallback("ContextCreated",e)}static addContextDestroyedCallback(e){this.registerCallback("ContextDestroyed",e)}}const Zb=()=>o=>o;function $P(o){return Zb()(o)}function HP(){return!!w("debug")}class Ei{_factory;_cache=[];_maxSize;_index=0;constructor(e,t){this._factory=e,this._maxSize=t}get(){const e=this._index%this._maxSize;return this._index++,this._cache.length<=e&&(this._cache[e]=this._factory()),this._cache[e]}}let wr=!1;const Gm=new Array;typeof window<"u"&&setTimeout(()=>{if(wr){const o={},e=new URL(window.location.href),t=new URL(e);t.searchParams.append("console","");const i=t.toString().replace(/=$|=(?=&)/g,"");for(const s of Gm){const r=new URL(e);r.searchParams.append(s,""),o[s]=r.toString().replace(/=$|=(?=&)/g,"")}console.log(`\u{1F335} ?help: Debug Options for Needle Engine.
|
|
2
2
|
Append any of these parameters to the URL to enable specific debug options.
|
|
3
3
|
Example: ${i} will show an onscreen console window.`);const n=wr===!0?"":` (containing "${wr}")`;console.group("Available URL parameters:"+n);for(const s of Object.keys(o).sort())typeof wr=="string"&&!s.toLowerCase().includes(wr.toLowerCase())||(console.groupCollapsed(s),console.log("Reload with this flag enabled:"),console.log(o[s]),console.groupEnd());console.groupEnd()}},100);function dc(){return new URLSearchParams(globalThis.location?.search)}function w(o){wr&&!Gm.includes(o)&&Gm.push(o);const e=dc();if(e.has(o)){const t=e.get(o);if(t){const i=Number(t);return isNaN(i)?t:i}else return!0}return!1}wr=w("help");function GP(o,e){const t=dc();t.has(o)?t.set(o,e):t.append(o,e),document.location.search=t.toString()}function uc(o,e,t=!0){const i=dc();i.has(o)?e===null?i.delete(o):i.set(o,e):e!==null&&i.append(o,e),t?Kb(o,i):Xm(o,i)}function qm(o,e,t){o.has(e)?o.set(e,t.toString()):o.append(e,t.toString())}function Kb(o,e,t){window.history.pushState(t,o,"?"+e.toString())}function Xm(o,e,t){window.history.replaceState(t,o,"?"+e.toString())}function qP(o){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=t.length,n=0;n<o;n++)e+=t.charAt(Math.floor(Math.random()*i));return e}function XP(o,e){return Math.floor(Math.random()*(e-o+1))+o}const Jb=["smol","tiny","giant","interesting","smart","bright","dull","extreme","beautiful","pretty","dark","epic","salty","silly","funny","lame","lazy","loud","lucky","mad","mean","mighty","mysterious","nasty","odd","old","powerful","quiet","rapid","scary","shiny","shy","silly","smooth","sour","spicy","stupid","sweet","tasty","terrible","ugly","unusual","vast","wet","wild","witty","wrong","zany","zealous","zippy","zombie","zorro"],e_=["cat","dog","mouse","pig","cow","horse","sheep","chicken","duck","goat","panda","tiger","lion","elephant","monkey","bird","fish","snake","frog","turtle","hamster","penguin","kangaroo","whale","dolphin","crocodile","snail","ant","bee","beetle","butterfly","dragon","eagle","fish","giraffe","lizard","panda","penguin","rabbit","snake","spider","tiger","zebra"];function t_(){const o=Jb[Math.floor(Math.random()*Jb.length)],e=e_[Math.floor(Math.random()*e_.length)];return o+"_"+e}function i_(o){return o=o.replace(/[^a-z0-9áéíóúñü \.,_-]/gim,""),o.trim()}function Ba(o,e,t=!0,i=!1){if(e==null)return null;if(e.userData&&e.userData.guid===o||e.guid==o)return e;if(i&&e.userData?.components){for(const n of e.userData.components)if(n.guid===o)return n}if(t){if(e.scenes)for(const n in e.scenes){const s=e.scenes[n],r=Ba(o,s,t,i);if(r)return r}if(e.children)for(const n in e.children){const s=e.children[n],r=Ba(o,s,t,i);if(r)return r}}}function pc(o,e){if(o!=null&&typeof o=="object"){let t;Array.isArray(o)?t=[]:(t=Object.create(o),Object.assign(t,o));for(const i of Object.keys(o)){const n=o[i];e&&!e(o,i,n)?t[i]=n:n?.clone!==void 0&&typeof n.clone=="function"?t[i]=n.clone():t[i]=pc(n,e)}return t}return o}function To(o){return new Promise((e,t)=>{setTimeout(e,o)})}function mc(o,e){if(o<=0)return Promise.resolve();if(e||(e=pe.Current),!e)return Promise.reject("No context");const t=e.time.frameCount+o;return new Promise((i,n)=>{if(!e)return n("No context");const s=()=>{e.time.frameCount>=t&&(e.pre_update_callbacks.splice(e.pre_update_callbacks.indexOf(s),1),i())};e.pre_update_callbacks.push(s)})}const Dd=w("debugresolveurl"),n_="rel:";function QP(o,e){return Ao(o,e)}function Ao(o,e){if(e===void 0)return Dd&&console.warn("getPath: uri is undefined, returning uri",e),e;if(e.startsWith("./"))return e;if(e.startsWith("http"))return Dd&&console.warn("getPath: uri is absolute, returning uri",e),e;if(o===void 0)return Dd&&console.warn("getPath: source is undefined, returning uri",e),e;e.startsWith(n_)&&(e=e.substring(4));const t=o.lastIndexOf("/");if(t>=0){const i=o.substring(0,t+1);for(;i.endsWith("/")&&e.startsWith("/");)e=e.substring(1);const n=i+e;return Dd&&console.log("source:",o,`changed uri
|
|
4
4
|
from`,e,`
|
|
@@ -141,7 +141,7 @@ void main(){
|
|
|
141
141
|
#__vconsole .vc-mask {
|
|
142
142
|
overflow: hidden;
|
|
143
143
|
}
|
|
144
|
-
`,Or?.prepend(i),o===!0&&s_()<=0&&I_(),console.log("\u{1F335} Debug console has loaded")}},e.onerror=()=>{console.warn("\u{1F335} Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),vc=!1,ui=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function ek(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const s=n.indexOf("?");s>-1&&(n=n.substring(0,s));const r=location.protocol+"//"+location.host+location.pathname+"/"+n,a=encodeURIComponent(r);o.fullUrl="https://viewer.needle.tools?inspect&file="+a;var l='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(l)}),o.on("show",function(){const t=e();t&&t.src!==o.fullUrl&&(t.src=o.fullUrl)}),o.on("hide",function(){const t=e();t&&(t.src="")}),o.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window \u2197",onClick:function(n){window.open(o.fullUrl,"_blank"),ui?.hide()}}),i.push({name:"Reload",onClick:function(n){const s=e();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=e();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),t(i)}),o}const bg="padding: 10px; font-family: monospace;",j_="margin-bottom: 10px;",kr="margin-bottom: 10px; margin-top: 15px;",tk="width: 100%; border-collapse: collapse; border: 1px solid rgba(0,0,0,0.1); table-layout: fixed;",D_="border: 1px solid rgba(0,0,0,0.1); padding: 5px;",ik=D_,nk=D_+" word-break: break-all;";function Gn(o,e=!1){e&&o.sort((i,n)=>(n.value?1:0)-(i.value?1:0));let t=`<table style='${tk}'>`;t+="<tbody>";for(const i of o){const n=typeof i.value=="boolean"?i.value?"\u2705":"\u274C":i.value;t+=`<tr><td style='${ik}'>${i.label}</td><td style='${nk}'>${n}</td></tr>`}return t+="</tbody></table>",t}function B_(){try{if(document.createElement("canvas").getContext("webgl2"))return"\u2705"}catch{}return"\u274C"}function ok(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("device-utilities","\u{1F4F1} Device Info");return o.on("renderTab",function(e){let t=`<div style='${bg}'>`;const i=mk();t+=`<h3 style='${j_}'>Device: ${i}</h3>`,t+=Gn([{label:"\u{1F4BB} Desktop",value:I.isDesktop()},{label:"\u{1F4F1} Mobile Device",value:I.isMobileDevice()},{label:"\u{1F34E} iOS",value:I.isiOS()},{label:"\u{1F4F1} iPad",value:I.isiPad()},{label:"\u{1F916} Android",value:I.isAndroidDevice()},{label:"\u{1F98A} Mozilla XR",value:I.isMozillaXR()},{label:"\u{1F335} Needle App Clip",value:I.isNeedleAppClip()},{label:"\u{1F34F} macOS",value:I.isMacOS()},{label:"\u{1F453} VisionOS",value:I.isVisionOS()},{label:"\u{1F9ED} Safari",value:I.isSafari()},{label:"\u{1F576}\uFE0F Meta Quest",value:I.isQuest()},{label:"\u{1F517} QuickLook AR Support",value:I.supportsQuickLookAR()}],!0);const n=[],s=I.getiOSVersion();s&&n.push({label:"\u{1F34E} iOS Version",value:s});const r=I.getChromeVersion();r&&n.push({label:"\u{1F310} Chrome Version",value:r});const a=I.getSafariVersion();a&&n.push({label:"\u{1F9ED} Safari Version",value:a}),n.length>0&&(t+=Gn(n,!1)),t+="</div>",t+=`<div style='${bg} margin-top: 20px;'>`,t+=`<h3 style='${j_}'>User Agent Info</h3>`;const l=[{label:"User Agent",value:navigator.userAgent},{label:"Platform",value:navigator.platform},{label:"App Version",value:navigator.appVersion},{label:"User Agent Data",value:navigator.userAgentData?`Platform: ${navigator.userAgentData.platform}, Mobile: ${navigator.userAgentData.mobile}`:"Not supported"},{label:"WebXR",value:"xr"in navigator?"\u2705":"\u274C"},{label:"WebGPU",value:"gpu"in navigator?"\u2705":"\u274C"},{label:"WebGL 2",value:B_()}];t+=Gn(l,!1),t+="</div>",e(t)}),o}function sk(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("graphics-info","\u{1F3A8} Graphics Info");return o.on("renderTab",async function(e){let t=`<div style='${bg}'>`;const i=rk();i.length>0&&(t+=`<h3 style='${kr}'>General GPU Info</h3>`,t+=Gn(i,!1));const n=lk();n.length>0&&(t+=`<h3 style='${kr}'>WebGL</h3>`,t+=Gn(n,!1));const s=ck();s.length>0&&(t+=`<h3 style='${kr}'>WebGL 2 Features</h3>`,t+=Gn(s,!1));const r=hk();r.length>0&&(t+=`<h3 style='${kr}'>WebGL Limits</h3>`,t+=Gn(r,!1));const a=dk();a.length>0&&(t+=`<h3 style='${kr}'>Texture Formats</h3>`,t+=Gn(a,!1));const l=await uk();if(l.length>0&&(t+=`<h3 style='${kr}'>WebGPU</h3>`,t+=Gn(l,!1)),I.isSafari()){const c=pk();c.length>0&&(t+=`<h3 style='${kr}'>Safari GPU Info</h3>`,t+=Gn(c,!1))}t+="</div>",e(t)}),o}function rk(){const o=[],e=window.devicePixelRatio;o.push({label:"Device Pixel Ratio",value:e.toString()}),o.push({label:"Width (px)",value:(window.innerWidth*e).toString()}),o.push({label:"Height (px)",value:(window.innerHeight*e).toString()});const t=I.isMobileDevice()?150:96,i=screen.width/t,n=screen.height/t,s=i*2.54,r=n*2.54;o.push({label:"Estimated Width (cm)",value:s.toFixed(1)}),o.push({label:"Estimated Height (cm)",value:r.toFixed(1)});const a=F_();if(a){o.push({label:"GPU",value:a.renderer}),o.push({label:"Driver",value:a.vendor}),o.push({label:"ANGLE",value:a.angle||"Not detected"});const l=ak(a.renderer);l&&(l.manufacturer&&o.push({label:"Manufacturer",value:l.manufacturer}),l.cardVersion&&o.push({label:"Card Version",value:l.cardVersion}),l.brand&&o.push({label:"Brand",value:l.brand}),o.push({label:"Integrated",value:l.integrated?"Yes":"No"}),l.layer&&o.push({label:"WebGL Layer",value:l.layer}))}return o}function ak(o){if(!o)return null;const e=(l,c)=>{const h=c.match(l);return h&&h[0]},t=e(/(ANGLE)/g,o)||void 0,i=e(/((NVIDIA|AMD|Intel)[^\d]*[^\s]+)/,o)||o,n=i.split(" ");n.shift();const s=e(/(NVIDIA|AMD|Intel)/g,i)||void 0,r=n.length>0?n.pop():void 0,a=n.length>0?n.join(" "):void 0;return{manufacturer:s,cardVersion:r,brand:a,integrated:s==="Intel",layer:t,card:i}}function lk(){const o=[],e=F_();return e&&(o.push({label:"\u{1F4CA} WebGL Version",value:e.version}),o.push({label:"\u{1F3AE} WebGL 2 Available",value:B_()})),o}function ck(){const o=[];try{const e=document.createElement("canvas").getContext("webgl2");if(!e)return o;o.push({label:"Float Color Buffer",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"Anisotropic Filtering",value:e.getExtension("EXT_texture_filter_anisotropic")?"\u2705":"\u274C"}),o.push({label:"Float Texture Linear",value:e.getExtension("OES_texture_float_linear")?"\u2705":"\u274C"}),o.push({label:"S3TC Compression",value:e.getExtension("WEBGL_compressed_texture_s3tc")?"\u2705":"\u274C"}),o.push({label:"ETC Compression",value:e.getExtension("WEBGL_compressed_texture_etc")?"\u2705":"\u274C"}),o.push({label:"PVRTC Compression",value:e.getExtension("WEBGL_compressed_texture_pvrtc")?"\u2705":"\u274C"}),o.push({label:"ASTC Compression",value:e.getExtension("WEBGL_compressed_texture_astc")?"\u2705":"\u274C"})}catch{}return o}function hk(){const o=[];try{const e=document.createElement("canvas"),t=e.getContext("webgl2")||e.getContext("webgl");if(!t)return o;const i=t instanceof WebGL2RenderingContext;o.push({label:"\u{1F4CF} Max Texture Size",value:t.getParameter(t.MAX_TEXTURE_SIZE).toString()}),o.push({label:"\u{1F3A8} Max Renderbuffer Size",value:t.getParameter(t.MAX_RENDERBUFFER_SIZE).toString()}),o.push({label:"\u{1F517} Max Vertex Attribs",value:t.getParameter(t.MAX_VERTEX_ATTRIBS).toString()}),o.push({label:"\u{1F3AF} Max Texture Units",value:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS).toString()}),i&&(o.push({label:"\u26A1 Max Samples",value:t.getParameter(t.MAX_SAMPLES).toString()}),o.push({label:"\u{1F504} Max Uniform Buffer Bindings",value:t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS).toString()}),o.push({label:"\u{1F4D0} Max 3D Texture Size",value:t.getParameter(t.MAX_3D_TEXTURE_SIZE).toString()}))}catch{}return o}function dk(){const o=[];try{document.createElement("canvas").getContext("webgl")&&(o.push({label:"WebGL 1 RGBA",value:"\u2705"}),o.push({label:"WebGL 1 RGB",value:"\u2705"}));const e=document.createElement("canvas").getContext("webgl2");e&&(o.push({label:"WebGL 2 RGBA32F",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"WebGL 2 RGB32F",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"WebGL 2 R11F_G11F_B10F",value:"\u2705"}),o.push({label:"WebGL 2 RGB565",value:"\u2705"}),o.push({label:"WebGL 2 RGB5_A1",value:"\u2705"}),o.push({label:"WebGL 2 RGBA4444",value:"\u2705"}))}catch{}return o}async function uk(){const o=[];if(!("gpu"in navigator))return o.push({label:"\u{1F680} WebGPU Support",value:"\u274C Not supported"}),o;o.push({label:"\u{1F680} WebGPU Support",value:"\u2705 Supported"});try{const e=await navigator.gpu.requestAdapter();if(!e)return o.push({label:"\u{1F3AF} Adapter",value:"No adapter available"}),o;o.push({label:"\u{1F3AF} Adapter",value:e.name||"Unknown Adapter"});const t=await e.requestDevice();o.push({label:"\u{1F527} Device",value:t.label||"WebGPU Device"}),o.push({label:"\u{1F4CF} Max Texture 2D",value:t.limits.maxTextureDimension2D.toString()}),o.push({label:"\u{1F4D0} Max Texture 3D",value:t.limits.maxTextureDimension3D.toString()}),o.push({label:"\u{1F4CA} Max Texture Array Layers",value:t.limits.maxTextureArrayLayers.toString()}),o.push({label:"\u{1F4BE} Max Buffer Size",value:`${(t.limits.maxBufferSize/1024/1024).toFixed(1)}MB`}),o.push({label:"\u{1F517} Max Bind Groups",value:t.limits.maxBindGroups.toString()})}catch(e){o.push({label:"\u274C Error",value:e.message})}return o}function F_(){try{const o=document.createElement("canvas"),e=o.getContext("webgl2")||o.getContext("webgl");if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info"),i=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),n=t?e.getParameter(t.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR),s=e.getParameter(e.VERSION);let r;if(i&&i.includes("ANGLE")){const a=i.match(/ANGLE \(([^)]+)\)/);a&&(r=a[1])}return{renderer:i,vendor:n,version:s,angle:r}}catch{return null}}function pk(){const o=[];try{const e=document.createElement("canvas").getContext("webgl");if(e){const t=e.getExtension("WEBGL_debug_renderer_info");if(t){const i=e.getParameter(t.UNMASKED_RENDERER_WEBGL);i&&i.includes("Apple")&&o.push({label:"\u{1F34E} Apple GPU",value:i})}}}catch{}try{const e=document.createElement("canvas").getContext("webgl");e&&(e.getSupportedExtensions()||[]).includes("WEBGL_compressed_texture_pvrtc")&&o.push({label:"\u{1F5DC}\uFE0F PVRTC Support",value:"\u2705"})}catch{}return o}function mk(){return I.isQuest()?"Meta Quest":I.isVisionOS()?"Vision Pro":I.isiOS()?I.isiPad()?"iPad":"iPhone/iPod":I.isAndroidDevice()?"Android Device":I.isMozillaXR()?"Mozilla XR Browser":I.isNeedleAppClip()?"Needle App Clip":I.isMacOS()?"Mac":I.isDesktop()?"Desktop PC":"Unknown Device"}function gk(){return document.querySelector("#__vconsole .vc-switch")||null}function fk(){return document.querySelector("#__vconsole")||null}const U_=w("debugdefines");Cs('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),Cs('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),Cs('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),Cs('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),Cs('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.16.4-alpha";'),Cs('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),Cs('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Sun Mar 15 2026 15:37:15 GMT+0000 (Coordinated Universal Time)";'),Cs('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const Ti="4.16.4-alpha",Wa="undefined",wc="Sun Mar 15 2026 15:37:15 GMT+0000 (Coordinated Universal Time)";U_&&console.log(`Engine version: ${Ti} (generator: ${Wa})
|
|
144
|
+
`,Or?.prepend(i),o===!0&&s_()<=0&&I_(),console.log("\u{1F335} Debug console has loaded")}},e.onerror=()=>{console.warn("\u{1F335} Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),vc=!1,ui=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function ek(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const s=n.indexOf("?");s>-1&&(n=n.substring(0,s));const r=location.protocol+"//"+location.host+location.pathname+"/"+n,a=encodeURIComponent(r);o.fullUrl="https://viewer.needle.tools?inspect&file="+a;var l='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(l)}),o.on("show",function(){const t=e();t&&t.src!==o.fullUrl&&(t.src=o.fullUrl)}),o.on("hide",function(){const t=e();t&&(t.src="")}),o.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window \u2197",onClick:function(n){window.open(o.fullUrl,"_blank"),ui?.hide()}}),i.push({name:"Reload",onClick:function(n){const s=e();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=e();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),t(i)}),o}const bg="padding: 10px; font-family: monospace;",j_="margin-bottom: 10px;",kr="margin-bottom: 10px; margin-top: 15px;",tk="width: 100%; border-collapse: collapse; border: 1px solid rgba(0,0,0,0.1); table-layout: fixed;",D_="border: 1px solid rgba(0,0,0,0.1); padding: 5px;",ik=D_,nk=D_+" word-break: break-all;";function Gn(o,e=!1){e&&o.sort((i,n)=>(n.value?1:0)-(i.value?1:0));let t=`<table style='${tk}'>`;t+="<tbody>";for(const i of o){const n=typeof i.value=="boolean"?i.value?"\u2705":"\u274C":i.value;t+=`<tr><td style='${ik}'>${i.label}</td><td style='${nk}'>${n}</td></tr>`}return t+="</tbody></table>",t}function B_(){try{if(document.createElement("canvas").getContext("webgl2"))return"\u2705"}catch{}return"\u274C"}function ok(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("device-utilities","\u{1F4F1} Device Info");return o.on("renderTab",function(e){let t=`<div style='${bg}'>`;const i=mk();t+=`<h3 style='${j_}'>Device: ${i}</h3>`,t+=Gn([{label:"\u{1F4BB} Desktop",value:I.isDesktop()},{label:"\u{1F4F1} Mobile Device",value:I.isMobileDevice()},{label:"\u{1F34E} iOS",value:I.isiOS()},{label:"\u{1F4F1} iPad",value:I.isiPad()},{label:"\u{1F916} Android",value:I.isAndroidDevice()},{label:"\u{1F98A} Mozilla XR",value:I.isMozillaXR()},{label:"\u{1F335} Needle App Clip",value:I.isNeedleAppClip()},{label:"\u{1F34F} macOS",value:I.isMacOS()},{label:"\u{1F453} VisionOS",value:I.isVisionOS()},{label:"\u{1F9ED} Safari",value:I.isSafari()},{label:"\u{1F576}\uFE0F Meta Quest",value:I.isQuest()},{label:"\u{1F517} QuickLook AR Support",value:I.supportsQuickLookAR()}],!0);const n=[],s=I.getiOSVersion();s&&n.push({label:"\u{1F34E} iOS Version",value:s});const r=I.getChromeVersion();r&&n.push({label:"\u{1F310} Chrome Version",value:r});const a=I.getSafariVersion();a&&n.push({label:"\u{1F9ED} Safari Version",value:a}),n.length>0&&(t+=Gn(n,!1)),t+="</div>",t+=`<div style='${bg} margin-top: 20px;'>`,t+=`<h3 style='${j_}'>User Agent Info</h3>`;const l=[{label:"User Agent",value:navigator.userAgent},{label:"Platform",value:navigator.platform},{label:"App Version",value:navigator.appVersion},{label:"User Agent Data",value:navigator.userAgentData?`Platform: ${navigator.userAgentData.platform}, Mobile: ${navigator.userAgentData.mobile}`:"Not supported"},{label:"WebXR",value:"xr"in navigator?"\u2705":"\u274C"},{label:"WebGPU",value:"gpu"in navigator?"\u2705":"\u274C"},{label:"WebGL 2",value:B_()}];t+=Gn(l,!1),t+="</div>",e(t)}),o}function sk(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("graphics-info","\u{1F3A8} Graphics Info");return o.on("renderTab",async function(e){let t=`<div style='${bg}'>`;const i=rk();i.length>0&&(t+=`<h3 style='${kr}'>General GPU Info</h3>`,t+=Gn(i,!1));const n=lk();n.length>0&&(t+=`<h3 style='${kr}'>WebGL</h3>`,t+=Gn(n,!1));const s=ck();s.length>0&&(t+=`<h3 style='${kr}'>WebGL 2 Features</h3>`,t+=Gn(s,!1));const r=hk();r.length>0&&(t+=`<h3 style='${kr}'>WebGL Limits</h3>`,t+=Gn(r,!1));const a=dk();a.length>0&&(t+=`<h3 style='${kr}'>Texture Formats</h3>`,t+=Gn(a,!1));const l=await uk();if(l.length>0&&(t+=`<h3 style='${kr}'>WebGPU</h3>`,t+=Gn(l,!1)),I.isSafari()){const c=pk();c.length>0&&(t+=`<h3 style='${kr}'>Safari GPU Info</h3>`,t+=Gn(c,!1))}t+="</div>",e(t)}),o}function rk(){const o=[],e=window.devicePixelRatio;o.push({label:"Device Pixel Ratio",value:e.toString()}),o.push({label:"Width (px)",value:(window.innerWidth*e).toString()}),o.push({label:"Height (px)",value:(window.innerHeight*e).toString()});const t=I.isMobileDevice()?150:96,i=screen.width/t,n=screen.height/t,s=i*2.54,r=n*2.54;o.push({label:"Estimated Width (cm)",value:s.toFixed(1)}),o.push({label:"Estimated Height (cm)",value:r.toFixed(1)});const a=F_();if(a){o.push({label:"GPU",value:a.renderer}),o.push({label:"Driver",value:a.vendor}),o.push({label:"ANGLE",value:a.angle||"Not detected"});const l=ak(a.renderer);l&&(l.manufacturer&&o.push({label:"Manufacturer",value:l.manufacturer}),l.cardVersion&&o.push({label:"Card Version",value:l.cardVersion}),l.brand&&o.push({label:"Brand",value:l.brand}),o.push({label:"Integrated",value:l.integrated?"Yes":"No"}),l.layer&&o.push({label:"WebGL Layer",value:l.layer}))}return o}function ak(o){if(!o)return null;const e=(l,c)=>{const h=c.match(l);return h&&h[0]},t=e(/(ANGLE)/g,o)||void 0,i=e(/((NVIDIA|AMD|Intel)[^\d]*[^\s]+)/,o)||o,n=i.split(" ");n.shift();const s=e(/(NVIDIA|AMD|Intel)/g,i)||void 0,r=n.length>0?n.pop():void 0,a=n.length>0?n.join(" "):void 0;return{manufacturer:s,cardVersion:r,brand:a,integrated:s==="Intel",layer:t,card:i}}function lk(){const o=[],e=F_();return e&&(o.push({label:"\u{1F4CA} WebGL Version",value:e.version}),o.push({label:"\u{1F3AE} WebGL 2 Available",value:B_()})),o}function ck(){const o=[];try{const e=document.createElement("canvas").getContext("webgl2");if(!e)return o;o.push({label:"Float Color Buffer",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"Anisotropic Filtering",value:e.getExtension("EXT_texture_filter_anisotropic")?"\u2705":"\u274C"}),o.push({label:"Float Texture Linear",value:e.getExtension("OES_texture_float_linear")?"\u2705":"\u274C"}),o.push({label:"S3TC Compression",value:e.getExtension("WEBGL_compressed_texture_s3tc")?"\u2705":"\u274C"}),o.push({label:"ETC Compression",value:e.getExtension("WEBGL_compressed_texture_etc")?"\u2705":"\u274C"}),o.push({label:"PVRTC Compression",value:e.getExtension("WEBGL_compressed_texture_pvrtc")?"\u2705":"\u274C"}),o.push({label:"ASTC Compression",value:e.getExtension("WEBGL_compressed_texture_astc")?"\u2705":"\u274C"})}catch{}return o}function hk(){const o=[];try{const e=document.createElement("canvas"),t=e.getContext("webgl2")||e.getContext("webgl");if(!t)return o;const i=t instanceof WebGL2RenderingContext;o.push({label:"\u{1F4CF} Max Texture Size",value:t.getParameter(t.MAX_TEXTURE_SIZE).toString()}),o.push({label:"\u{1F3A8} Max Renderbuffer Size",value:t.getParameter(t.MAX_RENDERBUFFER_SIZE).toString()}),o.push({label:"\u{1F517} Max Vertex Attribs",value:t.getParameter(t.MAX_VERTEX_ATTRIBS).toString()}),o.push({label:"\u{1F3AF} Max Texture Units",value:t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS).toString()}),i&&(o.push({label:"\u26A1 Max Samples",value:t.getParameter(t.MAX_SAMPLES).toString()}),o.push({label:"\u{1F504} Max Uniform Buffer Bindings",value:t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS).toString()}),o.push({label:"\u{1F4D0} Max 3D Texture Size",value:t.getParameter(t.MAX_3D_TEXTURE_SIZE).toString()}))}catch{}return o}function dk(){const o=[];try{document.createElement("canvas").getContext("webgl")&&(o.push({label:"WebGL 1 RGBA",value:"\u2705"}),o.push({label:"WebGL 1 RGB",value:"\u2705"}));const e=document.createElement("canvas").getContext("webgl2");e&&(o.push({label:"WebGL 2 RGBA32F",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"WebGL 2 RGB32F",value:e.getExtension("EXT_color_buffer_float")?"\u2705":"\u274C"}),o.push({label:"WebGL 2 R11F_G11F_B10F",value:"\u2705"}),o.push({label:"WebGL 2 RGB565",value:"\u2705"}),o.push({label:"WebGL 2 RGB5_A1",value:"\u2705"}),o.push({label:"WebGL 2 RGBA4444",value:"\u2705"}))}catch{}return o}async function uk(){const o=[];if(!("gpu"in navigator))return o.push({label:"\u{1F680} WebGPU Support",value:"\u274C Not supported"}),o;o.push({label:"\u{1F680} WebGPU Support",value:"\u2705 Supported"});try{const e=await navigator.gpu.requestAdapter();if(!e)return o.push({label:"\u{1F3AF} Adapter",value:"No adapter available"}),o;o.push({label:"\u{1F3AF} Adapter",value:e.name||"Unknown Adapter"});const t=await e.requestDevice();o.push({label:"\u{1F527} Device",value:t.label||"WebGPU Device"}),o.push({label:"\u{1F4CF} Max Texture 2D",value:t.limits.maxTextureDimension2D.toString()}),o.push({label:"\u{1F4D0} Max Texture 3D",value:t.limits.maxTextureDimension3D.toString()}),o.push({label:"\u{1F4CA} Max Texture Array Layers",value:t.limits.maxTextureArrayLayers.toString()}),o.push({label:"\u{1F4BE} Max Buffer Size",value:`${(t.limits.maxBufferSize/1024/1024).toFixed(1)}MB`}),o.push({label:"\u{1F517} Max Bind Groups",value:t.limits.maxBindGroups.toString()})}catch(e){o.push({label:"\u274C Error",value:e.message})}return o}function F_(){try{const o=document.createElement("canvas"),e=o.getContext("webgl2")||o.getContext("webgl");if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info"),i=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),n=t?e.getParameter(t.UNMASKED_VENDOR_WEBGL):e.getParameter(e.VENDOR),s=e.getParameter(e.VERSION);let r;if(i&&i.includes("ANGLE")){const a=i.match(/ANGLE \(([^)]+)\)/);a&&(r=a[1])}return{renderer:i,vendor:n,version:s,angle:r}}catch{return null}}function pk(){const o=[];try{const e=document.createElement("canvas").getContext("webgl");if(e){const t=e.getExtension("WEBGL_debug_renderer_info");if(t){const i=e.getParameter(t.UNMASKED_RENDERER_WEBGL);i&&i.includes("Apple")&&o.push({label:"\u{1F34E} Apple GPU",value:i})}}}catch{}try{const e=document.createElement("canvas").getContext("webgl");e&&(e.getSupportedExtensions()||[]).includes("WEBGL_compressed_texture_pvrtc")&&o.push({label:"\u{1F5DC}\uFE0F PVRTC Support",value:"\u2705"})}catch{}return o}function mk(){return I.isQuest()?"Meta Quest":I.isVisionOS()?"Vision Pro":I.isiOS()?I.isiPad()?"iPad":"iPhone/iPod":I.isAndroidDevice()?"Android Device":I.isMozillaXR()?"Mozilla XR Browser":I.isNeedleAppClip()?"Needle App Clip":I.isMacOS()?"Mac":I.isDesktop()?"Desktop PC":"Unknown Device"}function gk(){return document.querySelector("#__vconsole .vc-switch")||null}function fk(){return document.querySelector("#__vconsole")||null}const U_=w("debugdefines");Cs('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),Cs('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),Cs('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),Cs('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),Cs('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.16.4-alpha.1";'),Cs('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),Cs('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Sun Mar 15 2026 15:47:33 GMT+0000 (Coordinated Universal Time)";'),Cs('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const Ti="4.16.4-alpha.1",Wa="undefined",wc="Sun Mar 15 2026 15:47:33 GMT+0000 (Coordinated Universal Time)";U_&&console.log(`Engine version: ${Ti} (generator: ${Wa})
|
|
145
145
|
Project built at ${wc}`);const Ss=NEEDLE_PUBLIC_KEY,Io="needle_isActiveInHierarchy",Mr="builtin_components",xc="needle_editor_guid";function Cs(o){try{(0,eval)(o)}catch(e){U_&&console.error(e)}}let z_,N_=null;function Cn(){return z_}function _g(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}N_!==o&&(N_=o,z_=new o)}function yk(o,e){if(typeof window!==void 0&&window.SPECTOR){console.log(window.SPECTOR);const t=new URLSearchParams(window.location.search);if(t.has("spector")){let i=function(){if(n>o.time.frame)return window.requestAnimationFrame(()=>i());const r=s.captureCanvas(e);r&&r instanceof Promise?r.then(()=>s.displayUI()):s.displayUI()};const n=Number.parseInt(t.get("spector")||"0")||0;console.log("Scheduled Spector capture at frame #"+n);const s=new window.SPECTOR.Spector;s.spyCanvases=!0,i();return}else A()&&console.debug("Spector available: Add '?spector=<frame>' to the URL to enable it and capture a frame.")}}function W_(o){const e=o;return!!(e.parser&&e.parser.json)}var Gd=(o=>(o[o.None=0]="None",o[o.DontExport=1]="DontExport",o))(Gd||{});const V_=Symbol("component-name");function vg(o){return o&&o.isComponent}const bk=Symbol("object"),wg=new Ei(()=>new b,20);class $_{_point;_normal;_tangentVelocity;distance;impulse;friction;get point(){return wg.get().set(this._point.x,this._point.y,this._point.z)}get normal(){return wg.get().set(this._normal.x,this._normal.y,this._normal.z)}get tangentVelocity(){return wg.get().set(this._tangentVelocity.x,this._tangentVelocity.y,this._tangentVelocity.z)}constructor(e,t,i,n,s,r){this._point=e,this.distance=t,this._normal=i,this.impulse=n,this.friction=s,this._tangentVelocity=r}}class H_{contacts;constructor(e,t,i){this.me=e,this._collider=t,this._gameObject=t.gameObject,this.contacts=i}me;_collider;get collider(){return this._collider}_gameObject;get gameObject(){return this._gameObject}get rigidBody(){return this.collider?.attachedRigidbody}}class G_{object;collider;constructor(e,t){this.object=e,this.collider=t}}class Sm{constructor(e){this.context=e,this.root.style.cssText=`
|
|
146
146
|
position: absolute;
|
|
147
147
|
width: 1px; height: 1px;
|
|
@@ -959,7 +959,7 @@ Exit Time: `+c,s.hasExitTime)}this.transitionTo(s.destinationState,s.duration,s.
|
|
|
959
959
|
// Uncomment to visualize blur amount
|
|
960
960
|
// gl_FragColor = vec4(blurAmount, 0.0, 0.0, 1.0);
|
|
961
961
|
}
|
|
962
|
-
`;function lx(o){if(Z.active)return console.warn("[OrbitControls] Can not fit camera while XR session is active"),null;const e=U.Current;if(!e)return console.warn("[OrbitControls] No context found"),null;const t=o?.camera||e.mainCamera;if(!t)return console.warn("No camera or controls found to fit camera to objects..."),null;o||(o={}),o.autoApply=o.autoApply!==!1,o.minZoom||=0,o.maxZoom||=1/0;const{centerCamera:i,cameraNearFar:n="auto",fitOffset:s=1.1,fov:r=t instanceof de?t?.fov:-1}=o,a=new b,l=new b,c=t instanceof de?t.aspect:1,h=o.objects||e.scene,d=di(h,void 0,t?.layers),p=d.clone();d.getCenter(l);const m=new b;if(d.getSize(m),t instanceof de&&t.updateProjectionMatrix(),t.updateMatrixWorld(),d.applyMatrix4(t.matrixWorldInverse),d.getSize(a),d.setFromCenterAndSize(l,a),Number.isNaN(a.x)||Number.isNaN(a.y)||Number.isNaN(a.z))return console.warn("Camera fit size resultet in NaN",t,d),null;if(a.length()<=1e-10)return console.warn("Camera fit size is zero",d),null;const g=r,f=2*Math.atan(Math.tan(g*Math.PI/360/2)*c)/Math.PI*360,y=a.y/(2*Math.atan(Math.PI*g/360)),_=a.x/(2*Math.atan(Math.PI*f/360)),v=s*Math.max(y,_)+a.z/2;o.maxZoom=v*10,o.minZoom=v*.01,o.debug===!0&&console.log("Fit camera to objects",{fitHeightDistance:y,fitWidthDistance:_,distance:v,verticalFov:g,horizontalFov:f});const P=.05,k=l.clone();if(k.y-=a.y*P,o.targetOffset&&(o.targetOffset.x!==void 0&&(k.x+=o.targetOffset.x),o.targetOffset.y!==void 0&&(k.y+=o.targetOffset.y),o.targetOffset.z!==void 0&&(k.z+=o.targetOffset.z)),o.relativeTargetOffset&&(o.relativeTargetOffset.x!==void 0&&(k.x+=o.relativeTargetOffset.x*a.x),o.relativeTargetOffset.y!==void 0&&(k.y+=o.relativeTargetOffset.y*a.y),o.relativeTargetOffset.z!==void 0&&(k.z+=o.relativeTargetOffset.z*a.z)),n==null||n=="auto"){const L=tl(Jn),V=L?L.radius:0,W=Math.max(m.x,m.y,m.z,V);t instanceof de&&(t.near=v/100,t.far=W+v*10,t.updateProjectionMatrix()),L&&(o.maxZoom=Math.max(Math.min(o.maxZoom,V*.5),v))}o.currentZoom!==void 0&&(o.currentZoom<o.minZoom&&(o.minZoom=o.currentZoom*.9),o.currentZoom>o.maxZoom&&(o.maxZoom=o.currentZoom*1.1));const O=l.clone();o.fitDirection?O.sub(new b().copy(o.fitDirection).multiplyScalar(1e6)):O.sub(t.worldPosition),i==="y"&&(O.y=0),O.normalize(),O.multiplyScalar(v),i==="y"&&(O.y+=-P*4*v);let D=l.clone().sub(O);return o.cameraOffset&&(o.cameraOffset.x!==void 0&&(D.x+=o.cameraOffset.x),o.cameraOffset.y!==void 0&&(D.y+=o.cameraOffset.y),o.cameraOffset.z!==void 0&&(D.z+=o.cameraOffset.z)),o.relativeCameraOffset&&(o.relativeCameraOffset.x!==void 0&&(D.x+=o.relativeCameraOffset.x*a.x),o.relativeCameraOffset.y!==void 0&&(D.y+=o.relativeCameraOffset.y*a.y),o.relativeCameraOffset.z!==void 0&&(D.z+=o.relativeCameraOffset.z*a.z)),t.parent&&(D=t.parent.worldToLocal(D)),o.debug&&(B.DrawWireBox3(d,16777011,10),B.DrawWireBox3(p,65280,10)),o.autoApply&&(t.position.copy(D),t.lookAt(k),r>0&&t instanceof de&&(t.fov=r,t.updateProjectionMatrix())),{camera:t,position:D,lookAt:k,fov:o.fov}}var XE=Object.defineProperty,jf=(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&&XE(e,t,n),n};class Wr extends E{constraintActive=!0;locked=!1;sources=[];setConstraintPosition(e){const t=this.sources[0];t&&(t.worldPosition=e)}}jf([u()],Wr.prototype,"constraintActive"),jf([u()],Wr.prototype,"locked"),jf([u(M)],Wr.prototype,"sources");let Vr=class{bb=null;bb_pos=0;__init(o,e){return this.bb_pos=o,this.bb=e,this}x(){return this.bb.readFloat32(this.bb_pos)}y(){return this.bb.readFloat32(this.bb_pos+4)}z(){return this.bb.readFloat32(this.bb_pos+8)}static sizeOf(){return 12}static createVec3(o,e,t,i){return o.prep(4,12),o.writeFloat32(i),o.writeFloat32(t),o.writeFloat32(e),o.offset()}};class cx{bb=null;bb_pos=0;__init(e,t){return this.bb_pos=e,this.bb=t,this}position(e){return(e||new Vr).__init(this.bb_pos,this.bb)}rotation(e){return(e||new Vr).__init(this.bb_pos+12,this.bb)}scale(e){return(e||new Vr).__init(this.bb_pos+24,this.bb)}static sizeOf(){return 36}static createTransform(e,t,i,n,s,r,a,l,c,h){return e.prep(4,36),e.prep(4,12),e.writeFloat32(h),e.writeFloat32(c),e.writeFloat32(l),e.prep(4,12),e.writeFloat32(a),e.writeFloat32(r),e.writeFloat32(s),e.prep(4,12),e.writeFloat32(n),e.writeFloat32(i),e.writeFloat32(t),e.offset()}}class gs{bb=null;bb_pos=0;__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSyncedTransformModel(e,t){return(t||new gs).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSyncedTransformModel(e,t){return e.setPosition(e.position()+Vb),(t||new gs).__init(e.readInt32(e.position())+e.position(),e)}guid(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}fast(){const e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}transform(e){const t=this.bb.__offset(this.bb_pos,8);return t?(e||new cx).__init(this.bb_pos+t,this.bb):null}dontSave(){const e=this.bb.__offset(this.bb_pos,10);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startSyncedTransformModel(e){e.startObject(4)}static addGuid(e,t){e.addFieldOffset(0,t,0)}static addFast(e,t){e.addFieldInt8(1,+t,0)}static addTransform(e,t){e.addFieldStruct(2,t,0)}static addDontSave(e,t){e.addFieldInt8(3,+t,0)}static endSyncedTransformModel(e){return e.endObject()}static finishSyncedTransformModelBuffer(e,t){e.finish(t)}static finishSizePrefixedSyncedTransformModelBuffer(e,t){e.finish(t,void 0,!0)}}var T;(o=>{(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./materialx-D_ofN96q.min.js");return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.MaterialX||(o.MaterialX={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./rapier-DJ-luMxr.min.js");return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.RAPIER_PHYSICS||(o.RAPIER_PHYSICS={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./postprocessing-DXm8YKbQ.min.js").then(r=>r.index);return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.POSTPROCESSING||(o.POSTPROCESSING={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./postprocessing-DXm8YKbQ.min.js").then(r=>r.N8AO);return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.POSTPROCESSING_AO||(o.POSTPROCESSING_AO={}))})(T||(T={}));var vt=(o=>(o[o.Average=0]="Average",o[o.Multiply=1]="Multiply",o[o.Minimum=2]="Minimum",o[o.Maximum=3]="Maximum",o))(vt||{}),Bu=(o=>(o[o.Discrete=0]="Discrete",o[o.Continuous=1]="Continuous",o))(Bu||{}),Ze=(o=>(o[o.None=0]="None",o[o.FreezePositionX=2]="FreezePositionX",o[o.FreezePositionY=4]="FreezePositionY",o[o.FreezePositionZ=8]="FreezePositionZ",o[o.FreezePosition=14]="FreezePosition",o[o.FreezeRotationX=16]="FreezeRotationX",o[o.FreezeRotationY=32]="FreezeRotationY",o[o.FreezeRotationZ=64]="FreezeRotationZ",o[o.FreezeRotation=112]="FreezeRotation",o[o.FreezeAll=126]="FreezeAll",o))(Ze||{}),cl=(o=>(o[o.None=0]="None",o[o.X=2]="X",o[o.Y=4]="Y",o[o.Z=8]="Z",o[o.All=-1]="All",o))(cl||{});const kt=function(o,e){return function(t,i,n){QE(t,i,n,o,e)}};function QE(o,e,t,i,n){if(!n&&!i&&!o.onValidate)return;if(t!==void 0){console.error("Invalid usage of validate decorator. Only fields can be validated.",o,e,t),Oe("Invalid usage of validate decorator. Only fields can be validated. Property: "+e,{type:Ri.Error});return}let s="";if(typeof e=="string"?s=e:s=e.name,o.__internalAwake){const r=Symbol(s),a=o.__internalAwake;o.__internalAwake=function(){if(!this.onValidate){A()&&console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "'+o.constructor?.name+'"');return}if(this[r]===void 0){this[r]=this[s];const l=this[s];if(l instanceof K||l instanceof b||l instanceof ye||l instanceof N){const c=this[s];Bd(c,()=>{this.onValidate(s)})}Object.defineProperty(this,s,{set:function(c){if(this[lf]===!0)this[r]=c;else{i?.call(this,c);const h=this[r];this[r]=c,this.onValidate?.call(this,s,h)}},get:function(){return n?.call(this),this[r]}})}a.call(this)}}}const YE=function(o){return function(e,t,i){let n="";typeof t=="string"?n=t:n=t.name;const s=o.prototype,r=Object.getOwnPropertyDescriptor(s,n);if(!r?.value){console.warn("Can not apply prefix: type does not have method named",t,o);return}const a=r.value,l=e[n];Object.defineProperty(s,n,{value:function(...c){const h=l?.call(this,...c);if(h instanceof Promise){h.then(d=>{if(d!==!1)return a.call(this,...c)});return}if(h!==!1)return a.call(this,...c)}})}};var ZE=Object.defineProperty,KE=Object.getOwnPropertyDescriptor,Li=(o,e,t,i)=>{for(var n=i>1?void 0:i?KE(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&&ZE(e,t,n),n};class JE{get isDirty(){return this.positionChanged||this.rotationChanged}positionChanged=!1;rotationChanged=!1;position;quaternion;_positionKeys=["x","y","z"];_quaternionKeys=["_x","_y","_z","_w"];reset(e=!1){if(this.positionChanged=!1,this.rotationChanged=!1,this.mute=!1,e){if(this.position)for(const t of this._positionKeys)delete this.position[t];if(this.quaternion)for(const t of this._quaternionKeys)delete this.quaternion[t]}}syncValues(){for(const e of this._positionKeys)this.position[e]=this.obj.position[e];for(const e of this._quaternionKeys)this.quaternion[e]=this.obj.quaternion[e]}mute=!1;applyValues(){if(this.positionChanged&&this.position)for(const e of this._positionKeys){const t=this.position[e];t!==void 0&&(this.obj.position[e]=t)}if(this.rotationChanged&&this.quaternion)for(const e of this._quaternionKeys){const t=this.quaternion[e];t!==void 0&&(this.obj.quaternion[e]=t)}}context;obj;_positionWatch;_rotationWatch;constructor(e,t){this.context=t,this.obj=e}start(e,t){this.reset(),e&&(this._positionWatch||(this._positionWatch=new ps(this.obj.position,["x","y","z"])),this._positionWatch.apply(),this.position={},this._positionWatch.subscribeWrite((s,r)=>{if(this.context.physics.engine?.isUpdating||this.mute)return;const a=this.position[r];Math.abs(a-s)<1e-5||(this.position[r]=s,this.positionChanged=!0)})),t&&(this._rotationWatch||(this._rotationWatch=new ps(this.obj.quaternion,["_x","_y","_z","_w"])),this._rotationWatch.apply(),this.quaternion={},this._rotationWatch.subscribeWrite((s,r)=>{if(this.context.physics.engine?.isUpdating||this.mute)return;const a=this.quaternion[r];Math.abs(a-s)<1e-5||(this.quaternion[r]=s,this.rotationChanged=!0)}));const i=this.obj.matrixWorld.multiplyMatrices.bind(this.obj.matrixWorld),n=new J;this.obj.matrixWorld.multiplyMatrices=(s,r)=>(this.context.physics.engine?.isUpdating||this.mute||n.equals(s)||(this.positionChanged=!0,this.rotationChanged=!0,n.copy(s)),i(s,r))}stop(){this._positionWatch?.revoke(),this._rotationWatch?.revoke()}}const fi=class bm extends E{get isRigidbody(){return!0}autoMass=!0;set mass(e){e!==this._mass&&(this._mass=e,this._propertiesChanged=!0,this.__didAwake&&(this.autoMass=!1))}get mass(){return this.autoMass?this.context.physics.engine?.getBody(this)?.mass()??-1:this._mass}_mass=0;useGravity=!0;centerOfMass=new b(0,0,0);constraints=Ze.None;isKinematic=!1;drag=0;angularDrag=1;detectCollisions=!0;sleepThreshold=.01;collisionDetectionMode=Bu.Discrete;get lockPositionX(){return(this.constraints&Ze.FreezePositionX)!==0}get lockPositionY(){return(this.constraints&Ze.FreezePositionY)!==0}get lockPositionZ(){return(this.constraints&Ze.FreezePositionZ)!==0}get lockRotationX(){return(this.constraints&Ze.FreezeRotationX)!==0}get lockRotationY(){return(this.constraints&Ze.FreezeRotationY)!==0}get lockRotationZ(){return(this.constraints&Ze.FreezeRotationZ)!==0}set lockPositionX(e){e?this.constraints|=Ze.FreezePositionX:this.constraints&=~Ze.FreezePositionX}set lockPositionY(e){e?this.constraints|=Ze.FreezePositionY:this.constraints&=~Ze.FreezePositionY}set lockPositionZ(e){e?this.constraints|=Ze.FreezePositionZ:this.constraints&=~Ze.FreezePositionZ}set lockRotationX(e){e?this.constraints|=Ze.FreezeRotationX:this.constraints&=~Ze.FreezeRotationX}set lockRotationY(e){e?this.constraints|=Ze.FreezeRotationY:this.constraints&=~Ze.FreezeRotationY}set lockRotationZ(e){e?this.constraints|=Ze.FreezeRotationZ:this.constraints&=~Ze.FreezeRotationZ}set gravityScale(e){this._gravityScale=e}get gravityScale(){return this._gravityScale}_gravityScale=1;dominanceGroup=0;static tempPosition=new b;_propertiesChanged=!1;_currentVelocity=new b;_smoothedVelocity=new b;_smoothedVelocityGetter=new b;_lastPosition=new b;_watch;awake(){this._watch=void 0,this._propertiesChanged=!1}onEnable(){this._watch||(this._watch=new JE(this.gameObject,this.context)),this._watch.start(!0,!0),this.startCoroutine(this.beforePhysics(),xe.LateUpdate),A()&&(globalThis.NEEDLE_USE_RAPIER?T.RAPIER_PHYSICS.ready().then(async()=>{await mc(3),this.context.physics.engine?.getBody(this)||console.warn(`Rigidbody could not be created. Ensure "${this.name}" has a Collider component.`)}):console.warn("Rigidbody could not be created: Rapier physics are explicitly disabled."))}onDisable(){this._watch?.stop(),this.context.physics.engine?.removeBody(this)}onDestroy(){this.context.physics.engine?.removeBody(this)}onValidate(){this._propertiesChanged=!0}*beforePhysics(){for(;;)this._propertiesChanged&&(this._propertiesChanged=!1,this.context.physics.engine?.updateProperties(this)),this._watch?.isDirty?(this._watch.mute=!0,this._watch.applyValues(),this.context.physics.engine?.updateBody(this,this._watch.positionChanged,this._watch.rotationChanged),this._watch.reset()):this._watch?.syncValues(),this.captureVelocity(),yield}teleport(e,t=!0){this._watch?.reset(!0),t?this.gameObject.position.set(e.x,e.y,e.z):this.setWorldPosition(e.x,e.y,e.z),this.resetForcesAndTorques(),this.resetVelocities()}resetForces(e=!0){this.context.physics.engine?.resetForces(this,e)}resetTorques(e=!0){this.context.physics.engine?.resetTorques(this,e)}resetVelocities(){this.setVelocity(0,0,0),this.setAngularVelocity(0,0,0)}resetForcesAndTorques(){this.resetForces(),this.resetTorques()}wakeUp(){this.context.physics.engine?.wakeup(this)}get isSleeping(){return this.context.physics.engine?.isSleeping(this)}updateProperties(){return this._propertiesChanged=!1,this.context.physics.engine?.updateProperties(this)}applyForce(e,t,i=!0){this._propertiesChanged&&this.updateProperties(),this.context.physics.engine?.addForce(this,e,i)}applyImpulse(e,t=!0){this._propertiesChanged&&this.updateProperties(),this.context.physics.engine?.applyImpulse(this,e,t)}setForce(e,t,i,n=!0){this.context.physics.engine?.resetForces(this,n),typeof e=="number"?(t??=0,i??=0,this.context.physics.engine?.addForce(this,{x:e,y:t,z:i},n)):this.context.physics.engine?.addForce(this,e,n)}getVelocity(){const e=this.context.physics.engine?.getLinearVelocity(this);return e?(this._currentVelocity.x=e.x,this._currentVelocity.y=e.y,this._currentVelocity.z=e.z,this._currentVelocity):this._currentVelocity.set(0,0,0)}setVelocity(e,t,i,n=!0){if(e instanceof b){const s=e;this.context.physics.engine?.setLinearVelocity(this,s,n);return}t===void 0||i===void 0||this.context.physics.engine?.setLinearVelocity(this,{x:e,y:t,z:i},n)}getAngularVelocity(){const e=this.context.physics.engine?.getAngularVelocity(this);return e?(this._currentVelocity.x=e.x,this._currentVelocity.y=e.y,this._currentVelocity.z=e.z,this._currentVelocity):this._currentVelocity.set(0,0,0)}setAngularVelocity(e,t,i,n=!0){if(typeof e=="object"){const s=e;this.context.physics.engine?.setAngularVelocity(this,s,n);return}if(t===void 0||i===void 0||typeof t=="boolean"){console.warn("setAngularVelocity expects either a Vec3 or 3 numbers");return}this.context.physics.engine?.setAngularVelocity(this,{x:e,y:t,z:i},n)}setTorque(e,t,i){typeof e=="number"?this.setAngularVelocity(e,t,i):this.setAngularVelocity(e)}get smoothedVelocity(){return this._smoothedVelocityGetter.copy(this._smoothedVelocity),this._smoothedVelocityGetter.multiplyScalar(1/this.context.time.deltaTime)}setBodyFromGameObject(e=null){}captureVelocity(){const e=this.gameObject.matrixWorld;bm.tempPosition.setFromMatrixPosition(e);const t=bm.tempPosition.sub(this._lastPosition);this._lastPosition.copy(bm.tempPosition),this._smoothedVelocity.lerp(t,this.context.time.deltaTime/.1)}};Li([kt()],fi.prototype,"autoMass",2),Li([u()],fi.prototype,"mass",1),Li([kt(),u()],fi.prototype,"useGravity",2),Li([u(b)],fi.prototype,"centerOfMass",2),Li([kt(),u()],fi.prototype,"constraints",2),Li([kt(),u()],fi.prototype,"isKinematic",2),Li([kt(),u()],fi.prototype,"drag",2),Li([kt(),u()],fi.prototype,"angularDrag",2),Li([kt(),u()],fi.prototype,"detectCollisions",2),Li([kt(),u()],fi.prototype,"sleepThreshold",2),Li([kt(),u()],fi.prototype,"collisionDetectionMode",2),Li([kt()],fi.prototype,"_gravityScale",2),Li([kt()],fi.prototype,"dominanceGroup",2);let Ke=fi;new b,new b;const Is=w("debugsync"),Qc="STRS";Eg(Qc,gs.getRootAsSyncedTransformModel);const eo=new Wm;function hx(o,e,t=!0){eo.clear();const i=eo.createString(o);gs.startSyncedTransformModel(eo),gs.addGuid(eo,i),gs.addFast(eo,t);const n=e.worldPosition,s=e.worldEuler,r=e.gameObject.scale;gs.addTransform(eo,cx.createTransform(eo,n.x,n.y,n.z,s.x,s.y,s.z,r.x,r.y,r.z));const a=gs.endSyncedTransformModel(eo);return eo.finish(a,Qc),eo.asUint8Array()}let Df=0,Yc=0;$w(o=>{const e=o.connection.currentServerUrl?.includes("glitch")?10:40;Yc=Math.floor(Df/e),Df=0,Is&&Yc>0&&console.log("Sync Transform Fast Interval",Yc)});class Tn extends E{overridePhysics=!0;interpolatePosition=!0;interpolateRotation=!0;fastMode=!1;syncDestroy=!1;_model=null;_needsUpdate=!0;rb=null;_wasKinematic=!1;_receivedDataBefore=!1;_targetPosition;_targetRotation;_receivedFastUpdate=!1;_shouldRequestOwnership=!1;requestOwnership(){Is&&console.log("Request ownership"),this._model?this._model.requestOwnership():(this._shouldRequestOwnership=!0,this._needsUpdate=!0)}freeOwnership(){this._model?.freeOwnership()}hasOwnership(){return this._model?.hasOwnership??void 0}isOwned(){return this._model?.isOwned}joinedRoomCallback=null;receivedDataCallback=null;awake(){Is&&console.log("new instance",this.guid,this),this._receivedDataBefore=!1,this._targetPosition=new b,this._targetRotation=new N,this.lastPosition=new b,this.lastRotation=new N,this.lastScale=new b,this.rb=S.getComponentInChildren(this.gameObject,Ke),this.rb&&(this._wasKinematic=this.rb.isKinematic),this.receivedUpdate=!0,this._model=new Tg(this.context.connection,this.guid),this.context.connection.isConnected&&this.tryGetLastState(),this.joinedRoomCallback=this.tryGetLastState.bind(this),this.context.connection.beginListen(ie.JoinedRoom,this.joinedRoomCallback),this.receivedDataCallback=this.onReceivedData.bind(this),this.context.connection.beginListenBinary(Qc,this.receivedDataCallback)}onDestroy(){this.syncDestroy&&Zg(this.guid,this.context.connection),this._model=null,this.context.connection.stopListen(ie.JoinedRoom,this.joinedRoomCallback),this.context.connection.stopListenBinary(Qc,this.receivedDataCallback)}tryGetLastState(){const e=this.context.connection.tryGetState(this.guid);e&&this.onReceivedData(e)}tempEuler=new at;onReceivedData(e){if(!this.destroyed&&typeof e.guid=="function"&&e.guid()===this.guid){Is&&console.log("new data",this.context.connection.connectionId,this.context.time.frameCount,this.guid,e),this.receivedUpdate=!0,this._receivedFastUpdate=e.fast();const t=e.transform();if(t){pn.markDirty(this.gameObject,!0);const i=t.position();i&&(this.interpolatePosition&&this._targetPosition?.set(i.x(),i.y(),i.z()),(!this.interpolatePosition||!this._receivedDataBefore)&&this.setWorldPosition(i.x(),i.y(),i.z()));const n=t.rotation();n&&(this.tempEuler.set(n.x(),n.y(),n.z()),this.interpolateRotation&&this._targetRotation.setFromEuler(this.tempEuler),(!this.interpolateRotation||!this._receivedDataBefore)&&ug(this.gameObject,this.tempEuler));const s=t.scale();s&&this.gameObject.scale.set(s.x(),s.y(),s.z())}this._receivedDataBefore=!0}}onEnable(){this.lastPosition.copy(this.worldPosition),this.lastRotation.copy(this.worldQuaternion),this.lastScale.copy(this.gameObject.scale),this._needsUpdate=!0,this._model&&this._model.updateIsOwned()}onDisable(){this._model&&this._model.freeOwnership()}receivedUpdate=!1;lastPosition;lastRotation;lastScale;onBeforeRender(){if(!this.activeAndEnabled||!this.context.connection.isConnected)return;if(!this.context.connection.isInRoom||!this._model){Is&&console.log("no model or room",this.name,this.guid,this.context.connection.isInRoom);return}this._shouldRequestOwnership&&(this._shouldRequestOwnership=!1,this._model.requestOwnership());const e=this.worldPosition,t=this.worldQuaternion,i=this.gameObject.scale;if(this._model.isOwned&&!this.receivedUpdate){const r=this._model.hasOwnership||this.fastMode?1e-4:.001;(e.distanceTo(this.lastPosition)>r||t.angleTo(this.lastRotation)>r||i.distanceTo(this.lastScale)>r)&&(this._model.hasOwnership?this._needsUpdate=!0:(Is&&console.log(this.guid,"reset because not owned but",this.gameObject.name,this.lastPosition),this.worldPosition=this.lastPosition,e.copy(this.lastPosition),this.worldQuaternion=this.lastRotation,t.copy(this.lastRotation),this.gameObject.scale.copy(this.lastScale),pn.markDirty(this.gameObject,!0),this._needsUpdate=!1))}if(this._model&&!this._model.hasOwnership&&this._model.isOwned&&this._receivedDataBefore){const r=this._receivedFastUpdate||this.fastMode?.5:.3;let a=!1;if(this.interpolatePosition&&this._targetPosition){const l=this.worldPosition;l.lerp(this._targetPosition,r),this.worldPosition=l,a=!0}if(this.interpolateRotation&&this._targetRotation){const l=this.worldQuaternion;l.slerp(this._targetRotation,r),this.worldQuaternion=l,a=!0}a&&pn.markDirty(this.gameObject,!0)}if(this.receivedUpdate=!1,this.lastPosition.copy(e),this.lastRotation.copy(t),this.lastScale.copy(i),!this._model||!this._model||this._model.hasOwnership===void 0||!this._model.hasOwnership)return;this.rb&&this.overridePhysics&&this._wasKinematic!==void 0&&(Is&&console.log("reset kinematic",this.rb.name,this._wasKinematic),this.rb.isKinematic=this._wasKinematic);const n=10,s=this.rb||this.fastMode;if(this._needsUpdate&&(this.context.time.frameCount%n===0||s)){if(Df++,s&&Yc>0&&this.context.time.frameCount%Yc!==0)return;Is&&console.debug("[SyncedTransform] Send update",this.context.connection.connectionId,this.guid,this.gameObject.name,this.gameObject.guid),this._needsUpdate=!1;const r=hx(this.guid,this,!!s);this.context.connection.sendBinary(r)}}}class vd{event;get deviceIndex(){return this.event.deviceIndex}get pointerId(){return this.event.pointerId}button;buttonName;get pressure(){return this.event.pressure}get used(){return this._used}_used=!1;use(){this._used||(this._used=!0,this.event.use())}_propagationStopped=!1;get propagationStopped(){return this._propagationStopped}stopPropagation(){this._propagationStopped=!0,this.event.stopImmediatePropagation()}stopImmediatePropagation(){this._propagationStopped=!0,this.event.stopImmediatePropagation()}z__pointer_ctured=!1;setPointerCapture(){this.z__pointer_ctured=!0}z__pointer_cture_rleased=!1;releasePointerCapture(){this.z__pointer_cture_rleased=!0}inputSource;get mode(){return this.event.mode}object;point;normal;face;distance;instanceId;intersection;isDown;isUp;isPressed;isClick;isDoubleClick;input;constructor(e,t){this.event=t,this.input=e,this.button=t.button}clone(){const e=new vd(this.input,this.event);return Object.assign(e,this),e}Use(){this.use()}StopPropagation(){this.event.stopImmediatePropagation()}}function Fu(o,e){return S.foreachComponent(o,t=>{if(!t.enabled)return;const i=t;if(e)switch(e){case"pointerdown":if(i.onPointerDown)return!0;break;case"pointerup":if(i.onPointerUp||i.onPointerClick)return!0;break;case"pointermove":if(i.onPointerEnter||i.onPointerExit||i.onPointerMove)return!0;break}else if(i.onPointerDown||i.onPointerUp||i.onPointerEnter||i.onPointerExit||i.onPointerClick)return!0},!1)===!0}const zo=new Array;class No{enabled=!0;target;methodName;arguments;get canClone(){return this.target instanceof Object}constructor(e,t,i,n){this.target=e,this.methodName=t||null,this.arguments=i,n!=null&&(this.enabled=n)}invoke(...e){if(this.enabled!==!1){if(typeof this.target=="function")this.arguments?(zo.length=0,e!==void 0&&e.length>0&&zo.push(...e),zo.push(...this.arguments),this.target(...this.arguments),zo.length=0):this.target(...e);else if(this.methodName!=null){const t=this.target[this.methodName];typeof t=="function"?this.arguments?(zo.length=0,e!==void 0&&e.length>0&&zo.push(...e),zo.push(...this.arguments),t.call(this.target,...zo),zo.length=0):t.call(this.target,...e):this.arguments?e!==void 0&&e.length>0?this.target[this.methodName]=e[0]:this.target[this.methodName]=this.arguments[0]:this.target[this.methodName]=e[0]}}}}const eR=o=>/^[A-Z]*$/.test(o);class Uu extends Event{args}class ae{isEventList=!0;__internalOnInstantiate(e){const t=new Array;for(let i=0;i<this.methods.length;i++){const n=this.methods[i];if(!(n.target instanceof Function)){const s=n.target;let r=s?.uuid;if(s&&(r=s.guid),r){const a=e[r];if(a){const l=n.arguments?.map(c=>c instanceof Object&&c.uuid?e[c.uuid].clone:c?.isComponent?e[c.guid].clone:c);t.push(new No(a.clone,n.methodName,l,n.enabled))}else A()&&console.warn("Could not find target for event listener")}}}return new ae(t)}target;key;setEventTarget(e,t){if(this.key=e,this.target=t,this.key!==void 0){let i="",n=!1;for(const s of this.key)n&&eR(s)&&(i+="-"),n=!0,i+=s.toLowerCase();this.key=i}}get listenerCount(){return this.methods?.length??0}get isInvoking(){return this._isInvoking}_isInvoking=!1;methods=[];_methodsCopy=[];static from(...e){return new ae(e)}constructor(e){if(this.methods=[],Array.isArray(e))for(const t of e)t instanceof No?this.methods.push(t):typeof t=="function"&&this.methods.push(new No(t));else typeof e=="function"&&this.methods.push(new No(e))}invoke(...e){if(this._isInvoking)return console.warn("Circular event invocation detected. Please check your event listeners for circular references.",this),!1;if(this.methods?.length<=0)return!1;this._isInvoking=!0;try{this._methodsCopy.length=0,this._methodsCopy.push(...this.methods);for(const t of this._methodsCopy)t.invoke(...e);if(typeof this.target=="object"&&typeof this.key=="string"){const t=this.target.dispatchEvent;if(typeof t=="function"){const i=new Uu(this.key);i.args=e,t.call(this.target,i)}}}finally{this._isInvoking=!1,this._methodsCopy.length=0}return!0}addEventListener(e){return this.methods.push(new No(e)),e}removeEventListener(e){if(e)for(let t=this.methods.length-1;t>=0;t--)this.methods[t].target===e&&(this.methods[t].enabled=!1,this.methods.splice(t,1))}removeAllEventListeners(){this.methods.length=0}}class tR extends Zi{constructor(){super([oe,se],"ColorSerializer")}onDeserialize(e){if(e!=null)return e.a!==void 0?new se(e.r,e.g,e.b,e.a):e.alpha!==void 0?new se(e.r,e.g,e.b,e.alpha):new oe(e.r,e.g,e.b)}onSerialize(e){if(e!=null)return e.a!==void 0?{r:e.r,g:e.g,b:e.b,a:e.a}:{r:e.r,g:e.g,b:e.b}}}const iR=new tR;class nR extends Zi{constructor(){super([at],"EulerSerializer")}onDeserialize(e,t){if(e!=null){if(e.order)return new at(e.x,e.y,e.z,e.order);if(e.x!=null)return new at(e.x,e.y,e.z)}}onSerialize(e,t){return{x:e.x,y:e.y,z:e.z,order:e.order}}}const oR=new nR;class sR extends Zi{constructor(){super(M,"ObjectSerializer")}onSerialize(e,t){if(t.objectToNode!==void 0&&e.uuid){const i=t.objectToNode[e.uuid];return bt&&console.log(i,e.name,e.uuid),{node:i}}}onDeserialize(e,t){if(typeof e=="string"){if(e.endsWith(".glb")||e.endsWith(".gltf")){if(t.serializable instanceof Array&&t.serializable.includes(ne))return;A()&&be("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");const i=t.target?.constructor?.name;console.warn(`Wrong usage of @serializable detected in your script "${i}"
|
|
962
|
+
`;function lx(o){if(Z.active)return console.warn("[OrbitControls] Can not fit camera while XR session is active"),null;const e=U.Current;if(!e)return console.warn("[OrbitControls] No context found"),null;const t=o?.camera||e.mainCamera;if(!t)return console.warn("No camera or controls found to fit camera to objects..."),null;o||(o={}),o.autoApply=o.autoApply!==!1,o.minZoom||=0,o.maxZoom||=1/0;const{centerCamera:i,cameraNearFar:n="auto",fitOffset:s=1.1,fov:r=t instanceof de?t?.fov:-1}=o,a=new b,l=new b,c=t instanceof de?t.aspect:1,h=o.objects||e.scene,d=di(h,void 0,t?.layers),p=d.clone();d.getCenter(l);const m=new b;if(d.getSize(m),t instanceof de&&t.updateProjectionMatrix(),t.updateMatrixWorld(),d.applyMatrix4(t.matrixWorldInverse),d.getSize(a),d.setFromCenterAndSize(l,a),Number.isNaN(a.x)||Number.isNaN(a.y)||Number.isNaN(a.z))return console.warn("Camera fit size resultet in NaN",t,d),null;if(a.length()<=1e-10)return console.warn("Camera fit size is zero",d),null;const g=r,f=2*Math.atan(Math.tan(g*Math.PI/360/2)*c)/Math.PI*360,y=a.y/(2*Math.atan(Math.PI*g/360)),_=a.x/(2*Math.atan(Math.PI*f/360)),v=s*Math.max(y,_)+a.z/2;o.maxZoom=v*10,o.minZoom=v*.01,o.debug===!0&&console.log("Fit camera to objects",{fitHeightDistance:y,fitWidthDistance:_,distance:v,verticalFov:g,horizontalFov:f});const P=.05,k=l.clone();if(k.y-=a.y*P,o.targetOffset&&(o.targetOffset.x!==void 0&&(k.x+=o.targetOffset.x),o.targetOffset.y!==void 0&&(k.y+=o.targetOffset.y),o.targetOffset.z!==void 0&&(k.z+=o.targetOffset.z)),o.relativeTargetOffset&&(o.relativeTargetOffset.x!==void 0&&(k.x+=o.relativeTargetOffset.x*a.x),o.relativeTargetOffset.y!==void 0&&(k.y+=o.relativeTargetOffset.y*a.y),o.relativeTargetOffset.z!==void 0&&(k.z+=o.relativeTargetOffset.z*a.z)),n==null||n=="auto"){const L=tl(Jn),V=L?L.radius:0,W=Math.max(m.x,m.y,m.z,V);t instanceof de&&(t.near=v/100,t.far=W+v*10,t.updateProjectionMatrix()),L&&(o.maxZoom=Math.max(Math.min(o.maxZoom,V*.5),v))}o.currentZoom!==void 0&&(o.currentZoom<o.minZoom&&(o.minZoom=o.currentZoom*.9),o.currentZoom>o.maxZoom&&(o.maxZoom=o.currentZoom*1.1));const O=l.clone();o.fitDirection?O.sub(new b().copy(o.fitDirection).multiplyScalar(1e6)):O.sub(t.worldPosition),i==="y"&&(O.y=0),O.normalize(),O.multiplyScalar(v),i==="y"&&(O.y+=-P*4*v);let D=l.clone().sub(O);return o.cameraOffset&&(o.cameraOffset.x!==void 0&&(D.x+=o.cameraOffset.x),o.cameraOffset.y!==void 0&&(D.y+=o.cameraOffset.y),o.cameraOffset.z!==void 0&&(D.z+=o.cameraOffset.z)),o.relativeCameraOffset&&(o.relativeCameraOffset.x!==void 0&&(D.x+=o.relativeCameraOffset.x*a.x),o.relativeCameraOffset.y!==void 0&&(D.y+=o.relativeCameraOffset.y*a.y),o.relativeCameraOffset.z!==void 0&&(D.z+=o.relativeCameraOffset.z*a.z)),t.parent&&(D=t.parent.worldToLocal(D)),o.debug&&(B.DrawWireBox3(d,16777011,10),B.DrawWireBox3(p,65280,10)),o.autoApply&&(t.position.copy(D),t.lookAt(k),r>0&&t instanceof de&&(t.fov=r,t.updateProjectionMatrix())),{camera:t,position:D,lookAt:k,fov:o.fov}}var XE=Object.defineProperty,jf=(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&&XE(e,t,n),n};class Wr extends E{constraintActive=!0;locked=!1;sources=[];setConstraintPosition(e){const t=this.sources[0];t&&(t.worldPosition=e)}}jf([u()],Wr.prototype,"constraintActive"),jf([u()],Wr.prototype,"locked"),jf([u(M)],Wr.prototype,"sources");let Vr=class{bb=null;bb_pos=0;__init(o,e){return this.bb_pos=o,this.bb=e,this}x(){return this.bb.readFloat32(this.bb_pos)}y(){return this.bb.readFloat32(this.bb_pos+4)}z(){return this.bb.readFloat32(this.bb_pos+8)}static sizeOf(){return 12}static createVec3(o,e,t,i){return o.prep(4,12),o.writeFloat32(i),o.writeFloat32(t),o.writeFloat32(e),o.offset()}};class cx{bb=null;bb_pos=0;__init(e,t){return this.bb_pos=e,this.bb=t,this}position(e){return(e||new Vr).__init(this.bb_pos,this.bb)}rotation(e){return(e||new Vr).__init(this.bb_pos+12,this.bb)}scale(e){return(e||new Vr).__init(this.bb_pos+24,this.bb)}static sizeOf(){return 36}static createTransform(e,t,i,n,s,r,a,l,c,h){return e.prep(4,36),e.prep(4,12),e.writeFloat32(h),e.writeFloat32(c),e.writeFloat32(l),e.prep(4,12),e.writeFloat32(a),e.writeFloat32(r),e.writeFloat32(s),e.prep(4,12),e.writeFloat32(n),e.writeFloat32(i),e.writeFloat32(t),e.offset()}}class gs{bb=null;bb_pos=0;__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSyncedTransformModel(e,t){return(t||new gs).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSyncedTransformModel(e,t){return e.setPosition(e.position()+Vb),(t||new gs).__init(e.readInt32(e.position())+e.position(),e)}guid(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}fast(){const e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}transform(e){const t=this.bb.__offset(this.bb_pos,8);return t?(e||new cx).__init(this.bb_pos+t,this.bb):null}dontSave(){const e=this.bb.__offset(this.bb_pos,10);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startSyncedTransformModel(e){e.startObject(4)}static addGuid(e,t){e.addFieldOffset(0,t,0)}static addFast(e,t){e.addFieldInt8(1,+t,0)}static addTransform(e,t){e.addFieldStruct(2,t,0)}static addDontSave(e,t){e.addFieldInt8(3,+t,0)}static endSyncedTransformModel(e){return e.endObject()}static finishSyncedTransformModelBuffer(e,t){e.finish(t)}static finishSizePrefixedSyncedTransformModelBuffer(e,t){e.finish(t,void 0,!0)}}var T;(o=>{(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./materialx-D_ofN96q.min.js");return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.MaterialX||(o.MaterialX={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./rapier-DJ-luMxr.min.js");return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.RAPIER_PHYSICS||(o.RAPIER_PHYSICS={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./postprocessing-CaEfRjRY.min.js").then(r=>r.index);return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.POSTPROCESSING||(o.POSTPROCESSING={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./postprocessing-CaEfRjRY.min.js").then(r=>r.N8AO);return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.POSTPROCESSING_AO||(o.POSTPROCESSING_AO={}))})(T||(T={}));var vt=(o=>(o[o.Average=0]="Average",o[o.Multiply=1]="Multiply",o[o.Minimum=2]="Minimum",o[o.Maximum=3]="Maximum",o))(vt||{}),Bu=(o=>(o[o.Discrete=0]="Discrete",o[o.Continuous=1]="Continuous",o))(Bu||{}),Ze=(o=>(o[o.None=0]="None",o[o.FreezePositionX=2]="FreezePositionX",o[o.FreezePositionY=4]="FreezePositionY",o[o.FreezePositionZ=8]="FreezePositionZ",o[o.FreezePosition=14]="FreezePosition",o[o.FreezeRotationX=16]="FreezeRotationX",o[o.FreezeRotationY=32]="FreezeRotationY",o[o.FreezeRotationZ=64]="FreezeRotationZ",o[o.FreezeRotation=112]="FreezeRotation",o[o.FreezeAll=126]="FreezeAll",o))(Ze||{}),cl=(o=>(o[o.None=0]="None",o[o.X=2]="X",o[o.Y=4]="Y",o[o.Z=8]="Z",o[o.All=-1]="All",o))(cl||{});const kt=function(o,e){return function(t,i,n){QE(t,i,n,o,e)}};function QE(o,e,t,i,n){if(!n&&!i&&!o.onValidate)return;if(t!==void 0){console.error("Invalid usage of validate decorator. Only fields can be validated.",o,e,t),Oe("Invalid usage of validate decorator. Only fields can be validated. Property: "+e,{type:Ri.Error});return}let s="";if(typeof e=="string"?s=e:s=e.name,o.__internalAwake){const r=Symbol(s),a=o.__internalAwake;o.__internalAwake=function(){if(!this.onValidate){A()&&console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "'+o.constructor?.name+'"');return}if(this[r]===void 0){this[r]=this[s];const l=this[s];if(l instanceof K||l instanceof b||l instanceof ye||l instanceof N){const c=this[s];Bd(c,()=>{this.onValidate(s)})}Object.defineProperty(this,s,{set:function(c){if(this[lf]===!0)this[r]=c;else{i?.call(this,c);const h=this[r];this[r]=c,this.onValidate?.call(this,s,h)}},get:function(){return n?.call(this),this[r]}})}a.call(this)}}}const YE=function(o){return function(e,t,i){let n="";typeof t=="string"?n=t:n=t.name;const s=o.prototype,r=Object.getOwnPropertyDescriptor(s,n);if(!r?.value){console.warn("Can not apply prefix: type does not have method named",t,o);return}const a=r.value,l=e[n];Object.defineProperty(s,n,{value:function(...c){const h=l?.call(this,...c);if(h instanceof Promise){h.then(d=>{if(d!==!1)return a.call(this,...c)});return}if(h!==!1)return a.call(this,...c)}})}};var ZE=Object.defineProperty,KE=Object.getOwnPropertyDescriptor,Li=(o,e,t,i)=>{for(var n=i>1?void 0:i?KE(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&&ZE(e,t,n),n};class JE{get isDirty(){return this.positionChanged||this.rotationChanged}positionChanged=!1;rotationChanged=!1;position;quaternion;_positionKeys=["x","y","z"];_quaternionKeys=["_x","_y","_z","_w"];reset(e=!1){if(this.positionChanged=!1,this.rotationChanged=!1,this.mute=!1,e){if(this.position)for(const t of this._positionKeys)delete this.position[t];if(this.quaternion)for(const t of this._quaternionKeys)delete this.quaternion[t]}}syncValues(){for(const e of this._positionKeys)this.position[e]=this.obj.position[e];for(const e of this._quaternionKeys)this.quaternion[e]=this.obj.quaternion[e]}mute=!1;applyValues(){if(this.positionChanged&&this.position)for(const e of this._positionKeys){const t=this.position[e];t!==void 0&&(this.obj.position[e]=t)}if(this.rotationChanged&&this.quaternion)for(const e of this._quaternionKeys){const t=this.quaternion[e];t!==void 0&&(this.obj.quaternion[e]=t)}}context;obj;_positionWatch;_rotationWatch;constructor(e,t){this.context=t,this.obj=e}start(e,t){this.reset(),e&&(this._positionWatch||(this._positionWatch=new ps(this.obj.position,["x","y","z"])),this._positionWatch.apply(),this.position={},this._positionWatch.subscribeWrite((s,r)=>{if(this.context.physics.engine?.isUpdating||this.mute)return;const a=this.position[r];Math.abs(a-s)<1e-5||(this.position[r]=s,this.positionChanged=!0)})),t&&(this._rotationWatch||(this._rotationWatch=new ps(this.obj.quaternion,["_x","_y","_z","_w"])),this._rotationWatch.apply(),this.quaternion={},this._rotationWatch.subscribeWrite((s,r)=>{if(this.context.physics.engine?.isUpdating||this.mute)return;const a=this.quaternion[r];Math.abs(a-s)<1e-5||(this.quaternion[r]=s,this.rotationChanged=!0)}));const i=this.obj.matrixWorld.multiplyMatrices.bind(this.obj.matrixWorld),n=new J;this.obj.matrixWorld.multiplyMatrices=(s,r)=>(this.context.physics.engine?.isUpdating||this.mute||n.equals(s)||(this.positionChanged=!0,this.rotationChanged=!0,n.copy(s)),i(s,r))}stop(){this._positionWatch?.revoke(),this._rotationWatch?.revoke()}}const fi=class bm extends E{get isRigidbody(){return!0}autoMass=!0;set mass(e){e!==this._mass&&(this._mass=e,this._propertiesChanged=!0,this.__didAwake&&(this.autoMass=!1))}get mass(){return this.autoMass?this.context.physics.engine?.getBody(this)?.mass()??-1:this._mass}_mass=0;useGravity=!0;centerOfMass=new b(0,0,0);constraints=Ze.None;isKinematic=!1;drag=0;angularDrag=1;detectCollisions=!0;sleepThreshold=.01;collisionDetectionMode=Bu.Discrete;get lockPositionX(){return(this.constraints&Ze.FreezePositionX)!==0}get lockPositionY(){return(this.constraints&Ze.FreezePositionY)!==0}get lockPositionZ(){return(this.constraints&Ze.FreezePositionZ)!==0}get lockRotationX(){return(this.constraints&Ze.FreezeRotationX)!==0}get lockRotationY(){return(this.constraints&Ze.FreezeRotationY)!==0}get lockRotationZ(){return(this.constraints&Ze.FreezeRotationZ)!==0}set lockPositionX(e){e?this.constraints|=Ze.FreezePositionX:this.constraints&=~Ze.FreezePositionX}set lockPositionY(e){e?this.constraints|=Ze.FreezePositionY:this.constraints&=~Ze.FreezePositionY}set lockPositionZ(e){e?this.constraints|=Ze.FreezePositionZ:this.constraints&=~Ze.FreezePositionZ}set lockRotationX(e){e?this.constraints|=Ze.FreezeRotationX:this.constraints&=~Ze.FreezeRotationX}set lockRotationY(e){e?this.constraints|=Ze.FreezeRotationY:this.constraints&=~Ze.FreezeRotationY}set lockRotationZ(e){e?this.constraints|=Ze.FreezeRotationZ:this.constraints&=~Ze.FreezeRotationZ}set gravityScale(e){this._gravityScale=e}get gravityScale(){return this._gravityScale}_gravityScale=1;dominanceGroup=0;static tempPosition=new b;_propertiesChanged=!1;_currentVelocity=new b;_smoothedVelocity=new b;_smoothedVelocityGetter=new b;_lastPosition=new b;_watch;awake(){this._watch=void 0,this._propertiesChanged=!1}onEnable(){this._watch||(this._watch=new JE(this.gameObject,this.context)),this._watch.start(!0,!0),this.startCoroutine(this.beforePhysics(),xe.LateUpdate),A()&&(globalThis.NEEDLE_USE_RAPIER?T.RAPIER_PHYSICS.ready().then(async()=>{await mc(3),this.context.physics.engine?.getBody(this)||console.warn(`Rigidbody could not be created. Ensure "${this.name}" has a Collider component.`)}):console.warn("Rigidbody could not be created: Rapier physics are explicitly disabled."))}onDisable(){this._watch?.stop(),this.context.physics.engine?.removeBody(this)}onDestroy(){this.context.physics.engine?.removeBody(this)}onValidate(){this._propertiesChanged=!0}*beforePhysics(){for(;;)this._propertiesChanged&&(this._propertiesChanged=!1,this.context.physics.engine?.updateProperties(this)),this._watch?.isDirty?(this._watch.mute=!0,this._watch.applyValues(),this.context.physics.engine?.updateBody(this,this._watch.positionChanged,this._watch.rotationChanged),this._watch.reset()):this._watch?.syncValues(),this.captureVelocity(),yield}teleport(e,t=!0){this._watch?.reset(!0),t?this.gameObject.position.set(e.x,e.y,e.z):this.setWorldPosition(e.x,e.y,e.z),this.resetForcesAndTorques(),this.resetVelocities()}resetForces(e=!0){this.context.physics.engine?.resetForces(this,e)}resetTorques(e=!0){this.context.physics.engine?.resetTorques(this,e)}resetVelocities(){this.setVelocity(0,0,0),this.setAngularVelocity(0,0,0)}resetForcesAndTorques(){this.resetForces(),this.resetTorques()}wakeUp(){this.context.physics.engine?.wakeup(this)}get isSleeping(){return this.context.physics.engine?.isSleeping(this)}updateProperties(){return this._propertiesChanged=!1,this.context.physics.engine?.updateProperties(this)}applyForce(e,t,i=!0){this._propertiesChanged&&this.updateProperties(),this.context.physics.engine?.addForce(this,e,i)}applyImpulse(e,t=!0){this._propertiesChanged&&this.updateProperties(),this.context.physics.engine?.applyImpulse(this,e,t)}setForce(e,t,i,n=!0){this.context.physics.engine?.resetForces(this,n),typeof e=="number"?(t??=0,i??=0,this.context.physics.engine?.addForce(this,{x:e,y:t,z:i},n)):this.context.physics.engine?.addForce(this,e,n)}getVelocity(){const e=this.context.physics.engine?.getLinearVelocity(this);return e?(this._currentVelocity.x=e.x,this._currentVelocity.y=e.y,this._currentVelocity.z=e.z,this._currentVelocity):this._currentVelocity.set(0,0,0)}setVelocity(e,t,i,n=!0){if(e instanceof b){const s=e;this.context.physics.engine?.setLinearVelocity(this,s,n);return}t===void 0||i===void 0||this.context.physics.engine?.setLinearVelocity(this,{x:e,y:t,z:i},n)}getAngularVelocity(){const e=this.context.physics.engine?.getAngularVelocity(this);return e?(this._currentVelocity.x=e.x,this._currentVelocity.y=e.y,this._currentVelocity.z=e.z,this._currentVelocity):this._currentVelocity.set(0,0,0)}setAngularVelocity(e,t,i,n=!0){if(typeof e=="object"){const s=e;this.context.physics.engine?.setAngularVelocity(this,s,n);return}if(t===void 0||i===void 0||typeof t=="boolean"){console.warn("setAngularVelocity expects either a Vec3 or 3 numbers");return}this.context.physics.engine?.setAngularVelocity(this,{x:e,y:t,z:i},n)}setTorque(e,t,i){typeof e=="number"?this.setAngularVelocity(e,t,i):this.setAngularVelocity(e)}get smoothedVelocity(){return this._smoothedVelocityGetter.copy(this._smoothedVelocity),this._smoothedVelocityGetter.multiplyScalar(1/this.context.time.deltaTime)}setBodyFromGameObject(e=null){}captureVelocity(){const e=this.gameObject.matrixWorld;bm.tempPosition.setFromMatrixPosition(e);const t=bm.tempPosition.sub(this._lastPosition);this._lastPosition.copy(bm.tempPosition),this._smoothedVelocity.lerp(t,this.context.time.deltaTime/.1)}};Li([kt()],fi.prototype,"autoMass",2),Li([u()],fi.prototype,"mass",1),Li([kt(),u()],fi.prototype,"useGravity",2),Li([u(b)],fi.prototype,"centerOfMass",2),Li([kt(),u()],fi.prototype,"constraints",2),Li([kt(),u()],fi.prototype,"isKinematic",2),Li([kt(),u()],fi.prototype,"drag",2),Li([kt(),u()],fi.prototype,"angularDrag",2),Li([kt(),u()],fi.prototype,"detectCollisions",2),Li([kt(),u()],fi.prototype,"sleepThreshold",2),Li([kt(),u()],fi.prototype,"collisionDetectionMode",2),Li([kt()],fi.prototype,"_gravityScale",2),Li([kt()],fi.prototype,"dominanceGroup",2);let Ke=fi;new b,new b;const Is=w("debugsync"),Qc="STRS";Eg(Qc,gs.getRootAsSyncedTransformModel);const eo=new Wm;function hx(o,e,t=!0){eo.clear();const i=eo.createString(o);gs.startSyncedTransformModel(eo),gs.addGuid(eo,i),gs.addFast(eo,t);const n=e.worldPosition,s=e.worldEuler,r=e.gameObject.scale;gs.addTransform(eo,cx.createTransform(eo,n.x,n.y,n.z,s.x,s.y,s.z,r.x,r.y,r.z));const a=gs.endSyncedTransformModel(eo);return eo.finish(a,Qc),eo.asUint8Array()}let Df=0,Yc=0;$w(o=>{const e=o.connection.currentServerUrl?.includes("glitch")?10:40;Yc=Math.floor(Df/e),Df=0,Is&&Yc>0&&console.log("Sync Transform Fast Interval",Yc)});class Tn extends E{overridePhysics=!0;interpolatePosition=!0;interpolateRotation=!0;fastMode=!1;syncDestroy=!1;_model=null;_needsUpdate=!0;rb=null;_wasKinematic=!1;_receivedDataBefore=!1;_targetPosition;_targetRotation;_receivedFastUpdate=!1;_shouldRequestOwnership=!1;requestOwnership(){Is&&console.log("Request ownership"),this._model?this._model.requestOwnership():(this._shouldRequestOwnership=!0,this._needsUpdate=!0)}freeOwnership(){this._model?.freeOwnership()}hasOwnership(){return this._model?.hasOwnership??void 0}isOwned(){return this._model?.isOwned}joinedRoomCallback=null;receivedDataCallback=null;awake(){Is&&console.log("new instance",this.guid,this),this._receivedDataBefore=!1,this._targetPosition=new b,this._targetRotation=new N,this.lastPosition=new b,this.lastRotation=new N,this.lastScale=new b,this.rb=S.getComponentInChildren(this.gameObject,Ke),this.rb&&(this._wasKinematic=this.rb.isKinematic),this.receivedUpdate=!0,this._model=new Tg(this.context.connection,this.guid),this.context.connection.isConnected&&this.tryGetLastState(),this.joinedRoomCallback=this.tryGetLastState.bind(this),this.context.connection.beginListen(ie.JoinedRoom,this.joinedRoomCallback),this.receivedDataCallback=this.onReceivedData.bind(this),this.context.connection.beginListenBinary(Qc,this.receivedDataCallback)}onDestroy(){this.syncDestroy&&Zg(this.guid,this.context.connection),this._model=null,this.context.connection.stopListen(ie.JoinedRoom,this.joinedRoomCallback),this.context.connection.stopListenBinary(Qc,this.receivedDataCallback)}tryGetLastState(){const e=this.context.connection.tryGetState(this.guid);e&&this.onReceivedData(e)}tempEuler=new at;onReceivedData(e){if(!this.destroyed&&typeof e.guid=="function"&&e.guid()===this.guid){Is&&console.log("new data",this.context.connection.connectionId,this.context.time.frameCount,this.guid,e),this.receivedUpdate=!0,this._receivedFastUpdate=e.fast();const t=e.transform();if(t){pn.markDirty(this.gameObject,!0);const i=t.position();i&&(this.interpolatePosition&&this._targetPosition?.set(i.x(),i.y(),i.z()),(!this.interpolatePosition||!this._receivedDataBefore)&&this.setWorldPosition(i.x(),i.y(),i.z()));const n=t.rotation();n&&(this.tempEuler.set(n.x(),n.y(),n.z()),this.interpolateRotation&&this._targetRotation.setFromEuler(this.tempEuler),(!this.interpolateRotation||!this._receivedDataBefore)&&ug(this.gameObject,this.tempEuler));const s=t.scale();s&&this.gameObject.scale.set(s.x(),s.y(),s.z())}this._receivedDataBefore=!0}}onEnable(){this.lastPosition.copy(this.worldPosition),this.lastRotation.copy(this.worldQuaternion),this.lastScale.copy(this.gameObject.scale),this._needsUpdate=!0,this._model&&this._model.updateIsOwned()}onDisable(){this._model&&this._model.freeOwnership()}receivedUpdate=!1;lastPosition;lastRotation;lastScale;onBeforeRender(){if(!this.activeAndEnabled||!this.context.connection.isConnected)return;if(!this.context.connection.isInRoom||!this._model){Is&&console.log("no model or room",this.name,this.guid,this.context.connection.isInRoom);return}this._shouldRequestOwnership&&(this._shouldRequestOwnership=!1,this._model.requestOwnership());const e=this.worldPosition,t=this.worldQuaternion,i=this.gameObject.scale;if(this._model.isOwned&&!this.receivedUpdate){const r=this._model.hasOwnership||this.fastMode?1e-4:.001;(e.distanceTo(this.lastPosition)>r||t.angleTo(this.lastRotation)>r||i.distanceTo(this.lastScale)>r)&&(this._model.hasOwnership?this._needsUpdate=!0:(Is&&console.log(this.guid,"reset because not owned but",this.gameObject.name,this.lastPosition),this.worldPosition=this.lastPosition,e.copy(this.lastPosition),this.worldQuaternion=this.lastRotation,t.copy(this.lastRotation),this.gameObject.scale.copy(this.lastScale),pn.markDirty(this.gameObject,!0),this._needsUpdate=!1))}if(this._model&&!this._model.hasOwnership&&this._model.isOwned&&this._receivedDataBefore){const r=this._receivedFastUpdate||this.fastMode?.5:.3;let a=!1;if(this.interpolatePosition&&this._targetPosition){const l=this.worldPosition;l.lerp(this._targetPosition,r),this.worldPosition=l,a=!0}if(this.interpolateRotation&&this._targetRotation){const l=this.worldQuaternion;l.slerp(this._targetRotation,r),this.worldQuaternion=l,a=!0}a&&pn.markDirty(this.gameObject,!0)}if(this.receivedUpdate=!1,this.lastPosition.copy(e),this.lastRotation.copy(t),this.lastScale.copy(i),!this._model||!this._model||this._model.hasOwnership===void 0||!this._model.hasOwnership)return;this.rb&&this.overridePhysics&&this._wasKinematic!==void 0&&(Is&&console.log("reset kinematic",this.rb.name,this._wasKinematic),this.rb.isKinematic=this._wasKinematic);const n=10,s=this.rb||this.fastMode;if(this._needsUpdate&&(this.context.time.frameCount%n===0||s)){if(Df++,s&&Yc>0&&this.context.time.frameCount%Yc!==0)return;Is&&console.debug("[SyncedTransform] Send update",this.context.connection.connectionId,this.guid,this.gameObject.name,this.gameObject.guid),this._needsUpdate=!1;const r=hx(this.guid,this,!!s);this.context.connection.sendBinary(r)}}}class vd{event;get deviceIndex(){return this.event.deviceIndex}get pointerId(){return this.event.pointerId}button;buttonName;get pressure(){return this.event.pressure}get used(){return this._used}_used=!1;use(){this._used||(this._used=!0,this.event.use())}_propagationStopped=!1;get propagationStopped(){return this._propagationStopped}stopPropagation(){this._propagationStopped=!0,this.event.stopImmediatePropagation()}stopImmediatePropagation(){this._propagationStopped=!0,this.event.stopImmediatePropagation()}z__pointer_ctured=!1;setPointerCapture(){this.z__pointer_ctured=!0}z__pointer_cture_rleased=!1;releasePointerCapture(){this.z__pointer_cture_rleased=!0}inputSource;get mode(){return this.event.mode}object;point;normal;face;distance;instanceId;intersection;isDown;isUp;isPressed;isClick;isDoubleClick;input;constructor(e,t){this.event=t,this.input=e,this.button=t.button}clone(){const e=new vd(this.input,this.event);return Object.assign(e,this),e}Use(){this.use()}StopPropagation(){this.event.stopImmediatePropagation()}}function Fu(o,e){return S.foreachComponent(o,t=>{if(!t.enabled)return;const i=t;if(e)switch(e){case"pointerdown":if(i.onPointerDown)return!0;break;case"pointerup":if(i.onPointerUp||i.onPointerClick)return!0;break;case"pointermove":if(i.onPointerEnter||i.onPointerExit||i.onPointerMove)return!0;break}else if(i.onPointerDown||i.onPointerUp||i.onPointerEnter||i.onPointerExit||i.onPointerClick)return!0},!1)===!0}const zo=new Array;class No{enabled=!0;target;methodName;arguments;get canClone(){return this.target instanceof Object}constructor(e,t,i,n){this.target=e,this.methodName=t||null,this.arguments=i,n!=null&&(this.enabled=n)}invoke(...e){if(this.enabled!==!1){if(typeof this.target=="function")this.arguments?(zo.length=0,e!==void 0&&e.length>0&&zo.push(...e),zo.push(...this.arguments),this.target(...this.arguments),zo.length=0):this.target(...e);else if(this.methodName!=null){const t=this.target[this.methodName];typeof t=="function"?this.arguments?(zo.length=0,e!==void 0&&e.length>0&&zo.push(...e),zo.push(...this.arguments),t.call(this.target,...zo),zo.length=0):t.call(this.target,...e):this.arguments?e!==void 0&&e.length>0?this.target[this.methodName]=e[0]:this.target[this.methodName]=this.arguments[0]:this.target[this.methodName]=e[0]}}}}const eR=o=>/^[A-Z]*$/.test(o);class Uu extends Event{args}class ae{isEventList=!0;__internalOnInstantiate(e){const t=new Array;for(let i=0;i<this.methods.length;i++){const n=this.methods[i];if(!(n.target instanceof Function)){const s=n.target;let r=s?.uuid;if(s&&(r=s.guid),r){const a=e[r];if(a){const l=n.arguments?.map(c=>c instanceof Object&&c.uuid?e[c.uuid].clone:c?.isComponent?e[c.guid].clone:c);t.push(new No(a.clone,n.methodName,l,n.enabled))}else A()&&console.warn("Could not find target for event listener")}}}return new ae(t)}target;key;setEventTarget(e,t){if(this.key=e,this.target=t,this.key!==void 0){let i="",n=!1;for(const s of this.key)n&&eR(s)&&(i+="-"),n=!0,i+=s.toLowerCase();this.key=i}}get listenerCount(){return this.methods?.length??0}get isInvoking(){return this._isInvoking}_isInvoking=!1;methods=[];_methodsCopy=[];static from(...e){return new ae(e)}constructor(e){if(this.methods=[],Array.isArray(e))for(const t of e)t instanceof No?this.methods.push(t):typeof t=="function"&&this.methods.push(new No(t));else typeof e=="function"&&this.methods.push(new No(e))}invoke(...e){if(this._isInvoking)return console.warn("Circular event invocation detected. Please check your event listeners for circular references.",this),!1;if(this.methods?.length<=0)return!1;this._isInvoking=!0;try{this._methodsCopy.length=0,this._methodsCopy.push(...this.methods);for(const t of this._methodsCopy)t.invoke(...e);if(typeof this.target=="object"&&typeof this.key=="string"){const t=this.target.dispatchEvent;if(typeof t=="function"){const i=new Uu(this.key);i.args=e,t.call(this.target,i)}}}finally{this._isInvoking=!1,this._methodsCopy.length=0}return!0}addEventListener(e){return this.methods.push(new No(e)),e}removeEventListener(e){if(e)for(let t=this.methods.length-1;t>=0;t--)this.methods[t].target===e&&(this.methods[t].enabled=!1,this.methods.splice(t,1))}removeAllEventListeners(){this.methods.length=0}}class tR extends Zi{constructor(){super([oe,se],"ColorSerializer")}onDeserialize(e){if(e!=null)return e.a!==void 0?new se(e.r,e.g,e.b,e.a):e.alpha!==void 0?new se(e.r,e.g,e.b,e.alpha):new oe(e.r,e.g,e.b)}onSerialize(e){if(e!=null)return e.a!==void 0?{r:e.r,g:e.g,b:e.b,a:e.a}:{r:e.r,g:e.g,b:e.b}}}const iR=new tR;class nR extends Zi{constructor(){super([at],"EulerSerializer")}onDeserialize(e,t){if(e!=null){if(e.order)return new at(e.x,e.y,e.z,e.order);if(e.x!=null)return new at(e.x,e.y,e.z)}}onSerialize(e,t){return{x:e.x,y:e.y,z:e.z,order:e.order}}}const oR=new nR;class sR extends Zi{constructor(){super(M,"ObjectSerializer")}onSerialize(e,t){if(t.objectToNode!==void 0&&e.uuid){const i=t.objectToNode[e.uuid];return bt&&console.log(i,e.name,e.uuid),{node:i}}}onDeserialize(e,t){if(typeof e=="string"){if(e.endsWith(".glb")||e.endsWith(".gltf")){if(t.serializable instanceof Array&&t.serializable.includes(ne))return;A()&&be("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");const i=t.target?.constructor?.name;console.warn(`Wrong usage of @serializable detected in your script "${i}"
|
|
963
963
|
|
|
964
964
|
It looks like you used @serializable(Object3D) or @serializable(GameObject) for a prefab or scene reference which is exported to a separate glTF file.
|
|
965
965
|
|