Contents5 sections
Kinds
| Kind | What it does |
|---|---|
push | Pushes along direction, like a fan. |
point | Away from the center, or toward it with negative strength. Gas only. |
vortex | Spins gas around direction (right-hand rule). |
turbulence | Random gusts in one place. |
drag | Slows the gas: a still pocket behind a wall. |
expand | Pushes everything outward: a blast. Keep it short, about 0.1 s. |
Example
The fire whirl spins a ground fire into a column and pulls air in at its foot:
# The spin: around the vertical axis, up the whole column, on air and gas alike.
[[forces]]
kind = "vortex"
shape = "box"
position_m = [0, 4, 0]
size_m = [1.3, 4, 1.3]
direction = [0, 1, 0]
strength = 14
max_speed_mps = 4
falloff = 0.4
# Air drawn in at the foot, which is what keeps a real whirl narrow.
[[forces]]
kind = "point"
position_m = [0, 1.2, 0]
size_m = 2.0
strength = -6
falloff = 0.6
Change the fan strength
Each setting pushes the same looping plume sideways with a different force. The two passes of a looping compile share one solver.
forces.strength=0.01Fields
| Field | Meaning | Default |
|---|---|---|
kind | push, point, vortex, turbulence, drag or expand | push |
shape | sphere, box or everywhere | sphere |
position_m | Center of the region, of a point force and of a vortex (t) | [0, 1, 0] |
size_m | Radius of a sphere; half-extents of a box (t) | 1.0 |
rotation_deg | Turns the region and its direction (t) | [0, 0, 0] |
falloff | Fade toward the edge, 0 to 1 (t); 0 is a hard edge | 0.5 |
strength | Meters per second gained each second (t); for drag and expand a rate per second. Negative reverses push, point, vortex and expand. | 10 |
direction | Which way a push pushes, or the axis of a vortex (t) | [0, 1, 0] |
max_speed_mps | Stops adding speed to gas already this fast (t); 0 never stops | 0 |
acts_on | all (air and gas, like a fan) or gas (clear air is left alone) | all |
start_s, end_s | When it is on; end_s = 0 never stops | 0, 0 |
A push that piles gas against a wall cancels out, as in real air. expand always takes effect.
Questions
What kinds of forces can I add to a pyrofx spec?
You can add push, point, vortex, turbulence, drag and expand forces acting on a sphere, a box or everywhere.
What is the difference between acts_on all and gas in pyrofx forces?
Setting acts_on to all affects both air and gas like a fan, while gas leaves clear air alone.
Why does a push force against a wall stop moving gas in pyrofx?
A push that piles gas against a wall cancels out like real air, whereas expand always takes effect.