@adatechnology/game-fluids-three 0.2.3 → 0.3.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 +14 -0
- package/dist/index.global.js +909 -233
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +29 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -124,6 +124,8 @@ declare class FilmGrid {
|
|
|
124
124
|
setView(camera: Vec3, forward: Vec3, time: number): void;
|
|
125
125
|
/** Steps the film one frame and refreshes the texture cells that may have changed. Returns the rectangle to upload, or null. */
|
|
126
126
|
update(dt: number, dryingSeconds: number): CellRect | null;
|
|
127
|
+
/** Clears the cells less than `maxDryness` dry and sends the rectangle that held them up with the next update. Returns how many it cleared. */
|
|
128
|
+
wash(maxDryness?: number): number;
|
|
127
129
|
private takePending;
|
|
128
130
|
/** The mean dryness of the cells that are wet (1 when nothing is). */
|
|
129
131
|
dryness(): number;
|
|
@@ -182,6 +184,8 @@ interface FilmManagerOptions {
|
|
|
182
184
|
/** Colour of the surface under the film (default the page's grey). */
|
|
183
185
|
base?: number;
|
|
184
186
|
maxGrids?: number;
|
|
187
|
+
/** The liquids rain washes while fresh (`wash`). Default `blood` and `old_blood`. */
|
|
188
|
+
washable?: readonly string[];
|
|
185
189
|
/** Metres from the player past which a grid is not simulated and is baked. */
|
|
186
190
|
range?: number;
|
|
187
191
|
/** Milliseconds of film simulation per frame; the grids left out wait for the next frame. */
|
|
@@ -246,6 +250,7 @@ declare class FilmManager {
|
|
|
246
250
|
private readonly staging;
|
|
247
251
|
private readonly now;
|
|
248
252
|
private rain;
|
|
253
|
+
private drying;
|
|
249
254
|
private time;
|
|
250
255
|
private bakedCount;
|
|
251
256
|
private last;
|
|
@@ -256,7 +261,13 @@ declare class FilmManager {
|
|
|
256
261
|
list(): readonly FilmGrid[];
|
|
257
262
|
setWeather(weather: {
|
|
258
263
|
rain: number;
|
|
264
|
+
drying?: number;
|
|
259
265
|
}): void;
|
|
266
|
+
/**
|
|
267
|
+
* Rain washes the fresh stain away (the visor's `ZG.wipe` with mode "chuva"): in the grids of the washable liquids (default blood and old blood), the
|
|
268
|
+
* cells that are less than `maxDryness` dry (default 0.5) are cleared. Returns how many cells it cleared.
|
|
269
|
+
*/
|
|
270
|
+
wash(maxDryness?: number): number;
|
|
260
271
|
/** Throws a drop of a liquid: it lands in the grid under it (made on the spot) and leaves the impact splash. Null when it is out of range or has no surface. */
|
|
261
272
|
launch(request: FilmLaunch): FilmGrid | null;
|
|
262
273
|
/** A drip: a bead swells at `point`, detaches and falls every `every` seconds on average. Replaces the grid's drip. */
|
|
@@ -362,7 +373,10 @@ interface FilmBridge {
|
|
|
362
373
|
/** Weather of the film (the Phase 6 hook): while it rains the film does not dry and spreads 1.5 times faster. */
|
|
363
374
|
setWeather(weather: {
|
|
364
375
|
rain: number;
|
|
376
|
+
drying?: number;
|
|
365
377
|
}): void;
|
|
378
|
+
/** Rain washes the fresh film of the washable liquids (less than half dry, or `maxDryness`). Returns the cells it cleared. */
|
|
379
|
+
wash(maxDryness?: number): number;
|
|
366
380
|
/** Streams of the world that feed the film right now. */
|
|
367
381
|
readonly leaks: number;
|
|
368
382
|
/** Feeds the leaks: call it each frame with the frame's seconds, before or after `manager.update`. */
|