@bendyline/molen-tooling 0.0.10 → 0.0.12
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/capture/harness.js +610 -271
- package/dist/capture/worldgen-preview.js +396 -298
- package/dist/cli.mjs +2 -2
- package/dist/docs-src/guide/3d-art-guidelines.md +34 -10
- package/dist/docs-src/guide/3d-model-assets.md +40 -2
- package/dist/docs-src/guide/adaptive-performance.md +12 -4
- package/dist/docs-src/guide/aircraft.md +126 -26
- package/dist/docs-src/guide/ambient-life.md +13 -4
- package/dist/docs-src/guide/audio.md +19 -5
- package/dist/docs-src/guide/building-interiors.md +7 -2
- package/dist/docs-src/guide/determinism.md +1 -1
- package/dist/docs-src/guide/dioramas.md +6 -0
- package/dist/docs-src/guide/earth-view.md +121 -20
- package/dist/docs-src/guide/entities.md +84 -5
- package/dist/docs-src/guide/figures.md +31 -7
- package/dist/docs-src/guide/graphics-performance.md +27 -12
- package/dist/docs-src/guide/medium-fi.md +269 -25
- package/dist/docs-src/guide/navigation.md +5 -2
- package/dist/docs-src/guide/project.md +5 -0
- package/dist/docs-src/guide/recognizable-places.md +6 -0
- package/dist/docs-src/guide/regional-fleets.md +94 -0
- package/dist/docs-src/guide/regional-world.md +398 -0
- package/dist/docs-src/guide/sky.md +36 -3
- package/dist/docs-src/guide/structure-library.md +4 -1
- package/dist/docs-src/guide/surface-rendering.md +264 -2
- package/dist/docs-src/guide/terrain.md +5 -0
- package/dist/docs-src/guide/typography.md +105 -0
- package/dist/docs-src/guide/vehicle-interiors.md +169 -9
- package/dist/docs-src/guide/vehicles.md +13 -2
- package/dist/docs-src/guide/weather.md +15 -8
- package/dist/docs-src/guide/worldgen.md +88 -10
- package/dist/docs-src/llms.txt +5 -1
- package/dist/docs-src/schemas/README.md +6 -0
- package/dist/docs-src/schemas/archstyle.md +66 -0
- package/dist/docs-src/schemas/components.md +1087 -66
- package/dist/docs-src/schemas/ecology-atlas.md +236 -0
- package/dist/docs-src/schemas/fleet-catalog.md +113 -0
- package/dist/docs-src/schemas/landmark.md +10 -0
- package/dist/docs-src/schemas/matgraph.md +11 -1
- package/dist/docs-src/schemas/pack-source.md +11 -1
- package/dist/docs-src/schemas/pack.md +1 -1
- package/dist/docs-src/schemas/project.md +1 -1
- package/dist/docs-src/schemas/region-atlas.md +6 -0
- package/dist/docs-src/schemas/regional-catalog.md +1436 -0
- package/dist/docs-src/schemas/scatter.md +110 -4
- package/dist/docs-src/schemas/structure-placement-data.md +662 -0
- package/dist/docs-src/schemas/structure-placement-index.md +87 -0
- package/dist/docs-src/schemas/structure-placements.md +183 -0
- package/dist/docs-src/schemas/terrain-package.md +41 -0
- package/dist/docs-src/schemas/transport-network.md +8 -0
- package/dist/docs-src/schemas/types.md +1 -1
- package/dist/docs-src/schemas/wildlife-ranges.md +251 -0
- package/dist/docs-src/schemas/worldgen-batch.md +61 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{mcp-BbxqqnD1.mjs → mcp-BXaK46X-.mjs} +1 -1
- package/dist/{ops-b4Pag8U-.mjs → ops-Cm7WNvb9.mjs} +55 -22
- package/dist/templates/city-courier/gen/molen-types.ts +138 -17
- package/dist/templates/city-courier/scripts/molen-scripts.d.ts +138 -17
- package/dist/templates/figures-gallery/test/headless.test.ts +2 -1
- package/dist/templates/index.json +17 -17
- package/dist/templates/skybound/gen/molen-types.ts +138 -17
- package/dist/templates/skybound/scripts/molen-scripts.d.ts +138 -17
- package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +138 -17
- package/dist/templates/top-down-arena/src/gen/molen-types.ts +138 -17
- package/package.json +13 -13
package/dist/index.d.mts
CHANGED
|
@@ -7,6 +7,7 @@ import { ResolvedTypes, World, WorldSetup } from "@bendyline/molen-kernel";
|
|
|
7
7
|
import { PackSet } from "@bendyline/molen-pack";
|
|
8
8
|
import { AssertionResult, ComponentDiff, RecordedEvent } from "@bendyline/molen-kernel/testing";
|
|
9
9
|
import { PMTiles } from "pmtiles";
|
|
10
|
+
import { FontLibrary } from "@bendyline/molen-materials/text";
|
|
10
11
|
//#region src/frame-stats.d.ts
|
|
11
12
|
/** A rectangle as fractions of the frame (0 to 1), so a check reads the same at any size. */
|
|
12
13
|
interface FrameRegion {
|
|
@@ -1231,6 +1232,7 @@ declare function bakeWorldgen(input: WorldgenBakeInput): Promise<WorldgenBakeOut
|
|
|
1231
1232
|
//#endregion
|
|
1232
1233
|
//#region src/ops/worldgen-pack.d.ts
|
|
1233
1234
|
interface LoadedStylePackFiles {
|
|
1235
|
+
fonts?: FontLibrary;
|
|
1234
1236
|
pack: ResolvedStylePack;
|
|
1235
1237
|
/** Directory every pack path resolves against. */
|
|
1236
1238
|
dir: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, G as schemaToTsType, H as describeOps, L as exportFrames, N as generateTypes, O as extractContentPack, P as renderTypesModule, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, V as OPS_CATALOG, W as checkScripts, X as stageAssets, Y as ASSET_INDEX_FILE, Z as screenshotAsset, a as lineupBatchDoc, at as findProjectFile, b as diffSnapshots, c as validateAsset, ct as loadSetupLike, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, ft as registerExperiencePlaySchema, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, lt as updateProjectFile, m as getSchemaOp, n as worldgenStats, nt as listAssets, o as loadStylePackFromDisk, ot as loadProject, p as getComponentOp, r as previewWorldgen, rt as assetFileIndex, s as simWatch, st as loadSceneDocument, tt as inspectAsset, u as testTypes, ut as parseExperiencePlayScenario, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates, z as locateDocsRoot } from "./ops-
|
|
1
|
+
import { A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, G as schemaToTsType, H as describeOps, L as exportFrames, N as generateTypes, O as extractContentPack, P as renderTypesModule, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, V as OPS_CATALOG, W as checkScripts, X as stageAssets, Y as ASSET_INDEX_FILE, Z as screenshotAsset, a as lineupBatchDoc, at as findProjectFile, b as diffSnapshots, c as validateAsset, ct as loadSetupLike, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, ft as registerExperiencePlaySchema, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, lt as updateProjectFile, m as getSchemaOp, n as worldgenStats, nt as listAssets, o as loadStylePackFromDisk, ot as loadProject, p as getComponentOp, r as previewWorldgen, rt as assetFileIndex, s as simWatch, st as loadSceneDocument, tt as inspectAsset, u as testTypes, ut as parseExperiencePlayScenario, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates, z as locateDocsRoot } from "./ops-Cm7WNvb9.mjs";
|
|
2
2
|
import { access, copyFile, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
3
|
import { PNG } from "pngjs";
|
|
4
4
|
import { dirname } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as formatPacked, A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, F as previewFigure, H as describeOps, I as listFigurePresets, J as checkSoundbank, K as planAudio, L as exportFrames, M as bakeNetwork, N as generateTypes, O as extractContentPack, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, W as checkScripts, X as stageAssets, Z as screenshotAsset, _ as loadComponentRegistry, b as diffSnapshots, c as validateAsset, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, m as getSchemaOp, n as worldgenStats, nt as listAssets, p as getComponentOp, q as importSound, r as previewWorldgen, tt as inspectAsset, u as testTypes, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates } from "./ops-
|
|
1
|
+
import { $ as formatPacked, A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, F as previewFigure, H as describeOps, I as listFigurePresets, J as checkSoundbank, K as planAudio, L as exportFrames, M as bakeNetwork, N as generateTypes, O as extractContentPack, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, W as checkScripts, X as stageAssets, Z as screenshotAsset, _ as loadComponentRegistry, b as diffSnapshots, c as validateAsset, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, m as getSchemaOp, n as worldgenStats, nt as listAssets, p as getComponentOp, q as importSound, r as previewWorldgen, tt as inspectAsset, u as testTypes, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates } from "./ops-Cm7WNvb9.mjs";
|
|
2
2
|
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -29,6 +29,7 @@ import { AudioDirector, entitySourceFromWorld, mergeSoundbanks } from "@bendylin
|
|
|
29
29
|
import { diffKeyframes, firstDivergentTick, formatAssertionResults, perTickHashes, runAssertions, runHeadless } from "@bendyline/molen-kernel/testing";
|
|
30
30
|
import { hashJson } from "@bendyline/molen-kernel/determinism";
|
|
31
31
|
import { PMTiles } from "pmtiles";
|
|
32
|
+
import { loadFontLibrary } from "@bendyline/molen-materials/text";
|
|
32
33
|
//#region src/capture-server.ts
|
|
33
34
|
const MIME$1 = {
|
|
34
35
|
".html": "text/html; charset=utf-8",
|
|
@@ -603,6 +604,34 @@ async function playExperience(input) {
|
|
|
603
604
|
}
|
|
604
605
|
}
|
|
605
606
|
//#endregion
|
|
607
|
+
//#region src/file-io.ts
|
|
608
|
+
const WINDOWS_FILE_LOCKS = new Set([
|
|
609
|
+
"EBUSY",
|
|
610
|
+
"EPERM",
|
|
611
|
+
"EACCES",
|
|
612
|
+
"EUNKNOWN",
|
|
613
|
+
"UNKNOWN"
|
|
614
|
+
]);
|
|
615
|
+
/** Retry short-lived Windows scanner/editor locks at the filesystem operation, not the import. */
|
|
616
|
+
async function retryFileOperation(operation) {
|
|
617
|
+
for (let attempt = 0;; attempt++) try {
|
|
618
|
+
return await operation();
|
|
619
|
+
} catch (error) {
|
|
620
|
+
if (process.platform !== "win32" || attempt >= 20 || !WINDOWS_FILE_LOCKS.has(error.code ?? "")) throw error;
|
|
621
|
+
await new Promise((done) => setTimeout(done, Math.min(25 * 2 ** attempt, 250)));
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
/** Replace a file without truncating a destination that another process may have mapped. */
|
|
625
|
+
async function writeFileAtomic(path, data) {
|
|
626
|
+
const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
627
|
+
try {
|
|
628
|
+
await retryFileOperation(() => writeFile(temporary, data));
|
|
629
|
+
await retryFileOperation(() => rename(temporary, path));
|
|
630
|
+
} finally {
|
|
631
|
+
await retryFileOperation(() => rm(temporary, { force: true }));
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
//#endregion
|
|
606
635
|
//#region src/content.ts
|
|
607
636
|
/** Where downloaded packs are cached: $MOLEN_CACHE_DIR, else the XDG cache, else ~/.cache. */
|
|
608
637
|
function packCacheDir() {
|
|
@@ -792,21 +821,24 @@ async function updateProjectFile(path, mutate) {
|
|
|
792
821
|
const lockPath = `${projectPath}.lock`;
|
|
793
822
|
const start = Date.now();
|
|
794
823
|
const staleAfterMs = 3e4;
|
|
795
|
-
const waitLimitMs =
|
|
824
|
+
const waitLimitMs = 3e4;
|
|
796
825
|
for (;;) try {
|
|
797
|
-
const handle = await open(lockPath, "wx");
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
826
|
+
const handle = await retryFileOperation(() => open(lockPath, "wx"));
|
|
827
|
+
try {
|
|
828
|
+
await handle.writeFile(`${JSON.stringify({
|
|
829
|
+
pid: process.pid,
|
|
830
|
+
createdAt: Date.now()
|
|
831
|
+
})}\n`);
|
|
832
|
+
} finally {
|
|
833
|
+
await handle.close();
|
|
834
|
+
}
|
|
803
835
|
break;
|
|
804
836
|
} catch (error) {
|
|
805
837
|
if (error.code !== "EEXIST") throw error;
|
|
806
838
|
try {
|
|
807
839
|
const info = await stat(lockPath);
|
|
808
840
|
if (Date.now() - info.mtimeMs > staleAfterMs) {
|
|
809
|
-
await rm(lockPath, { force: true });
|
|
841
|
+
await retryFileOperation(() => rm(lockPath, { force: true }));
|
|
810
842
|
continue;
|
|
811
843
|
}
|
|
812
844
|
} catch (statError) {
|
|
@@ -816,21 +848,18 @@ async function updateProjectFile(path, mutate) {
|
|
|
816
848
|
if (Date.now() - start > waitLimitMs) throw new Error(`project manifest is locked by another writer: ${lockPath}`);
|
|
817
849
|
await new Promise((r) => setTimeout(r, 25));
|
|
818
850
|
}
|
|
819
|
-
const tmpPath = `${projectPath}.${process.pid}.${randomUUID()}.tmp`;
|
|
820
851
|
try {
|
|
821
|
-
const parsed = validate("project", parseJson(await readFile(projectPath, "utf8")));
|
|
852
|
+
const parsed = validate("project", parseJson(await retryFileOperation(() => readFile(projectPath, "utf8"))));
|
|
822
853
|
if (!parsed.ok) throw new Error(parsed.formatted);
|
|
823
854
|
const manifest = parsed.value;
|
|
855
|
+
const before = JSON.stringify(manifest);
|
|
824
856
|
const next = mutate(manifest) ?? manifest;
|
|
825
857
|
const reparsed = validate("project", JSON.parse(JSON.stringify(next)));
|
|
826
858
|
if (!reparsed.ok) throw new Error(`project.json update produced an invalid manifest:\n${reparsed.formatted}`);
|
|
827
|
-
await
|
|
828
|
-
await writeFile(tmpPath, `${JSON.stringify(reparsed.value, null, 2)}\n`);
|
|
829
|
-
await rename(tmpPath, projectPath);
|
|
859
|
+
if (JSON.stringify(reparsed.value) !== before) await writeFileAtomic(projectPath, `${JSON.stringify(reparsed.value, null, 2)}\n`);
|
|
830
860
|
return reparsed.value;
|
|
831
861
|
} finally {
|
|
832
|
-
await rm(
|
|
833
|
-
await rm(lockPath, { force: true });
|
|
862
|
+
await retryFileOperation(() => rm(lockPath, { force: true }));
|
|
834
863
|
}
|
|
835
864
|
}
|
|
836
865
|
/**
|
|
@@ -1186,7 +1215,7 @@ async function importAsset(input) {
|
|
|
1186
1215
|
if (resolved.warning !== void 0) warnings.push(resolved.warning);
|
|
1187
1216
|
let registeredAssets = {};
|
|
1188
1217
|
if (projectPath !== void 0) {
|
|
1189
|
-
const project = validate("project", parseJson(await readFile(projectPath, "utf8")));
|
|
1218
|
+
const project = validate("project", parseJson(await retryFileOperation(() => readFile(projectPath, "utf8"))));
|
|
1190
1219
|
if (!project.ok) return {
|
|
1191
1220
|
ok: false,
|
|
1192
1221
|
error: project.formatted
|
|
@@ -1214,7 +1243,7 @@ async function importAsset(input) {
|
|
|
1214
1243
|
};
|
|
1215
1244
|
let existing;
|
|
1216
1245
|
try {
|
|
1217
|
-
existing = parseJson(await readFile(sidecarPath, "utf8"));
|
|
1246
|
+
existing = parseJson(await retryFileOperation(() => readFile(sidecarPath, "utf8")));
|
|
1218
1247
|
} catch (error) {
|
|
1219
1248
|
if (error.code !== "ENOENT" && !(error instanceof SyntaxError)) throw error;
|
|
1220
1249
|
}
|
|
@@ -1336,7 +1365,7 @@ async function importAsset(input) {
|
|
|
1336
1365
|
});
|
|
1337
1366
|
await mkdir(dir, { recursive: true });
|
|
1338
1367
|
const glb = await io.writeBinary(doc);
|
|
1339
|
-
await
|
|
1368
|
+
await writeFileAtomic(join(dir, "model.glb"), glb);
|
|
1340
1369
|
let trimeshHeader;
|
|
1341
1370
|
let collisionFile;
|
|
1342
1371
|
if (input.trimesh === true) {
|
|
@@ -1352,7 +1381,7 @@ async function importAsset(input) {
|
|
|
1352
1381
|
});
|
|
1353
1382
|
const encoded = encodeCollisionTrimesh(positions, new Uint32Array(allIndices));
|
|
1354
1383
|
collisionFile = "collision.bin";
|
|
1355
|
-
await
|
|
1384
|
+
await writeFileAtomic(join(dir, collisionFile), encoded.bin);
|
|
1356
1385
|
trimeshHeader = {
|
|
1357
1386
|
bin: collisionFile,
|
|
1358
1387
|
positions: encoded.positions,
|
|
@@ -1396,7 +1425,7 @@ async function importAsset(input) {
|
|
|
1396
1425
|
ok: false,
|
|
1397
1426
|
error: `sidecar failed self-validation:\n${checked.formatted}`
|
|
1398
1427
|
};
|
|
1399
|
-
await
|
|
1428
|
+
await writeFileAtomic(sidecarPath, `${JSON.stringify(checked.value, null, 2)}\n`);
|
|
1400
1429
|
try {
|
|
1401
1430
|
await stat(sidecarPath);
|
|
1402
1431
|
} catch (e) {
|
|
@@ -7730,9 +7759,12 @@ async function landmarkDocs(source) {
|
|
|
7730
7759
|
}
|
|
7731
7760
|
async function withLandmarks(loaded, own, options) {
|
|
7732
7761
|
const source = await providedBy("landmarks", own, options);
|
|
7733
|
-
|
|
7762
|
+
const fontSource = await providedBy("fonts", own, options);
|
|
7763
|
+
const fonts = fontSource ? await loadFontLibrary(await fontSource.pack.readJson(fontSource.path), (path) => fontSource.pack.readJson(fontSource.path.slice(0, fontSource.path.lastIndexOf("/") + 1) + path)) : void 0;
|
|
7764
|
+
return {
|
|
7734
7765
|
...loaded,
|
|
7735
|
-
landmarks: await landmarkDocs(source)
|
|
7766
|
+
...source ? { landmarks: await landmarkDocs(source) } : {},
|
|
7767
|
+
...fonts ? { fonts } : {}
|
|
7736
7768
|
};
|
|
7737
7769
|
}
|
|
7738
7770
|
async function stylePackAt(path) {
|
|
@@ -8310,6 +8342,7 @@ async function previewWorldgenImpl(input) {
|
|
|
8310
8342
|
filesBaseUrl,
|
|
8311
8343
|
assetIndex: stylePackAssetIndex(pack, filesBaseUrl),
|
|
8312
8344
|
landmarks,
|
|
8345
|
+
...loaded.fonts ? { fonts: loaded.fonts } : {},
|
|
8313
8346
|
materialRefs: [...new Set(output.buildings?.groups.map((group) => group.materialRef) ?? [])],
|
|
8314
8347
|
ground: {
|
|
8315
8348
|
y: groundY,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:
|
|
1
|
+
// AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:e03618693a83a67c7afb29951b8748fc4687443d516472392f74751d139a29ad
|
|
2
2
|
// Regenerate after editing types/*.json; `molen types check` flags staleness.
|
|
3
3
|
/** biome-ignore-all format: generated file (stable output beats house wrapping) */
|
|
4
4
|
import { defineComponent, type JsonObject } from '@bendyline/molen-kernel';
|
|
@@ -8,6 +8,7 @@ export type AircraftData = {
|
|
|
8
8
|
kind: string;
|
|
9
9
|
spec: {
|
|
10
10
|
label: string;
|
|
11
|
+
genericLabel?: string;
|
|
11
12
|
model: 'airplane' | 'helicopter';
|
|
12
13
|
mass: number;
|
|
13
14
|
span: number;
|
|
@@ -16,12 +17,22 @@ export type AircraftData = {
|
|
|
16
17
|
centerOfMass: [number, number, number];
|
|
17
18
|
pilotEye: [number, number, number];
|
|
18
19
|
engine?: {
|
|
20
|
+
propulsion?: 'propeller' | 'jet';
|
|
21
|
+
dryThrust?: number;
|
|
22
|
+
afterburnerThrust?: number;
|
|
23
|
+
afterburnerDetent?: number;
|
|
24
|
+
densityExponent?: number;
|
|
25
|
+
highAltitudeDensityRatio?: number;
|
|
26
|
+
highAltitudeExponent?: number;
|
|
27
|
+
ratedDensityRatio?: number;
|
|
28
|
+
ramRise?: number;
|
|
19
29
|
position: [number, number, number];
|
|
20
30
|
thrustAxis: [number, number, number];
|
|
21
31
|
power: number;
|
|
22
32
|
idleRpm: number;
|
|
23
33
|
spoolRate: number;
|
|
24
34
|
rotorAngularSpeed: number;
|
|
35
|
+
vectored?: boolean;
|
|
25
36
|
propellerEfficiency?: number;
|
|
26
37
|
maxThrust?: number;
|
|
27
38
|
minPropellerSpeed?: number;
|
|
@@ -29,12 +40,22 @@ export type AircraftData = {
|
|
|
29
40
|
propellerInertia?: number;
|
|
30
41
|
};
|
|
31
42
|
engines?: {
|
|
43
|
+
propulsion?: 'propeller' | 'jet';
|
|
44
|
+
dryThrust?: number;
|
|
45
|
+
afterburnerThrust?: number;
|
|
46
|
+
afterburnerDetent?: number;
|
|
47
|
+
densityExponent?: number;
|
|
48
|
+
highAltitudeDensityRatio?: number;
|
|
49
|
+
highAltitudeExponent?: number;
|
|
50
|
+
ratedDensityRatio?: number;
|
|
51
|
+
ramRise?: number;
|
|
32
52
|
position: [number, number, number];
|
|
33
53
|
thrustAxis: [number, number, number];
|
|
34
54
|
power: number;
|
|
35
55
|
idleRpm: number;
|
|
36
56
|
spoolRate: number;
|
|
37
57
|
rotorAngularSpeed: number;
|
|
58
|
+
vectored?: boolean;
|
|
38
59
|
propellerEfficiency?: number;
|
|
39
60
|
maxThrust?: number;
|
|
40
61
|
minPropellerSpeed?: number;
|
|
@@ -60,6 +81,22 @@ export type AircraftData = {
|
|
|
60
81
|
flapLift: number;
|
|
61
82
|
postStallFlapEffect: number;
|
|
62
83
|
stallAngle: number;
|
|
84
|
+
criticalMach?: number;
|
|
85
|
+
waveDrag?: number;
|
|
86
|
+
maxEquivalentAirspeed?: number;
|
|
87
|
+
maxMach?: number;
|
|
88
|
+
gearLimitSpeed?: number;
|
|
89
|
+
flapLimitSpeed?: number;
|
|
90
|
+
groundEffect?: boolean;
|
|
91
|
+
departure?: {
|
|
92
|
+
onsetAngle: number;
|
|
93
|
+
fullAngle: number;
|
|
94
|
+
yawInstability: number;
|
|
95
|
+
yawSaturationRate: number;
|
|
96
|
+
rudderBlanking: number;
|
|
97
|
+
pitchBlanking: number;
|
|
98
|
+
aileronReversal: number;
|
|
99
|
+
};
|
|
63
100
|
stallTransitionAngle?: number;
|
|
64
101
|
pitchFrequency?: number;
|
|
65
102
|
pitchDamping?: number;
|
|
@@ -81,6 +118,7 @@ export type AircraftData = {
|
|
|
81
118
|
inducedDrag: number;
|
|
82
119
|
gearDrag: number;
|
|
83
120
|
flapDrag: number;
|
|
121
|
+
fixedGear?: boolean;
|
|
84
122
|
gearTransitTime?: number;
|
|
85
123
|
flapTransitTime?: number;
|
|
86
124
|
stallDrag: number;
|
|
@@ -95,6 +133,12 @@ export type AircraftData = {
|
|
|
95
133
|
helicopter?: {
|
|
96
134
|
rotorPosition: [number, number, number];
|
|
97
135
|
rotorRadius: number;
|
|
136
|
+
powerLimitedRotor?: boolean;
|
|
137
|
+
rotorEfficiency?: number;
|
|
138
|
+
profilePowerFraction?: number;
|
|
139
|
+
vortexRing?: boolean;
|
|
140
|
+
retreatingBladeSpeed?: number;
|
|
141
|
+
rotorDiscs?: number;
|
|
98
142
|
cyclicTilt: number;
|
|
99
143
|
cyclicResponse: number;
|
|
100
144
|
cyclicDamping: number;
|
|
@@ -110,6 +154,14 @@ export type AircraftData = {
|
|
|
110
154
|
quadraticDrag: number;
|
|
111
155
|
groundDeceleration: number;
|
|
112
156
|
};
|
|
157
|
+
poweredLift?: {
|
|
158
|
+
transitTime: number;
|
|
159
|
+
controlFadeSpeed: number;
|
|
160
|
+
pitchAuthority: number;
|
|
161
|
+
rollAuthority: number;
|
|
162
|
+
yawAuthority: number;
|
|
163
|
+
damping: number;
|
|
164
|
+
};
|
|
113
165
|
hardLandingSpeed: number;
|
|
114
166
|
hardLandingRoll: number;
|
|
115
167
|
hardLandingPitch: number;
|
|
@@ -153,15 +205,22 @@ export type AircraftData = {
|
|
|
153
205
|
bindings: {
|
|
154
206
|
node: string;
|
|
155
207
|
source: string;
|
|
156
|
-
property: 'rotation' | 'position';
|
|
157
|
-
axis
|
|
208
|
+
property: 'rotation' | 'position' | 'visible';
|
|
209
|
+
axis?: 'x' | 'y' | 'z';
|
|
158
210
|
scale?: number;
|
|
159
211
|
offset?: number;
|
|
160
212
|
keys?: [number, number][];
|
|
161
213
|
ease?: 'linear' | 'smooth';
|
|
162
214
|
min?: number;
|
|
163
215
|
max?: number;
|
|
216
|
+
period?: number;
|
|
217
|
+
responseSeconds?: number;
|
|
218
|
+
missing?: 'hold' | 'rest' | 'hide';
|
|
164
219
|
}[];
|
|
220
|
+
derived?: Record<string, {
|
|
221
|
+
op: 'add' | 'subtract' | 'multiply' | 'divide' | 'min' | 'max' | 'clamp' | 'abs' | 'sqrt' | 'floor' | 'modulo' | 'sin' | 'cos' | 'atan2' | 'less' | 'greater' | 'equal' | 'and' | 'or' | 'not' | 'if' | 'coalesce';
|
|
222
|
+
args: (number | string)[];
|
|
223
|
+
}>;
|
|
165
224
|
};
|
|
166
225
|
animation?: {
|
|
167
226
|
sources?: Record<string, {
|
|
@@ -171,15 +230,22 @@ export type AircraftData = {
|
|
|
171
230
|
bindings: {
|
|
172
231
|
node: string;
|
|
173
232
|
source: string;
|
|
174
|
-
property: 'rotation' | 'position';
|
|
175
|
-
axis
|
|
233
|
+
property: 'rotation' | 'position' | 'visible';
|
|
234
|
+
axis?: 'x' | 'y' | 'z';
|
|
176
235
|
scale?: number;
|
|
177
236
|
offset?: number;
|
|
178
237
|
keys?: [number, number][];
|
|
179
238
|
ease?: 'linear' | 'smooth';
|
|
180
239
|
min?: number;
|
|
181
240
|
max?: number;
|
|
241
|
+
period?: number;
|
|
242
|
+
responseSeconds?: number;
|
|
243
|
+
missing?: 'hold' | 'rest' | 'hide';
|
|
182
244
|
}[];
|
|
245
|
+
derived?: Record<string, {
|
|
246
|
+
op: 'add' | 'subtract' | 'multiply' | 'divide' | 'min' | 'max' | 'clamp' | 'abs' | 'sqrt' | 'floor' | 'modulo' | 'sin' | 'cos' | 'atan2' | 'less' | 'greater' | 'equal' | 'and' | 'or' | 'not' | 'if' | 'coalesce';
|
|
247
|
+
args: (number | string)[];
|
|
248
|
+
}>;
|
|
183
249
|
};
|
|
184
250
|
};
|
|
185
251
|
};
|
|
@@ -197,10 +263,16 @@ export type AircraftInputData = {
|
|
|
197
263
|
enabled?: boolean;
|
|
198
264
|
}>;
|
|
199
265
|
gear: boolean;
|
|
200
|
-
flaps: boolean;
|
|
266
|
+
flaps: boolean | number;
|
|
267
|
+
thrustVector?: number;
|
|
201
268
|
};
|
|
202
269
|
/** Deterministic flight state, including rotor phase and engine spool, preserved by keyframes. */
|
|
203
270
|
export type AircraftStateData = {
|
|
271
|
+
mach?: number;
|
|
272
|
+
equivalentAirspeed?: number;
|
|
273
|
+
overspeed?: boolean;
|
|
274
|
+
departure?: number;
|
|
275
|
+
vortexRing?: number;
|
|
204
276
|
velocity: [number, number, number];
|
|
205
277
|
yaw: number;
|
|
206
278
|
pitch: number;
|
|
@@ -212,12 +284,14 @@ export type AircraftStateData = {
|
|
|
212
284
|
gearPosition?: number;
|
|
213
285
|
flapPosition?: number;
|
|
214
286
|
pitchTrim?: number;
|
|
287
|
+
thrustVectorPosition?: number;
|
|
215
288
|
sideslip?: number;
|
|
216
289
|
loadFactor?: number;
|
|
217
290
|
engines?: Record<string, {
|
|
218
291
|
rpm: number;
|
|
219
292
|
rotorAngle: number;
|
|
220
293
|
failed: boolean;
|
|
294
|
+
afterburner?: number;
|
|
221
295
|
thrust: number;
|
|
222
296
|
}>;
|
|
223
297
|
rpm: number;
|
|
@@ -469,15 +543,22 @@ export type BoatData = {
|
|
|
469
543
|
bindings: {
|
|
470
544
|
node: string;
|
|
471
545
|
source: string;
|
|
472
|
-
property: 'rotation' | 'position';
|
|
473
|
-
axis
|
|
546
|
+
property: 'rotation' | 'position' | 'visible';
|
|
547
|
+
axis?: 'x' | 'y' | 'z';
|
|
474
548
|
scale?: number;
|
|
475
549
|
offset?: number;
|
|
476
550
|
keys?: [number, number][];
|
|
477
551
|
ease?: 'linear' | 'smooth';
|
|
478
552
|
min?: number;
|
|
479
553
|
max?: number;
|
|
554
|
+
period?: number;
|
|
555
|
+
responseSeconds?: number;
|
|
556
|
+
missing?: 'hold' | 'rest' | 'hide';
|
|
480
557
|
}[];
|
|
558
|
+
derived?: Record<string, {
|
|
559
|
+
op: 'add' | 'subtract' | 'multiply' | 'divide' | 'min' | 'max' | 'clamp' | 'abs' | 'sqrt' | 'floor' | 'modulo' | 'sin' | 'cos' | 'atan2' | 'less' | 'greater' | 'equal' | 'and' | 'or' | 'not' | 'if' | 'coalesce';
|
|
560
|
+
args: (number | string)[];
|
|
561
|
+
}>;
|
|
481
562
|
};
|
|
482
563
|
animation?: {
|
|
483
564
|
sources?: Record<string, {
|
|
@@ -487,15 +568,22 @@ export type BoatData = {
|
|
|
487
568
|
bindings: {
|
|
488
569
|
node: string;
|
|
489
570
|
source: string;
|
|
490
|
-
property: 'rotation' | 'position';
|
|
491
|
-
axis
|
|
571
|
+
property: 'rotation' | 'position' | 'visible';
|
|
572
|
+
axis?: 'x' | 'y' | 'z';
|
|
492
573
|
scale?: number;
|
|
493
574
|
offset?: number;
|
|
494
575
|
keys?: [number, number][];
|
|
495
576
|
ease?: 'linear' | 'smooth';
|
|
496
577
|
min?: number;
|
|
497
578
|
max?: number;
|
|
579
|
+
period?: number;
|
|
580
|
+
responseSeconds?: number;
|
|
581
|
+
missing?: 'hold' | 'rest' | 'hide';
|
|
498
582
|
}[];
|
|
583
|
+
derived?: Record<string, {
|
|
584
|
+
op: 'add' | 'subtract' | 'multiply' | 'divide' | 'min' | 'max' | 'clamp' | 'abs' | 'sqrt' | 'floor' | 'modulo' | 'sin' | 'cos' | 'atan2' | 'less' | 'greater' | 'equal' | 'and' | 'or' | 'not' | 'if' | 'coalesce';
|
|
585
|
+
args: (number | string)[];
|
|
586
|
+
}>;
|
|
499
587
|
};
|
|
500
588
|
};
|
|
501
589
|
color?: string;
|
|
@@ -601,8 +689,12 @@ export type EnvironmentData = {
|
|
|
601
689
|
moonIntensity?: number;
|
|
602
690
|
dayAmbient?: number;
|
|
603
691
|
nightAmbient?: number;
|
|
692
|
+
skyLightSaturation?: number;
|
|
604
693
|
castShadow?: boolean;
|
|
605
694
|
};
|
|
695
|
+
dome?: {
|
|
696
|
+
brightness?: number;
|
|
697
|
+
};
|
|
606
698
|
stars?: {
|
|
607
699
|
enabled?: boolean;
|
|
608
700
|
magnitudeLimit?: number;
|
|
@@ -645,8 +737,12 @@ export type EnvironmentData = {
|
|
|
645
737
|
moonIntensity?: number;
|
|
646
738
|
dayAmbient?: number;
|
|
647
739
|
nightAmbient?: number;
|
|
740
|
+
skyLightSaturation?: number;
|
|
648
741
|
castShadow?: boolean;
|
|
649
742
|
};
|
|
743
|
+
dome?: {
|
|
744
|
+
brightness?: number;
|
|
745
|
+
};
|
|
650
746
|
stars?: {
|
|
651
747
|
enabled?: boolean;
|
|
652
748
|
magnitudeLimit?: number;
|
|
@@ -838,7 +934,7 @@ export type LocalTransformData = {
|
|
|
838
934
|
scale?: [number, number, number];
|
|
839
935
|
teleport?: boolean;
|
|
840
936
|
};
|
|
841
|
-
/** Bind same-entity simulation fields
|
|
937
|
+
/** Bind same-entity simulation fields and named numeric expressions to GLB transforms and visibility. Supports calibration, cyclic needles and timed response. Visual only; no physics writes. */
|
|
842
938
|
export type ModelSignalsData = {
|
|
843
939
|
sources: Record<string, {
|
|
844
940
|
component: string;
|
|
@@ -847,15 +943,22 @@ export type ModelSignalsData = {
|
|
|
847
943
|
bindings: {
|
|
848
944
|
node: string;
|
|
849
945
|
source: string;
|
|
850
|
-
property: 'rotation' | 'position';
|
|
851
|
-
axis
|
|
946
|
+
property: 'rotation' | 'position' | 'visible';
|
|
947
|
+
axis?: 'x' | 'y' | 'z';
|
|
852
948
|
scale?: number;
|
|
853
949
|
offset?: number;
|
|
854
950
|
keys?: [number, number][];
|
|
855
951
|
ease?: 'linear' | 'smooth';
|
|
856
952
|
min?: number;
|
|
857
953
|
max?: number;
|
|
954
|
+
period?: number;
|
|
955
|
+
responseSeconds?: number;
|
|
956
|
+
missing?: 'hold' | 'rest' | 'hide';
|
|
858
957
|
}[];
|
|
958
|
+
derived?: Record<string, {
|
|
959
|
+
op: 'add' | 'subtract' | 'multiply' | 'divide' | 'min' | 'max' | 'clamp' | 'abs' | 'sqrt' | 'floor' | 'modulo' | 'sin' | 'cos' | 'atan2' | 'less' | 'greater' | 'equal' | 'and' | 'or' | 'not' | 'if' | 'coalesce';
|
|
960
|
+
args: (number | string)[];
|
|
961
|
+
}>;
|
|
859
962
|
};
|
|
860
963
|
/** Mount points in local meters, ordered safe exit candidates, and interaction reach. Seat position is the rider camera anchor. */
|
|
861
964
|
export type MountableData = {
|
|
@@ -989,6 +1092,8 @@ export type VehicleData = {
|
|
|
989
1092
|
color: string;
|
|
990
1093
|
spec: {
|
|
991
1094
|
label: string;
|
|
1095
|
+
bodyStyle?: 'city' | 'hatchback' | 'sedan' | 'fastback' | 'coupe' | 'roadster' | 'wagon' | 'crossover' | 'suv' | 'offroad' | 'pickup' | 'van' | 'cargo-van' | 'box-truck' | 'motorhome' | 'bus' | 'light-rail' | 'bicycle' | 'motorcycle' | 'scooter';
|
|
1096
|
+
genericLabel?: string;
|
|
992
1097
|
width: number;
|
|
993
1098
|
length: number;
|
|
994
1099
|
height: number;
|
|
@@ -1048,15 +1153,22 @@ export type VehicleData = {
|
|
|
1048
1153
|
bindings: {
|
|
1049
1154
|
node: string;
|
|
1050
1155
|
source: string;
|
|
1051
|
-
property: 'rotation' | 'position';
|
|
1052
|
-
axis
|
|
1156
|
+
property: 'rotation' | 'position' | 'visible';
|
|
1157
|
+
axis?: 'x' | 'y' | 'z';
|
|
1053
1158
|
scale?: number;
|
|
1054
1159
|
offset?: number;
|
|
1055
1160
|
keys?: [number, number][];
|
|
1056
1161
|
ease?: 'linear' | 'smooth';
|
|
1057
1162
|
min?: number;
|
|
1058
1163
|
max?: number;
|
|
1164
|
+
period?: number;
|
|
1165
|
+
responseSeconds?: number;
|
|
1166
|
+
missing?: 'hold' | 'rest' | 'hide';
|
|
1059
1167
|
}[];
|
|
1168
|
+
derived?: Record<string, {
|
|
1169
|
+
op: 'add' | 'subtract' | 'multiply' | 'divide' | 'min' | 'max' | 'clamp' | 'abs' | 'sqrt' | 'floor' | 'modulo' | 'sin' | 'cos' | 'atan2' | 'less' | 'greater' | 'equal' | 'and' | 'or' | 'not' | 'if' | 'coalesce';
|
|
1170
|
+
args: (number | string)[];
|
|
1171
|
+
}>;
|
|
1060
1172
|
};
|
|
1061
1173
|
animation?: {
|
|
1062
1174
|
sources?: Record<string, {
|
|
@@ -1066,15 +1178,22 @@ export type VehicleData = {
|
|
|
1066
1178
|
bindings: {
|
|
1067
1179
|
node: string;
|
|
1068
1180
|
source: string;
|
|
1069
|
-
property: 'rotation' | 'position';
|
|
1070
|
-
axis
|
|
1181
|
+
property: 'rotation' | 'position' | 'visible';
|
|
1182
|
+
axis?: 'x' | 'y' | 'z';
|
|
1071
1183
|
scale?: number;
|
|
1072
1184
|
offset?: number;
|
|
1073
1185
|
keys?: [number, number][];
|
|
1074
1186
|
ease?: 'linear' | 'smooth';
|
|
1075
1187
|
min?: number;
|
|
1076
1188
|
max?: number;
|
|
1189
|
+
period?: number;
|
|
1190
|
+
responseSeconds?: number;
|
|
1191
|
+
missing?: 'hold' | 'rest' | 'hide';
|
|
1077
1192
|
}[];
|
|
1193
|
+
derived?: Record<string, {
|
|
1194
|
+
op: 'add' | 'subtract' | 'multiply' | 'divide' | 'min' | 'max' | 'clamp' | 'abs' | 'sqrt' | 'floor' | 'modulo' | 'sin' | 'cos' | 'atan2' | 'less' | 'greater' | 'equal' | 'and' | 'or' | 'not' | 'if' | 'coalesce';
|
|
1195
|
+
args: (number | string)[];
|
|
1196
|
+
}>;
|
|
1078
1197
|
};
|
|
1079
1198
|
};
|
|
1080
1199
|
};
|
|
@@ -1123,6 +1242,8 @@ export type WaterData = {
|
|
|
1123
1242
|
/** Singleton physical atmosphere and visual weather: temperature, pressure, humidity, wind, independent cloud cover, precipitation and visibility. Readable by scripts and physics; see guide/weather.md. */
|
|
1124
1243
|
export type WeatherData = {
|
|
1125
1244
|
atmosphere?: {
|
|
1245
|
+
model?: 'standard' | 'isothermal';
|
|
1246
|
+
moistAir?: boolean;
|
|
1126
1247
|
temperatureK?: number;
|
|
1127
1248
|
pressurePa?: number;
|
|
1128
1249
|
relativeHumidity?: number;
|