@adatechnology/game-vfx 0.8.0 → 0.9.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 +4 -0
- package/dist/index.global.js +2 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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;
|
package/dist/index.global.js
CHANGED
|
@@ -5882,7 +5882,7 @@ var GameVfx = (() => {
|
|
|
5882
5882
|
const { core, def, random, x, y, z } = context;
|
|
5883
5883
|
const mark = def.mark;
|
|
5884
5884
|
const keepsMarks = !core.marklessAt?.(x, z);
|
|
5885
|
-
if (keepsMarks && mark.crater && mark.dent && y < 1.2) {
|
|
5885
|
+
if (keepsMarks && mark.crater && mark.dent && y < 1.2 && (core.cratersAt?.(x, z) ?? true)) {
|
|
5886
5886
|
core.emit({ type: "crater", x, z, radius: mark.crater, depth: mark.dent });
|
|
5887
5887
|
core.trace?.crater?.(x, z, mark.crater, mark.dent);
|
|
5888
5888
|
addCrater(core.marks, core.ground, random, { x, z, radius: mark.crater, depth: mark.dent, marks: core.layers.mark });
|
|
@@ -7684,6 +7684,7 @@ var GameVfx = (() => {
|
|
|
7684
7684
|
clock: { time: 0, lastBlast: -1, lod: 1, forcedLod: null },
|
|
7685
7685
|
groundAt,
|
|
7686
7686
|
...options.marklessAt ? { marklessAt: options.marklessAt } : {},
|
|
7687
|
+
...options.cratersAt ? { cratersAt: options.cratersAt } : {},
|
|
7687
7688
|
emit: (request) => options.onRequest?.(request)
|
|
7688
7689
|
};
|
|
7689
7690
|
function definitionOf(id) {
|