@adatechnology/game-vfx 0.19.0 → 0.20.1
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 +1 -0
- package/dist/index.d.ts +24 -2
- package/dist/index.global.js +287 -114
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +287 -114
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,6 +79,7 @@ is the recipes plus these, what a world plays by default. Texts of every recipe
|
|
|
79
79
|
|
|
80
80
|
## Vehicle effects
|
|
81
81
|
|
|
82
|
+
`VEHICLE_EFFECTS` hold the glass of a car by its kind (`vehicle_glass_chip`: dust and grains off a laminated pane that cracks and stays; `vehicle_glass_shatter`: the glints and dust of a tempered pane letting go, whose dice the vehicle throws itself; never `glass_burst`, the shards of a shopfront) and
|
|
82
83
|
`VEHICLE_EFFECTS` write the Garagem's recipes around a car: `vehicle_fire` and `vehicle_exhaust` (`engine_smoke`), `vehicle_leak` and `vehicle_leak_ignited` (`fuel_leak`). A normal bullet through a tank only leaks, so
|
|
83
84
|
`vehicle_leak` is the page's pool and drips without the fire and the explosion (`FUEL_LEAK_ONLY`: the same `decal` and `emit` steps); `vehicle_leak_ignited` is the whole sequence (the spark, the fire running along
|
|
84
85
|
the pool to the tank and the blast at 7.2 s), played when the leak catches fire.
|
package/dist/index.d.ts
CHANGED
|
@@ -629,6 +629,11 @@ interface PuffCut {
|
|
|
629
629
|
nz: number;
|
|
630
630
|
d: number;
|
|
631
631
|
}
|
|
632
|
+
/**
|
|
633
|
+
* The faces a puff is cut at, at most: three, the walls of a corner (two walls and the ceiling, or a wall, a door's jamb and its head). With two, a puff in a
|
|
634
|
+
* corner kept the two nearest and the third wall's other side showed it (smoke over a shut door, seen from the next room).
|
|
635
|
+
*/
|
|
636
|
+
declare const PUFF_CUTS = 3;
|
|
632
637
|
/** How far a puff's drawn surface reaches from its middle, in sizes: the renderer bulges the ball by up to this much (`game-vfx-three`'s puff shader). */
|
|
633
638
|
declare const PUFF_REACH = 1.28;
|
|
634
639
|
|
|
@@ -685,7 +690,7 @@ interface Puff {
|
|
|
685
690
|
* The faces of the walls (host solids, closed spaces) within the puff's reach, up to two (a wall and the skirting in front of it): the drawn ball is cut at
|
|
686
691
|
* them, so smoke against a wall flattens on it instead of growing through to its other side. See `puff-cuts.ts`.
|
|
687
692
|
*/
|
|
688
|
-
readonly cuts: readonly [PuffCut, PuffCut];
|
|
693
|
+
readonly cuts: readonly [PuffCut, PuffCut, PuffCut];
|
|
689
694
|
}
|
|
690
695
|
|
|
691
696
|
/** A shock wave: an air shell that grows to the lethal radius in 120 ms, and a dust ring on the ground (L319-348). The last block is what the renderer reads. */
|
|
@@ -1693,6 +1698,8 @@ declare const SPRITE_KINDS: Readonly<Record<SpriteKind, SpriteKindDef>>;
|
|
|
1693
1698
|
/** A copy of the kinds with some changed (a partial replaces the fields it names), added or removed (`null`); a game tunes its sprites without touching the core. */
|
|
1694
1699
|
declare function patchSpriteKinds(base: Readonly<Record<string, SpriteKindDef>>, changes: Readonly<Record<string, Partial<SpriteKindDef> | SpriteKindDef | null>>): Record<string, SpriteKindDef>;
|
|
1695
1700
|
|
|
1701
|
+
/** The offset of the face a sprite with no wall is cut at (`SpriteKindPool.cutA`, `cutB`, `cutC`): so far below that no point of it is. */
|
|
1702
|
+
declare const NO_CUT = -1000000000;
|
|
1696
1703
|
/** Per-spawn overrides. */
|
|
1697
1704
|
interface SpriteSpawnOptions {
|
|
1698
1705
|
/** `0xRRGGBB`: replaces the kind's colour ramp. */
|
|
@@ -1742,6 +1749,14 @@ declare class SpriteKindPool {
|
|
|
1742
1749
|
readonly color: Float32Array;
|
|
1743
1750
|
readonly alpha: Float32Array;
|
|
1744
1751
|
readonly size: Float32Array;
|
|
1752
|
+
/**
|
|
1753
|
+
* The faces of the walls each carried sprite (smoke, steam, dust) is cut at, three of them (`PUFF_CUTS`: a corner), four numbers a sprite in each: unit normal towards the sprite and offset
|
|
1754
|
+
* (`n · point`), `(0, 0, 0, NO_CUT)` for none. The renderer drops the part of the drawn square behind a face: a puff against a wall flattens on it and
|
|
1755
|
+
* shows nothing on the wall's other side, as a puff's ball does (`Puff.cuts`).
|
|
1756
|
+
*/
|
|
1757
|
+
readonly cutA: Float32Array;
|
|
1758
|
+
readonly cutB: Float32Array;
|
|
1759
|
+
readonly cutC: Float32Array;
|
|
1745
1760
|
private next;
|
|
1746
1761
|
private high;
|
|
1747
1762
|
private readonly velocity;
|
|
@@ -1765,6 +1780,13 @@ declare class SpriteKindPool {
|
|
|
1765
1780
|
private readonly ground;
|
|
1766
1781
|
constructor(capacity: number, defs: readonly SpriteKindDef[], owners: string[], sources?: SpriteSources);
|
|
1767
1782
|
spawn(kind: number, p: readonly number[], v: readonly number[], random: () => number, options?: SpriteSpawnOptions): void;
|
|
1783
|
+
/** Sprite `i` cut at no wall. */
|
|
1784
|
+
private uncut;
|
|
1785
|
+
/**
|
|
1786
|
+
* Looks for the walls carried sprite `i` reaches (as a puff's ball does: `lookForWalls`), `met` the face its step was just stopped at, and keeps them in `cuts`.
|
|
1787
|
+
* The sprite's faces go into the reused `VIEW` and come back out: no object a sprite.
|
|
1788
|
+
*/
|
|
1789
|
+
private cutAtWalls;
|
|
1768
1790
|
private ownerIndex;
|
|
1769
1791
|
private sourceIndex;
|
|
1770
1792
|
/** Kills the live sprites made for `source`; returns how many went. */
|
|
@@ -2540,4 +2562,4 @@ declare function resolveWaterShotProfile(profile: string | WaterShotProfile, tab
|
|
|
2540
2562
|
/** Changes a profile table without touching the kit's: `null` removes an entry, a partial entry is merged over the old one. */
|
|
2541
2563
|
declare function patchWaterShotProfiles(base: Readonly<Record<string, WaterShotProfile>>, changes: Readonly<Record<string, Partial<WaterShotProfile> | null>>): Record<string, WaterShotProfile>;
|
|
2542
2564
|
|
|
2543
|
-
export { AREA_CAP_GAME, type AreaCap, type AreaCapTracker, type Behavior, type BehaviorHost, type BlastLight, type BloodMark, type Carrier, type Chunk, type ConfineMove, type ConfineResult, type Confiner, type CueRequest, DEBRIS_COLOR_VARIABLE, DEBRIS_EFFECT_FAMILIES, DUST_COLOR_VARIABLE, type DebrisEffectFamily, type DebrisObstacle, type DebrisSpawn, type Decal, type DecalOptions, type DirtMark, EVENT_BUDGET, EVENT_EFFECTS, EVENT_EFFECTS_MAP, EXPLOSIONS, EXPLOSION_ALIASES, EffectCamera, type EffectDef, EffectInstance, type EffectPlayer, type EffectPlayerOptions, EffectRunner, type EffectRunnerOptions, type EffectStep, type EffectTexts, type EffectTrack, type EffectView, Enclosures, type ExplosionCall, type ExplosionDef, type ExplosionOptions, type Fire, type FireBody, type FireLight, type FireOptions, type FireSpec, type Follow, GAME_EFFECTS, type GameEvent, type Glow, type GroundField, type GroundFieldOptions, type InstanceDeps, type InstanceSetup, type KindPoolHost, LOD_GAME, LOD_LAB, type LandListener, type LensBlob, type LightGlow, type LightPool, type LodBands, MATERIAL_EVENT_EFFECTS, type Mark, type MarkEvent, type MarkStore, type MeshParticle, MeshPool, type MeshShape, type MeshSpawn, type MushroomSpec, type MutableVec3, OrderedPool, PIECES_DRAWN_VARIABLE, PROFILES, PUFF_REACH, type Placement, type PlayOptions, type PostProcess, type Puddle, type Puff, type PuffCut, type Quaternion, RAIN_CAPACITY, RainField, type RandomStream, type Rgb, type Ring, type RockMark, SCRAPE_LIMIT, SMOKE_COLORS, SPRITE_KINDS, type Schedule, type ScorchMark, type ScrapeMark, type ScreenState, type SheetLabels, type Shock, type Spark, type SpriteGround, type SpriteKind, type SpriteKindDef, SpriteKindPool, SpriteKindSystem, type SpriteKindSystemOptions, type SpriteSpawn, type SpriteSpawnOptions, type SpriteSystem, VFX_LAYERS, VIEWMODEL_EFFECTS, type Vec3Like, type Vec3Tuple, type VfxEnclosure, type VfxEnclosureBox, type VfxLayer, type VfxLocale, type VfxOptions, type VfxPoolsView, type VfxProfile, type VfxProfileName, type VfxSideRequest, type VfxSolidQuery, type VfxStats, type VfxStrings, type VfxTrace, type VfxWorld, WATER_BLASTS, WATER_BLAST_KINDS, WATER_LIMITS, WATER_SHOT_BY_CALIBER, WATER_SHOT_PROFILES, WORKSHOP_BEHAVIORS, WORKSHOP_EFFECTS, WORKSHOP_PUDDLES, type WaterBlastCharge, type WaterBlastKind, type WaterBlastKindId, type WaterBlastParams, type WaterBlastPlan, type WaterBubble, type WaterColumn, type WaterDrop, type WaterEffects, type WaterEffectsLimits, type WaterEffectsOptions, type WaterEffectsStats, type WaterFoam, type WaterMist, type WaterRing, type WaterRound, type WaterShotClass, type WaterShotParams, type WaterShotPlan, type WaterShotProfile, type WaterVec3, type WaterWave, type WaterWaveSample, type WorkshopContext, WorkshopEngine, type WorkshopOptions, type WorkshopTrace, colorOfChunk, composeExplosion, createAreaCap, createEffectPlayer, createGroundField, createSchedule, createScreenState, createVfx, createWaterEffects, createWorkshopBehaviors, effectForEvent, estimateCost, explosionEffectIds, hexToLinearRgb, hexToRgb, inPuddle, lcg, lehmer, locales, lodScale, patchEffects, patchExplosions, patchSpriteKinds, patchWaterShotProfiles, planWaterBlast, planWaterShot, resolveStrings, resolveWaterBlast, resolveWaterShotProfile, slideAlong, slideInto, streamFor, updateScreen, waterShotClassOf, workshopGround };
|
|
2565
|
+
export { AREA_CAP_GAME, type AreaCap, type AreaCapTracker, type Behavior, type BehaviorHost, type BlastLight, type BloodMark, type Carrier, type Chunk, type ConfineMove, type ConfineResult, type Confiner, type CueRequest, DEBRIS_COLOR_VARIABLE, DEBRIS_EFFECT_FAMILIES, DUST_COLOR_VARIABLE, type DebrisEffectFamily, type DebrisObstacle, type DebrisSpawn, type Decal, type DecalOptions, type DirtMark, EVENT_BUDGET, EVENT_EFFECTS, EVENT_EFFECTS_MAP, EXPLOSIONS, EXPLOSION_ALIASES, EffectCamera, type EffectDef, EffectInstance, type EffectPlayer, type EffectPlayerOptions, EffectRunner, type EffectRunnerOptions, type EffectStep, type EffectTexts, type EffectTrack, type EffectView, Enclosures, type ExplosionCall, type ExplosionDef, type ExplosionOptions, type Fire, type FireBody, type FireLight, type FireOptions, type FireSpec, type Follow, GAME_EFFECTS, type GameEvent, type Glow, type GroundField, type GroundFieldOptions, type InstanceDeps, type InstanceSetup, type KindPoolHost, LOD_GAME, LOD_LAB, type LandListener, type LensBlob, type LightGlow, type LightPool, type LodBands, MATERIAL_EVENT_EFFECTS, type Mark, type MarkEvent, type MarkStore, type MeshParticle, MeshPool, type MeshShape, type MeshSpawn, type MushroomSpec, type MutableVec3, OrderedPool, PIECES_DRAWN_VARIABLE, PROFILES, PUFF_CUTS, PUFF_REACH, type Placement, type PlayOptions, type PostProcess, type Puddle, type Puff, type PuffCut, type Quaternion, RAIN_CAPACITY, RainField, type RandomStream, type Rgb, type Ring, type RockMark, SCRAPE_LIMIT, SMOKE_COLORS, SPRITE_KINDS, NO_CUT as SPRITE_NO_CUT, type Schedule, type ScorchMark, type ScrapeMark, type ScreenState, type SheetLabels, type Shock, type Spark, type SpriteGround, type SpriteKind, type SpriteKindDef, SpriteKindPool, SpriteKindSystem, type SpriteKindSystemOptions, type SpriteSpawn, type SpriteSpawnOptions, type SpriteSystem, VFX_LAYERS, VIEWMODEL_EFFECTS, type Vec3Like, type Vec3Tuple, type VfxEnclosure, type VfxEnclosureBox, type VfxLayer, type VfxLocale, type VfxOptions, type VfxPoolsView, type VfxProfile, type VfxProfileName, type VfxSideRequest, type VfxSolidQuery, type VfxStats, type VfxStrings, type VfxTrace, type VfxWorld, WATER_BLASTS, WATER_BLAST_KINDS, WATER_LIMITS, WATER_SHOT_BY_CALIBER, WATER_SHOT_PROFILES, WORKSHOP_BEHAVIORS, WORKSHOP_EFFECTS, WORKSHOP_PUDDLES, type WaterBlastCharge, type WaterBlastKind, type WaterBlastKindId, type WaterBlastParams, type WaterBlastPlan, type WaterBubble, type WaterColumn, type WaterDrop, type WaterEffects, type WaterEffectsLimits, type WaterEffectsOptions, type WaterEffectsStats, type WaterFoam, type WaterMist, type WaterRing, type WaterRound, type WaterShotClass, type WaterShotParams, type WaterShotPlan, type WaterShotProfile, type WaterVec3, type WaterWave, type WaterWaveSample, type WorkshopContext, WorkshopEngine, type WorkshopOptions, type WorkshopTrace, colorOfChunk, composeExplosion, createAreaCap, createEffectPlayer, createGroundField, createSchedule, createScreenState, createVfx, createWaterEffects, createWorkshopBehaviors, effectForEvent, estimateCost, explosionEffectIds, hexToLinearRgb, hexToRgb, inPuddle, lcg, lehmer, locales, lodScale, patchEffects, patchExplosions, patchSpriteKinds, patchWaterShotProfiles, planWaterBlast, planWaterShot, resolveStrings, resolveWaterBlast, resolveWaterShotProfile, slideAlong, slideInto, streamFor, updateScreen, waterShotClassOf, workshopGround };
|