@adatechnology/game-destruction-three 0.24.4 → 0.26.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.
- package/README.md +95 -1
- package/dist/ground-worker.global.js +826 -0
- package/dist/ground-worker.global.js.map +1 -0
- package/dist/ground-worker.js +823 -0
- package/dist/ground-worker.js.map +1 -0
- package/dist/index.d.ts +681 -6
- package/dist/index.global.js +18362 -2934
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +7132 -503
- package/dist/index.js.map +1 -1
- package/dist/worker-kinds.d.ts +99 -0
- package/dist/worker-kinds.js +924 -0
- package/dist/worker-kinds.js.map +1 -0
- package/package.json +22 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,299 @@
|
|
|
1
|
-
import { Fragment, Vec3, DebrisKind, HitResult, DestructionWorld, MaterialId, DestructibleSpec, MaterialDef, DamageType } from '@adatechnology/game-destruction';
|
|
1
|
+
import { Fragment, Vec3, DebrisKind, HitResult, DestructionWorld, MaterialId, DestructibleSpec, MaterialDef, DestructionEvent, BlastOptions, DamageType } from '@adatechnology/game-destruction';
|
|
2
2
|
export { Quat, Vec3 } from '@adatechnology/game-destruction';
|
|
3
|
-
import { DeferredQueue, WarmUpProbes, BlastShoveOptions, Vec3 as Vec3$1 } from '@adatechnology/game-contracts';
|
|
3
|
+
import { WorkerCoordinator, KitOrigin, DeferredQueue, DeferredQueueOptions, WarmUpProbes, BlastShoveOptions, TaskKind, Vec3 as Vec3$1 } from '@adatechnology/game-contracts';
|
|
4
|
+
import { HeightPatch } from '@adatechnology/game-terrain';
|
|
5
|
+
import { WorkerLike, WorkerScopeLike } from '@adatechnology/game-shapes';
|
|
4
6
|
import * as THREE_NS from 'three';
|
|
7
|
+
import { WorkBudgetOptions, PhysicsLoop, SeamWorld, PhysicsEngine, WorldDesc, Quat } from '@adatechnology/game-physics';
|
|
8
|
+
export { DEFAULT_WORK_BUDGET_MS, isPhysicsLoop, physicsPieceCount } from '@adatechnology/game-physics';
|
|
5
9
|
import { VfxWorld, SpriteKind } from '@adatechnology/game-vfx';
|
|
6
|
-
import { LoopRecipe, SoundBank, SoundRecipe, Falloff, AudioEngine, SampleDefaults, SfxManifest } from '@adatechnology/game-audio';
|
|
10
|
+
import { LoopRecipe, SoundBank, SoundRecipe, Falloff, AudioEngine, VoiceGroup, SampleDefaults, SfxManifest } from '@adatechnology/game-audio';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The ground over a lattice in one pass: the height at (`xs[i]`, `zs[j]`) into `out[j * xs.length + i]`, to the bit what the tile's `groundAt` answers at each point
|
|
14
|
+
* (`Terrain.heightGrid` is one). A tile reads its 26 000 samples through it instead of a call each.
|
|
15
|
+
*/
|
|
16
|
+
type GroundGrid = (xs: ArrayLike<number>, zs: ArrayLike<number>, out: Float64Array) => void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A tile of the engine's ground as plain data, so it can be made off the main thread (`engine-ground-port`): the main thread reads the tile's samples and the band of ground
|
|
20
|
+
* past its edges its solid may read (`readGroundBand`), and the tile is a pure function of those (`computeGroundTile`), the same bits wherever it runs. Nothing here calls back
|
|
21
|
+
* into the host: a worker has no `groundAt`.
|
|
22
|
+
*/
|
|
23
|
+
/** What a tile is made from: its samples (`readGround`) and the band past its edges (`readGroundBand`), both read on the main thread at the frame it was asked for. */
|
|
24
|
+
interface GroundTileJob {
|
|
25
|
+
readonly id: number;
|
|
26
|
+
readonly x0: number;
|
|
27
|
+
readonly z0: number;
|
|
28
|
+
readonly size: number;
|
|
29
|
+
/** Whether the tile collided on the coarse field before (`collisionFieldOf`). */
|
|
30
|
+
readonly wasCoarse: boolean;
|
|
31
|
+
/** Empty in a patch job (`patch`), whose samples and band are made where the tile is. */
|
|
32
|
+
readonly samples: Float64Array;
|
|
33
|
+
readonly band: Float64Array;
|
|
34
|
+
/**
|
|
35
|
+
* The terrain's vertices under the tile and its ring (`readGroundPatch`), in place of the samples and the band: about 26 x 26 numbers instead of 60 000. The tile is made from
|
|
36
|
+
* the samples and band the patch gives (`heightPatchGrid`, the terrain's own blend), the same bits as read from the terrain on the main thread.
|
|
37
|
+
*/
|
|
38
|
+
readonly patch?: HeightPatch;
|
|
39
|
+
}
|
|
40
|
+
/** A tile made from a job, as arrays that cross threads; `samples` and `band` are the job's own, handed back for the next job. */
|
|
41
|
+
interface GroundTileResult {
|
|
42
|
+
readonly id: number;
|
|
43
|
+
readonly cells: number;
|
|
44
|
+
readonly collisionCells: number;
|
|
45
|
+
readonly level: number | null;
|
|
46
|
+
readonly heights: Float32Array;
|
|
47
|
+
readonly collision: Float32Array;
|
|
48
|
+
readonly boxes: Float64Array;
|
|
49
|
+
readonly solid: Float64Array;
|
|
50
|
+
readonly ring: Float64Array;
|
|
51
|
+
readonly samples: Float64Array;
|
|
52
|
+
readonly band: Float64Array;
|
|
53
|
+
/** A patch job's vertex heights, handed back for the next job. */
|
|
54
|
+
readonly patch?: Float64Array;
|
|
55
|
+
}
|
|
56
|
+
/** The length of the band of a tile of `size` m: one height per half cell over the tile and its ring (`GroundSource`). */
|
|
57
|
+
declare const bandLength: (size: number) => number;
|
|
58
|
+
/**
|
|
59
|
+
* Reads into `band` the ground past the tile's edges, as far as its solid may read it (`SOLID_RING`) and on the edges themselves: every half cell `(a, b)` with `a` or `b` on or
|
|
60
|
+
* past an edge, at the very point the ring asks `groundAt` for (`x0 + (a / 2) * cell`). Through `grid` in four strips, else a call each. The tile's inside is left as it was.
|
|
61
|
+
*/
|
|
62
|
+
declare const readGroundBand: (groundAt: (x: number, z: number) => number, band: Float64Array, x0: number, z0: number, size: number, grid?: GroundGrid) => void;
|
|
63
|
+
/** The host's terrain as vertex heights under a rectangle (min x, max x, min z, max z), or null where it cannot (`Terrain.heightPatch` is one); written into `into` when long enough. */
|
|
64
|
+
type GroundPatchRead = (minX: number, maxX: number, minZ: number, maxZ: number, into?: Float64Array) => HeightPatch | null;
|
|
65
|
+
/**
|
|
66
|
+
* The terrain's vertices under the tile at (x0, z0) and its ring, the rectangle every sample and band point lies in (the band's own outermost points, as `readGroundBand` computes
|
|
67
|
+
* them); null where the host has none (a tile crossing the terrain's bounds, where its `baseHeight` answers): that tile is read as before.
|
|
68
|
+
*/
|
|
69
|
+
declare const readGroundPatch: (read: GroundPatchRead, x0: number, z0: number, size: number, into?: Float64Array) => HeightPatch | null;
|
|
70
|
+
/**
|
|
71
|
+
* The tile a job makes: `shapeGround` of its samples and, under a height field, its solid over the band (both made from its patch first, in a patch job). Pure of the job.
|
|
72
|
+
* Not reentrant: a patch job's samples and band, and `readGround`'s lattice, are module scratch (one job at a time per thread, as a worker and the schedule run them).
|
|
73
|
+
*/
|
|
74
|
+
declare const computeGroundTile: (job: GroundTileJob) => GroundTileResult;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Where the engine's ground tiles are made (`RendererOptions.groundWorker`): the main thread posts a job (`GroundTileJob`, plain arrays, transferred) and takes the tile back
|
|
78
|
+
* when it comes. The engine applies a tile exactly `groundWorkerFrames` updates after it asked for it, from the answer if it came, else made on the main thread from the same
|
|
79
|
+
* job: the answer is the same bits either way, so when it comes changes nothing but where the work ran (`GroundSchedule`).
|
|
80
|
+
*
|
|
81
|
+
* - `transfer`: the game's worker coordinator (`createCoordinatorGroundPort`, the `destruction.ground-tiles` kind, CLAUDE.md §14), or a
|
|
82
|
+
* worker of the host's (`createWorkerGroundPort`, over game-shapes' `WorkerLike`); the answer comes whenever its event loop delivers it.
|
|
83
|
+
* - `inline`: this thread, at once when posted (`createInlineGroundPort`): tests, Node.
|
|
84
|
+
* - `none`: never answers and nothing is posted (`createMainThreadGroundPort`): every tile made on the main thread at its frame, the reference the other two match.
|
|
85
|
+
*/
|
|
86
|
+
interface GroundWorkerPort {
|
|
87
|
+
/** May turn `none` later (a worker that failed): read it at each job. */
|
|
88
|
+
readonly transport: 'transfer' | 'inline' | 'none';
|
|
89
|
+
/** Takes the job's arrays (they may be transferred: not to be read after). */
|
|
90
|
+
postTile(job: GroundTileJob): void;
|
|
91
|
+
/** The one handler the answers go to. */
|
|
92
|
+
onTile(handler: (result: GroundTileResult) => void): void;
|
|
93
|
+
/** Stops the worker, if any; no answer comes after. */
|
|
94
|
+
dispose(): void;
|
|
95
|
+
}
|
|
96
|
+
declare const createInlineGroundPort: () => GroundWorkerPort;
|
|
97
|
+
declare const createMainThreadGroundPort: () => GroundWorkerPort;
|
|
98
|
+
/**
|
|
99
|
+
* A worker running `installGroundWorker` (the package's `ground-worker` entry): jobs and answers cross with their buffers transferred; `dispose` terminates it. A worker that
|
|
100
|
+
* fails (`onerror`: its script did not load, it threw) is posted nothing more: the port turns `none` and every tile is made on the main thread at its update, as it would have
|
|
101
|
+
* been anyway (game-shapes' pool fails its jobs the same way).
|
|
102
|
+
*/
|
|
103
|
+
declare const createWorkerGroundPort: (worker: WorkerLike) => GroundWorkerPort;
|
|
104
|
+
/**
|
|
105
|
+
* The tiles through the game's worker coordinator (CLAUDE.md §14): each job is a `destruction.ground-tiles` task the coordinator hands to a
|
|
106
|
+
* worker, awaited (the engine's `GroundSchedule` applies the tile at its update, from the answer if it came, else made here from the same
|
|
107
|
+
* job). A coordinator with no workers is posted nothing (`none`): every tile is made at its update, with no job run twice. The coordinator
|
|
108
|
+
* is the game's: `dispose` lets go of the answers, not of the workers. The job's arrays are transferred (the kind's `transferAwaitedInput`):
|
|
109
|
+
* `GroundSchedule` posts copies from its pool and keeps its own for the fallback. A job lost with its worker (it died holding it) is made here at
|
|
110
|
+
* its update and the next ones still go to the workers (the coordinator replaces a dying worker a few times, then lets it go: `none` when none
|
|
111
|
+
* is left); any other rejection (a worker that cannot run the kind) and nothing more is posted.
|
|
112
|
+
*/
|
|
113
|
+
declare const createCoordinatorGroundPort: (workers: WorkerCoordinator) => GroundWorkerPort;
|
|
114
|
+
/** The worker side: each job answered with its tile, every array transferred back (the job's own included, for the main thread's pool). */
|
|
115
|
+
declare const installGroundWorker: (scope: WorkerScopeLike) => void;
|
|
116
|
+
|
|
117
|
+
/** What happens to debris that is far from the player and old (`FarDebrisOptions.action`): it sleeps where it lies, or shrinks away and leaves the scene. Debris at rest is already drawn merged by `settledBatches`. */
|
|
118
|
+
type FarDebrisAction = 'sleep' | 'fade';
|
|
119
|
+
interface FarDebrisOptions {
|
|
120
|
+
/** Metres from `focus` past which debris is far. Default `BLAST_DEBRIS_DEFAULTS.far.distance`. */
|
|
121
|
+
distance?: number;
|
|
122
|
+
/** Seconds a piece must have lived to be old. Default `BLAST_DEBRIS_DEFAULTS.far.age`. */
|
|
123
|
+
age?: number;
|
|
124
|
+
/** What far and old debris at rest does. Default `'sleep'`. */
|
|
125
|
+
action?: FarDebrisAction;
|
|
126
|
+
/** Seconds a faded piece takes to shrink away once its body is gone. Default `BLAST_DEBRIS_DEFAULTS.far.fadeSeconds`. */
|
|
127
|
+
fadeSeconds?: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Everything the kit decides about the debris of a blast, each a number the host sets: per renderer (`RendererOptions.blastDebris`) or per explosion (`ExplodeOptions.debris`).
|
|
131
|
+
* None is a constant of the code; `BLAST_DEBRIS_DEFAULTS` is what was measured (spec 008, evidence T3.6d).
|
|
132
|
+
*/
|
|
133
|
+
interface BlastDebrisOptions {
|
|
134
|
+
/**
|
|
135
|
+
* Milliseconds the physics step may reach as the debris of blasts wakes: each frame wakes as many (nearest the player first, else the blast's centre) as the step cost measured
|
|
136
|
+
* on the frames before leaves room for under this. A frame of a woken pile costs more than the same pile asleep; nothing is timed per body.
|
|
137
|
+
*/
|
|
138
|
+
wakeCostTargetMs?: number;
|
|
139
|
+
/** Seconds a piece waits to wake at most, whatever the cost: the debris of a blast is all awake within tens of ms. */
|
|
140
|
+
maxWakeDelay?: number;
|
|
141
|
+
/** Pieces waiting to wake at most; the farthest over it wake at once. */
|
|
142
|
+
maxQueuedWakes?: number;
|
|
143
|
+
/** Pieces woken every frame at least, so a queue behind a heavy frame still drains. */
|
|
144
|
+
minWakesPerFrame?: number;
|
|
145
|
+
/** Fewest pieces of one blast that enter physics, whatever the cost (the count adapts between this and `maxPhysicsPieces`). */
|
|
146
|
+
minPhysicsPieces?: number;
|
|
147
|
+
/** Most pieces of one blast that enter physics. */
|
|
148
|
+
maxPhysicsPieces?: number;
|
|
149
|
+
/** Milliseconds of physics step the debris of one blast may add in the frame it wakes: the count is this over the wake cost measured per body. */
|
|
150
|
+
physicsCostTargetMs?: number;
|
|
151
|
+
/** Milliseconds one awake body costs a step, used until the world has been measured (`PhysicsFrame.stepMs`). */
|
|
152
|
+
physicsCostPerBodyMs?: number;
|
|
153
|
+
/** The same in the frame a pile wakes in (a woken island costs several times what it costs settled): what sizes the wake batches until measured. */
|
|
154
|
+
wakeCostPerBodyMs?: number;
|
|
155
|
+
/** Longest side (m) under which a loosened object is a chip: it goes after every big one when the blast's count is full. */
|
|
156
|
+
chipSize?: number;
|
|
157
|
+
/** Most loose pieces alive at once, asleep or not: over it the far and old ones go first (`far`). */
|
|
158
|
+
maxLivePieces?: number;
|
|
159
|
+
/** Which pieces are far and old, and what happens to them. They also go when the pieces alive pass `maxLivePieces`. */
|
|
160
|
+
far?: FarDebrisOptions;
|
|
161
|
+
}
|
|
162
|
+
interface ResolvedBlastDebris {
|
|
163
|
+
readonly wakeCostTargetMs: number;
|
|
164
|
+
readonly maxWakeDelay: number;
|
|
165
|
+
readonly maxQueuedWakes: number;
|
|
166
|
+
readonly minWakesPerFrame: number;
|
|
167
|
+
readonly minPhysicsPieces: number;
|
|
168
|
+
readonly maxPhysicsPieces: number;
|
|
169
|
+
readonly physicsCostTargetMs: number;
|
|
170
|
+
readonly physicsCostPerBodyMs: number;
|
|
171
|
+
readonly wakeCostPerBodyMs: number;
|
|
172
|
+
readonly chipSize: number;
|
|
173
|
+
readonly maxLivePieces: number;
|
|
174
|
+
readonly far: Required<FarDebrisOptions>;
|
|
175
|
+
}
|
|
176
|
+
/** Measured on "Intel Core Ultra 9 275HX, 24 cores, Node 20" (evidence T3.6d); an AMD or weaker range gets its own row after it is measured. */
|
|
177
|
+
declare const BLAST_DEBRIS_DEFAULTS: ResolvedBlastDebris;
|
|
178
|
+
/** The defaults with `options` over them: a number left out is the default. */
|
|
179
|
+
declare const resolveBlastDebris: (...layers: ReadonlyArray<BlastDebrisOptions | undefined>) => ResolvedBlastDebris;
|
|
180
|
+
/** What one frame's step cost: `PhysicsFrame.stepMs` and the bodies the world had awake. */
|
|
181
|
+
interface DebrisCostSample {
|
|
182
|
+
readonly stepMs: number;
|
|
183
|
+
readonly active: number;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Where the cost the debris policy adapts to comes from (`RendererOptions.debrisCost`). `measured` (the default, as the owner decided in D4) reads the loop's wall-clock step
|
|
187
|
+
* time, so the batch sizes and piece counts depend on the machine's speed; `record` collects each frame's sample. `fixed` never reads the clock: batches and counts come only
|
|
188
|
+
* from the configured numbers (`wakeCostTargetMs`, `physicsCostPerBodyMs`, `wakeCostPerBodyMs`...), the same on every machine (tests, lockstep). `replay` feeds a recorded list,
|
|
189
|
+
* frame by frame, in place of the clock, so a session recorded on one machine plays the same decisions on another.
|
|
190
|
+
*/
|
|
191
|
+
type DebrisCostOptions = {
|
|
192
|
+
readonly source: 'measured';
|
|
193
|
+
readonly record?: DebrisCostSample[];
|
|
194
|
+
} | {
|
|
195
|
+
readonly source: 'fixed';
|
|
196
|
+
} | {
|
|
197
|
+
readonly source: 'replay';
|
|
198
|
+
readonly samples: readonly DebrisCostSample[];
|
|
199
|
+
};
|
|
200
|
+
/** One push of a blast waiting its turn, as data (never a closure), so a save in the middle of a blast keeps it: the piece, the impulse and where it lands. */
|
|
201
|
+
interface BlastWake {
|
|
202
|
+
readonly objectId: string;
|
|
203
|
+
/** The body's `generation` when it was pushed: a piece removed and made again under the same id takes nothing. */
|
|
204
|
+
readonly generation: number;
|
|
205
|
+
readonly impulse: readonly [number, number, number];
|
|
206
|
+
readonly point: readonly [number, number, number];
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Work units (`WorkBudget`, 1 unit = 10 µs on the reference machine) each kind of the explosion's deferred work is charged. Every one is an estimate from the size of the work,
|
|
210
|
+
* never from what a cache holds: a split is charged as if none of its boxes were fitted ahead (spec 008, `design/orcamento-da-explosao.md` §7 D2), so the schedule does not
|
|
211
|
+
* depend on how far a fit ahead got.
|
|
212
|
+
*/
|
|
213
|
+
interface WorkUnitCosts {
|
|
214
|
+
/** Units of one split whatever its size (making the new object, its piece and its bookkeeping). */
|
|
215
|
+
readonly perSplit?: number;
|
|
216
|
+
/** Units per vertex of the loose group's meshes (its box fits and measure). */
|
|
217
|
+
readonly perVertex?: number;
|
|
218
|
+
/** Units per vertex of a merged mesh the group is cut out of (the host mesh is rebuilt, normals and all). */
|
|
219
|
+
readonly perHostVertex?: number;
|
|
220
|
+
/** Units per part of the object it is cut from (the world rebuilds both halves). */
|
|
221
|
+
readonly perObjectPart?: number;
|
|
222
|
+
/** Units per fragment spawned. */
|
|
223
|
+
readonly perFragment?: number;
|
|
224
|
+
/** Units charged per event applied (its effects show in the frame it happens, so it never waits; it only leaves less for the rest). */
|
|
225
|
+
readonly perEvent?: number;
|
|
226
|
+
/** Units per body woken from the blast's wake queue. */
|
|
227
|
+
readonly perWake?: number;
|
|
228
|
+
}
|
|
229
|
+
/** The frame budget of the explosion's work (`RendererOptions.workBudget`): the budget, the machine's tier, the frames a loose group may wait, and the unit costs. */
|
|
230
|
+
interface ExplosionWorkOptions extends WorkBudgetOptions {
|
|
231
|
+
readonly costs?: WorkUnitCosts;
|
|
232
|
+
}
|
|
233
|
+
/** First calibration on the main of 2026-11-15 (evidence T3.8aa); to be measured again on top of the box fits ahead, the batched bodies and the ground budget. */
|
|
234
|
+
declare const WORK_UNIT_DEFAULTS: Required<WorkUnitCosts>;
|
|
235
|
+
declare const resolveWorkUnitCosts: (costs: WorkUnitCosts | undefined) => Required<WorkUnitCosts>;
|
|
236
|
+
/** What a split is estimated to cost, in units, from the sizes of its work. */
|
|
237
|
+
declare const splitWorkUnits: (costs: Required<WorkUnitCosts>, size: {
|
|
238
|
+
readonly vertices: number;
|
|
239
|
+
readonly hostVertices: number;
|
|
240
|
+
readonly objectParts: number;
|
|
241
|
+
}) => number;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* The physics a seam is handed, always by its host and always spelled out: a `PhysicsLoop` (the host steps it; the seam registers phases), a world (the seam makes its own loop
|
|
245
|
+
* and steps it in its `update`), or `'own'` (the kit's own solver, until it goes).
|
|
246
|
+
*/
|
|
247
|
+
type PiecePhysics = PhysicsLoop | SeamWorld | 'own';
|
|
248
|
+
declare class PhysicsOptionError extends Error {
|
|
249
|
+
readonly code = "PHYSICS_OPTION";
|
|
250
|
+
constructor(message: string);
|
|
251
|
+
}
|
|
7
252
|
|
|
8
253
|
/** What a fragment's resting time can depend on: the fragment (its material, size, shape) and the id of the object it came from. */
|
|
9
254
|
type FragmentLifeRule = (fragment: Fragment, objectId: string) => number;
|
|
10
255
|
|
|
256
|
+
/** How the debris at rest is drawn in batches (`RendererOptions.settledBatches`). */
|
|
257
|
+
interface SettledBatchOptions {
|
|
258
|
+
/** Draw the debris at rest in batches (default true). */
|
|
259
|
+
readonly enabled?: boolean;
|
|
260
|
+
/** Debris meshes at rest outside a batch before the batches are made again (default 16). */
|
|
261
|
+
readonly minMeshes?: number;
|
|
262
|
+
/** Seconds at least between two makings of the batches (default 1). */
|
|
263
|
+
readonly intervalSeconds?: number;
|
|
264
|
+
/** Milliseconds of merging per update while the batches are made, with no frame budget running the queue (default 2): what is not merged yet draws on its own meanwhile. */
|
|
265
|
+
readonly budgetMs?: number;
|
|
266
|
+
/** Vertices of the largest mesh a batch takes (default 4000): a bigger one (a slab come down whole) draws on its own. */
|
|
267
|
+
readonly maxVertices?: number;
|
|
268
|
+
}
|
|
269
|
+
/** What the batches of the debris at rest hold now (`DestructionRenderer.settledBatchStats`). */
|
|
270
|
+
interface SettledBatchStats {
|
|
271
|
+
/** Draws of the batches: one per material, shadow and attribute set. */
|
|
272
|
+
readonly batches: number;
|
|
273
|
+
/** Debris meshes drawn by a batch instead of on their own. */
|
|
274
|
+
readonly batched: number;
|
|
275
|
+
}
|
|
276
|
+
declare const SETTLED_BATCH_DEFAULTS: Required<SettledBatchOptions>;
|
|
277
|
+
/** Where the batches come from when their meshes do not all come from one piece of the kit. */
|
|
278
|
+
declare const SETTLED_BATCH_ORIGIN: KitOrigin;
|
|
279
|
+
|
|
280
|
+
/** What the warm-up runs on: the engine whose body creation, compounds and ground it heats (without one, the kit's own solver), and the numbers of the throwaway world. */
|
|
281
|
+
interface JitWarmUpOptions {
|
|
282
|
+
readonly engine?: PhysicsEngine;
|
|
283
|
+
/** The world the engine makes for the warm-up (default `KIT_WORLD`: the same code runs as in the game's world). */
|
|
284
|
+
readonly world?: WorldDesc;
|
|
285
|
+
}
|
|
286
|
+
/** What the warm-up saw: the loose pieces the blast made at most, and the fragments (so a test can tell the paths ran). */
|
|
287
|
+
interface JitWarmUpReport {
|
|
288
|
+
readonly pieces: number;
|
|
289
|
+
readonly fragments: number;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Runs the first explosion once, off screen, so the code it needs is warm when the real one comes. Once per engine (and once for the kit's own solver): a second call is a
|
|
293
|
+
* no-op (`undefined`). `makeRenderer` is the renderer factory of the package, so the throwaway renderer is the real one.
|
|
294
|
+
*/
|
|
295
|
+
declare const warmUpDestructionJit: (THREE: ThreeNamespace, makeRenderer: (options: RendererOptions) => DestructionRenderer, options?: JitWarmUpOptions) => JitWarmUpReport | undefined;
|
|
296
|
+
|
|
11
297
|
/**
|
|
12
298
|
* Public types of @adatechnology/game-destruction-three.
|
|
13
299
|
*
|
|
@@ -38,6 +324,8 @@ interface SoundDetail {
|
|
|
38
324
|
readonly fuel?: 'wood' | 'fabric' | 'plastic' | 'gas' | 'liquid';
|
|
39
325
|
}
|
|
40
326
|
interface RendererOptions {
|
|
327
|
+
/** What steps the loose pieces; required, so a host never ends up on the kit's solver by forgetting it. See `PieceSystemOptions.physics`. */
|
|
328
|
+
physics: PiecePhysics;
|
|
41
329
|
/** Scene that receives fragments, loose pieces, decals and particles. */
|
|
42
330
|
scene: THREE_NS.Scene;
|
|
43
331
|
world: DestructionWorld;
|
|
@@ -45,12 +333,72 @@ interface RendererOptions {
|
|
|
45
333
|
quality?: Quality;
|
|
46
334
|
/** Upper bound of live fragment meshes (default 160; oldest fade first). */
|
|
47
335
|
maxFragments?: number;
|
|
336
|
+
/**
|
|
337
|
+
* Most loose pieces simulated at once (default no limit; a game loop starts from `SUGGESTED_MAX_AWAKE_PIECES`, 24). Over it the oldest pieces that have come to rest (on the
|
|
338
|
+
* ground, slower than a piece that sleeps, and one held up at an angle once it kept its tilt for 1.5 s) sleep where they lie at once; nothing is moved. With a limit, one held
|
|
339
|
+
* up at an angle that kept its tilt sleeps under it too (by itself it never does). One put to sleep so wakes as any other (hit, knocked) and when any point it lay on loses its
|
|
340
|
+
* support.
|
|
341
|
+
*/
|
|
342
|
+
maxAwakePieces?: number;
|
|
343
|
+
/** Most fragments moving at once (default no limit; `SUGGESTED_MAX_AWAKE_FRAGMENTS`, 64): over it the oldest at rest on what is under them sleep where they lie. */
|
|
344
|
+
maxAwakeFragments?: number;
|
|
345
|
+
/**
|
|
346
|
+
* Keep the pose of the step before the last for the pieces and fragments that are awake, to draw them between it and the step's (`present`). Default off: they are drawn at
|
|
347
|
+
* the step's pose, as always. The simulation never reads a drawn pose: `update` (and `restoreStepPose`) give the step pose back first.
|
|
348
|
+
*/
|
|
349
|
+
interpolate?: boolean;
|
|
350
|
+
/**
|
|
351
|
+
* Draw the debris at rest in batches, a draw per material (`SettledBatchOptions`; `{}` for the defaults). Omitted, every debris mesh draws on its own, as before. Only the
|
|
352
|
+
* drawing changes: the collision is each piece's own.
|
|
353
|
+
*/
|
|
354
|
+
settledBatches?: SettledBatchOptions;
|
|
48
355
|
/**
|
|
49
356
|
* Milliseconds of one `update` spent applying queued world events (default `Infinity`: every event is drawn
|
|
50
357
|
* in the `update` that receives it, so what a caller reads right after is final). A game loop sets a finite budget (the test room uses 8): what is left waits for the
|
|
51
358
|
* next frame, in order; at least one event is applied per frame, so 0 means one at a time.
|
|
52
359
|
*/
|
|
53
360
|
eventBudgetMs?: number;
|
|
361
|
+
/**
|
|
362
|
+
* What the kit decides about the debris of a blast: the speed of the front that wakes it from the centre out, how many pieces enter physics (between a minimum and a maximum,
|
|
363
|
+
* by the cost measured), the size under which a loosened object is a chip, the cap of pieces alive and the far and old rule. Each is a number with a default
|
|
364
|
+
* (`BLAST_DEBRIS_DEFAULTS`); a blast can override them (`ExplodeOptions.debris`).
|
|
365
|
+
*/
|
|
366
|
+
blastDebris?: BlastDebrisOptions;
|
|
367
|
+
/**
|
|
368
|
+
* With an engine (Jolt): the ground of a loose piece of several parts (a pole with its wires, a wall with its openings) is laid under each part's box, not under the box around
|
|
369
|
+
* all of them, so a piece 23 m across and mostly air gets the tiles (and the solid under each) it touches, not 70. Default off: the same tiles as before (T3.8v).
|
|
370
|
+
*/
|
|
371
|
+
tilesUnderParts?: boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Fit the boxes a part drawn by a range of a merged mesh gets when it comes loose (`fitOrientedBoxes`) ahead of the blow, a part at a time with the time a frame has left, so the frame
|
|
374
|
+
* that splits a house reads them instead of fitting them. They are fitted in the space of the part's own vertices and carried to where the part is by its pose (a turn and a
|
|
375
|
+
* move), so a split or a move does not fit them again; a scaled or sheared pose fits the points where they are. The boxes are the very same numbers either way. Default on;
|
|
376
|
+
* off, they are fitted when the part breaks off.
|
|
377
|
+
*/
|
|
378
|
+
fitBoxesAhead?: boolean;
|
|
379
|
+
/** Where the debris policy's step cost comes from: measured (default), fixed from the configuration, or replayed from a recording. Only `fixed` and `replay` are the same on every machine. */
|
|
380
|
+
debrisCost?: DebrisCostOptions;
|
|
381
|
+
/**
|
|
382
|
+
* The explosion's deferred work in a frame budget of work units, never of time (spec 008, `design/orcamento-da-explosao.md`): the loose groups a blow leaves become pieces
|
|
383
|
+
* one queue at a time, nearest the player first (`focus`, read once at the start of the frame's work), then by id; until its turn a group stays in its object, drawn and
|
|
384
|
+
* solid as it stood, and none stands loose more than `maxWaitFrames` frames. The events still apply in their frame (their flash, dust and cracks show at once), the fragments
|
|
385
|
+
* still to spawn and the blast's wake queue draw from the same budget. `eventBudgetMs` no longer cuts the work: the same session cuts the same pieces in the same frames on
|
|
386
|
+
* every machine of the same `tier`. That holds only while `deferredQueue()` is not registered with a game-runtime `FrameBudget`: registered, the frame budget's clock decides
|
|
387
|
+
* again in which frames the work step runs at all. A bound or redrawn object with loose groups (a load) has them queued in the next work step. Omitted, off: the work is cut
|
|
388
|
+
* by the clock as before.
|
|
389
|
+
*/
|
|
390
|
+
workBudget?: ExplosionWorkOptions;
|
|
391
|
+
/** Where the player is (m): the far and old rule of `blastDebris.far` counts distance from it. Without it, no piece is far. */
|
|
392
|
+
focus?: () => Vec3;
|
|
393
|
+
/** A piece faded away (`blastDebris.far.action: 'fade'`, or over `maxLivePieces`) has left the scene: the host owns its geometry and disposes it here. */
|
|
394
|
+
onDebrisFaded?: (objectId: string, root: THREE_NS.Object3D) => void;
|
|
395
|
+
/**
|
|
396
|
+
* Run one explosion on a small throwaway wall once, when the first renderer is made, so the code the first real explosion needs (fracture, split, oriented boxes, engine bodies,
|
|
397
|
+
* the ground under the pieces) is not cold: the first one costs about twice the later ones without it. Off screen, in a world and a renderer of its own, all freed; the game's
|
|
398
|
+
* state and random streams are not touched. Default on, once per process and engine; `false` turns it off. Give `{ engine }` (the `PhysicsEngine` the host made its world from)
|
|
399
|
+
* to heat the engine's own paths too; without it the kit's own solver and the code the engines share are what runs.
|
|
400
|
+
*/
|
|
401
|
+
jitWarmUp?: boolean | JitWarmUpOptions;
|
|
54
402
|
/** Upper bound of live particles (default 2500). */
|
|
55
403
|
maxParticles?: number;
|
|
56
404
|
/**
|
|
@@ -60,14 +408,73 @@ interface RendererOptions {
|
|
|
60
408
|
fragmentLife?: number | FragmentLifeRule;
|
|
61
409
|
/** Ground height at (x, z) for fragments, pieces and drips (default 0). */
|
|
62
410
|
groundAt?: (x: number, z: number) => number;
|
|
411
|
+
/**
|
|
412
|
+
* The terrain alone at (x, z): soil, lot, street, crater; never the top of a table or the floor of a house. With an engine (`physics` other than `'own'`) the ground it stands the pieces
|
|
413
|
+
* on is this, because every drawn fixed thing is a body of its own there (`staticSolids`) and a top in both would be ground twice. Default `groundAt`; the kit's own solver ignores it.
|
|
414
|
+
*/
|
|
415
|
+
terrainAt?: (x: number, z: number) => number;
|
|
416
|
+
/**
|
|
417
|
+
* The rolling resistance (C_rr) of the terrain's surface at (x, z), from its material (`TerrainMaterial.rolling`: grass, soil and sand hold a rolling can or rod back far
|
|
418
|
+
* more than asphalt), or undefined for the default (0.015, a hard floor). Read at the middle of the 2 m tile the point is in, the same in both solvers; only where a round
|
|
419
|
+
* piece stands on the terrain itself (not on a top, a fixed thing or another piece). A round piece rolls by the larger of its own and this one.
|
|
420
|
+
*/
|
|
421
|
+
terrainRollingAt?: (x: number, z: number) => number | undefined;
|
|
422
|
+
/**
|
|
423
|
+
* The rolling damping (1/s) of the terrain's surface at (x, z), from its material (`TerrainMaterial.rollingDamping`: grass and sand drag a rolling thing more the faster it
|
|
424
|
+
* rolls), or undefined for the default (`GROUND_ROLLING_DAMPING`, a hard floor). Read where `terrainRollingAt` is.
|
|
425
|
+
*/
|
|
426
|
+
terrainRollingDampingAt?: (x: number, z: number) => number | undefined;
|
|
427
|
+
/** The most tiles of ground the physics engine lays at a blast, nearest first (default 0: the tiles are laid as the pieces reach them; a count lays that many at a blast, which moves their cost into the explosion's frame). */
|
|
428
|
+
blastGroundTiles?: number;
|
|
429
|
+
/**
|
|
430
|
+
* The lowest and highest `terrainAt` (else `groundAt`) can answer over a rectangle (min x, max x, min z, max z), exact bounds, or null when none is known. With it the engine lays a
|
|
431
|
+
* tile it proves level without reading its 26 000 samples (`Terrain.heightRange` is one). A bound that is not exact makes a tile level that is not: leave it out if unsure.
|
|
432
|
+
*/
|
|
433
|
+
terrainRangeAt?: (minX: number, maxX: number, minZ: number, maxZ: number) => {
|
|
434
|
+
readonly low: number;
|
|
435
|
+
readonly high: number;
|
|
436
|
+
} | null;
|
|
437
|
+
/**
|
|
438
|
+
* `terrainAt` over a lattice in one pass: the height at (`xs[i]`, `zs[j]`) into `out[j * xs.length + i]`, to the bit what `terrainAt` answers at each point
|
|
439
|
+
* (`Terrain.heightGrid` is one). With it the engine reads a ground tile's 26 000 samples in one pass instead of a call each. Used only when `terrainAt` is given too (without
|
|
440
|
+
* it the engine's ground is `groundAt`, which a grid of the terrain may not be). A reader that is not exact changes the ground: leave it out if unsure.
|
|
441
|
+
*/
|
|
442
|
+
terrainGridAt?: (xs: ArrayLike<number>, zs: ArrayLike<number>, out: Float64Array) => void;
|
|
443
|
+
/**
|
|
444
|
+
* `terrainAt`'s vertices under a rectangle (`Terrain.heightPatch` is one), to the bit what `terrainGridAt` reads there. Under `groundWorker` a tile it covers is asked for with
|
|
445
|
+
* its patch (about 26 x 26 numbers) instead of its samples and band (about 60 000), which the worker, or the main thread at the tile's update, makes from it; a tile it does not
|
|
446
|
+
* cover (null: across the terrain's bounds) is read as before. A tile asked again is made again when any vertex of its patch changed, not only where the host told a change
|
|
447
|
+
* (`wakeRegion`): a change the host did not tell is caught too. Used only with `terrainAt` and `terrainGridAt`. A reader that is not exact changes the ground: leave it out if unsure.
|
|
448
|
+
*/
|
|
449
|
+
terrainPatchAt?: GroundPatchRead;
|
|
450
|
+
/**
|
|
451
|
+
* Where the physics engine's ground tiles are made (`GroundWorkerPort`: `createWorkerGroundPort` over a worker running the package's `ground-worker` entry, `createInlineGroundPort`,
|
|
452
|
+
* `createMainThreadGroundPort`). With it a tile asked for at update N is applied at N + `groundWorkerFrames`, the same tile whether the worker answered in time or not (made on
|
|
453
|
+
* the main thread from the same data if not), so the physics does not depend on the worker; a piece with no ground laid under it yet waits held still. The renderer owns the
|
|
454
|
+
* port once handed (`dispose` stops it). Default none: every tile is made in the update it is needed.
|
|
455
|
+
*/
|
|
456
|
+
groundWorker?: GroundWorkerPort;
|
|
457
|
+
/** Updates from asking for a ground tile to applying it under `groundWorker` (default 2, at least 1). */
|
|
458
|
+
groundWorkerFrames?: number;
|
|
459
|
+
/**
|
|
460
|
+
* The game's worker coordinator (CLAUDE.md §14): the fixed colliders measured from what is drawn (a house at load, a part measured again) are
|
|
461
|
+
* `destruction.static-colliders` jobs in its workers; an object waits for its answers as it waits for its turn, the same boxes either way. Default none: measured here.
|
|
462
|
+
*/
|
|
463
|
+
workers?: WorkerCoordinator;
|
|
63
464
|
gravity?: number;
|
|
64
|
-
/**
|
|
465
|
+
/**
|
|
466
|
+
* Turn a loose group into a separate physical piece automatically (default true): the ones a detach or a collapse leaves, and the ones an object already has when it is
|
|
467
|
+
* bound or drawn again (`redraw`), in the next `update` or drain after it (under `workBudget`, queued in the next work step). Off, they stay in their object.
|
|
468
|
+
*/
|
|
65
469
|
autoSplit?: boolean;
|
|
66
470
|
/** Called when a loose piece is created (the bench registers it as grabbable). */
|
|
67
471
|
onPiece?: (piece: Piece) => void;
|
|
472
|
+
/** Called by `release` with the ids of the pieces it took out of the world, so a host that kept them (`onPiece`) forgets them. */
|
|
473
|
+
onReleased?: (pieceIds: readonly string[]) => void;
|
|
68
474
|
/**
|
|
69
475
|
* The numbers of the shove a blast gives to the pieces (`BlastShoveOptions` of game-contracts: how much of the energy becomes speed, the fastest throw, the lift, the falloff).
|
|
70
|
-
*
|
|
476
|
+
* Without it a piece is pushed by the blast wave itself (the impulse of the charge over the area the piece shows, divided by its mass: `blastShove` with an `area`); giving it chooses
|
|
477
|
+
* this game rule instead (default coupling 0.02, cap 20 m/s).
|
|
71
478
|
*/
|
|
72
479
|
blastShove?: BlastShoveOptions;
|
|
73
480
|
/**
|
|
@@ -128,6 +535,11 @@ interface BindOptions {
|
|
|
128
535
|
* used; meshes with neither are matched to the part whose box contains the mesh's bounding-box centre.
|
|
129
536
|
*/
|
|
130
537
|
parts?: Record<string, Object3D | MeshRange | Array<Object3D | MeshRange>>;
|
|
538
|
+
/**
|
|
539
|
+
* Part id -> the parts whose meshes draw its marks (holes, spalls, cracks) when it is drawn by none of its own: a pillar cast between the bricks of two walls is
|
|
540
|
+
* drawn inside their meshes, under their plaster, and the rounds that hit it leave their holes there.
|
|
541
|
+
*/
|
|
542
|
+
marksOn?: Record<string, readonly string[]>;
|
|
131
543
|
/** Keep the world transform in sync from the root's matrixWorld every update (default true). */
|
|
132
544
|
syncTransform?: boolean;
|
|
133
545
|
/** Called from every `update`, after the queued events were applied: where the host finishes the drawing of this object that it deferred (a wall repainted once per frame). */
|
|
@@ -164,6 +576,8 @@ interface ExplodeOptions {
|
|
|
164
576
|
* the energy that reached it (`energy * confinement * shelter` of the piece's object) instead of the raw energy. Without it the old formula.
|
|
165
577
|
*/
|
|
166
578
|
readonly report?: readonly HitResult[];
|
|
579
|
+
/** This blast's own debris numbers over the renderer's (`RendererOptions.blastDebris`): a big charge a slower front, a small one fewer pieces. */
|
|
580
|
+
readonly debris?: BlastDebrisOptions;
|
|
167
581
|
}
|
|
168
582
|
/** One box of `DestructionRenderer.solidsNear`. */
|
|
169
583
|
interface SolidBox {
|
|
@@ -192,12 +606,29 @@ interface MakePieceOptions {
|
|
|
192
606
|
*/
|
|
193
607
|
inertia?: number;
|
|
194
608
|
}
|
|
609
|
+
/** A queue and the options a frame budget registers it with (`DestructionRenderer.deferredQueues`). */
|
|
610
|
+
interface DeferredQueueRegistration {
|
|
611
|
+
readonly queue: DeferredQueue;
|
|
612
|
+
readonly options: DeferredQueueOptions;
|
|
613
|
+
}
|
|
195
614
|
interface DestructionRenderer {
|
|
196
615
|
/** Attach a world object to its three.js root. */
|
|
197
616
|
bind(objectId: string, root: Object3D, options?: BindOptions): void;
|
|
198
617
|
unbind(objectId: string): void;
|
|
618
|
+
/**
|
|
619
|
+
* The object leaves for good (a house replaced, a module cleared): every piece that split from it leaves the world, and every effect of it and of
|
|
620
|
+
* its pieces (fires, burn sounds, leaks, events still waiting, fragments, ground marks, bare bars, sprites, flames and smoke) goes at once; then it is
|
|
621
|
+
* unbound. The object itself stays in the world for whoever added it to remove. Returns the ids of the pieces removed (also told to `onReleased`).
|
|
622
|
+
*/
|
|
623
|
+
release(objectId: string): string[];
|
|
624
|
+
/** What split from the object leaves the world with all its effects, as `release` does, and the object keeps its binding (a reset). Returns the ids removed. */
|
|
625
|
+
releasePieces(objectId: string): string[];
|
|
199
626
|
/** Make a bound object a physical piece (bench items that can be thrown). */
|
|
200
627
|
makePiece(objectId: string, options?: MakePieceOptions): Piece;
|
|
628
|
+
/** The host moved the root of a bound object by hand (a teleport): its transform goes to the world on the next `update`, even for a piece asleep. */
|
|
629
|
+
markMoved(objectId: string): void;
|
|
630
|
+
/** The mass of a piece changed (a liquid drunk or leaked out): the physics body follows, and a round one turns by the moment of what is left in it. */
|
|
631
|
+
setPieceMass(objectId: string, mass: number): void;
|
|
201
632
|
pieces(): Piece[];
|
|
202
633
|
/** What lies in the disc looks at the ground again (`groundAt` changed under it: a crater, a heap). */
|
|
203
634
|
wakeRegion(x: number, z: number, radius: number): void;
|
|
@@ -218,11 +649,36 @@ interface DestructionRenderer {
|
|
|
218
649
|
impulse(objectId: string, impulse: Vec3, point?: Vec3): void;
|
|
219
650
|
/** Integrate fragments, pieces and particles; apply pending visual changes. Call once per frame after `world.update`. */
|
|
220
651
|
update(dt: number): void;
|
|
652
|
+
/** With `interpolate`: the awake pieces and fragments drawn `alpha` (0 to 1) of the way from the pose before the last step to the step's. Call in the present phase; 1 draws the step's pose. */
|
|
653
|
+
present(alpha: number): void;
|
|
654
|
+
/** With `interpolate`: gives the step pose back to what `present` drew between. `update` does it first; call it before reading a piece's root between `present` and `update`. */
|
|
655
|
+
restoreStepPose(): void;
|
|
656
|
+
/** The host applies the structural events itself at the end of each tick (`applyStructuralEvents`); a frame drain leaves them for the next tick. */
|
|
657
|
+
setStructuralInTick(isInTick: boolean): void;
|
|
658
|
+
/** At the end of a tick, on the step pose: applies the structural events that wait and the visual ones of their objects, in the order of emission. */
|
|
659
|
+
applyStructuralEvents(): void;
|
|
660
|
+
/**
|
|
661
|
+
* Holds every event in the queue (no frame drain applies one, no stall dump) while the host runs a blast in slices (`DestructionWorld.beginExplosion`), or lets them
|
|
662
|
+
* go. Held, they stay for `applyStructuralEventsSliced` or the next tick.
|
|
663
|
+
*/
|
|
664
|
+
holdEvents(isHeld: boolean): void;
|
|
665
|
+
/**
|
|
666
|
+
* `applyStructuralEvents` spread over frames for a large blast: arranged once, the same events in the same order, a slice of `units` (`EVENT_APPLY_WEIGHT`, never a
|
|
667
|
+
* clock) per call; returns the structural events still to apply. `applyStructuralEvents` applies what is left first.
|
|
668
|
+
*/
|
|
669
|
+
applyStructuralEventsSliced(units: number): number;
|
|
670
|
+
/** Structural events of a spread blast not applied yet. */
|
|
671
|
+
structuralBacklog(): number;
|
|
221
672
|
/**
|
|
222
673
|
* The waiting events and the presentation slices they left, as a `DeferredQueue` for a shared frame budget (id `destruction.events`). `budget.register`
|
|
223
674
|
* attaches it and `update` stops draining by itself; unregistering gives the draining back to `update` and `eventBudgetMs`. Asking for it changes nothing.
|
|
224
675
|
*/
|
|
225
676
|
deferredQueue?(): DeferredQueue;
|
|
677
|
+
/**
|
|
678
|
+
* Every queue of the renderer with the options to register it with, for a shared frame budget: `destruction.events` (`mustDrain`: a hit shows in its own frame),
|
|
679
|
+
* `destruction.prefit` and `destruction.settled-batch`. Registering one attaches it: its work leaves `update`; unregistering gives it back. Asking changes nothing.
|
|
680
|
+
*/
|
|
681
|
+
deferredQueues?(): readonly DeferredQueueRegistration[];
|
|
226
682
|
/** Emit particles directly (muzzle flashes, extinguisher foam, tool sparks). */
|
|
227
683
|
emit(kind: DebrisKind | 'fire' | 'flash' | 'foam', point: Vec3, normal: Vec3, count: number, speed?: number): void;
|
|
228
684
|
/**
|
|
@@ -240,12 +696,16 @@ interface DestructionRenderer {
|
|
|
240
696
|
reset(): void;
|
|
241
697
|
/** Restore one object (after `world.reset`). */
|
|
242
698
|
restore(objectId: string): void;
|
|
699
|
+
/** Draw a bound object again from the state its world holds now (after `DestructionWorld.loadObject` put it back damaged): dents, holes, cracks, bend, char, broken parts hidden. */
|
|
700
|
+
redraw(objectId: string): void;
|
|
243
701
|
stats(): {
|
|
244
702
|
fragments: number;
|
|
245
703
|
particles: number;
|
|
246
704
|
pieces: number;
|
|
247
705
|
decals: number;
|
|
248
706
|
};
|
|
707
|
+
/** The draws of the batches of the debris at rest and how many debris meshes they draw (`RendererOptions.settledBatches`). */
|
|
708
|
+
settledBatchStats?(): SettledBatchStats;
|
|
249
709
|
/** Meshes that use the materials of the hole, patch and crack decals, to render once so that the first hit does not build their shader programs in the middle of a frame. */
|
|
250
710
|
warmUpProbes(): WarmUpProbes;
|
|
251
711
|
/** Bars of exposed rebar drawn now (`expose` events; one instanced mesh per part). */
|
|
@@ -274,6 +734,11 @@ interface SpecFromObjectResult {
|
|
|
274
734
|
parts: Record<string, Object3D[]>;
|
|
275
735
|
}
|
|
276
736
|
|
|
737
|
+
/** Most loose pieces and fragments simulated at once a game loop can start from (`RendererOptions.maxAwakePieces`, `maxAwakeFragments`; the default is no limit). */
|
|
738
|
+
declare const SUGGESTED_MAX_AWAKE_PIECES = 24;
|
|
739
|
+
declare const SUGGESTED_MAX_AWAKE_FRAGMENTS = 64;
|
|
740
|
+
/** The lightest a piece weighs in the physics (kg): below it the solver's mass ratios against a floor or a foot go wild. An empty can is 50 g, so it keeps its own mass. */
|
|
741
|
+
declare const MIN_PIECE_MASS_KG = 0.02;
|
|
277
742
|
/** Sound key for an impact on a material. */
|
|
278
743
|
declare function impactKey(def: MaterialDef | undefined): string;
|
|
279
744
|
/** Sound key (`shot_*`) of a round striking this material: sharper than a blow (a tink on steel, a crack on glass); a host without it plays the `impact_*`. */
|
|
@@ -283,7 +748,202 @@ declare const dragSoundKey: (def: MaterialDef | undefined) => string;
|
|
|
283
748
|
/** The renderer this package makes always has its `deferredQueue`; a third-party `DestructionRenderer` may leave it out. */
|
|
284
749
|
declare function createDestructionRenderer(THREE: ThreeNamespace, options: RendererOptions): DestructionRenderer & {
|
|
285
750
|
deferredQueue(): DeferredQueue;
|
|
751
|
+
deferredQueues(): readonly DeferredQueueRegistration[];
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
type EventClass = 'structural' | 'visual';
|
|
755
|
+
/**
|
|
756
|
+
* What applying each event of the world does in the renderer. Structural: makes a body, changes the world, touches a collision mesh, enters the registry or draws on the
|
|
757
|
+
* renderer's generator (`spall`, `drip` and `leak` do, until they get a generator of their own), so it applies inside the fixed step, on the step pose. Visual: only marks,
|
|
758
|
+
* sounds and particles, so it may wait for the frame. A type that is in doubt is structural; a new type does not compile until it is listed here.
|
|
759
|
+
*/
|
|
760
|
+
declare const EVENT_CLASS: {
|
|
761
|
+
readonly detach: "structural";
|
|
762
|
+
readonly collapse: "structural";
|
|
763
|
+
readonly fracture: "structural";
|
|
764
|
+
readonly expose: "structural";
|
|
765
|
+
readonly settle: "structural";
|
|
766
|
+
readonly subside: "structural";
|
|
767
|
+
readonly burnout: "structural";
|
|
768
|
+
readonly destroyed: "structural";
|
|
769
|
+
readonly explode: "structural";
|
|
770
|
+
readonly chip: "structural";
|
|
771
|
+
readonly stage: "structural";
|
|
772
|
+
readonly dent: "structural";
|
|
773
|
+
readonly bend: "structural";
|
|
774
|
+
readonly spall: "structural";
|
|
775
|
+
readonly drip: "structural";
|
|
776
|
+
readonly leak: "structural";
|
|
777
|
+
readonly ignite: "structural";
|
|
778
|
+
readonly primed: "structural";
|
|
779
|
+
readonly extinguish: "structural";
|
|
780
|
+
readonly hole: "visual";
|
|
781
|
+
readonly crack: "visual";
|
|
782
|
+
readonly ricochet: "visual";
|
|
783
|
+
readonly debris: "visual";
|
|
784
|
+
readonly damage: "visual";
|
|
785
|
+
readonly melt: "visual";
|
|
786
|
+
readonly disassemble_progress: "visual";
|
|
787
|
+
readonly reveal: "visual";
|
|
788
|
+
readonly stress: "visual";
|
|
789
|
+
readonly sway: "visual";
|
|
790
|
+
readonly blast: "visual";
|
|
791
|
+
readonly body: "visual";
|
|
792
|
+
readonly fragment_hit: "visual";
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* What applying one event of each type costs the renderer, in fixed units (a bullet hole is 10), for spreading the structural events of a large blast over frames
|
|
797
|
+
* (`applyStructuralEventsSliced`). A table, never a clock: the same events give the same slices on any machine, so the world the slices build is the same.
|
|
798
|
+
* Derived from the cost per event measured applying the M67's 1687 events in the room house (spec 018, 2026-11-22, `m2`: a fracture ~1.7 ms, a hole ~0.05 ms, a
|
|
799
|
+
* stage ~0.1 ms, a chip ~0.04 ms, a spall ~0.01 ms, a debris ~0.005 ms); types not measured there take the weight of the nearest measured kind of work. Every
|
|
800
|
+
* event costs at least 1, so a slice always moves. A new type does not compile until it is listed.
|
|
801
|
+
*/
|
|
802
|
+
declare const EVENT_APPLY_WEIGHT: {
|
|
803
|
+
readonly fracture: 340;
|
|
804
|
+
readonly collapse: 340;
|
|
805
|
+
readonly destroyed: 120;
|
|
806
|
+
readonly expose: 60;
|
|
807
|
+
readonly subside: 30;
|
|
808
|
+
readonly settle: 30;
|
|
809
|
+
readonly detach: 10;
|
|
810
|
+
readonly stage: 20;
|
|
811
|
+
readonly dent: 20;
|
|
812
|
+
readonly bend: 20;
|
|
813
|
+
readonly burnout: 20;
|
|
814
|
+
readonly explode: 20;
|
|
815
|
+
readonly hole: 10;
|
|
816
|
+
readonly chip: 8;
|
|
817
|
+
readonly ignite: 4;
|
|
818
|
+
readonly primed: 2;
|
|
819
|
+
readonly extinguish: 2;
|
|
820
|
+
readonly spall: 2;
|
|
821
|
+
readonly leak: 2;
|
|
822
|
+
readonly drip: 1;
|
|
823
|
+
readonly crack: 1;
|
|
824
|
+
readonly debris: 1;
|
|
825
|
+
readonly ricochet: 1;
|
|
826
|
+
readonly damage: 1;
|
|
827
|
+
readonly melt: 1;
|
|
828
|
+
readonly disassemble_progress: 1;
|
|
829
|
+
readonly reveal: 1;
|
|
830
|
+
readonly stress: 1;
|
|
831
|
+
readonly sway: 1;
|
|
832
|
+
readonly blast: 1;
|
|
833
|
+
readonly body: 1;
|
|
834
|
+
readonly fragment_hit: 1;
|
|
835
|
+
};
|
|
836
|
+
/** Units of `EVENT_APPLY_WEIGHT` a frame of a spread blast applies by default: ~5 ms of the measured costs, about a quarter of the M67's structural events. */
|
|
837
|
+
declare const STRUCTURAL_UNITS_PER_FRAME = 1000;
|
|
838
|
+
declare function eventApplyWeight(event: DestructionEvent): number;
|
|
839
|
+
|
|
840
|
+
/** Fragment rays a frame of a spread blast casts by default: the M67's 256 in 4 frames and its wave in a fifth (spec 018, `proposta-d2.md`). */
|
|
841
|
+
declare const BLAST_RAYS_PER_FRAME = 64;
|
|
842
|
+
/** Parts the wave of a spread blast reaches per frame by default, nearest first (`ExplosionJob.advance`): the wave of the M67 in the room house over a few frames. */
|
|
843
|
+
declare const BLAST_WAVE_PARTS_PER_FRAME = 128;
|
|
844
|
+
type BlastPacerOptions = {
|
|
845
|
+
readonly world: Pick<DestructionWorld, 'beginExplosion' | 'cancelExplosions'>;
|
|
846
|
+
readonly renderer: Pick<DestructionRenderer, 'holdEvents' | 'applyStructuralEventsSliced'>;
|
|
847
|
+
/** Fragment rays per frame (`ExplosionJob.advance`). Default `BLAST_RAYS_PER_FRAME`; Infinity runs every blast whole in `begin` (the one-shot blast, through the pacer). */
|
|
848
|
+
readonly raysPerFrame?: number;
|
|
849
|
+
/** Parts of the wave per frame, once the rays are cast. Default `BLAST_WAVE_PARTS_PER_FRAME`; Infinity runs the wave in one frame. */
|
|
850
|
+
readonly wavePartsPerFrame?: number;
|
|
851
|
+
/** Units of `EVENT_APPLY_WEIGHT` of structural events applied per frame once the blast is done. Default `STRUCTURAL_UNITS_PER_FRAME`. */
|
|
852
|
+
readonly unitsPerFrame?: number;
|
|
853
|
+
};
|
|
854
|
+
/** A blast for the pacer: the arguments of `DestructionWorld.explode`. */
|
|
855
|
+
type PacedBlast = {
|
|
856
|
+
readonly point: Vec3;
|
|
857
|
+
readonly energy: number;
|
|
858
|
+
readonly radius: number;
|
|
859
|
+
readonly source?: string;
|
|
860
|
+
readonly options?: BlastOptions;
|
|
861
|
+
};
|
|
862
|
+
type BlastPacer = {
|
|
863
|
+
/**
|
|
864
|
+
* Begins a blast and runs its first slice now; `onDone` gets what `explode` would have returned when it ends (in this call when it fits in one slice). A blast begun
|
|
865
|
+
* while another is open waits for it (`beginExplosion`).
|
|
866
|
+
*/
|
|
867
|
+
begin(blast: PacedBlast, onDone: (results: HitResult[]) => void): void;
|
|
868
|
+
/** true while the world must not step: a blast still open, or the structural events of the blasts done still being applied. The host holds its fixed steps on it. */
|
|
869
|
+
isHolding(): boolean;
|
|
870
|
+
/** Once per frame while holding, outside the fixed step: the next slice of the oldest open blast, or, all done, the next slice of their structural events. */
|
|
871
|
+
step(): void;
|
|
872
|
+
/**
|
|
873
|
+
* Drops every open blast (no `onDone`) and both holds: the host is clearing or replacing its world. It calls `world.cancelExplosions()`, which cancels every open
|
|
874
|
+
* explosion of the world, also one begun outside this pacer.
|
|
875
|
+
*/
|
|
876
|
+
clear(): void;
|
|
286
877
|
};
|
|
878
|
+
/**
|
|
879
|
+
* Spreads a large blast over frames with the world held (spec 018 D2): the fragments a fixed number of rays per frame, the wave a fixed number of the parts it reaches per frame, then the
|
|
880
|
+
* structural events a fixed weight per frame, every count fixed so the world it leaves is the one the one-shot blast leaves. The host holds the fixed steps while
|
|
881
|
+
* `isHolding` (`game-runtime`'s `holdFixed`) and calls `step` once per frame; the effects, the sound and the camera go on meanwhile.
|
|
882
|
+
*/
|
|
883
|
+
declare function createBlastPacer(options: BlastPacerOptions): BlastPacer;
|
|
884
|
+
|
|
885
|
+
/** The triangles of a fixed drawn part where no box fits it (world space, three indices a triangle). */
|
|
886
|
+
interface StaticMesh {
|
|
887
|
+
readonly vertices: Float32Array;
|
|
888
|
+
readonly indices: Uint32Array;
|
|
889
|
+
}
|
|
890
|
+
/** A fixed box of what does not move, as it is drawn: centre, half sizes and rotation (world). With `mesh` the part is those triangles, and the box is the one around them. */
|
|
891
|
+
interface StaticSolid {
|
|
892
|
+
readonly center: Vec3;
|
|
893
|
+
readonly half: Vec3;
|
|
894
|
+
readonly rotation: Quat;
|
|
895
|
+
readonly mesh?: StaticMesh;
|
|
896
|
+
/** Names the part across lists (a part measured again is the same part): without it, the place in the list. */
|
|
897
|
+
readonly key?: string;
|
|
898
|
+
/** The Coulomb friction and rolling resistance of the part's material; without it the body has the ground's. */
|
|
899
|
+
readonly friction?: {
|
|
900
|
+
readonly static: number;
|
|
901
|
+
readonly dynamic: number;
|
|
902
|
+
readonly rolling: number;
|
|
903
|
+
readonly rollingDamping?: number;
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* One fixed drawn part to measure (`measureStaticPart`): plain arrays, so it crosses to a worker (`destruction.static-colliders`). The main thread reads the vertices,
|
|
909
|
+
* the triangles and the mesh's world matrix (with three's own `decompose` of it); the measuring is here.
|
|
910
|
+
*/
|
|
911
|
+
interface StaticPartJob {
|
|
912
|
+
/** The part's vertices in the mesh's frame, three numbers each, with what another drawing collapses there already collapsed. */
|
|
913
|
+
readonly points: Float64Array;
|
|
914
|
+
/** The mesh's world matrix (16 numbers, column major). */
|
|
915
|
+
readonly matrix: Float64Array;
|
|
916
|
+
/** The world matrix decomposed (three's `Matrix4.decompose`): position, quaternion (x, y, z, w) and scale. */
|
|
917
|
+
readonly position: readonly [number, number, number];
|
|
918
|
+
readonly quaternion: readonly [number, number, number, number];
|
|
919
|
+
readonly scale: readonly [number, number, number];
|
|
920
|
+
/** The triangles of the part as vertex numbers of the host (three each), `from` its first vertex. */
|
|
921
|
+
readonly found: Uint32Array;
|
|
922
|
+
readonly from: number;
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* What a fixed drawn part collides as, in world space, for an engine: one box turned as drawn where a box fits it (every corner has a vertex within `FIT` and its
|
|
926
|
+
* triangles cover its faces), else the box turned to fit the world vertices where that one fits, else the triangles as drawn (`mesh`, static only). A part collapsed to
|
|
927
|
+
* a point is nothing (`CLAUDE.md` §12). A pure function of the job: the worker and the main thread give the same bits (`staticCollidersKind`).
|
|
928
|
+
*/
|
|
929
|
+
declare function measureStaticPart(job: StaticPartJob): StaticSolid[];
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* The engine's ground tiles as a task kind of the worker coordinator (`destruction.ground-tiles`, CLAUDE.md §14): a tile is a pure function
|
|
933
|
+
* of the samples and the band read at the update it was asked for, so the worker and the main thread give the same bits. The engine's
|
|
934
|
+
* `GroundSchedule` applies it at its update whatever the worker does (`createCoordinatorGroundPort`). No three.js here: a game's worker file
|
|
935
|
+
* imports it from `@adatechnology/game-destruction-three/worker-kinds`.
|
|
936
|
+
*/
|
|
937
|
+
declare const groundTilesKind: TaskKind<GroundTileJob, GroundTileResult>;
|
|
938
|
+
/**
|
|
939
|
+
* The fixed colliders measured from what is drawn (`destruction.static-colliders`, lane `build`, CLAUDE.md §14): a part of a house, a table, a wall measured anew is a
|
|
940
|
+
* pure function of its vertices, its triangles and its world matrix (`measureStaticPart`), so the worker and the main thread give the same bits. The renderer hands its
|
|
941
|
+
* parts to it when it has a coordinator (`RendererOptions.workers`); the object waits for the answer as a part out of turns waits for the next update.
|
|
942
|
+
*/
|
|
943
|
+
declare const staticCollidersKind: TaskKind<StaticPartJob, StaticSolid[]>;
|
|
944
|
+
|
|
945
|
+
/** Updates from asking for a tile to applying it under `groundWorker` unless the host says otherwise (owner, 2026-11-17: 1 to 3 frames of delay accepted). */
|
|
946
|
+
declare const GROUND_WORKER_FRAMES = 2;
|
|
287
947
|
|
|
288
948
|
/** What `userData.destructionPart` says: a string (the part id) or an object `{ id, material?, parent?, kind? }`. */
|
|
289
949
|
interface PartHint {
|
|
@@ -425,6 +1085,12 @@ declare const impactSoundIds: (rules?: Readonly<Record<string, SoundKeyRule>>) =
|
|
|
425
1085
|
* which key is the kit's choice (the teams call the sounds, not the renderer's keys), so it is data: `keys` replaces any entry.
|
|
426
1086
|
*/
|
|
427
1087
|
declare const DESTRUCTION_SOUND_KEYS: Readonly<Record<DestructionSoundStyle, Readonly<Record<string, SoundKeyRule>>>>;
|
|
1088
|
+
/**
|
|
1089
|
+
* Every sound an explosion and what it leaves can play: the boom of each blast family, the far rumble and the indoor tail, the fire loops and
|
|
1090
|
+
* crackles, and each blow, break and fall on a material (`impactSoundIds` of `rules`). A game preloads them (`AudioEngine.preload`) so that no
|
|
1091
|
+
* first blast decodes its recordings in play; derived from the tables, so a new family or material rule is covered with no list to update.
|
|
1092
|
+
*/
|
|
1093
|
+
declare const blastSoundIds: (rules?: Readonly<Record<string, SoundKeyRule>>) => string[];
|
|
428
1094
|
type DestructionSoundOptions = {
|
|
429
1095
|
/** Which team answers the keys (default `art_scene`, the kit mix). `game` falls back to the art scene for the keys the game has no sound for. */
|
|
430
1096
|
readonly style?: DestructionSoundStyle;
|
|
@@ -499,6 +1165,15 @@ declare const DEFAULT_INDOOR_CONFINEMENT = 1.3;
|
|
|
499
1165
|
*/
|
|
500
1166
|
declare function createDestructionSound(engine: AudioEngine, options?: DestructionSoundOptions): DestructionSound;
|
|
501
1167
|
|
|
1168
|
+
/** The voice group every impact, break and ricochet of the destruction sounds plays in (`createDestructionSound` passes it as `PlayOptions.group`). */
|
|
1169
|
+
declare const IMPACT_BURST_GROUP = "impact_burst";
|
|
1170
|
+
/**
|
|
1171
|
+
* `VOICE_GROUPS` plus the cap on a burst of impacts: one blast with fragments makes hundreds of them in one frame (276 voices, about 12 ms), and only the
|
|
1172
|
+
* 16 loudest are built, 1.4x louder when others were dropped. 16 is half the engine's 32-voice cap, so impacts cannot take the weapons' and voices' places.
|
|
1173
|
+
* The host passes it as the engine's `groups`, which needs `deferredStart`.
|
|
1174
|
+
*/
|
|
1175
|
+
declare const DESTRUCTION_VOICE_GROUPS: Readonly<Record<string, VoiceGroup>>;
|
|
1176
|
+
|
|
502
1177
|
/** The numbers of one recorded sound, plus whether it loops (the fire's roar). */
|
|
503
1178
|
type BlastFireSampleDefaults = SampleDefaults & {
|
|
504
1179
|
readonly loop?: boolean | {
|
|
@@ -527,4 +1202,4 @@ declare function blastFireSampleBank(manifest: SfxManifest, options?: BlastFireS
|
|
|
527
1202
|
/** Every particle kind the renderer can emit (the game's sprite kinds, see `@adatechnology/game-vfx`). */
|
|
528
1203
|
type ParticleKind = SpriteKind;
|
|
529
1204
|
|
|
530
|
-
export { BIG_BLAST_RADIUS, BLAST_FALLOFF, BLAST_FAR_DISTANCE, BLAST_FAR_FALLOFF, BLAST_FIRE_SAMPLES, BLAST_KINDS, BLAST_KIND_OF, BLAST_SOUNDS, BLAST_SOUND_OF, BURN_LOOP, type BindOptions, type BlastFireSampleBankOptions, type BlastFireSampleDefaults, type BlastKind, DEFAULT_CRACKLES, DEFAULT_FIRE, DEFAULT_INDOOR_CONFINEMENT, DESTRUCTION_SOUND_BANK, DESTRUCTION_SOUND_KEYS, DRAG_SOUNDS, type DestructionRenderer, type DestructionSound, type DestructionSoundOptions, type DestructionSoundStyle, EXPLOSION_BOOM, type ExplodeOptions, FIRE_FADE_SECONDS, FIRE_FALLOFF, FIRE_LOOP, FIRE_SOUNDS, type FragmentLifeRule, GRENADE_PIN_PULL, IMPACT_FAMILY_TAGS, IMPACT_SOUNDS, IMPACT_SOUND_KEYS, type ImpactFamily, type ImpactKeys, type LooseBody, type MakePieceOptions, type Mesh, type MeshRange, type Object3D, type PartHint, type ParticleKind, type Piece, type Quality, ROCKET_MOTOR_LOOP, type RendererOptions, SCENE_SOUNDS, SMOKE_HISS_LOOP, type SolidBox, type SoundDetail, type SoundKeyRule, type SpecFromObjectOptions, type SpecFromObjectResult, type ThreeNamespace, blastFireSampleBank, breakSoundKeys, createDestructionRenderer, createDestructionSound, dragSoundKey, heatColor, impactFamily, impactKey, impactSoundIds, impactSoundKeys, ricochetSoundKeys, shotKey, specFromObject3D };
|
|
1205
|
+
export { BIG_BLAST_RADIUS, BLAST_DEBRIS_DEFAULTS, BLAST_FALLOFF, BLAST_FAR_DISTANCE, BLAST_FAR_FALLOFF, BLAST_FIRE_SAMPLES, BLAST_KINDS, BLAST_KIND_OF, BLAST_RAYS_PER_FRAME, BLAST_SOUNDS, BLAST_SOUND_OF, BLAST_WAVE_PARTS_PER_FRAME, BURN_LOOP, type BindOptions, type BlastDebrisOptions, type BlastFireSampleBankOptions, type BlastFireSampleDefaults, type BlastKind, type BlastPacer, type BlastPacerOptions, type BlastWake, DEFAULT_CRACKLES, DEFAULT_FIRE, DEFAULT_INDOOR_CONFINEMENT, DESTRUCTION_SOUND_BANK, DESTRUCTION_SOUND_KEYS, DESTRUCTION_VOICE_GROUPS, DRAG_SOUNDS, type DebrisCostOptions, type DebrisCostSample, type DeferredQueueRegistration, type DestructionRenderer, type DestructionSound, type DestructionSoundOptions, type DestructionSoundStyle, EVENT_APPLY_WEIGHT, EVENT_CLASS, EXPLOSION_BOOM, type EventClass, type ExplodeOptions, type ExplosionWorkOptions, FIRE_FADE_SECONDS, FIRE_FALLOFF, FIRE_LOOP, FIRE_SOUNDS, type FarDebrisAction, type FarDebrisOptions, type FragmentLifeRule, GRENADE_PIN_PULL, GROUND_WORKER_FRAMES, type GroundPatchRead, type GroundTileJob, type GroundTileResult, type GroundWorkerPort, IMPACT_BURST_GROUP, IMPACT_FAMILY_TAGS, IMPACT_SOUNDS, IMPACT_SOUND_KEYS, type ImpactFamily, type ImpactKeys, type JitWarmUpOptions, type JitWarmUpReport, type LooseBody, MIN_PIECE_MASS_KG, type MakePieceOptions, type Mesh, type MeshRange, type Object3D, type PacedBlast, type PartHint, type ParticleKind, PhysicsOptionError, type Piece, type PiecePhysics, type Quality, ROCKET_MOTOR_LOOP, type RendererOptions, type ResolvedBlastDebris, SCENE_SOUNDS, SETTLED_BATCH_DEFAULTS, SETTLED_BATCH_ORIGIN, SMOKE_HISS_LOOP, STRUCTURAL_UNITS_PER_FRAME, SUGGESTED_MAX_AWAKE_FRAGMENTS, SUGGESTED_MAX_AWAKE_PIECES, type SettledBatchOptions, type SettledBatchStats, type SolidBox, type SoundDetail, type SoundKeyRule, type SpecFromObjectOptions, type SpecFromObjectResult, type StaticPartJob, type ThreeNamespace, WORK_UNIT_DEFAULTS, type WorkUnitCosts, bandLength, blastFireSampleBank, blastSoundIds, breakSoundKeys, computeGroundTile, createBlastPacer, createCoordinatorGroundPort, createDestructionRenderer, createDestructionSound, createInlineGroundPort, createMainThreadGroundPort, createWorkerGroundPort, dragSoundKey, eventApplyWeight, groundTilesKind, heatColor, impactFamily, impactKey, impactSoundIds, impactSoundKeys, installGroundWorker, measureStaticPart, readGroundBand, readGroundPatch, resolveBlastDebris, resolveWorkUnitCosts, ricochetSoundKeys, shotKey, specFromObject3D, splitWorkUnits, staticCollidersKind, warmUpDestructionJit };
|