Current project

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#

GML
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.

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 / ownerSignatureOperation contract
jolt_soft_body_windjolt_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.destroyJoltSoftBodyWind.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_debugJoltSoftBodyWind.get_debug()Stored debug Boolean; does not itself check validity.
JoltSoftBodyWind.get_directionJoltSoftBodyWind.get_direction()Copy of stored unit world {x, y, z}; configuration getter, does not itself check helper validity.
JoltSoftBodyWind.get_dragJoltSoftBodyWind.get_drag()Drag coefficient: stored configuration in dimensionless units; does not itself check validity. Not the instantaneous gust velocity.
JoltSoftBodyWind.get_enabledJoltSoftBodyWind.get_enabled()Boolean; false when invalid or disabled.
JoltSoftBodyWind.get_gust_frequencyJoltSoftBodyWind.get_gust_frequency()Gust frequency: stored configuration in Hz; does not itself check validity. Not the instantaneous gust velocity.
JoltSoftBodyWind.get_gust_strengthJoltSoftBodyWind.get_gust_strength()Gust strength: stored configuration in dimensionless units; does not itself check validity. Not the instantaneous gust velocity.
JoltSoftBodyWind.get_speedJoltSoftBodyWind.get_speed()Base air speed: stored configuration in m/s; does not itself check validity. Not the instantaneous gust velocity.
JoltSoftBodyWind.get_turbulenceJoltSoftBodyWind.get_turbulence()Turbulence: stored configuration in dimensionless units; does not itself check validity. Not the instantaneous gust velocity.
JoltSoftBodyWind.get_velocityJoltSoftBodyWind.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_validJoltSoftBodyWind.is_valid()Boolean; both helper and its soft body must be live. Destroying the soft body invalidates the helper.
JoltSoftBodyWind.set_debugJoltSoftBodyWind.set_debug(v)Boolean coercion; default false. Returns true/false, requires a live helper. Diagnostics only.
JoltSoftBodyWind.set_directionJoltSoftBodyWind.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_dragJoltSoftBodyWind.set_drag(v)Drag coefficient: finite 0..5 , default 1.2. Boolean; stored only after successful native configuration.
JoltSoftBodyWind.set_enabledJoltSoftBodyWind.set_enabled(v)Boolean coercion, default true; Boolean success. Persists across steps; disabling does not destroy the helper.
JoltSoftBodyWind.set_gust_frequencyJoltSoftBodyWind.set_gust_frequency(v)Gust frequency: finite 0..10 Hz, default 0.35. Boolean; stored only after successful native configuration.
JoltSoftBodyWind.set_gust_strengthJoltSoftBodyWind.set_gust_strength(v)Gust strength: finite 0..1 , default 0.3. Boolean; stored only after successful native configuration.
JoltSoftBodyWind.set_speedJoltSoftBodyWind.set_speed(v)Base air speed: finite 0..100 m/s, default 5. Boolean; stored only after successful native configuration.
JoltSoftBodyWind.set_turbulenceJoltSoftBodyWind.set_turbulence(v)Turbulence: finite 0..1 , default 0.2. Boolean; stored only after successful native configuration.