Cloth
Forces and Wind
Apply forces through physics or configure persistent aerodynamic wind.
Apply forces through physics or configure persistent aerodynamic wind.
cloth.add_force(x, y, z);This is a force, not an instantaneous impulse. Apply gameplay forces before the physics update. The API also supports local soft-body force/impulse helpers. Pinned and attached points follow their ownership rules.
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 is registered once and applied during physics steps; no per-frame apply() call is required. Destroying the cloth invalidates its wind helper. Wind does not perform obstacle occlusion.
New related workflows#
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 |
|---|---|---|
| JoltBBMODCloth.add_force | JoltBBMODCloth.add_force(x,y,z) | World force x/y/z in N; finiteness is checked natively. Boolean. This is total force; use jolt_soft_body_force for a local effect. |