‹›
Current project

Choosing a Soft Body

Procedural and imported cloth are open surfaces. A sphere and closed imported model are pressurized shells. A procedural box has internal particles and tetrahedral volume constraints. Choose by physical behavior rather than visual shape.

Usage and limits#

Start Jolt, create/configure before the first step and register the BBMOD renderer once. Keep the existing jolt_update loop; meshes refresh by physics revision and are reused across render passes. No second physics update is needed for rendering.

Use object setters; public settings factories were removed. get_position averages particle positions. A deformable body has no single rigid rotation describing its entire shape. Shared features include spatial attachments, opt-in Carry, local forces and wind. Self-collision, tearing and Soft Body–Soft Body collision are not supplied.

destroy()/jolt_stop release physics, attachments and owned rendering buffers. Borrowed materials/textures must stay alive until rendering ends; dispose your own source resources afterwards.

API reference#

Public function and method signatures. Call methods on the returned instance; parameters with defaults are optional.

Function / methodSignature
JoltBBMODSoftBody.add_forceJoltBBMODSoftBody.add_force(x,y,z)
JoltBBMODSoftBody.destroyJoltBBMODSoftBody.destroy()
JoltBBMODSoftBody.drawJoltBBMODSoftBody.draw()
JoltBBMODSoftBody.get_collision_thicknessJoltBBMODSoftBody.get_collision_thickness()
JoltBBMODSoftBody.get_dampingJoltBBMODSoftBody.get_damping()
JoltBBMODSoftBody.get_frictionJoltBBMODSoftBody.get_friction()
JoltBBMODSoftBody.get_gravity_factorJoltBBMODSoftBody.get_gravity_factor()
JoltBBMODSoftBody.get_layerJoltBBMODSoftBody.get_layer()
JoltBBMODSoftBody.get_massJoltBBMODSoftBody.get_mass()
JoltBBMODSoftBody.get_native_handleJoltBBMODSoftBody.get_native_handle()
JoltBBMODSoftBody.get_positionJoltBBMODSoftBody.get_position()
JoltBBMODSoftBody.get_stretchJoltBBMODSoftBody.get_stretch()
JoltBBMODSoftBody.get_vertex_positionJoltBBMODSoftBody.get_vertex_position(index)
JoltBBMODSoftBody.get_volumeJoltBBMODSoftBody.get_volume()
JoltBBMODSoftBody.is_validJoltBBMODSoftBody.is_valid()
JoltBBMODSoftBody.renderJoltBBMODSoftBody.render()
JoltBBMODSoftBody.set_collision_thicknessJoltBBMODSoftBody.set_collision_thickness(v)
JoltBBMODSoftBody.set_dampingJoltBBMODSoftBody.set_damping(v)
JoltBBMODSoftBody.set_debugJoltBBMODSoftBody.set_debug(v)
JoltBBMODSoftBody.set_frictionJoltBBMODSoftBody.set_friction(v)
JoltBBMODSoftBody.set_gravity_factorJoltBBMODSoftBody.set_gravity_factor(v)
JoltBBMODSoftBody.set_layerJoltBBMODSoftBody.set_layer(layer)
JoltBBMODSoftBody.set_massJoltBBMODSoftBody.set_mass(v)
JoltBBMODSoftBody.set_materialJoltBBMODSoftBody.set_material(material)
JoltBBMODSoftBody.set_rendererJoltBBMODSoftBody.set_renderer(renderer)
JoltBBMODSoftBody.set_stretchJoltBBMODSoftBody.set_stretch(v)
JoltBBMODSoftBody.set_visibleJoltBBMODSoftBody.set_visible(value)
JoltBBMODSoftBody.update_meshJoltBBMODSoftBody.update_mesh(force=false)

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
JoltBBMODSoftBody.add_forceJoltBBMODSoftBody.add_force(x,y,z)Finite world force components x/y/z in N; Boolean. Submits total force to the native soft body, not a local particle selection. Use jolt_soft_body_force for a local effect.
JoltBBMODSoftBody.destroyJoltBBMODSoftBody.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.
JoltBBMODSoftBody.drawJoltBBMODSoftBody.draw()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.
JoltBBMODSoftBody.get_collision_thicknessJoltBBMODSoftBody.get_collision_thickness()Current particle radius in m; undefined for an invalid wrapper, inspect native errors separately.
JoltBBMODSoftBody.get_dampingJoltBBMODSoftBody.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.
JoltBBMODSoftBody.get_frictionJoltBBMODSoftBody.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.
JoltBBMODSoftBody.get_gravity_factorJoltBBMODSoftBody.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.
JoltBBMODSoftBody.get_layerJoltBBMODSoftBody.get_layer()Returns a numeric layer handle, not a JoltLayer; undefined for an invalid wrapper.
JoltBBMODSoftBody.get_massJoltBBMODSoftBody.get_mass()Total mass: current numeric value in kg. Failure: undefined; an invalid object is not a zero measurement.
JoltBBMODSoftBody.get_native_handleJoltBBMODSoftBody.get_native_handle()Valid soft-body handle, otherwise 0. Not a JoltBody handle for rigid-body methods.
JoltBBMODSoftBody.get_positionJoltBBMODSoftBody.get_position()World mean particle position {x, y, z} in m, not a rigid transform; undefined for an invalid wrapper.
JoltBBMODSoftBody.get_stretchJoltBBMODSoftBody.get_stretch()Stretch stiffness: current numeric value in dimensionless units. Failure: undefined; an invalid object is not a zero measurement.
JoltBBMODSoftBody.get_vertex_positionJoltBBMODSoftBody.get_vertex_position(index)Integer index 0 ≤ index < vertex_count. Returns world {x, y, z} in m, undefined for an invalid index/wrapper.
JoltBBMODSoftBody.get_volumeJoltBBMODSoftBody.get_volume()Volume in m³ from current deformation; open model cloth returns 0. undefined for invalid object or read failure.
JoltBBMODSoftBody.is_validJoltBBMODSoftBody.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.
JoltBBMODSoftBody.renderJoltBBMODSoftBody.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.
JoltBBMODSoftBody.set_collision_thicknessJoltBBMODSoftBody.set_collision_thickness(v)Particle collision radius in m, finite ≥0. Upper bound: Sphere radius, half the smallest Box dimension, half the shortest model edge. Boolean; default 0.02 Sphere/Box, model 0.01 or a smaller edge-adjusted value when omitted from options.
JoltBBMODSoftBody.set_dampingJoltBBMODSoftBody.set_damping(v)Linear damping: finite number 0..1000 1/s; default 0.1 Sphere, 0.5 Box, 0.2 closed model / 0.1 model cloth. Returns true on acceptance, false for an invalid input or object. Updates the live object.
JoltBBMODSoftBody.set_debugJoltBBMODSoftBody.set_debug(v)Enables diagnostic drawing, default false; returns true. Does not change physics or object lifetime.
JoltBBMODSoftBody.set_frictionJoltBBMODSoftBody.set_friction(v)Friction coefficient: finite number 0..1000 ; default 0.5. Returns true on acceptance, false for an invalid input or object. Updates the live object.
JoltBBMODSoftBody.set_gravity_factorJoltBBMODSoftBody.set_gravity_factor(v)Gravity multiplier: finite number 0..1000 ; default 1. Returns true on acceptance, false for an invalid input or object. Updates the live object.
JoltBBMODSoftBody.set_layerJoltBBMODSoftBody.set_layer(layer)JoltLayer or positive integer layer handle; the layer must exist in this world. Boolean. Does not modify the layer collision matrix.
JoltBBMODSoftBody.set_massJoltBBMODSoftBody.set_mass(v)Total mass: finite number 0.01..1000000 kg; default 2 (Sphere/Box), 2 closed model / 1 model cloth. Returns true on acceptance, false for an invalid input or object. Updates the live object.
JoltBBMODSoftBody.set_materialJoltBBMODSoftBody.set_material(material)BBMOD_BaseMaterial or undefined for an automatic owned two-sided material. Boolean; user material is borrowed and not destroyed, a previous owned material is released.
JoltBBMODSoftBody.set_rendererJoltBBMODSoftBody.set_renderer(renderer)Live BBMOD_BaseRenderer or undefined to detach. Boolean; registers/unregisters this same object, do not additionally register it by hand. Requires a live soft body.
JoltBBMODSoftBody.set_stretchJoltBBMODSoftBody.set_stretch(v)Stretch stiffness: finite number 0..1 ; default 0.8 Sphere/closed model, 0.3 Box, 0.9 model cloth. Returns true on acceptance, false for an invalid input or object. Updates the live object.
JoltBBMODSoftBody.set_visibleJoltBBMODSoftBody.set_visible(value)Input coerced to Boolean, default true. Returns Boolean success. Hides rendering without disabling physics.
JoltBBMODSoftBody.update_meshJoltBBMODSoftBody.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.