‹
Cloth

Limits and Lifecycle

Preserve physics ownership while releasing BBMOD resources safely.

Preserve physics ownership while releasing BBMOD resources safely.

Procedural cloth accepts 1..100 integer segments per axis: at most 10,201 particles and 20,000 triangles. Imported BBMOD cloth uses separate mesh validation limits. Tearing and self-collision are not implemented.

The current system supports runtime mass/stretch/bend, moving-body attachments, named model anchors, Carry, wind and local forces. Resolution and topology remain construction-time choices. This page describes the current BBMOD API, replacing the retired standalone renderer.

GML
cloth.destroy();
// Or at world shutdown:
jolt_stop();

destroy() is idempotent, unregisters rendering, releases owned meshes/materials and destroys the native body. Borrowed materials and source models remain caller-owned. jolt_stop() releases all managed soft bodies before destroying the world. Do not delete internal mesh buffers manually.

Use is_valid() and get_native_handle() for lifetime checks. Read jolt_get_error() immediately on failure; another API operation can replace it.

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.destroyJoltBBMODCloth.destroy()Boolean, repeatedly true after successful destruction. Removes physics first, then renderer registration, owned meshes/materials, attachments, wind and force helpers. Borrowed materials and host bodies are not destroyed.
JoltBBMODCloth.get_native_handleJoltBBMODCloth.get_native_handle()Valid soft-body handle, otherwise 0. Not a JoltBody handle for rigid-body methods.
JoltBBMODCloth.is_validJoltBBMODCloth.is_valid()Boolean based on the wrapper, handle and original managed world. Not a native existence query for every particle; do not mix raw destruction with managed ownership.