@dcl-regenesislabs/bevy-explorer-web 0.1.0-23447591135.commit-3c2b416 → 0.1.0-23518090667.commit-2a4b958

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/.env CHANGED
@@ -1 +1 @@
1
- PUBLIC_URL="https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-23447591135.commit-3c2b416"
1
+ PUBLIC_URL="https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-23518090667.commit-2a4b958"
package/engine.js CHANGED
@@ -310,5 +310,15 @@ export function start() {
310
310
 
311
311
  engine_run(platform, realmValue, positionValue, systemScene, true, preview, 1e7);
312
312
  window.engine_console_command = engine_console_command;
313
+ window.loadSceneUtils = () => {
314
+ return new Promise((resolve, reject) => {
315
+ const basePath = window.location.pathname.replace(/\/$/, '');
316
+ const s = document.createElement('script');
317
+ s.src = new URL(`${basePath}/sceneUtils.js`, window.location.origin);
318
+ s.onload = () => { console.log('sceneUtils loaded'); resolve(); };
319
+ s.onerror = () => reject(new Error('failed to load sceneUtils.js'));
320
+ document.head.appendChild(s);
321
+ });
322
+ };
313
323
  setTimeout(showCanvas, 200);
314
324
  }
package/index.html CHANGED
@@ -411,7 +411,7 @@
411
411
  }
412
412
  </style>
413
413
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
414
- <script>window.PUBLIC_URL = "https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-23447591135.commit-3c2b416";</script>
414
+ <script>window.PUBLIC_URL = "https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-23518090667.commit-2a4b958";</script>
415
415
  </head>
416
416
  <body>
417
417
  <div id="header" class="container">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl-regenesislabs/bevy-explorer-web",
3
- "version": "0.1.0-23447591135.commit-3c2b416",
3
+ "version": "0.1.0-23518090667.commit-2a4b958",
4
4
  "scripts": {
5
5
  "postinstall": "node ./scripts/prebuild.js"
6
6
  },
@@ -8,6 +8,6 @@
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/decentraland/bevy-explorer.git"
10
10
  },
11
- "homepage": "https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-23447591135.commit-3c2b416",
12
- "commit": "3c2b416cec8bd3b31c16af0854a62b4964c73f1a"
11
+ "homepage": "https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-23518090667.commit-2a4b958",
12
+ "commit": "2a4b95885398a90792a620e41ef26e4516393e59"
13
13
  }
package/pkg/manifest.json CHANGED
@@ -1 +1 @@
1
- {"wasmSize":118127311}
1
+ {"wasmSize":118230806}
@@ -4406,27 +4406,27 @@ function __wbg_get_imports(memory) {
4406
4406
  return ret;
4407
4407
  },
4408
4408
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
4409
- // Cast intrinsic for `Closure(Closure { dtor_idx: 124437, function: Function { arguments: [Externref], shim_idx: 124438, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4409
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 124547, function: Function { arguments: [Externref], shim_idx: 124548, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4410
4410
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__wasm_bindgen_6c0c3bb491d8811b___JsValue____Output________2_, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__3_);
4411
4411
  return ret;
4412
4412
  },
4413
4413
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
4414
- // Cast intrinsic for `Closure(Closure { dtor_idx: 124437, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 124438, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4414
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 124547, function: Function { arguments: [NamedExternref("GPUUncapturedErrorEvent")], shim_idx: 124548, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4415
4415
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__wasm_bindgen_6c0c3bb491d8811b___JsValue____Output________2_, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__3__1);
4416
4416
  return ret;
4417
4417
  },
4418
4418
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
4419
- // Cast intrinsic for `Closure(Closure { dtor_idx: 131708, function: Function { arguments: [Externref], shim_idx: 131709, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4419
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 131818, function: Function { arguments: [Externref], shim_idx: 131819, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4420
4420
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__wasm_bindgen_6c0c3bb491d8811b___JsValue____Output________3_, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__4_);
4421
4421
  return ret;
4422
4422
  },
4423
4423
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
4424
- // Cast intrinsic for `Closure(Closure { dtor_idx: 139762, function: Function { arguments: [Externref], shim_idx: 139763, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4424
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 139872, function: Function { arguments: [Externref], shim_idx: 139873, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4425
4425
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__wasm_bindgen_6c0c3bb491d8811b___JsValue____Output___core_f2710c7f87f75ba1___result__Result_____wasm_bindgen_6c0c3bb491d8811b___JsError___, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue__core_f2710c7f87f75ba1___result__Result_____wasm_bindgen_6c0c3bb491d8811b___JsError___true_);
4426
4426
  return ret;
4427
4427
  },
4428
4428
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
4429
- // Cast intrinsic for `Closure(Closure { dtor_idx: 139762, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 139765, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4429
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 139872, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 139875, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4430
4430
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__wasm_bindgen_6c0c3bb491d8811b___JsValue____Output___core_f2710c7f87f75ba1___result__Result_____wasm_bindgen_6c0c3bb491d8811b___JsError___, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___web_sys_72aa5c11aad59394___features__gen_MessageEvent__MessageEvent______true_);
4431
4431
  return ret;
4432
4432
  },
@@ -4436,112 +4436,112 @@ function __wbg_get_imports(memory) {
4436
4436
  return ret;
4437
4437
  },
4438
4438
  __wbindgen_cast_0000000000000007: function(arg0, arg1) {
4439
- // Cast intrinsic for `Closure(Closure { dtor_idx: 45662, function: Function { arguments: [Externref], shim_idx: 45663, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4439
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 45772, function: Function { arguments: [Externref], shim_idx: 45773, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
4440
4440
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__Fn__comms_473a2fbc44efbcc6___livekit__web__room_event__RoomEvent____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___comms_473a2fbc44efbcc6___livekit__web__local_audio_track__LocalAudioTrack__core_f2710c7f87f75ba1___result__Result_____wasm_bindgen_6c0c3bb491d8811b___JsError___true_);
4441
4441
  return ret;
4442
4442
  },
4443
4443
  __wbindgen_cast_0000000000000008: function(arg0, arg1) {
4444
- // Cast intrinsic for `Closure(Closure { dtor_idx: 45662, function: Function { arguments: [Externref], shim_idx: 45665, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
4444
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 45772, function: Function { arguments: [Externref], shim_idx: 45775, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
4445
4445
  const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__Fn__comms_473a2fbc44efbcc6___livekit__web__room_event__RoomEvent____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___comms_473a2fbc44efbcc6___livekit__web__room_event__RoomEvent______true_);
4446
4446
  return ret;
4447
4447
  },
4448
4448
  __wbindgen_cast_0000000000000009: function(arg0, arg1) {
4449
- // Cast intrinsic for `Closure(Closure { dtor_idx: 55331, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 55332, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4449
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 55441, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 55442, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4450
4450
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__web_sys_72aa5c11aad59394___features__gen_CloseEvent__CloseEvent____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___web_sys_72aa5c11aad59394___features__gen_CloseEvent__CloseEvent______true_);
4451
4451
  return ret;
4452
4452
  },
4453
4453
  __wbindgen_cast_000000000000000a: function(arg0, arg1) {
4454
- // Cast intrinsic for `Closure(Closure { dtor_idx: 55436, function: Function { arguments: [], shim_idx: 55437, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4454
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 55546, function: Function { arguments: [], shim_idx: 55547, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4455
4455
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke_______true_);
4456
4456
  return ret;
4457
4457
  },
4458
4458
  __wbindgen_cast_000000000000000b: function(arg0, arg1) {
4459
- // Cast intrinsic for `Closure(Closure { dtor_idx: 55439, function: Function { arguments: [Externref], shim_idx: 55440, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4459
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 55549, function: Function { arguments: [Externref], shim_idx: 55550, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4460
4460
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__wasm_bindgen_6c0c3bb491d8811b___JsValue____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true_);
4461
4461
  return ret;
4462
4462
  },
4463
4463
  __wbindgen_cast_000000000000000c: function(arg0, arg1) {
4464
- // Cast intrinsic for `Closure(Closure { dtor_idx: 58699, function: Function { arguments: [], shim_idx: 58700, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4464
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 58809, function: Function { arguments: [], shim_idx: 58810, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4465
4465
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut_____Output________1_, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke_______true__1_);
4466
4466
  return ret;
4467
4467
  },
4468
4468
  __wbindgen_cast_000000000000000d: function(arg0, arg1) {
4469
- // Cast intrinsic for `Closure(Closure { dtor_idx: 59307, function: Function { arguments: [NamedExternref("CompositionEvent")], shim_idx: 59308, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4469
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 59417, function: Function { arguments: [NamedExternref("CompositionEvent")], shim_idx: 59418, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4470
4470
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__web_sys_72aa5c11aad59394___features__gen_InputEvent__InputEvent____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___web_sys_72aa5c11aad59394___features__gen_InputEvent__InputEvent______true_);
4471
4471
  return ret;
4472
4472
  },
4473
4473
  __wbindgen_cast_000000000000000e: function(arg0, arg1) {
4474
- // Cast intrinsic for `Closure(Closure { dtor_idx: 59307, function: Function { arguments: [NamedExternref("InputEvent")], shim_idx: 59308, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4474
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 59417, function: Function { arguments: [NamedExternref("InputEvent")], shim_idx: 59418, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4475
4475
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__web_sys_72aa5c11aad59394___features__gen_InputEvent__InputEvent____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___web_sys_72aa5c11aad59394___features__gen_InputEvent__InputEvent______true__13);
4476
4476
  return ret;
4477
4477
  },
4478
4478
  __wbindgen_cast_000000000000000f: function(arg0, arg1) {
4479
- // Cast intrinsic for `Closure(Closure { dtor_idx: 59307, function: Function { arguments: [NamedExternref("TouchEvent")], shim_idx: 59308, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4479
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 59417, function: Function { arguments: [NamedExternref("TouchEvent")], shim_idx: 59418, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4480
4480
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__web_sys_72aa5c11aad59394___features__gen_InputEvent__InputEvent____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___web_sys_72aa5c11aad59394___features__gen_InputEvent__InputEvent______true__14);
4481
4481
  return ret;
4482
4482
  },
4483
4483
  __wbindgen_cast_0000000000000010: function(arg0, arg1) {
4484
- // Cast intrinsic for `Closure(Closure { dtor_idx: 62559, function: Function { arguments: [], shim_idx: 62560, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4484
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 62669, function: Function { arguments: [], shim_idx: 62670, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4485
4485
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut_____Output________2_, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke_______true__2_);
4486
4486
  return ret;
4487
4487
  },
4488
4488
  __wbindgen_cast_0000000000000011: function(arg0, arg1) {
4489
- // Cast intrinsic for `Closure(Closure { dtor_idx: 62933, function: Function { arguments: [], shim_idx: 62934, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4489
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 63043, function: Function { arguments: [], shim_idx: 63044, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4490
4490
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut_____Output________3_, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke_______true__3_);
4491
4491
  return ret;
4492
4492
  },
4493
4493
  __wbindgen_cast_0000000000000012: function(arg0, arg1) {
4494
- // Cast intrinsic for `Closure(Closure { dtor_idx: 62969, function: Function { arguments: [Externref], shim_idx: 62970, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4494
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 63079, function: Function { arguments: [Externref], shim_idx: 63080, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4495
4495
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__wasm_bindgen_6c0c3bb491d8811b___JsValue____Output________1_, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__1_);
4496
4496
  return ret;
4497
4497
  },
4498
4498
  __wbindgen_cast_0000000000000013: function(arg0, arg1) {
4499
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [Externref], shim_idx: 64406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4499
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [Externref], shim_idx: 64516, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4500
4500
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__2_);
4501
4501
  return ret;
4502
4502
  },
4503
4503
  __wbindgen_cast_0000000000000014: function(arg0, arg1) {
4504
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [NamedExternref("Array<any>"), NamedExternref("ResizeObserver")], shim_idx: 64413, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4504
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [NamedExternref("Array<any>"), NamedExternref("ResizeObserver")], shim_idx: 64523, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4505
4505
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___js_sys_67c12748f230903f___Array__web_sys_72aa5c11aad59394___features__gen_ResizeObserver__ResizeObserver______true_);
4506
4506
  return ret;
4507
4507
  },
4508
4508
  __wbindgen_cast_0000000000000015: function(arg0, arg1) {
4509
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 64406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4509
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [NamedExternref("Array<any>")], shim_idx: 64516, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4510
4510
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__2__20);
4511
4511
  return ret;
4512
4512
  },
4513
4513
  __wbindgen_cast_0000000000000016: function(arg0, arg1) {
4514
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [NamedExternref("Event")], shim_idx: 64406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4514
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [NamedExternref("Event")], shim_idx: 64516, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4515
4515
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__2__21);
4516
4516
  return ret;
4517
4517
  },
4518
4518
  __wbindgen_cast_0000000000000017: function(arg0, arg1) {
4519
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [NamedExternref("FocusEvent")], shim_idx: 64406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4519
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [NamedExternref("FocusEvent")], shim_idx: 64516, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4520
4520
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__2__22);
4521
4521
  return ret;
4522
4522
  },
4523
4523
  __wbindgen_cast_0000000000000018: function(arg0, arg1) {
4524
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 64406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4524
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 64516, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4525
4525
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__2__23);
4526
4526
  return ret;
4527
4527
  },
4528
4528
  __wbindgen_cast_0000000000000019: function(arg0, arg1) {
4529
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [NamedExternref("PageTransitionEvent")], shim_idx: 64406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4529
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [NamedExternref("PageTransitionEvent")], shim_idx: 64516, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4530
4530
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__2__24);
4531
4531
  return ret;
4532
4532
  },
4533
4533
  __wbindgen_cast_000000000000001a: function(arg0, arg1) {
4534
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [NamedExternref("PointerEvent")], shim_idx: 64406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4534
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [NamedExternref("PointerEvent")], shim_idx: 64516, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4535
4535
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__2__25);
4536
4536
  return ret;
4537
4537
  },
4538
4538
  __wbindgen_cast_000000000000001b: function(arg0, arg1) {
4539
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [NamedExternref("WheelEvent")], shim_idx: 64406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4539
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [NamedExternref("WheelEvent")], shim_idx: 64516, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4540
4540
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke___wasm_bindgen_6c0c3bb491d8811b___JsValue______true__2__26);
4541
4541
  return ret;
4542
4542
  },
4543
4543
  __wbindgen_cast_000000000000001c: function(arg0, arg1) {
4544
- // Cast intrinsic for `Closure(Closure { dtor_idx: 64405, function: Function { arguments: [], shim_idx: 64421, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4544
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 64515, function: Function { arguments: [], shim_idx: 64531, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
4545
4545
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_6c0c3bb491d8811b___closure__destroy___dyn_core_f2710c7f87f75ba1___ops__function__FnMut__core_f2710c7f87f75ba1___option__Option_web_sys_72aa5c11aad59394___features__gen_Blob__Blob_____Output_______, wasm_bindgen_6c0c3bb491d8811b___convert__closures_____invoke_______true__4_);
4546
4546
  return ret;
4547
4547
  },
Binary file
package/sceneUtils.js ADDED
@@ -0,0 +1,85 @@
1
+ // Scene utility functions for the browser console.
2
+ // Requires `engine_console_command` to be available on `window`.
3
+
4
+ async function findEntitiesByDistance(componentName) {
5
+ const snapshot = await engine_console_command("/crdt_snapshot").then(JSON.parse);
6
+
7
+ // Use the player entity (id=1) from the snapshot for scene-local position
8
+ const playerPos = snapshot["1"]?.Transform
9
+ ? getGlobalPosition("1", snapshot)
10
+ : { x: 0, y: 0, z: 0 };
11
+
12
+ const results = [];
13
+ for (const [eid, components] of Object.entries(snapshot)) {
14
+ if (componentName && !components[componentName]) continue;
15
+ if (eid === "1" || eid === "0" || eid === "2") continue; // skip reserved entities
16
+ const pos = getGlobalPosition(eid, snapshot);
17
+ const dx = pos.x - playerPos.x, dy = pos.y - playerPos.y, dz = pos.z - playerPos.z;
18
+ results.push({
19
+ entity: eid,
20
+ position: pos,
21
+ dist: Math.sqrt(dx * dx + dy * dy + dz * dz),
22
+ components,
23
+ });
24
+ }
25
+ return results.sort((a, b) => a.dist - b.dist);
26
+ }
27
+
28
+ function getGlobalPosition(entityId, snapshot) {
29
+ const chain = [];
30
+ let current = entityId;
31
+ while (current && current !== "0") {
32
+ const t = snapshot[current]?.Transform;
33
+ if (!t) break;
34
+ chain.push(t);
35
+ current = t.parent != null ? String(t.parent) : "0";
36
+ }
37
+
38
+ let gx = 0, gy = 0, gz = 0;
39
+ let rot = { x: 0, y: 0, z: 0, w: 1 };
40
+ let sx = 1, sy = 1, sz = 1;
41
+ for (let i = chain.length - 1; i >= 0; i--) {
42
+ const { position: p, rotation: r, scale: s } = chain[i];
43
+ const scaled = { x: p.x * sx, y: p.y * sy, z: p.z * sz };
44
+ const v = rotateByQuat(scaled, rot);
45
+ gx += v.x; gy += v.y; gz += v.z;
46
+ rot = multiplyQuat(rot, r);
47
+ sx *= s.x; sy *= s.y; sz *= s.z;
48
+ }
49
+ return { x: gx, y: gy, z: gz };
50
+ }
51
+
52
+ function rotateByQuat(v, q) {
53
+ const ix = q.w * v.x + q.y * v.z - q.z * v.y;
54
+ const iy = q.w * v.y + q.z * v.x - q.x * v.z;
55
+ const iz = q.w * v.z + q.x * v.y - q.y * v.x;
56
+ const iw = -q.x * v.x - q.y * v.y - q.z * v.z;
57
+ return {
58
+ x: ix * q.w + iw * -q.x + iy * -q.z - iz * -q.y,
59
+ y: iy * q.w + iw * -q.y + iz * -q.x - ix * -q.z,
60
+ z: iz * q.w + iw * -q.z + ix * -q.y - iy * -q.x,
61
+ };
62
+ }
63
+
64
+ function multiplyQuat(a, b) {
65
+ return {
66
+ x: a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,
67
+ y: a.w * b.y + a.y * b.w + a.z * b.x - a.x * b.z,
68
+ z: a.w * b.z + a.z * b.w + a.x * b.y - a.y * b.x,
69
+ w: a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,
70
+ };
71
+ }
72
+
73
+ function printEntitiesByDistance(componentName) {
74
+ return findEntitiesByDistance(componentName).then(results =>
75
+ console.table(
76
+ results.map(r => ({
77
+ entity: r.entity,
78
+ x: r.position.x.toFixed(2),
79
+ y: r.position.y.toFixed(2),
80
+ z: r.position.z.toFixed(2),
81
+ dist: r.dist.toFixed(2),
82
+ }))
83
+ )
84
+ );
85
+ }