Cloth

Cloth Properties

Tune the live cloth without replacing its body or attachments.

Tune the live cloth without replacing its body or attachments.

PropertyRuntime methods
massset_mass / get_mass
stretchset_stretch / get_stretch (set_stretch / get_stretch)
bendset_bend / get_bend
gravityset_gravity_factor / get_gravity_factor
frictionset_friction / get_friction
dampingset_damping / get_damping
collision thicknessset_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.

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
JoltBBMODCloth.attach_edgeJoltBBMODCloth.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_pointJoltBBMODCloth.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_allJoltBBMODCloth.detach_all()Detaches all grid attachments; Boolean. Does not destroy the cloth.
JoltBBMODCloth.detach_edgeJoltBBMODCloth.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_pointJoltBBMODCloth.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_bendJoltBBMODCloth.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_thicknessJoltBBMODCloth.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_dampingJoltBBMODCloth.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_frictionJoltBBMODCloth.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_factorJoltBBMODCloth.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_massJoltBBMODCloth.get_mass()Total cloth mass: current numeric value in kg. Failure: undefined; an invalid object is not a zero measurement.
JoltBBMODCloth.get_stretchJoltBBMODCloth.get_stretch()Stretch stiffness: current numeric value in dimensionless units. Failure: undefined; an invalid object is not a zero measurement.
JoltBBMODCloth.is_point_attachedJoltBBMODCloth.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.renderJoltBBMODCloth.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_bendJoltBBMODCloth.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_thicknessJoltBBMODCloth.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_dampingJoltBBMODCloth.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_frictionJoltBBMODCloth.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_factorJoltBBMODCloth.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_massJoltBBMODCloth.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_stretchJoltBBMODCloth.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_visibleJoltBBMODCloth.set_visible(value)Input coerced to Boolean, default true. Returns Boolean success. Hides rendering without disabling physics.
JoltBBMODCloth.update_meshJoltBBMODCloth.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.