@adatechnology/game-vfx 0.8.0 → 0.10.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 CHANGED
@@ -712,6 +712,8 @@ interface VfxCore {
712
712
  groundAt(x: number, z: number): number;
713
713
  /** A surface that keeps no mark here (`VfxOptions.marklessAt`). */
714
714
  marklessAt?: (x: number, z: number) => boolean;
715
+ /** Ground a blast opens a dirt crater in (`VfxOptions.cratersAt`). */
716
+ cratersAt?: (x: number, z: number) => boolean;
715
717
  emit(request: VfxSideRequest): void;
716
718
  }
717
719
 
@@ -1654,6 +1656,8 @@ interface VfxOptions {
1654
1656
  readonly groundAt?: (x: number, z: number) => number;
1655
1657
  /** A surface that keeps no mark here (water): a blast over it leaves no crater, scorch or rim of rock. */
1656
1658
  readonly marklessAt?: (x: number, z: number) => boolean;
1659
+ /** Ground a blast opens a dirt crater in (soil, sand, snow). Where it answers false (rock, asphalt, a slab) a blast leaves only soot. Default everywhere. */
1660
+ readonly cratersAt?: (x: number, z: number) => boolean;
1657
1661
  /** A deformable ground the craters dig into (see `createGroundField`). */
1658
1662
  readonly ground?: GroundField;
1659
1663
  readonly wind?: Vec3Like;
@@ -124,7 +124,8 @@ var GameVfx = (() => {
124
124
  // src/data/explosion-aliases.json
125
125
  var explosion_aliases_default = {
126
126
  carl_gustaf_84mm: "at4_84mm",
127
- vog_25: "m79_40mm"
127
+ vog_25: "m79_40mm",
128
+ semtex: "c4"
128
129
  };
129
130
 
130
131
  // src/data/explosions.json
@@ -5882,7 +5883,7 @@ var GameVfx = (() => {
5882
5883
  const { core, def, random, x, y, z } = context;
5883
5884
  const mark = def.mark;
5884
5885
  const keepsMarks = !core.marklessAt?.(x, z);
5885
- if (keepsMarks && mark.crater && mark.dent && y < 1.2) {
5886
+ if (keepsMarks && mark.crater && mark.dent && y < 1.2 && (core.cratersAt?.(x, z) ?? true)) {
5886
5887
  core.emit({ type: "crater", x, z, radius: mark.crater, depth: mark.dent });
5887
5888
  core.trace?.crater?.(x, z, mark.crater, mark.dent);
5888
5889
  addCrater(core.marks, core.ground, random, { x, z, radius: mark.crater, depth: mark.dent, marks: core.layers.mark });
@@ -7684,6 +7685,7 @@ var GameVfx = (() => {
7684
7685
  clock: { time: 0, lastBlast: -1, lod: 1, forcedLod: null },
7685
7686
  groundAt,
7686
7687
  ...options.marklessAt ? { marklessAt: options.marklessAt } : {},
7688
+ ...options.cratersAt ? { cratersAt: options.cratersAt } : {},
7687
7689
  emit: (request) => options.onRequest?.(request)
7688
7690
  };
7689
7691
  function definitionOf(id) {