@kvyverse/world-runtime 0.1.0 → 0.3.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.
- package/README.md +78 -60
- package/dist/{BallCollider-8ZrxReEd.js → BallCollider-3L5vOrcL.js} +2 -2
- package/dist/{CapsuleCollider-bynyf6Mc.js → CapsuleCollider-CBTsR-Ys.js} +2 -2
- package/dist/ChatModule-2tiWS_Yr.js +411 -0
- package/dist/{Collider-4_rCTHVA.js → Collider-CPUCG3RA.js} +2 -2
- package/dist/{ConeCollider-DtRZmgK8.js → ConeCollider-C3XU3Y9X.js} +2 -2
- package/dist/{ConvexMeshCollider-BSmDM4o3.js → ConvexMeshCollider-DzNV4HTO.js} +1 -1
- package/dist/{CuboidCollider-CJvq7--s.js → CuboidCollider-Dp1DZoFM.js} +1 -1
- package/dist/{CylinderCollider-CQPSh4tu.js → CylinderCollider-C0h_nhB5.js} +2 -2
- package/dist/{FpsCameraController-BE2EirRj.js → FpsCameraController-2GNWJM5D.js} +1 -1
- package/dist/RapierDebugRenderer-BQy_m-3C.js +73 -0
- package/dist/{RapierFpsPlayerController-VsNfQl6v.js → RapierFpsPlayerController-DthD8dw9.js} +5 -22
- package/dist/{RapierPhysics-C_3b7QOn.js → RapierPhysics-zLwVZpwF.js} +33 -15
- package/dist/{Rigidbody-b7QNF4ev.js → Rigidbody-DLhN8ddv.js} +12 -1
- package/dist/World.d.ts +2 -2
- package/dist/WorldRuntime.d.ts +13 -4
- package/dist/addons/AddonsRuntime.d.ts +35 -0
- package/dist/addons/lib-registry.d.ts +34 -0
- package/dist/addons/types.d.ts +28 -0
- package/dist/behaviours/physics/BallCollider.d.ts +1 -1
- package/dist/behaviours/physics/CapsuleCollider.d.ts +1 -1
- package/dist/behaviours/physics/ConeCollider.d.ts +1 -1
- package/dist/behaviours/physics/ConvexMeshCollider.d.ts +1 -1
- package/dist/behaviours/physics/CuboidCollider.d.ts +1 -1
- package/dist/behaviours/physics/CylinderCollider.d.ts +1 -1
- package/dist/behaviours/physics/HalfspaceCollider.d.ts +1 -1
- package/dist/behaviours/physics/_required-patch.d.ts +10 -6
- package/dist/chat.module-descriptor-BTsep-Kq.js +107 -0
- package/dist/{get-scale-from-obj-QKv3Fig5.js → get-scale-from-obj-B7JlVPni.js} +1 -1
- package/dist/index.d.ts +21 -13
- package/dist/index.js +441 -155
- package/dist/modules/InputSystemModule.d.ts +14 -32
- package/dist/modules/chat/ChatDom.d.ts +100 -0
- package/dist/modules/chat/ChatModule.d.ts +36 -0
- package/dist/modules/chat/chat.module-descriptor.d.ts +43 -0
- package/dist/modules/contracts/addons.module-api.d.ts +15 -0
- package/dist/modules/contracts/chat.module-api.d.ts +52 -0
- package/dist/modules/contracts/controls.module-api.d.ts +58 -0
- package/dist/modules/contracts/html.module-api.d.ts +9 -1
- package/dist/modules/contracts/input.module-api.d.ts +11 -11
- package/dist/modules/contracts/module-events.d.ts +17 -0
- package/dist/modules/contracts/rapier.module-api.d.ts +13 -1
- package/dist/modules/controls/ControlsModule.d.ts +45 -0
- package/dist/modules/controls/KeyboardControlsDriver.d.ts +12 -0
- package/dist/modules/index.d.ts +30 -3
- package/dist/modules/optional-module-descriptor.d.ts +36 -0
- package/dist/modules/optional-modules.d.ts +11 -0
- package/dist/modules/physics/RapierDebugRenderer.d.ts +19 -0
- package/dist/{behaviours/physics/rapier-addon-core → modules/physics}/RapierPhysics.d.ts +13 -3
- package/dist/modules/physics/physics.module-descriptor.d.ts +16 -0
- package/dist/modules/registry.d.ts +7 -3
- package/dist/rendering/SceneBloom.d.ts +1 -1
- package/dist/rendering/renderer-apply.d.ts +1 -1
- package/dist/{settings → rendering}/types.d.ts +1 -12
- package/dist/types.d.ts +10 -3
- package/dist/version.gen.d.ts +1 -1
- package/package.json +9 -1
- package/dist/RapierDebugRenderer-sURZDLP4.js +0 -55
- package/dist/behaviours/physics/rapier-addon-core/RapierDebugRenderer.d.ts +0 -17
- package/dist/modules/contracts/rapierDebug.module-api.d.ts +0 -5
- package/dist/rolldown-runtime-D7D4PA-g.js +0 -13
- package/dist/settings/AddonsRuntime.d.ts +0 -19
- package/dist/settings/lib-loaders.d.ts +0 -7
- package/dist/settings/lib-registry.d.ts +0 -24
- package/dist/settings/module-registry.d.ts +0 -25
- /package/dist/{settings → addons}/externals.d.ts +0 -0
- /package/dist/behaviours/physics/{rapier-addon-core/Collider.d.ts → Collider.d.ts} +0 -0
- /package/dist/behaviours/physics/{rapier-addon-core/get-scale-from-obj.d.ts → get-scale-from-obj.d.ts} +0 -0
|
@@ -2,7 +2,7 @@ import { ContextModule } from "three-start";
|
|
|
2
2
|
import type { ThreeContext } from "three-start";
|
|
3
3
|
import type * as THREE from "three/webgpu";
|
|
4
4
|
import type * as RAPIER from "@dimforge/rapier3d-compat";
|
|
5
|
-
import type { RapierModuleApi } from "
|
|
5
|
+
import type { RapierModuleApi } from "../contracts/rapier.module-api";
|
|
6
6
|
export type ModulesWithRapierPhysics = {
|
|
7
7
|
rapier: RapierPhysics;
|
|
8
8
|
};
|
|
@@ -18,8 +18,17 @@ export declare class RapierPhysics extends ContextModule<{
|
|
|
18
18
|
/** @default "vary" */
|
|
19
19
|
timeStep: RapierPhysicsOptions["timeStep"];
|
|
20
20
|
private _steppingState;
|
|
21
|
-
|
|
21
|
+
private _debug;
|
|
22
|
+
private readonly _debugOnStart;
|
|
23
|
+
private readonly _gravity;
|
|
24
|
+
constructor(options?: Partial<RapierPhysicsOptions>);
|
|
25
|
+
onAwake(): void;
|
|
22
26
|
onStart(): void;
|
|
27
|
+
/** Whether collider outlines are being drawn right now. */
|
|
28
|
+
get isDebugEnabled(): boolean;
|
|
29
|
+
/** Turn on collider debug drawing; the renderer is fetched on demand. */
|
|
30
|
+
enableDebug(): Promise<void>;
|
|
31
|
+
disableDebug(): void;
|
|
23
32
|
/** three-start ContextModule has no onDestroy; teardown is explicit. */
|
|
24
33
|
dispose(): void;
|
|
25
34
|
private update;
|
|
@@ -124,7 +133,8 @@ export interface RapierPhysicsOptions {
|
|
|
124
133
|
**/
|
|
125
134
|
interpolate: boolean;
|
|
126
135
|
/**
|
|
127
|
-
*
|
|
136
|
+
* Start with the collider debug renderer on. The renderer itself is loaded
|
|
137
|
+
* on demand (`enableDebug()`), so worlds without debug never fetch it.
|
|
128
138
|
* @defaultValue false
|
|
129
139
|
*/
|
|
130
140
|
debug: boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OptionalModuleDescriptor } from "../optional-module-descriptor";
|
|
2
|
+
export type PhysicsEngine = "rapier";
|
|
3
|
+
/** `modules.physics`: off | engine shorthand | an object with options. */
|
|
4
|
+
export type PhysicsConfig = false | PhysicsEngine | {
|
|
5
|
+
engine: PhysicsEngine;
|
|
6
|
+
debug?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface NormalizedPhysics {
|
|
9
|
+
engine: PhysicsEngine;
|
|
10
|
+
/** Turn collider debug drawing on right away (the renderer loads on demand). */
|
|
11
|
+
debug: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const PHYSICS_ENGINES: readonly PhysicsEngine[];
|
|
14
|
+
/** Physics defaults: the rapier engine, debug off. */
|
|
15
|
+
export declare function normalizePhysics(value: PhysicsConfig | undefined): NormalizedPhysics | null;
|
|
16
|
+
export declare const physicsModuleDescriptor: OptionalModuleDescriptor<NormalizedPhysics>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { RapierPhysics } from "./physics/RapierPhysics";
|
|
2
|
+
import type { AddonsRuntime } from "../addons/AddonsRuntime";
|
|
3
|
+
import type { ChatModule } from "./chat/ChatModule";
|
|
4
|
+
import type { ControlsModule } from "./controls/ControlsModule";
|
|
3
5
|
import type { EnvModule } from "./EnvModule";
|
|
4
6
|
import type { HtmlHudModule } from "./HtmlHudModule";
|
|
5
7
|
import type { InputSystemModule } from "./InputSystemModule";
|
|
@@ -15,13 +17,15 @@ import type { UtilsModule } from "./UtilsModule";
|
|
|
15
17
|
* here may be missing in a particular ctx (e.g. editor-ctx registers only `input`).
|
|
16
18
|
*/
|
|
17
19
|
export interface KvyverseModules {
|
|
20
|
+
addons: AddonsRuntime;
|
|
18
21
|
input: InputSystemModule;
|
|
22
|
+
chat: ChatModule;
|
|
23
|
+
controls: ControlsModule;
|
|
19
24
|
env: EnvModule;
|
|
20
25
|
html: HtmlHudModule;
|
|
21
26
|
sounds: SoundsModule;
|
|
22
27
|
utils: UtilsModule;
|
|
23
28
|
rapier: RapierPhysics;
|
|
24
|
-
rapierDebug: RapierDebugRenderer;
|
|
25
29
|
}
|
|
26
30
|
declare module "three-start" {
|
|
27
31
|
interface ThreeStartRegister {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type BloomNode from "three/addons/tsl/display/BloomNode.js";
|
|
2
2
|
import type * as THREE from "three/webgpu";
|
|
3
3
|
import type { BloomModeName } from "./renderer-options";
|
|
4
|
-
import type { BloomConfig } from "
|
|
4
|
+
import type { BloomConfig } from "./types";
|
|
5
5
|
/**
|
|
6
6
|
* Enables MRT `{ output, emissive }` on the scenePass. Idempotent. IMPORTANT:
|
|
7
7
|
* MRT is part of the WebGPU pipelines' attachment state; enable it either before
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from "three/webgpu";
|
|
2
|
-
import type { RendererConfig } from "
|
|
2
|
+
import type { RendererConfig } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Applies the runtime part of `RendererConfig` to an already created WebGPURenderer
|
|
5
5
|
* (shadowMap, toneMapping, pixelRatio). Used by game (once on load) and editor
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { LibId } from "./lib-registry";
|
|
3
|
-
import type { PhysicsConfig } from "./module-registry";
|
|
4
|
-
import type { BloomModeName, ShadowMapTypeName, ToneMappingName } from "../rendering/renderer-options";
|
|
5
|
-
/** `settings.addons.json` — pluggable modules, built-in libs, external scripts. */
|
|
6
|
-
export interface AddonsConfig {
|
|
7
|
-
modules?: {
|
|
8
|
-
physics?: PhysicsConfig;
|
|
9
|
-
};
|
|
10
|
-
libs?: Partial<Record<LibId, boolean>>;
|
|
11
|
-
externals?: ExternalDescriptor[];
|
|
12
|
-
}
|
|
1
|
+
import type { BloomModeName, ShadowMapTypeName, ToneMappingName } from "./renderer-options";
|
|
13
2
|
/** Subset of `WebGPURendererParameters` configurable via the config. */
|
|
14
3
|
export interface RendererParams {
|
|
15
4
|
antialias?: boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Object3DBehaviourConstructor } from "three-start";
|
|
2
|
-
import type { AddonsConfig,
|
|
2
|
+
import type { AddonsConfig, WorldImports } from "./addons/types";
|
|
3
|
+
import type { RendererConfig } from "./rendering/types";
|
|
3
4
|
import type * as THREE from "three/webgpu";
|
|
4
5
|
/** World assets: asset path in the project (`/Folder/name.ext`) → URL. */
|
|
5
6
|
export type AssetUrlTable = Record<string, string>;
|
|
@@ -22,8 +23,8 @@ export interface WorldLoadProgress {
|
|
|
22
23
|
* scripts and behaviours. The only object the world hooks receive.
|
|
23
24
|
*/
|
|
24
25
|
export interface RuntimeApi {
|
|
25
|
-
/** Asset URL by
|
|
26
|
-
getUrl: (
|
|
26
|
+
/** Asset URL by project path or by a resource returned by `require`. */
|
|
27
|
+
getUrl: (source: string | object) => string;
|
|
27
28
|
/** `require` value by asset path or addon key. */
|
|
28
29
|
require: (key: string) => unknown;
|
|
29
30
|
/** Built-in behaviour class by uuid (preloaded by bootstrap). */
|
|
@@ -51,6 +52,12 @@ export interface WorldDefinition<TAssets = unknown> {
|
|
|
51
52
|
renderer?: RendererConfig;
|
|
52
53
|
/** `settings.addons.json`: built-in libs and external scripts for `require`. */
|
|
53
54
|
addons?: AddonsConfig;
|
|
55
|
+
/**
|
|
56
|
+
* How to import the optional packages this world uses (rapier, built-in
|
|
57
|
+
* libs). The build emits only what the world needs, so your bundler never
|
|
58
|
+
* has to resolve a package you did not install.
|
|
59
|
+
*/
|
|
60
|
+
imports?: WorldImports;
|
|
54
61
|
/** User scripts keyed by asset paths — same keys as `require`. */
|
|
55
62
|
scripts?: ScriptTable;
|
|
56
63
|
/** Path of the world entry script (`main.ts`). */
|
package/dist/version.gen.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const RUNTIME_VERSION = "0.
|
|
1
|
+
export declare const RUNTIME_VERSION = "0.3.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvyverse/world-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.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",
|
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
"animejs": "^4.5.0",
|
|
36
36
|
"eventemitter3": "^5.0.1",
|
|
37
37
|
"howler": "^2.2.4",
|
|
38
|
+
"nipplejs": "^0.10.2",
|
|
39
|
+
"stats.js": "^0.17.0",
|
|
38
40
|
"three": "^0.184.0",
|
|
39
41
|
"three-start": "^0.1.2",
|
|
40
42
|
"vanjs-core": "^1.6.0"
|
|
@@ -48,6 +50,12 @@
|
|
|
48
50
|
},
|
|
49
51
|
"animejs": {
|
|
50
52
|
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"nipplejs": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"stats.js": {
|
|
58
|
+
"optional": true
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
61
|
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { t as RapierPhysics } from "./RapierPhysics-C_3b7QOn.js";
|
|
2
|
-
import * as THREE from "three/webgpu";
|
|
3
|
-
import { ContextModule } from "three-start";
|
|
4
|
-
//#region packages/world-runtime/src/behaviours/physics/rapier-addon-core/RapierDebugRenderer.ts
|
|
5
|
-
/**
|
|
6
|
-
* @see {@link https://github.com/vladkrutenyuk/three-kvy-core/blob/main/src/addons/RapierDebugRenderer.ts | Source}
|
|
7
|
-
*/
|
|
8
|
-
var RapierDebugRenderer = class extends ContextModule {
|
|
9
|
-
_lines;
|
|
10
|
-
get enabled() {
|
|
11
|
-
return this._enabled;
|
|
12
|
-
}
|
|
13
|
-
set enabled(value) {
|
|
14
|
-
const lines = this._lines;
|
|
15
|
-
if (lines) lines.visible = value;
|
|
16
|
-
this._enabled = value;
|
|
17
|
-
}
|
|
18
|
-
_enabled = true;
|
|
19
|
-
_clear;
|
|
20
|
-
_inited = false;
|
|
21
|
-
/** three-start ContextModule has no onDestroy; teardown is explicit. */
|
|
22
|
-
dispose() {
|
|
23
|
-
this._clear?.();
|
|
24
|
-
}
|
|
25
|
-
init() {
|
|
26
|
-
if (this._inited) return;
|
|
27
|
-
this._inited = true;
|
|
28
|
-
const ctx = this.ctx;
|
|
29
|
-
const rapier = RapierPhysics.findInCtx(ctx);
|
|
30
|
-
if (!rapier) return;
|
|
31
|
-
const lines = new THREE.LineSegments(new THREE.BufferGeometry(), new THREE.LineBasicMaterial({
|
|
32
|
-
color: 16777215,
|
|
33
|
-
vertexColors: true
|
|
34
|
-
}));
|
|
35
|
-
lines.frustumCulled = false;
|
|
36
|
-
lines.visible = this._enabled;
|
|
37
|
-
ctx.scene.add(lines);
|
|
38
|
-
const draw = () => {
|
|
39
|
-
const { vertices, colors } = rapier.world.debugRender();
|
|
40
|
-
lines.geometry.setAttribute("position", new THREE.BufferAttribute(vertices, 3));
|
|
41
|
-
lines.geometry.setAttribute("color", new THREE.BufferAttribute(colors, 4));
|
|
42
|
-
lines.visible = true;
|
|
43
|
-
};
|
|
44
|
-
rapier.on("stepafter", draw);
|
|
45
|
-
this._clear = () => {
|
|
46
|
-
this._lines = void 0;
|
|
47
|
-
lines.removeFromParent();
|
|
48
|
-
lines.geometry.dispose();
|
|
49
|
-
lines.material.dispose();
|
|
50
|
-
rapier.off("stepafter", draw);
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
//#endregion
|
|
55
|
-
export { RapierDebugRenderer, RapierDebugRenderer as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ContextModule } from "three-start";
|
|
2
|
-
import type { RapierDebugModuleApi } from "../../../modules/contracts/rapierDebug.module-api";
|
|
3
|
-
/**
|
|
4
|
-
* @see {@link https://github.com/vladkrutenyuk/three-kvy-core/blob/main/src/addons/RapierDebugRenderer.ts | Source}
|
|
5
|
-
*/
|
|
6
|
-
export declare class RapierDebugRenderer extends ContextModule implements RapierDebugModuleApi {
|
|
7
|
-
private _lines?;
|
|
8
|
-
get enabled(): boolean;
|
|
9
|
-
set enabled(value: boolean);
|
|
10
|
-
private _enabled;
|
|
11
|
-
private _clear?;
|
|
12
|
-
private _inited;
|
|
13
|
-
/** three-start ContextModule has no onDestroy; teardown is explicit. */
|
|
14
|
-
dispose(): void;
|
|
15
|
-
init(): void;
|
|
16
|
-
}
|
|
17
|
-
export default RapierDebugRenderer;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __exportAll = (all, no_symbols) => {
|
|
4
|
-
let target = {};
|
|
5
|
-
for (var name in all) __defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true
|
|
8
|
-
});
|
|
9
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
-
return target;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
export { __exportAll as t };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AddonsConfig } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Runtime loading of addons (game-only): enabled built-in libs + external
|
|
4
|
-
* scripts (externals). Exposes them to user scripts via `resolve(key)`
|
|
5
|
-
* (used in `ScriptsRuntime.require`). Replaces the old
|
|
6
|
-
* `GameLoader.loadExternalsAsync` / `getExternalLib`.
|
|
7
|
-
*/
|
|
8
|
-
export declare class AddonsRuntime {
|
|
9
|
-
/** libs — by requireKey (`@tweenjs/tween.js`), externals — by accessor (`Tone`). */
|
|
10
|
-
private readonly _byKey;
|
|
11
|
-
private readonly _scriptTags;
|
|
12
|
-
load(addons: AddonsConfig): Promise<void>;
|
|
13
|
-
/** Resolves a require key: enabled lib or external accessor; undefined otherwise. */
|
|
14
|
-
resolve(key: string): unknown;
|
|
15
|
-
private _loadLibs;
|
|
16
|
-
private _loadExternals;
|
|
17
|
-
private _mountScript;
|
|
18
|
-
dispose(): void;
|
|
19
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { LibId } from "./lib-registry";
|
|
2
|
-
/**
|
|
3
|
-
* Dynamic loaders of built-in libs (game-only). Key — `LibId` from the registry;
|
|
4
|
-
* the value resolves for the user via `require("<requireKey>")`. Imports are lazy —
|
|
5
|
-
* bundled only when the lib is enabled in `settings.addons.json`.
|
|
6
|
-
*/
|
|
7
|
-
export declare const LIB_LOADERS: Record<LibId, () => Promise<unknown>>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Registry of built-in libraries enabled via `settings.addons.json → libs`.
|
|
3
|
-
*
|
|
4
|
-
* Separates two keys: `id` (short config key under `libs`) and `requireKey`
|
|
5
|
-
* (what the user writes in `require(...)` in scripts). Single source for:
|
|
6
|
-
* - game: dynamic loading (`lib-loaders`),
|
|
7
|
-
* - editor: JSON schema (`libs` props) + require typings (`AddonsRequireTypings`).
|
|
8
|
-
*
|
|
9
|
-
* Adding a lib = add an entry here (+ loader in game, + d.ts loader in editor).
|
|
10
|
-
*/
|
|
11
|
-
export declare enum LibId {
|
|
12
|
-
Tween = "tween",
|
|
13
|
-
Anime = "anime"
|
|
14
|
-
}
|
|
15
|
-
export interface LibDescriptor {
|
|
16
|
-
readonly id: LibId;
|
|
17
|
-
/** Key the user gets the lib by: `require("<requireKey>")`. */
|
|
18
|
-
readonly requireKey: string;
|
|
19
|
-
readonly label: string;
|
|
20
|
-
}
|
|
21
|
-
export declare const LIBS: Readonly<Record<LibId, LibDescriptor>>;
|
|
22
|
-
export declare const LIB_IDS: LibId[];
|
|
23
|
-
export declare const LIB_DESCRIPTORS: LibDescriptor[];
|
|
24
|
-
export declare function libByRequireKey(requireKey: string): LibDescriptor | undefined;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Registry of pluggable engine modules (`settings.addons.json → modules`).
|
|
3
|
-
* These are three-start modules that must be registered before `start()`.
|
|
4
|
-
* Feature toggles (chat/joystick/debugPerf) are NOT here — they live in
|
|
5
|
-
* `settings.json` (see `../features/feature-registry`).
|
|
6
|
-
*
|
|
7
|
-
* The only module so far is physics.
|
|
8
|
-
* Installation lives in game (`game/settings/module-installers`).
|
|
9
|
-
*/
|
|
10
|
-
export declare enum ModuleId {
|
|
11
|
-
Physics = "physics"
|
|
12
|
-
}
|
|
13
|
-
export type PhysicsEngine = "rapier";
|
|
14
|
-
/** `modules.physics` value: off | engine shorthand | object with options. */
|
|
15
|
-
export type PhysicsConfig = false | PhysicsEngine | {
|
|
16
|
-
engine: PhysicsEngine;
|
|
17
|
-
debug?: boolean;
|
|
18
|
-
};
|
|
19
|
-
export declare const PHYSICS_ENGINES: readonly PhysicsEngine[];
|
|
20
|
-
export declare const MODULE_IDS: ModuleId.Physics[];
|
|
21
|
-
/** Normalizes the physics config to an object (or null if disabled). */
|
|
22
|
-
export declare function normalizePhysics(value: PhysicsConfig | undefined): {
|
|
23
|
-
engine: PhysicsEngine;
|
|
24
|
-
debug: boolean;
|
|
25
|
-
} | null;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|