@woosh/meep-engine 2.157.0 → 2.159.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/package.json +1 -1
- package/src/core/binary/BitSet.d.ts.map +1 -1
- package/src/core/binary/BitSet.js +6 -1
- package/src/core/binary/float_to_uint8.d.ts +4 -1
- package/src/core/binary/float_to_uint8.d.ts.map +1 -1
- package/src/core/binary/float_to_uint8.js +7 -2
- package/src/core/bvh2/bvh3/query/compute_tight_near_far_clipping_planes.d.ts +11 -1
- package/src/core/bvh2/bvh3/query/compute_tight_near_far_clipping_planes.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/compute_tight_near_far_clipping_planes.js +37 -14
- package/src/core/geom/3d/shape/PosedShape3D.d.ts +17 -0
- package/src/core/geom/3d/shape/PosedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/PosedShape3D.js +50 -0
- package/src/core/math/gaussian.d.ts +7 -6
- package/src/core/math/gaussian.d.ts.map +1 -1
- package/src/core/math/gaussian.js +9 -8
- package/src/engine/graphics/ecs/trail2d/Trail2D.d.ts.map +1 -1
- package/src/engine/graphics/ecs/trail2d/Trail2D.js +21 -0
- package/src/engine/graphics/ecs/trail2d/Trail2DFlags.d.ts +1 -0
- package/src/engine/graphics/ecs/trail2d/Trail2DFlags.js +9 -1
- package/src/engine/physics/fluid/FluidField.d.ts +53 -9
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +684 -600
- package/src/engine/physics/fluid/FluidSimulator.d.ts +53 -38
- package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidSimulator.js +252 -178
- package/src/engine/physics/fluid/REVIEW_02_PLAN.md +155 -26
- package/src/engine/physics/fluid/ecs/FluidObstacle.d.ts +72 -0
- package/src/engine/physics/fluid/ecs/FluidObstacle.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidObstacle.js +97 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +117 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.js +348 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +62 -12
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +135 -38
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +85 -38
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.js +104 -50
- package/src/engine/physics/fluid/prototype.js +25 -1
- package/src/engine/physics/fluid/solver/v3_grid_sample_scalar_masked.d.ts +30 -0
- package/src/engine/physics/fluid/solver/v3_grid_sample_scalar_masked.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_sample_scalar_masked.js +92 -0
- package/src/engine/physics/fluid/solver/v3_mac_advect_maccormack_velocity.d.ts +42 -0
- package/src/engine/physics/fluid/solver/v3_mac_advect_maccormack_velocity.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_mac_advect_maccormack_velocity.js +319 -0
- package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.d.ts +53 -0
- package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.js +236 -0
- package/src/engine/physics/fluid/solver/v3_mac_advect_sl_velocity.d.ts +46 -0
- package/src/engine/physics/fluid/solver/v3_mac_advect_sl_velocity.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_mac_advect_sl_velocity.js +217 -0
- package/src/engine/physics/fluid/solver/v3_mac_apply_vorticity_confinement.d.ts +40 -0
- package/src/engine/physics/fluid/solver/v3_mac_apply_vorticity_confinement.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_mac_apply_vorticity_confinement.js +165 -0
- package/src/engine/physics/fluid/solver/v3_mac_clip_trace.d.ts +44 -0
- package/src/engine/physics/fluid/solver/v3_mac_clip_trace.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_mac_clip_trace.js +95 -0
- package/src/engine/physics/fluid/solver/v3_mac_compute_divergence.d.ts +38 -0
- package/src/engine/physics/fluid/solver/v3_mac_compute_divergence.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_mac_compute_divergence.js +77 -0
- package/src/engine/physics/fluid/solver/v3_mac_compute_face_solid.d.ts +52 -0
- package/src/engine/physics/fluid/solver/v3_mac_compute_face_solid.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_mac_compute_face_solid.js +131 -0
- package/src/engine/physics/fluid/solver/v3_mac_subtract_pressure_gradient.d.ts +38 -0
- package/src/engine/physics/fluid/solver/v3_mac_subtract_pressure_gradient.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_mac_subtract_pressure_gradient.js +104 -0
- package/src/engine/physics/fluid/effector/AmbientWindFluidEffector.d.ts +0 -41
- package/src/engine/physics/fluid/effector/AmbientWindFluidEffector.d.ts.map +0 -1
- package/src/engine/physics/fluid/effector/AmbientWindFluidEffector.js +0 -124
|
@@ -19,7 +19,12 @@ export namespace PressureSolver {
|
|
|
19
19
|
let MICPCG: string;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* VELOCITY transport scheme selection. Passive scalars always use
|
|
23
|
+
* semi-Lagrangian transport regardless of this setting — gather-form
|
|
24
|
+
* MacCormack is non-conservative (the corrector re-adds roughly double the
|
|
25
|
+
* gather bias; measured 1.7x total dye mass in one second of a sealed
|
|
26
|
+
* vortex, independent of wall handling), and scalar conservation is a hard
|
|
27
|
+
* requirement, not a preference.
|
|
23
28
|
*
|
|
24
29
|
* - `"semi-lagrangian"` — first-order back-trace + trilinear gather (Stam
|
|
25
30
|
* 1999). Cheapest; strongly dissipative — a vortex loses half its kinetic
|
|
@@ -27,10 +32,8 @@ export namespace PressureSolver {
|
|
|
27
32
|
*
|
|
28
33
|
* - `"maccormack"` — unconditionally stable MacCormack (Selle et al. 2008):
|
|
29
34
|
* a forward and a backward semi-Lagrangian pass with error correction and
|
|
30
|
-
* a monotone min-max limiter. Second-order accurate in space and time
|
|
31
|
-
*
|
|
32
|
-
* next to pressure, so the end-to-end price is small. Allocates 3
|
|
33
|
-
* additional N-sized scratch buffers, shared with the reflection scheme.
|
|
35
|
+
* a monotone min-max limiter. Second-order accurate in space and time.
|
|
36
|
+
* Allocates 3 additional face-lattice scratch buffers.
|
|
34
37
|
*/
|
|
35
38
|
export type AdvectionScheme = string;
|
|
36
39
|
export namespace AdvectionScheme {
|
|
@@ -38,7 +41,10 @@ export namespace AdvectionScheme {
|
|
|
38
41
|
let MACCORMACK: string;
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
41
|
-
*
|
|
44
|
+
* 3D incompressible-flow solver on a MAC (staggered) grid — Stam's stable-
|
|
45
|
+
* fluids step structure (1999/2003) with face-centered velocity (Harlow &
|
|
46
|
+
* Welch 1965), an exact discrete Helmholtz projection, and optional
|
|
47
|
+
* advection-reflection / MacCormack transport.
|
|
42
48
|
*
|
|
43
49
|
* Holds tuning knobs plus transient working memory (per-step velocity snapshots,
|
|
44
50
|
* divergence, ping-pong scratch). None of that working memory carries information
|
|
@@ -56,8 +62,8 @@ export namespace AdvectionScheme {
|
|
|
56
62
|
* form of the same two projections (see {@link advection_reflection}).
|
|
57
63
|
* Advection itself is semi-Lagrangian or MacCormack per
|
|
58
64
|
* {@link advection_scheme}.
|
|
59
|
-
* 6. For each scalar attribute on the field: optionally diffuse, then
|
|
60
|
-
*
|
|
65
|
+
* 6. For each scalar attribute on the field: optionally diffuse, then
|
|
66
|
+
* advect (always semi-Lagrangian — see {@link AdvectionScheme}).
|
|
61
67
|
*
|
|
62
68
|
* Pressure is warm-started from the previous step's solution (`field.pressure`),
|
|
63
69
|
* which converges much faster than starting from zero once the flow reaches a
|
|
@@ -127,13 +133,19 @@ export class FluidSimulator {
|
|
|
127
133
|
*
|
|
128
134
|
* Why it exists: the solver has no other dissipation mechanism that bounds
|
|
129
135
|
* energy under sustained forcing. Incompressible projection cannot oppose
|
|
130
|
-
* a uniform body force (a uniform field is divergence-free), so a
|
|
131
|
-
* {@link GlobalFluidEffector} accelerates the fluid without
|
|
132
|
-
* is no terminal state. A small damping rate gives constant
|
|
133
|
-
* terminal velocity of approximately
|
|
134
|
-
* and makes transient gusts decay back
|
|
135
|
-
*
|
|
136
|
-
*
|
|
136
|
+
* a uniform body force (a uniform field is divergence-free), so a bare
|
|
137
|
+
* `force` on a {@link GlobalFluidEffector} accelerates the fluid without
|
|
138
|
+
* limit — there is no terminal state. A small damping rate gives constant
|
|
139
|
+
* forcing a terminal velocity of approximately
|
|
140
|
+
* `acceleration / velocity_damping` and makes transient gusts decay back
|
|
141
|
+
* to calm.
|
|
142
|
+
*
|
|
143
|
+
* Relationship to {@link GlobalFluidEffector#drag}: the effector's drag
|
|
144
|
+
* is the same operation expressed as SCENE CONTENT — it relaxes toward a
|
|
145
|
+
* configurable ambient wind and travels with the effector entity. This
|
|
146
|
+
* knob is the SOLVER-level stability primitive: it exists even when no
|
|
147
|
+
* effectors are wired, and always relaxes toward zero. Use the effector
|
|
148
|
+
* for atmosphere design; use this to guarantee boundedness.
|
|
137
149
|
*
|
|
138
150
|
* The exponential form is frame-rate independent: two half-steps damp
|
|
139
151
|
* exactly as much as one full step.
|
|
@@ -175,21 +187,19 @@ export class FluidSimulator {
|
|
|
175
187
|
*/
|
|
176
188
|
vorticity_confinement: number;
|
|
177
189
|
/**
|
|
178
|
-
* Which transport scheme advects
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* **Default
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* it is the interaction with the collocated pressure floor that is
|
|
192
|
-
* unstable. Flip this on once the grid is staggered.
|
|
190
|
+
* Which transport scheme advects VELOCITY — see {@link AdvectionScheme}
|
|
191
|
+
* (scalars are always semi-Lagrangian; see the enum docstring for why).
|
|
192
|
+
*
|
|
193
|
+
* **Default MacCormack.** On the MAC grid with solid-clipped traces it is
|
|
194
|
+
* measured long-horizon stable (sealed-vortex energy peaks at 0.96x its
|
|
195
|
+
* initial over 10 s, monotone decay thereafter) and retains dramatically
|
|
196
|
+
* more energy than first-order transport: 0.80 vs 0.53 KE after one
|
|
197
|
+
* second (quality.spec.js scenario 2b).
|
|
198
|
+
*
|
|
199
|
+
* Do NOT combine with {@link advection_reflection}: the energy-preserving
|
|
200
|
+
* reflection re-injects the corrector overshoots and the pair pumps
|
|
201
|
+
* energy without bound (10 s peak 3.7x — measured both with and without
|
|
202
|
+
* trace clipping). Reflection is the companion for SEMI_LAGRANGIAN.
|
|
193
203
|
*
|
|
194
204
|
* @type {string}
|
|
195
205
|
*/
|
|
@@ -207,22 +217,27 @@ export class FluidSimulator {
|
|
|
207
217
|
*
|
|
208
218
|
* Same two pressure solves as the default double-projection Stam step,
|
|
209
219
|
* and two half-dt advections instead of one full-dt one — measured cost
|
|
210
|
-
*
|
|
220
|
+
* ~+70% of step() at 32×8×32 on the MAC lattices (each half-step pays the
|
|
221
|
+
* cross-component carrier sampling). The reflection replaces the
|
|
211
222
|
* energy-DISSIPATING first projection with an energy-PRESERVING
|
|
212
223
|
* reflection about the divergence-free subspace.
|
|
213
224
|
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
* see {@link advection_scheme}
|
|
220
|
-
* staggering.
|
|
225
|
+
* With semi-Lagrangian advection this is measured stable (sealed-vortex
|
|
226
|
+
* kinetic energy never exceeds its initial over 10 s) while retaining
|
|
227
|
+
* visibly more swirl — peak vorticity 0.74 vs 0.68 after one second
|
|
228
|
+
* (quality.spec.js scenario 2b). Do NOT combine with MacCormack — the
|
|
229
|
+
* reflection re-injects the corrector overshoots (10 s energy peak
|
|
230
|
+
* 3.7x); see {@link advection_scheme}.
|
|
221
231
|
*
|
|
222
232
|
* Only consulted when {@link project_before_advection} is true — the
|
|
223
233
|
* scheme is defined around the mid-step projection. With
|
|
224
234
|
* `project_before_advection = false` this flag is ignored.
|
|
225
235
|
*
|
|
236
|
+
* Default OFF: the default velocity scheme is MacCormack, with which the
|
|
237
|
+
* reflection is unstable (see {@link advection_scheme}). Enable it when
|
|
238
|
+
* running SEMI_LAGRANGIAN velocity transport — that pairing is measured
|
|
239
|
+
* stable and retains visibly more swirl than plain SL.
|
|
240
|
+
*
|
|
226
241
|
* @type {boolean}
|
|
227
242
|
*/
|
|
228
243
|
advection_reflection: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FluidSimulator.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/fluid/FluidSimulator.js"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"FluidSimulator.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/fluid/FluidSimulator.js"],"names":[],"mappings":";;;;;;;;;;;;;;;6BA2BU,MAAM;;;;;;;;;;;;;;;;;;;;;;8BAwBN,MAAM;;;;;AAOhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;;;;;;;;;GASG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;;;;;;;;;;;;;;GAgBG;AACH,qCAFU,MAAM,CAE2B;AAE3C;IAEI;;;OAGG;IACH,yBAFU,MAAM,CAEY;IAE5B;;;;OAIG;IACH,+BAFU,MAAM,CAEkB;IAElC;;;;;OAKG;IACH,uBAFU,MAAM,CAEU;IAE1B;;OAEG;IACH,6BAFU,MAAM,CAEgB;IAEhC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,kBAFU,MAAM,CAEK;IAErB;;;;;;;;;;;;;;;OAeG;IACH,iBAFU,MAAM,CAEqB;IAErC;;;;;;;;;;;;;;OAcG;IACH,uBAFU,MAAM,CAEU;IAE1B;;;;;;;;;;;;;;;;OAgBG;IACH,kBAFU,MAAM,CAE8B;IAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,sBAFU,OAAO,CAEY;IAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,0BAFU,OAAO,CAEe;IAEhC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,0BAFU,MAAM,CAEgB;IAuKhC;;;;;;;;;;;;OAYG;IACH,iCALW,MAAM,SACN,MAAM,SACN,MAAM,GACL,MAAM,CAUjB;IAED;;;;;;;;;;;;OAYG;IACH,iCAGC;IAwFD;;;;;;;;;;;;;OAaG;IACH,oCAVW,MAAM,aAEN,uBAAuB,iBACvB,YAAY,GAAC,MAAM,EAAE,QA4L/B;;CACJ"}
|