Wind
One helper per Soft Body; repeated creation returns it without doubling the effect. Direction is normalized and means where air travels in world axes. Speed is m/s. get_velocity returns air velocity, not particle velocity. Wind runs automatically during physics steps, including direct jolt_step. No per-frame apply is needed.
Example#
wind = jolt_soft_body_wind(cloth);
wind.set_direction(1, 0, 0);
wind.set_speed(5);
wind.set_gust_strength(0.3);
wind.set_turbulence(0.2);
wind.set_gust_frequency(0.35);
wind.set_drag(1.2);
wind.set_enabled(true);Usage and limits#
Ranges: speed 0..100, gust strength/turbulence 0..1, frequency 0..10 Hz, drag 0..5. Zero speed/drag removes the effect. Disabling pauses gust time, not existing cloth motion. Forces use projected current triangle area and relative air velocity from both sides. Wind parallel to a flat sheet has little effect.
Pinned/attached particles are not directly driven. Gusts are smooth deterministic waves in simulation time. No wall sheltering, fluid simulation or global wind volumes are provided. JOLT_DEBUG_FORCES or set_debug(true) shows direction; owner destruction and jolt_stop clean the helper.
API reference#
Public function and method signatures. Call methods on the returned instance; parameters with defaults are optional.
Related guides#
- Migrating existing code
- Choosing a Soft Body
- Soft sphere
- Volumetric soft box
- Closed model import
- Cloth model and named anchors
- Spatial attachments
- Separate visual mesh
- Local force and impulse
- Carrying Soft Bodies
Verified operation contracts#
These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.
| Symbol / owner | Signature | Operation contract |
|---|---|---|
| jolt_soft_body_wind | jolt_soft_body_wind(soft) | Live JoltBBMODCloth/JoltBBMODSoftBody. Returns Wind or undefined. One helper per body, repeated calls return the existing one. Created enabled=true: +X, 5 m/s, gust 0.3, turbulence 0.2, frequency 0.35 Hz, drag 1.2. |
| JoltSoftBodyWind.destroy | JoltSoftBodyWind.destroy() | Boolean, repeated destruction is safe. Removes only the helper, not the soft body or rigid host. Wind disables airflow, Force cancels the pending request, Attachment releases its particle selection. |
| JoltSoftBodyWind.get_debug | JoltSoftBodyWind.get_debug() | Stored debug Boolean; does not itself check validity. |
| JoltSoftBodyWind.get_direction | JoltSoftBodyWind.get_direction() | Copy of stored unit world {x, y, z}; configuration getter, does not itself check helper validity. |
| JoltSoftBodyWind.get_drag | JoltSoftBodyWind.get_drag() | Drag coefficient: stored configuration in dimensionless units; does not itself check validity. Not the instantaneous gust velocity. |
| JoltSoftBodyWind.get_enabled | JoltSoftBodyWind.get_enabled() | Boolean; false when invalid or disabled. |
| JoltSoftBodyWind.get_gust_frequency | JoltSoftBodyWind.get_gust_frequency() | Gust frequency: stored configuration in Hz; does not itself check validity. Not the instantaneous gust velocity. |
| JoltSoftBodyWind.get_gust_strength | JoltSoftBodyWind.get_gust_strength() | Gust strength: stored configuration in dimensionless units; does not itself check validity. Not the instantaneous gust velocity. |
| JoltSoftBodyWind.get_speed | JoltSoftBodyWind.get_speed() | Base air speed: stored configuration in m/s; does not itself check validity. Not the instantaneous gust velocity. |
| JoltSoftBodyWind.get_turbulence | JoltSoftBodyWind.get_turbulence() | Turbulence: stored configuration in dimensionless units; does not itself check validity. Not the instantaneous gust velocity. |
| JoltSoftBodyWind.get_velocity | JoltSoftBodyWind.get_velocity() | Instantaneous world airflow {x, y, z} in m/s including gusts, zero when disabled. undefined for an invalid helper; inspect individual native errors separately. |
| JoltSoftBodyWind.is_valid | JoltSoftBodyWind.is_valid() | Boolean; both helper and its soft body must be live. Destroying the soft body invalidates the helper. |
| JoltSoftBodyWind.set_debug | JoltSoftBodyWind.set_debug(v) | Boolean coercion; default false. Returns true/false, requires a live helper. Diagnostics only. |
| JoltSoftBodyWind.set_direction | JoltSoftBodyWind.set_direction(x,y,z) | Finite world x/y/z, absolute values ≤ 1e9, length ≥ 1e-6. Normalizes direction; Boolean, false for an invalid helper. |
| JoltSoftBodyWind.set_drag | JoltSoftBodyWind.set_drag(v) | Drag coefficient: finite 0..5 , default 1.2. Boolean; stored only after successful native configuration. |
| JoltSoftBodyWind.set_enabled | JoltSoftBodyWind.set_enabled(v) | Boolean coercion, default true; Boolean success. Persists across steps; disabling does not destroy the helper. |
| JoltSoftBodyWind.set_gust_frequency | JoltSoftBodyWind.set_gust_frequency(v) | Gust frequency: finite 0..10 Hz, default 0.35. Boolean; stored only after successful native configuration. |
| JoltSoftBodyWind.set_gust_strength | JoltSoftBodyWind.set_gust_strength(v) | Gust strength: finite 0..1 , default 0.3. Boolean; stored only after successful native configuration. |
| JoltSoftBodyWind.set_speed | JoltSoftBodyWind.set_speed(v) | Base air speed: finite 0..100 m/s, default 5. Boolean; stored only after successful native configuration. |
| JoltSoftBodyWind.set_turbulence | JoltSoftBodyWind.set_turbulence(v) | Turbulence: finite 0..1 , default 0.2. Boolean; stored only after successful native configuration. |