@adatechnology/game-fluids 0.5.5 → 0.6.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/dist/index.d.ts +2 -0
- package/dist/index.global.js +6 -0
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -280,6 +280,8 @@ interface FluidWorld {
|
|
|
280
280
|
heat(id: string, deltaC: number): void;
|
|
281
281
|
addSurface(spec: SurfaceSpec): void;
|
|
282
282
|
removeSurface(id: string): void;
|
|
283
|
+
/** Moves a surface and the stains on it by `offset` (a pushed table carries what was spilled on its top). Unknown ids are ignored. */
|
|
284
|
+
moveSurface(id: string, offset: Vec3): void;
|
|
283
285
|
/**
|
|
284
286
|
* Add a tap: while `on` it runs a `tap` stream (cause `'tap'`) from `position` along `direction` at `rate` litres per second. The stream fills any
|
|
285
287
|
* container whose opening it lands in (the same logic as a pour) and otherwise makes a stain on the surface below. Returns the tap id.
|
package/dist/index.global.js
CHANGED
|
@@ -1581,6 +1581,12 @@ var GameFluids = (() => {
|
|
|
1581
1581
|
surfaces.delete(id);
|
|
1582
1582
|
for (const s of [...stains.values()]) if (s.surface === id) stains.delete(s.id);
|
|
1583
1583
|
},
|
|
1584
|
+
moveSurface(id, offset) {
|
|
1585
|
+
const surface = surfaces.get(id);
|
|
1586
|
+
if (!surface) return;
|
|
1587
|
+
surface.point = add(surface.point, offset);
|
|
1588
|
+
for (const s of stains.values()) if (s.surface === id) s.center = add(s.center, offset);
|
|
1589
|
+
},
|
|
1584
1590
|
splash(liquid, point, liters, velocity, options2) {
|
|
1585
1591
|
if (!liquids.has(liquid) || !(liters > 0)) return;
|
|
1586
1592
|
const v = velocity ?? [0, -0.1, 0];
|