Назад
· 2 мин. четене
Soft bodies
Balaur devlog: softbody2d and softbody3d on Rapier, with cloth, rope, tearing, and a Physics panel that turns a mesh into a collider or a soft body.
- Dragos 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.

kindlays the particles out:box,sphere,cloth,cloth_tubeorropein 3D, andgrid,circleorropein 2D. Ameshcan be filled with cells or kept as a surface.pinned_particlesnames the particles held in place. Pasttear_strainortear_forcean edge breaks, and the node'son_tearruns.- 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 node picker's
rope2d,rope3dandcloth3dbuild pinned. A rope hangs from its first particle, and a 2 by 2 cloth from the two corners of one edge. - A 3D rope collides through segments and draws as a six-sided tube as wide as its particles.
regionsgives parts of a body a material of their own: each lists itsparticlesand setsstiffness_scale,tear_resistance,pinned,shape_matchingor an edge spring. Each is a rapier cluster, so it rides the snapshot.collision_meshputs a mesh on the body that deforms with it, bound vertex by nearest particle, by index, or by the cell that holds it.



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