Cloth Properties
Tune the live cloth without replacing its body or attachments.
Tune the live cloth without replacing its body or attachments.
| Property | Runtime methods |
|---|---|
| mass | set_mass / get_mass |
| stretch | set_stretch / get_stretch (set_stretch / get_stretch) |
| bend | set_bend / get_bend |
| gravity | set_gravity_factor / get_gravity_factor |
| friction | set_friction / get_friction |
| damping | set_damping / get_damping |
| collision thickness | set_collision_thickness / get_collision_thickness |
Mass is the total cloth mass. Stretch and bend are stiffness values in 0..1: higher values resist deformation more strongly. Bend=0 removes bending constraints; stretch remains independent. Damping reduces particle motion; excessive damping can make cloth look sluggish.
Collision thickness is the particle collision radius, not rendered fabric thickness. Setters validate values and return success; invalid values preserve previous state. Geometry resolution remains construction-only. Runtime material changes preserve particle positions, velocities, attachments and Carry ownership.
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.attach_edge | JoltBBMODCloth.attach_edge(name,body) | attach_edge: names top, bottom, left, right, case-insensitive. Boolean; labels follow the original grid, not world directions after rotation. top is y=0. attach_edge requires a live JoltBody in the same world. |
| JoltBBMODCloth.attach_point | JoltBBMODCloth.attach_point(x,y,body) | Attaches a point to a live JoltBody in the same world at its current relative offset. Integer grid x=0..segments_x, y=0..segments_y including boundaries. Boolean; these are not world coordinates. |
| JoltBBMODCloth.detach_all | JoltBBMODCloth.detach_all() | Detaches all grid attachments; Boolean. Does not destroy the cloth. |
| JoltBBMODCloth.detach_edge | JoltBBMODCloth.detach_edge(name) | detach_edge: names top, bottom, left, right, case-insensitive. Boolean; labels follow the original grid, not world directions after rotation. top is y=0. attach_edge requires a live JoltBody in the same world. |
| JoltBBMODCloth.detach_point | JoltBBMODCloth.detach_point(x,y) | Detaches a point from its host. Integer grid x=0..segments_x, y=0..segments_y including boundaries. Boolean; these are not world coordinates. |
| JoltBBMODCloth.get_bend | JoltBBMODCloth.get_bend() | Stiffness 0..1, undefined for an invalid wrapper; inspect native errors separately. Available only for procedural or open model cloth. |
| JoltBBMODCloth.get_collision_thickness | JoltBBMODCloth.get_collision_thickness() | Particle radius: current numeric value in m. Failure: undefined (invalid wrapper); inspect native errors separately; an invalid object is not a zero measurement. |
| JoltBBMODCloth.get_damping | JoltBBMODCloth.get_damping() | Linear damping: current numeric value in 1/s. Failure: undefined (invalid wrapper); inspect native errors separately; an invalid object is not a zero measurement. |
| JoltBBMODCloth.get_friction | JoltBBMODCloth.get_friction() | Friction coefficient: current numeric value in dimensionless units. Failure: undefined (invalid wrapper); inspect native errors separately; an invalid object is not a zero measurement. |
| JoltBBMODCloth.get_gravity_factor | JoltBBMODCloth.get_gravity_factor() | Gravity multiplier: current numeric value in dimensionless units. Failure: undefined (invalid wrapper); inspect native errors separately; an invalid object is not a zero measurement. |
| JoltBBMODCloth.get_mass | JoltBBMODCloth.get_mass() | Total cloth mass: current numeric value in kg. Failure: undefined; an invalid object is not a zero measurement. |
| JoltBBMODCloth.get_stretch | JoltBBMODCloth.get_stretch() | Stretch stiffness: current numeric value in dimensionless units. Failure: undefined; an invalid object is not a zero measurement. |
| JoltBBMODCloth.is_point_attached | JoltBBMODCloth.is_point_attached(x,y) | Boolean for an integer grid point including boundaries; also false for an invalid point/wrapper. Attached and pinned are not interchangeable queries: moving host versus particle fixation. |
| JoltBBMODCloth.render | JoltBBMODCloth.render() | Renders current deformed geometry if live and visible; no return value. draw aliases render. Do not additionally call these manually when registered with a renderer. |
| JoltBBMODCloth.set_bend | JoltBBMODCloth.set_bend(v) | Procedural or open model cloth only: finite stiffness 0..1, default 0.3. Boolean; 0 removes bend constraints, positive values rebuild them from rest geometry without changing particle/attachment identities. A closed model has no such method. |
| JoltBBMODCloth.set_collision_thickness | JoltBBMODCloth.set_collision_thickness(v) | Particle radius: finite number 0..1000000 m; default 0.01. Returns true on acceptance, false for an invalid input or object. Updates the live object. |
| JoltBBMODCloth.set_damping | JoltBBMODCloth.set_damping(v) | Linear damping: finite number 0..1000000 1/s; default 0.1. Returns true on acceptance, false for an invalid input or object. Updates the live object. |
| JoltBBMODCloth.set_friction | JoltBBMODCloth.set_friction(v) | Friction coefficient: finite number 0..1000000 ; default 0.5. Returns true on acceptance, false for an invalid input or object. Updates the live object. |
| JoltBBMODCloth.set_gravity_factor | JoltBBMODCloth.set_gravity_factor(v) | Gravity multiplier: finite number 0..1000000 ; default 1. Returns true on acceptance, false for an invalid input or object. Updates the live object. |
| JoltBBMODCloth.set_mass | JoltBBMODCloth.set_mass(v) | Total cloth mass: finite number 0.000001..1000000000 kg; default 1. Returns true on acceptance, false for an invalid input or object. Updates the live object. |
| JoltBBMODCloth.set_stretch | JoltBBMODCloth.set_stretch(v) | Stretch stiffness: finite number 0..1 ; default 0.9. Returns true on acceptance, false for an invalid input or object. Updates the live object. |
| JoltBBMODCloth.set_visible | JoltBBMODCloth.set_visible(value) | Input coerced to Boolean, default true. Returns Boolean success. Hides rendering without disabling physics. |
| JoltBBMODCloth.update_mesh | JoltBBMODCloth.update_mesh(force=false) | Boolean success; force=false uses the physics revision cache. force=true forces an update even after manual native stepping. Positions are already world-space; do not apply the body transform again. |