Media acting on materials
Skill ferret-physics-response · download all skills · SKILL.md
When to use#
A model with fans or rotors hovers over grass, sand, a pond or a lawn of leaves and the ground must answer; a jet or a river must move what it meets.
The model#
A model declares physics.propulsors; bindPropulsors publishes its jets (and the wall jet over a surface) into the flow field. Everything else only reads the field: FlowMap for plants, airOnWater for water, GroundWash, BedWash, FlakePool, physics-media for bodies, physics-stretch for cloth, jetFlux / snowMelted for heat. A model that declares no propulsors changes nothing.
Steps#
- Declare
physics.propulsorsin the model (kind, position, axis, diameter, optionalhoverShare,medium). const props = bindPropulsors(actor, { field, surface }); callprops.update()once a step.- Plants:
const map = new FlowMap(),map.update(field, camX, camZ, t, budget.mapStride)each frame, passflowMap: mapto the grass views and the foliage-wind plugin. - Water:
surface.forcing(airOnWater(field, surface, t, { publisher: 'physics-response' }), budget.waterStride)beforesurface.step;SprayEmitterfor spray;impactOnWaterfor falls. - Ground and bed:
GroundWash.step(dt, at)/BedWash.step(dt, at)with the grains of your ground; applydhto your height field; dust from the returned events. - Add
ResponseBudgetto the world so the quality regulator can give detail up.
Check afterwards#
Shots from examples/response on the NVIDIA card (tools/physics-response/sample-shot.mjs); the laws are tested in packages/physics-response/test; tools/physics-response/gpu-check.mjs checks the shader forms.
What usually goes wrong#
- Nothing blows: the model has no
propulsors, the actuator is off (no hover fallback then), orscaleis 0. - The grass does not lean: the view was made without
flowMap, or the map's centre is not near the source. - Water does not dent:
forcingnot called each step, or the field is asked for the weather's wind too (publisherlimits it). - A dust ring shows no pit: the height change is millimetres at real scale; judge it by
dh, not by eye. - WebGPU shows nothing: use the full Chromium; Ferret's GLSL shaders need
createGameAsync.
Files#
reference/response.md— physics/response.mdreference/api-physics-response.md— every export of@ferret/physics-responsewith signature and doc commentreference/api-physics-response-2.md— every export of@ferret/physics-responsewith signature and doc commentreference/api-flow.md— every export of@ferret/flowwith signature and doc commentreference/api-physics-liquids.md— every export of@ferret/physics-liquidswith signature and doc commentreference/api-physics-media.md— every export of@ferret/physics-mediawith signature and doc commentreference/commands.md— 36 commands of these packages with their arguments