@adatechnology/game-destruction-three 0.17.3 → 0.18.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/dist/index.d.ts +17 -1
- package/dist/index.global.js +333 -78
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +318 -70
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -77,6 +77,13 @@ interface RendererOptions {
|
|
|
77
77
|
shoveable?: (objectId: string) => boolean;
|
|
78
78
|
/** Called when the renderer made a bound object a piece on its own: a blast shoved it (`blast`, see `shoveable`), or furniture came apart and what stayed is loose too (`apart`). */
|
|
79
79
|
onLoosened?: (objectId: string, piece: Piece, cause: 'blast' | 'apart') => void;
|
|
80
|
+
/**
|
|
81
|
+
* After each break of a bound object (a part broke, came off, burned out or the object fell apart) the renderer checks it on the next update: what is left of an object that
|
|
82
|
+
* is not a piece must stand on something (the ground, a fixed top, a piece). One left over air is made a piece on the spot and falls (`released` true); either way the host
|
|
83
|
+
* hears of it, so it measures the object's collision again from what is drawn (`shownBoxes`) and can log the fix. Structures (`structure`, `room`, `ground`) answer to their
|
|
84
|
+
* own load path and are not checked.
|
|
85
|
+
*/
|
|
86
|
+
onBrokenChecked?: (objectId: string, released: boolean) => void;
|
|
80
87
|
/**
|
|
81
88
|
* Called when a sound should play; the host maps keys to audio (e.g. `impact_metal`, `shatter_glass`, `ignite`, `explode`). `burn_loop` is sent when a part starts to burn and `burn_end` when it burns out or is put out.
|
|
82
89
|
* An impact or a break also sends `detail.keys`, the keys to try before `key`, most specific first (`impact_concrete_ballistic`, `impact_concrete`, `impact_masonry_ballistic`, `impact_masonry`).
|
|
@@ -185,6 +192,11 @@ interface DestructionRenderer {
|
|
|
185
192
|
/** What lies in the disc looks at the ground again (`groundAt` changed under it: a crater, a heap). */
|
|
186
193
|
wakeRegion(x: number, z: number, radius: number): void;
|
|
187
194
|
piece(objectId: string): Piece | null;
|
|
195
|
+
/**
|
|
196
|
+
* World boxes (`[minX, minY, minZ, maxX, maxY, maxZ]`) of the meshes of the object still drawn (of one part, with `partId`): what is broken, burned out or came off is not in
|
|
197
|
+
* them. Empty when nothing is left.
|
|
198
|
+
*/
|
|
199
|
+
shownBoxes(objectId: string, partId?: string): Array<[number, number, number, number, number, number]>;
|
|
188
200
|
/**
|
|
189
201
|
* World boxes of what is drawn around (x, z) within `radius`: each drawn mesh of a fixed object (meshes wider than 3 m and parts inside a merged
|
|
190
202
|
* mesh are left out: walls, floors, roofs), of every piece and of the big fragments, with the object's id and its piece, if it is one. A turned mesh
|
|
@@ -356,6 +368,10 @@ declare const BLAST_SOUNDS: readonly SoundRecipe[];
|
|
|
356
368
|
declare const FIRE_SOUNDS: readonly SoundRecipe[];
|
|
357
369
|
/** The roar of the fires: low, soft noise; `createDestructionSound` raises it with every part that burns and sprinkles crackles on it. */
|
|
358
370
|
declare const FIRE_LOOP: LoopRecipe;
|
|
371
|
+
/** A smoke canister burning (an M18 and the like): a steady hiss of gas through the vents, bright and without crackles; the fallback of the recorded loop of the same id. */
|
|
372
|
+
declare const SMOKE_HISS_LOOP: LoopRecipe;
|
|
373
|
+
/** The pin of a hand grenade pulled and the lever let go: two small metal clicks, heard only near. */
|
|
374
|
+
declare const GRENADE_PIN_PULL: SoundRecipe;
|
|
359
375
|
/**
|
|
360
376
|
* What is burning, for the sound: each fuel has its own roar (a gas jet, a fuel pool, wood, plastic) and its own share of crackles. The rules are the
|
|
361
377
|
* same for all (the level grows with how much burns, fades with distance, never clips); only the timbre comes from the fuel.
|
|
@@ -497,4 +513,4 @@ declare function blastFireSampleBank(manifest: SfxManifest, options?: BlastFireS
|
|
|
497
513
|
/** Every particle kind the renderer can emit (the game's sprite kinds, see `@adatechnology/game-vfx`). */
|
|
498
514
|
type ParticleKind = SpriteKind;
|
|
499
515
|
|
|
500
|
-
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_FALLOFF, FIRE_LOOP, FIRE_SOUNDS, type FragmentLifeRule, IMPACT_FAMILY_TAGS, IMPACT_SOUNDS, IMPACT_SOUND_KEYS, type ImpactFamily, type ImpactKeys, type LooseBody, type Mesh, type MeshRange, type Object3D, type PartHint, type ParticleKind, type Piece, type Quality, type RendererOptions, SCENE_SOUNDS, 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 };
|
|
516
|
+
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_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 Mesh, type MeshRange, type Object3D, type PartHint, type ParticleKind, type Piece, type Quality, 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 };
|