@kvyverse/world-runtime 0.6.0 → 0.6.2

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.
Files changed (27) hide show
  1. package/dist/{BallCollider-3L5vOrcL.js → BallCollider-DdxrnexK.js} +3 -3
  2. package/dist/{CapsuleCollider-CBTsR-Ys.js → CapsuleCollider-XlGZqg_O.js} +3 -3
  3. package/dist/{ChatModule-2tiWS_Yr.js → ChatModule-DzNY_v-3.js} +4 -4
  4. package/dist/{Collider-CPUCG3RA.js → Collider-ElnvKET2.js} +2 -2
  5. package/dist/{ConeCollider-C3XU3Y9X.js → ConeCollider-CQfGphDa.js} +3 -3
  6. package/dist/{ConvexMeshCollider-DzNV4HTO.js → ConvexMeshCollider-0Q2u7QAL.js} +2 -2
  7. package/dist/{CuboidCollider-Dp1DZoFM.js → CuboidCollider-Cm7kKRMA.js} +2 -2
  8. package/dist/{CylinderCollider-C0h_nhB5.js → CylinderCollider-P2oZeEyb.js} +3 -3
  9. package/dist/{FpsCameraController-2GNWJM5D.js → FpsCameraController-CuYDbMHJ.js} +1 -1
  10. package/dist/{MeshInstansing-Bxij0Yc9.js → MeshInstansing-CSd1gjpu.js} +1 -1
  11. package/dist/{PointerLockCameraControls-DIK3cVmo.js → PointerLockCameraControls-Cq0m2NLS.js} +1 -1
  12. package/dist/{RapierDebugRenderer-BQy_m-3C.js → RapierDebugRenderer-BSsFENi2.js} +1 -1
  13. package/dist/{RapierFpsPlayerController-DthD8dw9.js → RapierFpsPlayerController-By_mnB5m.js} +1 -1
  14. package/dist/{RapierPhysics-CU6X--c7.js → RapierPhysics-C22OXUaE.js} +3 -3
  15. package/dist/{Rigidbody-DLhN8ddv.js → Rigidbody-BHRxJKXd.js} +1 -1
  16. package/dist/{ScalingToFro-BD-E5-uR.js → ScalingToFro-CmXQHfR5.js} +1 -1
  17. package/dist/{SightInteractableArea-DrqyB41W.js → SightInteractableArea-C7xBqoQo.js} +1 -1
  18. package/dist/{SimpleWASDMovement-C2m53YYH.js → SimpleWASDMovement-BYu0AFeG.js} +1 -1
  19. package/dist/{Spinning-sgUhHld8.js → Spinning-DDhlLF3g.js} +1 -1
  20. package/dist/{StartAnimation-B9eomOS2.js → StartAnimation-BbY1HgSj.js} +1 -1
  21. package/dist/{TrimeshCollider-7dIs_xtZ.js → TrimeshCollider-CGirnNOf.js} +1 -1
  22. package/dist/{chat.module-descriptor-BTsep-Kq.js → chat.module-descriptor-BMy5jpOU.js} +3 -3
  23. package/dist/{get-scale-from-obj-B7JlVPni.js → get-scale-from-obj-bFMquHMV.js} +1 -1
  24. package/dist/index.js +63 -63
  25. package/dist/{lib-registry-D1VyVPBg.js → lib-registry-B-NnzKUx.js} +1 -1
  26. package/dist/version.gen.d.ts +1 -1
  27. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
- import { n as getRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
2
- import { t as Collider } from "./Collider-CPUCG3RA.js";
3
- //#region packages/world-runtime/src/behaviours/physics/BallCollider.ts
1
+ import { n as getRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
2
+ import { t as Collider } from "./Collider-ElnvKET2.js";
3
+ //#region src/behaviours/physics/BallCollider.ts
4
4
  var BallCollider = class extends Collider {
5
5
  type = "Ball";
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
2
- import { t as Collider } from "./Collider-CPUCG3RA.js";
3
- //#region packages/world-runtime/src/behaviours/physics/CapsuleCollider.ts
1
+ import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
2
+ import { t as Collider } from "./Collider-ElnvKET2.js";
3
+ //#region src/behaviours/physics/CapsuleCollider.ts
4
4
  var CapsuleCollider = class extends Collider {
5
5
  type = "Capsule";
6
6
  /**
@@ -1,10 +1,10 @@
1
- import { t as CHAT_COMMAND_KEY } from "./chat.module-descriptor-BTsep-Kq.js";
1
+ import { t as CHAT_COMMAND_KEY } from "./chat.module-descriptor-BMy5jpOU.js";
2
2
  import { ContextModule, ThreeContextEvents } from "three-start";
3
3
  import van from "vanjs-core";
4
- //#region packages/world-runtime/src/modules/chat/chat.css?inline
4
+ //#region src/modules/chat/chat.css?inline
5
5
  var chat_default = "/* Neutral base for the chat input: only what it breaks without on real devices.\n Looks are left to the world. */\n\n.kvy-chat {\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n /* On-screen keyboard: ChatDom writes the overlap height here. */\n padding-bottom: var(--kvy-chat-keyboard-inset, 0px);\n /* Click-through like the HUD around it: the root stretches over the whole feed,\n so catching events here would kill clicks on the world behind the messages.\n Only the input takes events back. */\n pointer-events: none;\n}\n\n.kvy-chat__form {\n display: flex;\n margin: 0;\n}\n\n.kvy-chat__input {\n flex: 1 1 auto;\n min-width: 0;\n /* 16px — below that iOS Safari zooms the page on focus. */\n font: inherit;\n font-size: 16px;\n line-height: 1.25;\n color: inherit;\n background: transparent;\n border: 0;\n outline: none;\n padding: 4px 6px;\n -webkit-appearance: none;\n appearance: none;\n border-radius: 0;\n /* The one interactive part of the chat. */\n pointer-events: auto;\n /* No 300ms delay and no double-tap zoom on the input. */\n touch-action: manipulation;\n}\n\n/* The message feed is a TTL queue, not a scroll container. It sticks to the\n bottom and extra lines are cut from the top — no scrollbar here by design. */\n.kvy-chat__feed {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n max-height: 40vh;\n overflow: hidden;\n /* Belt and braces: the root is already click-through, but a world restyling it\n must not accidentally make messages catch clicks. */\n pointer-events: none;\n}\n\n.kvy-chat__line {\n opacity: 1;\n transition: opacity 300ms ease;\n overflow-wrap: anywhere;\n}\n\n/* The line has outlived its time: it fades but stays in the DOM — opening the\n chat shows it again instead of rebuilding the feed. */\n.kvy-chat__line--faded {\n opacity: 0;\n}\n\n/* Hidden submit button: backs up implicit submission in old webviews. */\n.kvy-chat__submit {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n/* Toggle mode: the input is hidden until entered (Enter on the canvas).\n Opacity, not visibility/display: an element hidden by those cannot be focused\n programmatically, leaving nothing to open the chat with. */\n.kvy-chat--idle-hidden .kvy-chat__input {\n opacity: 0;\n pointer-events: none;\n}\n";
6
6
  //#endregion
7
- //#region packages/world-runtime/src/modules/chat/ChatDom.ts
7
+ //#region src/modules/chat/ChatDom.ts
8
8
  var { button, div, form, input } = van.tags;
9
9
  var STYLE_ID = "kvyverse-chat-styles";
10
10
  /**
@@ -299,7 +299,7 @@ var ChatDom = class ChatDom {
299
299
  }
300
300
  };
301
301
  //#endregion
302
- //#region packages/world-runtime/src/modules/chat/ChatModule.ts
302
+ //#region src/modules/chat/ChatModule.ts
303
303
  /**
304
304
  * The world chat as a pluggable ctx module: message history plus its own DOM
305
305
  * input (`dom`), no React. Enabled from `settings.addons.json → modules`; it
@@ -1,7 +1,7 @@
1
- import { t as Rigidbody } from "./Rigidbody-DLhN8ddv.js";
1
+ import { t as Rigidbody } from "./Rigidbody-BHRxJKXd.js";
2
2
  import * as THREE from "three/webgpu";
3
3
  import { Object3DBehaviour, assertDefined, getComponents } from "three-start";
4
- //#region packages/world-runtime/src/behaviours/physics/Collider.ts
4
+ //#region src/behaviours/physics/Collider.ts
5
5
  /** Walk the parent chain (ancestors only); stop when `cb` returns `false`. */
6
6
  function traverseUp(obj, cb) {
7
7
  let cur = obj.parent;
@@ -1,6 +1,6 @@
1
- import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
2
- import { t as Collider } from "./Collider-CPUCG3RA.js";
3
- //#region packages/world-runtime/src/behaviours/physics/ConeCollider.ts
1
+ import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
2
+ import { t as Collider } from "./Collider-ElnvKET2.js";
3
+ //#region src/behaviours/physics/ConeCollider.ts
4
4
  var ConeCollider = class extends Collider {
5
5
  type = "Cone";
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { t as Collider } from "./Collider-CPUCG3RA.js";
2
- //#region packages/world-runtime/src/behaviours/physics/ConvexMeshCollider.ts
1
+ import { t as Collider } from "./Collider-ElnvKET2.js";
2
+ //#region src/behaviours/physics/ConvexMeshCollider.ts
3
3
  var ConvexMeshCollider = class extends Collider {
4
4
  type = "Convex";
5
5
  getDesc(rapier) {
@@ -1,5 +1,5 @@
1
- import { t as Collider } from "./Collider-CPUCG3RA.js";
2
- //#region packages/world-runtime/src/behaviours/physics/CuboidCollider.ts
1
+ import { t as Collider } from "./Collider-ElnvKET2.js";
2
+ //#region src/behaviours/physics/CuboidCollider.ts
3
3
  var CuboidCollider = class extends Collider {
4
4
  type = "Cuboid";
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
2
- import { t as Collider } from "./Collider-CPUCG3RA.js";
3
- //#region packages/world-runtime/src/behaviours/physics/CylinderCollider.ts
1
+ import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
2
+ import { t as Collider } from "./Collider-ElnvKET2.js";
3
+ //#region src/behaviours/physics/CylinderCollider.ts
4
4
  var CylinderCollider = class extends Collider {
5
5
  type = "Cylinder";
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/controls/FpsCameraController.ts
2
+ //#region src/behaviours/controls/FpsCameraController.ts
3
3
  var FpsCameraController = class extends Object3DBehaviour {
4
4
  sensitivity = .002;
5
5
  mobileSensitivity = .006;
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/utils/MeshInstansing.ts
3
+ //#region src/behaviours/utils/MeshInstansing.ts
4
4
  var MeshInstansing = class MeshInstansing extends Object3DBehaviour {
5
5
  static _totalInstance = 0;
6
6
  geometry = null;
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/controls/PointerLockCameraControls.ts
3
+ //#region src/behaviours/controls/PointerLockCameraControls.ts
4
4
  var _euler = new THREE.Euler(0, 0, 0, "YXZ");
5
5
  var _vector = new THREE.Vector3();
6
6
  var _MOUSE_SENSITIVITY = .002;
@@ -1,5 +1,5 @@
1
1
  import * as THREE from "three/webgpu";
2
- //#region packages/world-runtime/src/modules/physics/RapierDebugRenderer.ts
2
+ //#region src/modules/physics/RapierDebugRenderer.ts
3
3
  /**
4
4
  * Draws rapier colliders as lines. Not a ctx module: it lives inside
5
5
  * `RapierPhysics` (`enableDebug`/`disableDebug`) and is pulled dynamically —
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/physics/RapierFpsPlayerController.ts
3
+ //#region src/behaviours/physics/RapierFpsPlayerController.ts
4
4
  var RapierFpsPlayerController = class extends Object3DBehaviour {
5
5
  halfHeight = .85;
6
6
  radius = .5;
@@ -1,6 +1,6 @@
1
- import { a as LibId } from "./lib-registry-D1VyVPBg.js";
1
+ import { a as LibId } from "./lib-registry-B-NnzKUx.js";
2
2
  import { ContextModule, ThreeContextEvents, defineProps, readOnly } from "three-start";
3
- //#region packages/world-runtime/src/modules/physics/RapierPhysics.ts
3
+ //#region src/modules/physics/RapierPhysics.ts
4
4
  var RapierPhysics = class RapierPhysics extends ContextModule {
5
5
  isRapierPhysics;
6
6
  api;
@@ -53,7 +53,7 @@ var RapierPhysics = class RapierPhysics extends ContextModule {
53
53
  }
54
54
  /** Turn on collider debug drawing; the renderer is fetched on demand. */
55
55
  async enableDebug() {
56
- this._debug ??= new (await (import("./RapierDebugRenderer-BQy_m-3C.js"))).RapierDebugRenderer(this.ctx, this);
56
+ this._debug ??= new (await (import("./RapierDebugRenderer-BSsFENi2.js"))).RapierDebugRenderer(this.ctx, this);
57
57
  this._debug.start();
58
58
  }
59
59
  disableDebug() {
@@ -12,7 +12,7 @@ var __exportAll = (all, no_symbols) => {
12
12
  return target;
13
13
  };
14
14
  //#endregion
15
- //#region packages/world-runtime/src/behaviours/physics/Rigidbody.ts
15
+ //#region src/behaviours/physics/Rigidbody.ts
16
16
  var Rigidbody_exports = /* @__PURE__ */ __exportAll({ default: () => Rigidbody });
17
17
  /**
18
18
  * @see {@link https://github.com/vladkrutenyuk/three-kvy-core/blob/main/src/addons/Rigidbody.ts | Source}
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/animation/ScalingToFro.ts
2
+ //#region src/behaviours/animation/ScalingToFro.ts
3
3
  var ScalingToFro = class extends Object3DBehaviour {
4
4
  scale = 1;
5
5
  max = 2;
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/player/SightInteractableArea.ts
3
+ //#region src/behaviours/player/SightInteractableArea.ts
4
4
  var raycaster = new THREE.Raycaster();
5
5
  var SightInteractableArea = class SightInteractableArea extends Object3DBehaviour {
6
6
  static _CURRENT = null;
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/controls/SimpleWASDMovement.ts
2
+ //#region src/behaviours/controls/SimpleWASDMovement.ts
3
3
  var SimpleWASDMovement = class extends Object3DBehaviour {
4
4
  speed = 4;
5
5
  onBeforeRender() {
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/animation/Spinning.ts
2
+ //#region src/behaviours/animation/Spinning.ts
3
3
  var Spinning = class extends Object3DBehaviour {
4
4
  speed = 5;
5
5
  onBeforeRender() {
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/animation/StartAnimation.ts
3
+ //#region src/behaviours/animation/StartAnimation.ts
4
4
  var StartAnimation = class extends Object3DBehaviour {
5
5
  mixer;
6
6
  _action;
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/physics/TrimeshCollider.ts
2
+ //#region src/behaviours/physics/TrimeshCollider.ts
3
3
  var TrimeshCollider = class extends Object3DBehaviour {
4
4
  recursive = false;
5
5
  _detach;
@@ -1,4 +1,4 @@
1
- //#region packages/world-runtime/src/modules/optional-module-descriptor.ts
1
+ //#region src/modules/optional-module-descriptor.ts
2
2
  /**
3
3
  * Keys of the pluggable modules — the same keys as in
4
4
  * `settings.addons.json → modules`. Core modules (`addons`/`env`/`html`/`input`/
@@ -11,7 +11,7 @@ var OptionalModuleId = /* @__PURE__ */ function(OptionalModuleId) {
11
11
  }({});
12
12
  var OPTIONAL_MODULE_IDS = Object.values(OptionalModuleId);
13
13
  //#endregion
14
- //#region packages/world-runtime/src/modules/chat/chat.module-descriptor.ts
14
+ //#region src/modules/chat/chat.module-descriptor.ts
15
15
  /** `Slash` opens the chat with a "/" already typed — the Minecraft command gesture. */
16
16
  var CHAT_COMMAND_KEY = "Slash";
17
17
  var CHAT_INPUT_MODES = ["always", "toggle"];
@@ -49,7 +49,7 @@ var chatModuleDescriptor = {
49
49
  normalize: (raw) => normalizeChat(raw),
50
50
  defaultConfig: () => ({ ...DEFAULTS }),
51
51
  create: async (config) => {
52
- const { ChatModule } = await import("./ChatModule-2tiWS_Yr.js");
52
+ const { ChatModule } = await import("./ChatModule-DzNY_v-3.js");
53
53
  return new ChatModule(config);
54
54
  },
55
55
  schema: {
@@ -1,5 +1,5 @@
1
1
  import * as THREE from "three/webgpu";
2
- //#region packages/world-runtime/src/behaviours/physics/get-scale-from-obj.ts
2
+ //#region src/behaviours/physics/get-scale-from-obj.ts
3
3
  var _hrScale = {
4
4
  radius: 1,
5
5
  halfHeight: 1
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as OPTIONAL_MODULE_IDS, i as normalizeChat, n as CHAT_INPUT_MODES, o as OptionalModuleId, r as chatModuleDescriptor } from "./chat.module-descriptor-BTsep-Kq.js";
2
- import { a as LibId, c as libByRequireKey, i as LIB_IDS, n as LIBS, o as OPTIONAL_LIB_DESCRIPTORS, r as LIB_DESCRIPTORS, s as OPTIONAL_LIB_IDS, t as BUILTIN_LIB_DESCRIPTORS } from "./lib-registry-D1VyVPBg.js";
3
- import { n as getRadiusScale, t as getHalfheightRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
1
+ import { a as OPTIONAL_MODULE_IDS, i as normalizeChat, n as CHAT_INPUT_MODES, o as OptionalModuleId, r as chatModuleDescriptor } from "./chat.module-descriptor-BMy5jpOU.js";
2
+ import { a as LibId, c as libByRequireKey, i as LIB_IDS, n as LIBS, o as OPTIONAL_LIB_DESCRIPTORS, r as LIB_DESCRIPTORS, s as OPTIONAL_LIB_IDS, t as BUILTIN_LIB_DESCRIPTORS } from "./lib-registry-B-NnzKUx.js";
3
+ import { n as getRadiusScale, t as getHalfheightRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
4
4
  import * as THREE from "three/webgpu";
5
5
  import { BufferGeometryLoader, LoadingManager, TextureLoader } from "three/webgpu";
6
6
  import * as ThreeStartNS from "three-start";
@@ -15,7 +15,7 @@ import { clone } from "three/examples/jsm/utils/SkeletonUtils.js";
15
15
  import EventEmitter from "eventemitter3";
16
16
  import * as nanostores from "nanostores";
17
17
  import { atom } from "nanostores";
18
- //#region packages/world-runtime/src/world-events.ts
18
+ //#region src/world-events.ts
19
19
  /**
20
20
  * World lifecycle events, emitted on `game.emitter` (`world.events` in scripts)
21
21
  * during classic-load. The entry script runs BEFORE them (step 9) — subscriptions
@@ -31,7 +31,7 @@ var WorldEvent = /* @__PURE__ */ function(WorldEvent) {
31
31
  return WorldEvent;
32
32
  }({});
33
33
  //#endregion
34
- //#region packages/world-runtime/src/World.ts
34
+ //#region src/World.ts
35
35
  /**
36
36
  * A loaded world is a three-start app with the scene already assembled.
37
37
  * Mounting and starting are manual: `mount(container)` attaches the canvas and
@@ -66,7 +66,7 @@ var World = class extends ThreeStart {
66
66
  }
67
67
  };
68
68
  //#endregion
69
- //#region packages/world-runtime/src/utils/lazy.ts
69
+ //#region src/utils/lazy.ts
70
70
  /**
71
71
  * Object that forwards every access to `resolve()`. For script globals that are
72
72
  * shortcuts into something created later (`modules` → `ctx.modules`): the script
@@ -100,7 +100,7 @@ function lazy(factory) {
100
100
  } };
101
101
  }
102
102
  //#endregion
103
- //#region packages/world-runtime/src/resources/loaders.ts
103
+ //#region src/resources/loaders.ts
104
104
  var LOADING_MANAGER = new LoadingManager();
105
105
  LOADING_MANAGER.onError = (url) => {
106
106
  console.error(`Loading asset failed: ${url}`);
@@ -174,7 +174,7 @@ var AssetLoaders = {
174
174
  })
175
175
  };
176
176
  //#endregion
177
- //#region packages/world-runtime/src/rendering/renderer-apply.ts
177
+ //#region src/rendering/renderer-apply.ts
178
178
  var SHADOW_MAP_TYPES$1 = {
179
179
  Basic: THREE.BasicShadowMap,
180
180
  PCF: THREE.PCFShadowMap,
@@ -210,7 +210,7 @@ function applyRendererConfig(renderer, cfg) {
210
210
  renderer.setPixelRatio(window.devicePixelRatio * pixelResolution);
211
211
  }
212
212
  //#endregion
213
- //#region packages/world-runtime/src/rendering/SceneBloom.ts
213
+ //#region src/rendering/SceneBloom.ts
214
214
  /** BloomNode loads as a chunk only when bloom is enabled. */
215
215
  var lazyBloomModule = lazy(() => import("three/addons/tsl/display/BloomNode.js"));
216
216
  /**
@@ -296,7 +296,7 @@ function finiteOr(value, fallback) {
296
296
  return typeof value === "number" && Number.isFinite(value) ? value : fallback;
297
297
  }
298
298
  //#endregion
299
- //#region packages/world-runtime/src/modules/controls/KeyboardControlsDriver.ts
299
+ //#region src/modules/controls/KeyboardControlsDriver.ts
300
300
  /** A diagonal must not be faster than a straight line. */
301
301
  var DIAGONAL = Math.SQRT1_2;
302
302
  /**
@@ -328,7 +328,7 @@ var KeyboardControlsDriver = class {
328
328
  }
329
329
  };
330
330
  //#endregion
331
- //#region packages/world-runtime/src/modules/controls/ControlsModule.ts
331
+ //#region src/modules/controls/ControlsModule.ts
332
332
  /**
333
333
  * The player's movement intent — what they want to do, whatever the hardware is.
334
334
  * Input sources register as drivers (`addDriver`); the module polls them once a
@@ -441,8 +441,8 @@ var ControlsModule = class extends ContextModule {
441
441
  }
442
442
  };
443
443
  //#endregion
444
- //#region packages/world-runtime/src/behaviours/physics/_required-patch.ts
445
- var lazyRapierPhysicsModule = lazy(async () => (await import("./RapierPhysics-CU6X--c7.js")).default);
444
+ //#region src/behaviours/physics/_required-patch.ts
445
+ var lazyRapierPhysicsModule = lazy(async () => (await import("./RapierPhysics-C22OXUaE.js")).default);
446
446
  /** The only place the physics module is created — called by the registry
447
447
  * descriptor. The module itself takes rapier from `ctx.modules.addons` on awake. */
448
448
  async function createRapierPhysicsModule(config) {
@@ -468,7 +468,7 @@ async function applyRapierPhysicsPatch(starter) {
468
468
  starter.addModules({ rapier: module });
469
469
  }
470
470
  //#endregion
471
- //#region packages/world-runtime/src/modules/physics/physics.module-descriptor.ts
471
+ //#region src/modules/physics/physics.module-descriptor.ts
472
472
  var PHYSICS_ENGINES = ["rapier"];
473
473
  /** Physics defaults: the rapier engine, debug off. */
474
474
  function normalizePhysics(value) {
@@ -521,7 +521,7 @@ var physicsModuleDescriptor = {
521
521
  }
522
522
  };
523
523
  //#endregion
524
- //#region packages/world-runtime/src/modules/optional-modules.ts
524
+ //#region src/modules/optional-modules.ts
525
525
  /**
526
526
  * Table of contents for the world's pluggable modules: what can be enabled from
527
527
  * `settings.addons.json → modules`. The descriptors themselves live next to
@@ -538,7 +538,7 @@ function getOptionalModuleDescriptor(id) {
538
538
  return descriptor;
539
539
  }
540
540
  //#endregion
541
- //#region packages/world-runtime/src/modules/is-mobile-device.ts
541
+ //#region src/modules/is-mobile-device.ts
542
542
  function isMobileDevice() {
543
543
  if (typeof navigator === "undefined" || typeof window === "undefined") return false;
544
544
  const ua = navigator.userAgent || navigator.vendor || window.opera;
@@ -549,7 +549,7 @@ function isMobileDevice() {
549
549
  return "ontouchstart" in window || navigator.maxTouchPoints && navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
550
550
  }
551
551
  //#endregion
552
- //#region packages/world-runtime/src/modules/EnvModule.ts
552
+ //#region src/modules/EnvModule.ts
553
553
  var EnvModule = class extends ContextModule {
554
554
  mode;
555
555
  dev;
@@ -566,7 +566,7 @@ var EnvModule = class extends ContextModule {
566
566
  }
567
567
  };
568
568
  //#endregion
569
- //#region packages/world-runtime/src/modules/HtmlHudModule.ts
569
+ //#region src/modules/HtmlHudModule.ts
570
570
  var { div } = van.tags;
571
571
  var LAYER_STYLE = "position:fixed;inset:0;pointer-events:none;";
572
572
  var HtmlHudModule = class extends ContextModule {
@@ -622,7 +622,7 @@ var HtmlHudModule = class extends ContextModule {
622
622
  };
623
623
  };
624
624
  //#endregion
625
- //#region packages/world-runtime/src/modules/InputSystemModule.ts
625
+ //#region src/modules/InputSystemModule.ts
626
626
  var InputSystemModule = class extends ContextModule {
627
627
  _dom;
628
628
  _keys = /* @__PURE__ */ new Set();
@@ -874,7 +874,7 @@ function isUiKeyboardTarget(target) {
874
874
  }
875
875
  }
876
876
  //#endregion
877
- //#region packages/world-runtime/src/modules/SoundsModule.ts
877
+ //#region src/modules/SoundsModule.ts
878
878
  var SoundsModule = class extends ContextModule {
879
879
  global = Howler;
880
880
  /** three-start ContextModule has no onDestroy; teardown is explicit. */
@@ -883,7 +883,7 @@ var SoundsModule = class extends ContextModule {
883
883
  }
884
884
  };
885
885
  //#endregion
886
- //#region packages/world-runtime/src/modules/UtilsModule.ts
886
+ //#region src/modules/UtilsModule.ts
887
887
  var UtilsModule = class extends ContextModule {
888
888
  cloneObject3D;
889
889
  mergeGeometries;
@@ -894,7 +894,7 @@ var UtilsModule = class extends ContextModule {
894
894
  }
895
895
  };
896
896
  //#endregion
897
- //#region packages/world-runtime/src/modules/index.ts
897
+ //#region src/modules/index.ts
898
898
  /**
899
899
  * Assembles the world's ctx modules: core ones always, pluggable ones per config.
900
900
  * Pluggable classes are pulled dynamically, so a disabled module never reaches
@@ -927,100 +927,100 @@ async function createWorldModules(mode = "prod", options) {
927
927
  return modules;
928
928
  }
929
929
  //#endregion
930
- //#region packages/world-runtime/src/behaviours/registry.ts
930
+ //#region src/behaviours/registry.ts
931
931
  var entries = [
932
932
  {
933
933
  uuid: "spinning",
934
934
  name: "Spinning",
935
- load: () => loadDefault(import("./Spinning-sgUhHld8.js"))
935
+ load: () => loadDefault(import("./Spinning-DDhlLF3g.js"))
936
936
  },
937
937
  {
938
938
  uuid: "scalingtofro",
939
939
  name: "ScalingToFro",
940
- load: () => loadDefault(import("./ScalingToFro-BD-E5-uR.js"))
940
+ load: () => loadDefault(import("./ScalingToFro-CmXQHfR5.js"))
941
941
  },
942
942
  {
943
943
  uuid: "startanim",
944
944
  name: "StartAnimation",
945
- load: () => loadDefault(import("./StartAnimation-B9eomOS2.js"))
945
+ load: () => loadDefault(import("./StartAnimation-BbY1HgSj.js"))
946
946
  },
947
947
  {
948
948
  uuid: "pointerlockcameracontrols",
949
949
  name: "PointerLockCameraController",
950
- load: () => loadDefault(import("./PointerLockCameraControls-DIK3cVmo.js"))
950
+ load: () => loadDefault(import("./PointerLockCameraControls-Cq0m2NLS.js"))
951
951
  },
952
952
  {
953
953
  uuid: "simplewasdmovement",
954
954
  name: "SimpleWASDMovement",
955
- load: () => loadDefault(import("./SimpleWASDMovement-C2m53YYH.js"))
955
+ load: () => loadDefault(import("./SimpleWASDMovement-BYu0AFeG.js"))
956
956
  },
957
957
  {
958
958
  uuid: "fpscameracontroller",
959
959
  name: "FpsCameraController",
960
- load: () => loadDefault(import("./FpsCameraController-2GNWJM5D.js"))
960
+ load: () => loadDefault(import("./FpsCameraController-CuYDbMHJ.js"))
961
961
  },
962
962
  {
963
963
  uuid: "sightinteractablearea",
964
964
  name: "SightInteractableArea",
965
- load: () => loadDefault(import("./SightInteractableArea-DrqyB41W.js"))
965
+ load: () => loadDefault(import("./SightInteractableArea-C7xBqoQo.js"))
966
966
  },
967
967
  {
968
968
  uuid: "meshinstansing",
969
969
  name: "MeshInstansing",
970
- load: () => loadDefault(import("./MeshInstansing-Bxij0Yc9.js"))
970
+ load: () => loadDefault(import("./MeshInstansing-CSd1gjpu.js"))
971
971
  },
972
972
  {
973
973
  uuid: "rrb",
974
974
  name: "Rigidbody",
975
- load: () => loadDefault(import("./Rigidbody-DLhN8ddv.js").then((n) => n.n)),
975
+ load: () => loadDefault(import("./Rigidbody-BHRxJKXd.js").then((n) => n.n)),
976
976
  requiredPatch: rapierPhysicsPatch
977
977
  },
978
978
  {
979
979
  uuid: "rapierballcol",
980
980
  name: "BallCollider",
981
- load: () => loadDefault(import("./BallCollider-3L5vOrcL.js")),
981
+ load: () => loadDefault(import("./BallCollider-DdxrnexK.js")),
982
982
  requiredPatch: rapierPhysicsPatch
983
983
  },
984
984
  {
985
985
  uuid: "rapiercapscol",
986
986
  name: "CapsuleCollider",
987
- load: () => loadDefault(import("./CapsuleCollider-CBTsR-Ys.js")),
987
+ load: () => loadDefault(import("./CapsuleCollider-XlGZqg_O.js")),
988
988
  requiredPatch: rapierPhysicsPatch
989
989
  },
990
990
  {
991
991
  uuid: "rapierconecol",
992
992
  name: "ConeCollider",
993
- load: () => loadDefault(import("./ConeCollider-C3XU3Y9X.js")),
993
+ load: () => loadDefault(import("./ConeCollider-CQfGphDa.js")),
994
994
  requiredPatch: rapierPhysicsPatch
995
995
  },
996
996
  {
997
997
  uuid: "rapierconvxcol",
998
998
  name: "ConvexMeshCollider",
999
- load: () => loadDefault(import("./ConvexMeshCollider-DzNV4HTO.js")),
999
+ load: () => loadDefault(import("./ConvexMeshCollider-0Q2u7QAL.js")),
1000
1000
  requiredPatch: rapierPhysicsPatch
1001
1001
  },
1002
1002
  {
1003
1003
  uuid: "rapiercubcol",
1004
1004
  name: "CuboidCollider",
1005
- load: () => loadDefault(import("./CuboidCollider-Dp1DZoFM.js")),
1005
+ load: () => loadDefault(import("./CuboidCollider-Cm7kKRMA.js")),
1006
1006
  requiredPatch: rapierPhysicsPatch
1007
1007
  },
1008
1008
  {
1009
1009
  uuid: "rapiercylcol",
1010
1010
  name: "CylinderCollider",
1011
- load: () => loadDefault(import("./CylinderCollider-C0h_nhB5.js")),
1011
+ load: () => loadDefault(import("./CylinderCollider-P2oZeEyb.js")),
1012
1012
  requiredPatch: rapierPhysicsPatch
1013
1013
  },
1014
1014
  {
1015
1015
  uuid: "rapiertricol",
1016
1016
  name: "TrimeshCollider",
1017
- load: () => loadDefault(import("./TrimeshCollider-7dIs_xtZ.js")),
1017
+ load: () => loadDefault(import("./TrimeshCollider-CGirnNOf.js")),
1018
1018
  requiredPatch: rapierPhysicsPatch
1019
1019
  },
1020
1020
  {
1021
1021
  uuid: "rapierfpsplayercontroller",
1022
1022
  name: "RapierFpsPlayerController",
1023
- load: () => loadDefault(import("./RapierFpsPlayerController-DthD8dw9.js")),
1023
+ load: () => loadDefault(import("./RapierFpsPlayerController-By_mnB5m.js")),
1024
1024
  requiredPatch: rapierPhysicsPatch
1025
1025
  }
1026
1026
  ];
@@ -1034,7 +1034,7 @@ async function loadDefault(module) {
1034
1034
  return (await module).default;
1035
1035
  }
1036
1036
  //#endregion
1037
- //#region packages/world-runtime/src/resources/font.ts
1037
+ //#region src/resources/font.ts
1038
1038
  var FORMAT_BY_MIME = {
1039
1039
  "font/ttf": "truetype",
1040
1040
  "font/otf": "opentype",
@@ -1096,7 +1096,7 @@ function createFont(url, family, mime, name) {
1096
1096
  return source;
1097
1097
  }
1098
1098
  //#endregion
1099
- //#region packages/world-runtime/src/addons/builtin-libs.ts
1099
+ //#region src/addons/builtin-libs.ts
1100
1100
  /**
1101
1101
  * Libraries the runtime bundles itself: `require("<key>")` hands these back in
1102
1102
  * every world, no config and no importer involved. Metadata (keys, labels) is
@@ -1123,7 +1123,7 @@ var BUILTIN_GLOBALS = {
1123
1123
  van
1124
1124
  };
1125
1125
  //#endregion
1126
- //#region packages/world-runtime/src/addons/required-libs.ts
1126
+ //#region src/addons/required-libs.ts
1127
1127
  /**
1128
1128
  * Libs the world needs beyond what `libs` lists: an enabled module or a built-in
1129
1129
  * behaviour on the scene declares them itself (`requiredLibs`), so physics keeps
@@ -1146,7 +1146,7 @@ function collectRequiredLibs(addons, usedBuiltinUuids = []) {
1146
1146
  return [...required];
1147
1147
  }
1148
1148
  //#endregion
1149
- //#region packages/world-runtime/src/addons/AddonsRuntime.ts
1149
+ //#region src/addons/AddonsRuntime.ts
1150
1150
  /**
1151
1151
  * External dependencies of the world: libs and external scripts. Built-in libs
1152
1152
  * are registered right away (the runtime bundles them), optional ones are loaded
@@ -1253,7 +1253,7 @@ function unwrapLib(id, module) {
1253
1253
  return module.default ?? module;
1254
1254
  }
1255
1255
  //#endregion
1256
- //#region packages/world-runtime/src/world-stores.ts
1256
+ //#region src/world-stores.ts
1257
1257
  /**
1258
1258
  * Shared reactive key-value state of a world (`world.stores` in scripts) — the
1259
1259
  * state counterpart of the `world.events` bus. Stores are created lazily on
@@ -1314,7 +1314,7 @@ var WorldStores = class {
1314
1314
  }
1315
1315
  };
1316
1316
  //#endregion
1317
- //#region packages/world-runtime/src/WorldRuntime.ts
1317
+ //#region src/WorldRuntime.ts
1318
1318
  /**
1319
1319
  * Owner of the world's runtime state: assets, script execution, ctx access.
1320
1320
  * The only object the generated code receives.
@@ -1576,10 +1576,10 @@ function isAbsoluteUrl(url) {
1576
1576
  return /^(?:[a-z]+:)?\/\//i.test(url) || url.startsWith("data:");
1577
1577
  }
1578
1578
  //#endregion
1579
- //#region packages/world-runtime/src/version.gen.ts
1580
- var RUNTIME_VERSION = "0.6.0";
1579
+ //#region src/version.gen.ts
1580
+ var RUNTIME_VERSION = "0.6.2";
1581
1581
  //#endregion
1582
- //#region packages/world-runtime/src/version.ts
1582
+ //#region src/version.ts
1583
1583
  /**
1584
1584
  * Format version of the generated world. The codegen stamps it into the artifact,
1585
1585
  * the runtime checks it on load. A breaking format change = package major bump.
@@ -1593,7 +1593,7 @@ function assertFormatVersion(version) {
1593
1593
  throw new Error(`@kvyverse/world-runtime: world format v${version} is not supported by runtime (expected v1). Re-export the world or pin a matching runtime version.`);
1594
1594
  }
1595
1595
  //#endregion
1596
- //#region packages/world-runtime/src/bootstrap.ts
1596
+ //#region src/bootstrap.ts
1597
1597
  /**
1598
1598
  * World assembly order. The only place where it is fixed: the artifact supplies
1599
1599
  * the data and steps, the runtime owns the sequence. Mirrors the game's
@@ -1662,7 +1662,7 @@ async function createWorld(definition, runtime) {
1662
1662
  return world;
1663
1663
  }
1664
1664
  //#endregion
1665
- //#region packages/world-runtime/src/define-world.ts
1665
+ //#region src/define-world.ts
1666
1666
  /**
1667
1667
  * Entry point of the generated artifact: world definition → public `loadWorld`.
1668
1668
  * The codegen prints `export const { loadWorld } = defineWorld({ ... })`.
@@ -1671,7 +1671,7 @@ function defineWorld(definition) {
1671
1671
  return { loadWorld: (options = {}) => bootstrapWorld(definition, options) };
1672
1672
  }
1673
1673
  //#endregion
1674
- //#region packages/world-runtime/src/values.ts
1674
+ //#region src/values.ts
1675
1675
  /**
1676
1676
  * Writes a color into an object field, creating a `Color` if the slot is empty.
1677
1677
  * Mirrors the `$C` branch of `applyValues` — needed by generated code for fields
@@ -1688,7 +1688,7 @@ function setColor(target, key, hex) {
1688
1688
  holder[key] = new THREE.Color(hex);
1689
1689
  }
1690
1690
  //#endregion
1691
- //#region packages/world-runtime/src/resources/default-resources.ts
1691
+ //#region src/resources/default-resources.ts
1692
1692
  /**
1693
1693
  * Built-in engine resources with fixed uuids: world values reference them via
1694
1694
  * a regular ref (`{$A:"6"}`), so the identifiers must never change.
@@ -1759,7 +1759,7 @@ function isDefaultResourceId(uuid) {
1759
1759
  return DEFAULT_RESOURCE_IDS.includes(uuid);
1760
1760
  }
1761
1761
  //#endregion
1762
- //#region packages/world-runtime/src/resources/texture.ts
1762
+ //#region src/resources/texture.ts
1763
1763
  /**
1764
1764
  * World texture defaults: clamp wrapping switches to repeat, color space
1765
1765
  * is sRGB. Identical in the editor, the game and the exported world.
@@ -1777,7 +1777,7 @@ async function loadTexture(url, name) {
1777
1777
  return texture;
1778
1778
  }
1779
1779
  //#endregion
1780
- //#region packages/world-runtime/src/resources/model.ts
1780
+ //#region src/resources/model.ts
1781
1781
  /** Parses model bytes into a hierarchy. `data`: ArrayBuffer, for obj — text. */
1782
1782
  async function parseModel(data, format, name) {
1783
1783
  let root;
@@ -1846,7 +1846,7 @@ function collectModelSubResources(root) {
1846
1846
  };
1847
1847
  }
1848
1848
  //#endregion
1849
- //#region packages/world-runtime/src/resources/hdr.ts
1849
+ //#region src/resources/hdr.ts
1850
1850
  /** Parses hdr/exr into a `DataTexture` with environment defaults (equirect, no mipmaps). */
1851
1851
  async function parseHdr(data, format, name) {
1852
1852
  let texture;
@@ -1874,7 +1874,7 @@ async function loadHdr(url, format, name) {
1874
1874
  return parseHdr(await response.arrayBuffer(), format, name);
1875
1875
  }
1876
1876
  //#endregion
1877
- //#region packages/world-runtime/src/resources/geometry.ts
1877
+ //#region src/resources/geometry.ts
1878
1878
  /** Geometry from our json format (`BufferGeometry.toJSON`). */
1879
1879
  function parseGeometryJson(json, name) {
1880
1880
  const geometry = AssetLoaders.bufferGeometry.get().parse(json);
@@ -1888,7 +1888,7 @@ async function loadGeometry(url, name) {
1888
1888
  return parseGeometryJson(await response.json(), name);
1889
1889
  }
1890
1890
  //#endregion
1891
- //#region packages/world-runtime/src/resources/audio.ts
1891
+ //#region src/resources/audio.ts
1892
1892
  /**
1893
1893
  * Audio asset source: a `Howl` with identity — this is what scripts get
1894
1894
  * from `require("/Sounds/...")`.
@@ -1921,7 +1921,7 @@ function createAudio(url, format, name) {
1921
1921
  });
1922
1922
  }
1923
1923
  //#endregion
1924
- //#region packages/world-runtime/src/resources/video.ts
1924
+ //#region src/resources/video.ts
1925
1925
  /**
1926
1926
  * Video asset source: a `<video>` with identity — this is what scripts get
1927
1927
  * from `require("/Videos/...")` (and `THREE.VideoTexture` from `element`).
@@ -1978,7 +1978,7 @@ async function createVideo(url, name) {
1978
1978
  return source;
1979
1979
  }
1980
1980
  //#endregion
1981
- //#region packages/world-runtime/src/rendering/tsl-node.ts
1981
+ //#region src/rendering/tsl-node.ts
1982
1982
  /**
1983
1983
  * World TSL node: the built graph node + its uniform nodes. This is what
1984
1984
  * `require("/Shaders/....tsl")` returns, so the method set matches the editor's
@@ -2021,7 +2021,7 @@ function createTslNode(uniforms, build, name) {
2021
2021
  return new TslNode(uniforms, build, name);
2022
2022
  }
2023
2023
  //#endregion
2024
- //#region packages/world-runtime/src/rendering/tsl-uniforms.ts
2024
+ //#region src/rendering/tsl-uniforms.ts
2025
2025
  var UNIFORM_TYPES = [
2026
2026
  "float",
2027
2027
  "int",
@@ -2082,10 +2082,10 @@ var UNIFORM_DEFAULTS = {
2082
2082
  texture: () => getDefaultResource(DefaultResourceId.Texture)
2083
2083
  };
2084
2084
  //#endregion
2085
- //#region packages/world-runtime/src/addons/externals.ts
2085
+ //#region src/addons/externals.ts
2086
2086
  var EXTERNAL_TYPES = ["umd", "module"];
2087
2087
  //#endregion
2088
- //#region packages/world-runtime/src/rendering/renderer-options.ts
2088
+ //#region src/rendering/renderer-options.ts
2089
2089
  /**
2090
2090
  * String names for renderer options set as words in the config and mapped to
2091
2091
  * THREE constants at runtime (game). Single source for the JSON schema
@@ -1,4 +1,4 @@
1
- //#region packages/world-runtime/src/addons/lib-registry.ts
1
+ //#region src/addons/lib-registry.ts
2
2
  /**
3
3
  * Registry of the libraries scripts can `require`. One entry describes one
4
4
  * library; the flags say how it gets into the world:
@@ -1 +1 @@
1
- export declare const RUNTIME_VERSION = "0.6.0";
1
+ export declare const RUNTIME_VERSION = "0.6.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvyverse/world-runtime",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Runtime for worlds exported from the Kvyverse platform for self-hosting",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Vladislav Kruteniuk",
@@ -39,7 +39,7 @@
39
39
  "nipplejs": "^0.10.2",
40
40
  "stats.js": "^0.17.0",
41
41
  "three": "^0.184.0",
42
- "three-start": "^0.1.2",
42
+ "three-start": "^0.1.3",
43
43
  "vanjs-core": "^1.6.0"
44
44
  },
45
45
  "peerDependenciesMeta": {