Skip to main content
Soft bodies

Soft bodies

· 2 min read
Balaur

softbody2d and softbody3d are bodies of particles held together by springs and elastic cells. Rapier simulates them on the fixed step, and the node is drawn from what it produced.

examples/cloth: a sheet draped over a block, and a ball tearing through a sheet pinned all round

  • kind lays the particles out: box, sphere, cloth, cloth_tube or rope in 3D, and grid, circle or rope in 2D. A mesh can be filled with cells or kept as a surface.
  • pinned_particles names the particles held in place. Past tear_strain or tear_force an edge breaks, and the node's on_tear runs.
  • The material rows set a spring per constraint family, the cell model and plasticity. solver = "fem" switches to Rapier's implicit step.
  • A soft body is in the snapshot, and the digest hashes every particle's velocity.
  • The Physics panel lists every physics component on the selection. One click turns a mesh into a hull, convex pieces, voxels or a soft body.

The Physics panel on the disk of examples/jelly: the components it can add, and the soft body's rows by group

examples/jelly: a grid block over a peg, a disk under a box, a star, an arch and a rope bridge

[nodes.softbody2d]
kind = "circle"
radius = 1.0
particle_count = 32
color = [0.29, 0.56, 0.82, 1.0]