@margoengine/scenes 0.0.0-stage → 1.0.0

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 (48) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +4 -0
  3. package/README.md +619 -2
  4. package/dist/dune-coast-info-D9yQIv8G.js +218 -0
  5. package/dist/dune-coast-info.d.ts +3 -0
  6. package/dist/dune-coast.d.ts +179 -0
  7. package/dist/dune-coast.js +778 -0
  8. package/dist/errors-fc4i1pSL.js +7 -0
  9. package/dist/fauld-blast.d.ts +165 -0
  10. package/dist/fauld-blast.js +1034 -0
  11. package/dist/fauld-countryside.d.ts +13 -0
  12. package/dist/fauld-countryside.js +10 -0
  13. package/dist/fauld-crater.d.ts +13 -0
  14. package/dist/fauld-crater.js +10 -0
  15. package/dist/fauld-dig.d.ts +89 -0
  16. package/dist/fauld-dustfall-fines-grid-MA6XPrq6.js +14 -0
  17. package/dist/fauld-dustfall-fines-grid.d.ts +11 -0
  18. package/dist/fauld-dustfall-grid-Bb4X8b-u.js +14 -0
  19. package/dist/fauld-dustfall-grid.d.ts +11 -0
  20. package/dist/fauld-explosion.d.ts +135 -0
  21. package/dist/fauld-grains.d.ts +27 -0
  22. package/dist/fauld-mud.d.ts +104 -0
  23. package/dist/fauld-surge.d.ts +71 -0
  24. package/dist/fauld-tunnels-info-8qv9X4OJ.js +70 -0
  25. package/dist/fauld-tunnels-info.d.ts +5 -0
  26. package/dist/fauld-tunnels-plan.d.ts +1069 -0
  27. package/dist/fauld-tunnels.d.ts +281 -0
  28. package/dist/fauld-tunnels.js +6801 -0
  29. package/dist/fauld-world-CNNSonJF.js +863 -0
  30. package/dist/fauld-world-info.d.ts +7 -0
  31. package/dist/fauld-world.d.ts +243 -0
  32. package/dist/index.d.ts +53 -0
  33. package/dist/index.js +160 -0
  34. package/dist/library-mesh-CjTG-mVZ.js +329 -0
  35. package/dist/library-mesh.d.ts +108 -0
  36. package/dist/library-parts.d.ts +55 -0
  37. package/dist/library.d.ts +52 -0
  38. package/dist/library.js +48 -0
  39. package/dist/look-family.d.ts +63 -0
  40. package/dist/look-family.js +57 -0
  41. package/dist/shared/settings.d.ts +89 -0
  42. package/dist/shot-settings.d.ts +40 -0
  43. package/dist/shot-settings.js +94 -0
  44. package/dist/timber-valley-info-vVI2nwDs.js +253 -0
  45. package/dist/timber-valley-info.d.ts +3 -0
  46. package/dist/timber-valley.d.ts +229 -0
  47. package/dist/timber-valley.js +424 -0
  48. package/package.json +104 -4
@@ -0,0 +1,104 @@
1
+ import type { DamBreach } from '@margoengine/physics/breach';
2
+ import type { CraterSolver } from '@margoengine/physics/crater';
3
+ import type { GranularFlowSolver } from '@margoengine/physics/granular-flow';
4
+ import type { PhysicsWorld } from '@margoengine/physics/world';
5
+ /** The reservoir: what it held and how its bank stands. */
6
+ export declare const FAULD_RESERVOIR: Readonly<{
7
+ /** The water in it, m^3: six million imperial gallons. */
8
+ volume: 27300;
9
+ /** Its stage-storage power: 1, a pond with steep sides (27,300 m^3 at 8 m is 3,410 m^2, the mapped 58 by 58 m). */
10
+ exponent: 1;
11
+ /** The bank's length across the pond, m. */
12
+ length: 58;
13
+ /** The bank's height over its toe, m. */
14
+ bank: 8;
15
+ /** The blast's cut through the bank at the mud's start: its bottom over the toe and its width, m. */
16
+ cut: {
17
+ bottom: number;
18
+ width: number;
19
+ };
20
+ /** The breach it widens to, m, and over how long, s (a prescribed breach: the blast, not erosion, opened it). */
21
+ breach: {
22
+ width: number;
23
+ sideSlope: number;
24
+ time: number;
25
+ };
26
+ }>;
27
+ /** The mud as it runs: its density, its friction, the water in its pores and what it picks up from the slope. */
28
+ export declare const FAULD_MUD: Readonly<{
29
+ density: 1800;
30
+ friction: 0.1;
31
+ poreSupport: 0.7;
32
+ turbulence: 500;
33
+ /** McDougall and Hungr's growth rate per metre and the depth of loose soil it can take, m. */
34
+ entrainment: {
35
+ growth: number;
36
+ depth: number;
37
+ };
38
+ /** The mud's sediment for Water's tint, kg/m^3 (42 percent solids by volume at 2,650 kg/m^3). */
39
+ concentration: number;
40
+ }>;
41
+ /** A grid of the mud on the ground: its cells across, the corner it starts at and its size, m. */
42
+ export interface FauldMudGrid {
43
+ readonly cells: number;
44
+ readonly origin: readonly [number, number];
45
+ readonly size: readonly [number, number];
46
+ }
47
+ /** What Water's renderer reads: the grid and a sample of the mud's depth, surface and velocity at a point. */
48
+ export interface FauldMudSurface {
49
+ readonly shape: {
50
+ readonly columns: number;
51
+ readonly rows: number;
52
+ readonly width: number;
53
+ readonly depth: number;
54
+ readonly centre: readonly [number, number];
55
+ };
56
+ sample(x: number, z: number, out: {
57
+ depth: number;
58
+ surface: number;
59
+ velocity: [number, number];
60
+ }): {
61
+ depth: number;
62
+ surface: number;
63
+ velocity: [number, number];
64
+ };
65
+ }
66
+ /** The mud in the scene: its world, breach and flow, its film time and the renderer's views of it. */
67
+ export interface FauldMudFlow {
68
+ readonly world: PhysicsWorld;
69
+ readonly breach: DamBreach;
70
+ readonly flow: GranularFlowSolver;
71
+ /** With `blasts`: the crater EARTH-06 digs, whose zones break the bank. */
72
+ readonly crater: CraterSolver | undefined;
73
+ /** Film seconds the mud stands at. */
74
+ readonly time: number;
75
+ /** Moves the mud to film second `t`, back to the snapshot before it and on, or on from where it is. */
76
+ seek(t: number): void;
77
+ readonly surface: FauldMudSurface;
78
+ readonly sediment: {
79
+ readonly concentrationSize: readonly [number, number];
80
+ copyConcentrations(out: Float32Array): void;
81
+ };
82
+ }
83
+ /** A release of the store: its film second, its place [x, z] m from the crater and its TNT equivalent, kg. */
84
+ export interface FauldMudBlast {
85
+ readonly at: number;
86
+ readonly at_: readonly [number, number];
87
+ readonly tnt: number;
88
+ }
89
+ /**
90
+ * Builds the reservoir and its mud on `grid` over the ground `height(x, z)`: its outlet `outlet` [x, z] on the slope below
91
+ * and the way `toward` [x, z] the mud is sent off. With `blasts` and the pond's centre `pond` [x, z], the store's releases go
92
+ * off as one buried charge (FIRE-05) whose crater EARTH-06 digs, and the side of the pond's ring bank nearest it fails by
93
+ * the crater's zones (HYDRO-05): cracked inside 2.5 crater radii, it pipes, and the breach grows by Froehlich's law.
94
+ * Without, the bank is cut at film second `at`.
95
+ */
96
+ export declare function fauldMud({ height, grid, outlet, toward, at, blasts, pond, }: {
97
+ readonly height: (x: number, z: number) => number;
98
+ readonly grid: FauldMudGrid;
99
+ readonly outlet: readonly [number, number];
100
+ readonly toward: readonly [number, number];
101
+ readonly at?: number;
102
+ readonly blasts?: readonly FauldMudBlast[];
103
+ readonly pond?: readonly [number, number];
104
+ }): Promise<FauldMudFlow>;
@@ -0,0 +1,71 @@
1
+ import type { TerrainBed } from '@margoengine/physics/earth';
2
+ import type { ExplosionSolver } from '@margoengine/physics/explosive';
3
+ import type { GravityCurrentSolver } from '@margoengine/physics/gravity-current';
4
+ import type { PhysicsWorld } from '@margoengine/physics/world';
5
+ import { DustCurrent } from '@margoengine/vfx/dust-current';
6
+ /** The surge's dust and its ground: silt from the mudstone (50 micrometres, 2,650 kg/m^3, as the solver was calibrated). */
7
+ export declare const FAULD_SURGE: Readonly<{
8
+ grain: Readonly<{
9
+ diameter: 0.00005;
10
+ density: 2650;
11
+ }>;
12
+ /** The patch of ground it runs on: cells across and its size, m, centred on the crater. */
13
+ cells: 96;
14
+ size: 3200;
15
+ }>;
16
+ /** A release of the store: its film second, its place [x, z] m from the crater and its TNT equivalent, kg. */
17
+ export interface FauldSurgeBlast {
18
+ readonly at: number;
19
+ readonly at_: readonly [number, number];
20
+ readonly tnt: number;
21
+ }
22
+ /** The surge at a point: its depth, m, its dust's volume fraction, its velocity [x, z], m/s, and its dust's optical depth. */
23
+ export interface FauldSurgeSample {
24
+ depth: number;
25
+ dust: number;
26
+ velocity: [number, number];
27
+ opacity: number;
28
+ }
29
+ /** The base surge in the scene: its world and solvers, its film time and views of it. */
30
+ export interface FauldSurgeFlow {
31
+ readonly world: PhysicsWorld;
32
+ readonly charge: ExplosionSolver;
33
+ readonly bed: TerrainBed;
34
+ readonly current: GravityCurrentSolver;
35
+ /** The ground's grid: cells across, its size, m, and its centre [x, z]. */
36
+ readonly shape: {
37
+ readonly columns: number;
38
+ readonly rows: number;
39
+ readonly width: number;
40
+ readonly depth: number;
41
+ readonly centre: readonly [number, number];
42
+ };
43
+ /** Film seconds the surge stands at. */
44
+ readonly time: number;
45
+ /** Moves the surge to film second `t`, back to the snapshot before it and on, or on from where it is. */
46
+ seek(t: number): void;
47
+ /** The surge at (x, z), m, into `out`. */
48
+ sample(x: number, z: number, out: FauldSurgeSample): FauldSurgeSample;
49
+ /** The dust laid on the ground at (x, z) so far, m (the bed's rise over the ground). */
50
+ deposit(x: number, z: number): number;
51
+ }
52
+ /**
53
+ * Builds the base surge over the ground `height(x, z)` from the store's releases `blasts`.
54
+ * @example
55
+ * const surge = await fauldSurge({ height: world.height, blasts: FAULD_BLASTS });
56
+ * surge.seek(40);
57
+ * surge.sample(600, 0, { depth: 0, dust: 0, velocity: [0, 0], opacity: 0 }).opacity;
58
+ */
59
+ export declare function fauldSurge({ height, blasts, }: {
60
+ readonly height: (x: number, z: number) => number;
61
+ readonly blasts: readonly FauldSurgeBlast[];
62
+ }): Promise<FauldSurgeFlow>;
63
+ /**
64
+ * The surge drawn as dust: a `DustCurrent` of @margoengine/vfx/dust-current over its grid, a puff for each visible patch
65
+ * standing on `height(x, z)`. Draw it into the scene's smoke `Clouds` after each `surge.seek`.
66
+ * @example
67
+ * const dust = fauldSurgeDust(surge, world.height);
68
+ * surge.seek(40);
69
+ * dust.draw(smoke);
70
+ */
71
+ export declare function fauldSurgeDust(surge: FauldSurgeFlow, height: (x: number, z: number) => number): DustCurrent;
@@ -0,0 +1,70 @@
1
+ //#region src/fauld-tunnels-info.ts
2
+ var e = [
3
+ "working",
4
+ "blast",
5
+ "fire",
6
+ "after",
7
+ "flooded",
8
+ "sealed",
9
+ "yard_day",
10
+ "yard_night",
11
+ "yard_fire",
12
+ "yard_sealed"
13
+ ], t = {
14
+ name: "fauld-tunnels",
15
+ title: "The Fauld bomb store (RAF Fauld, 21 MU, Staffordshire, November 1944)",
16
+ about: "The underground bomb store in the old gypsum mine at Fauld: a main drift 240 m into the hill under steel arch ribs and corrugated sheet on whitewashed piers, side bays of 1,000 lb bombs stacked on timber baulks behind brick blast walls, 2 ft narrow gauge rails with trolleys, a work bay with bench and fuzing cradle, an SAA box bay, and the old pillar-and-stall gypsum roadway beside it; lit by caged bulkhead lamps on the mains, by hand lamps after the explosion, or by fire. The portal yard outside by day or night. Every model is a library glTF with its PBR maps (the asset library, never in the repository).",
17
+ entry: "@margoengine/scenes/fauld-tunnels",
18
+ settings: {
19
+ state: {
20
+ default: "working",
21
+ options: e,
22
+ about: "working (mains lamps, 27 November 1944 before 11:11), blast (the flash), fire, after (hand lamps, smoke clearing), flooded, sealed (the 1944 walls), and the portal yard by day, night, in the fire, sealed"
23
+ },
24
+ time: {
25
+ default: 0,
26
+ range: [0, 600],
27
+ unit: "s",
28
+ about: "seconds of the state (smoke, fire and dust move with it)"
29
+ },
30
+ quality: {
31
+ default: "film",
32
+ options: ["film", "preview"],
33
+ about: "shadow map size and fog grid"
34
+ },
35
+ library: {
36
+ default: "/asset-library/",
37
+ about: "URL root of the asset library (fauld-1944 and big-burn-1910 subjects)"
38
+ }
39
+ },
40
+ presets: {
41
+ working: { state: "working" },
42
+ rescue: { state: "fire" },
43
+ today: { state: "sealed" }
44
+ },
45
+ anchors: [
46
+ "portal",
47
+ "racks",
48
+ "stacks",
49
+ "stacks2",
50
+ "bays",
51
+ "vault",
52
+ "junction",
53
+ "roadway",
54
+ "bench",
55
+ "cradle",
56
+ "desk",
57
+ "water"
58
+ ],
59
+ views: [
60
+ "portal",
61
+ "drift",
62
+ "bays",
63
+ "vault",
64
+ "roadway",
65
+ "workbay"
66
+ ],
67
+ looks: ["natural"]
68
+ };
69
+ //#endregion
70
+ export { t as n, e as t };
@@ -0,0 +1,5 @@
1
+ import type { SceneInfo } from './index.js';
2
+ /** The lighting states of the store, each one rig and one metered exposure (the scene's `state` setting). */
3
+ export declare const FAULD_TUNNEL_STATES: readonly ['working', 'blast', 'fire', 'after', 'flooded', 'sealed', 'yard_day', 'yard_night', 'yard_fire', 'yard_sealed'];
4
+ /** The catalogue entry of this scene. */
5
+ export declare const fauldTunnelsInfo: SceneInfo;