Builtin Library
README.md
EcsSoftBody
Spec for ecs.SoftBody, the native soft body the SoftBody component drives: the shape (a generator, "Box", "Sphere", "Balloon" or "Cloth"; "Mesh", the entity's own model filled with tetrahedra; or "Custom" and "Rope", the particles and elements it lists), resolution, mass, stiffness, damping, the cell model of a solid ("Corotational", "NeoHookean" or "Volume"), the solver of its elasticity ("Constraints" or "Fem"), poisson, the plastic fields plasticYield, plasticCreep and plasticMax, inflation, shapeMatching (the natural frequency in hertz of the pull back toward the rest shape, 0 for none), selfContact, the repairs count, preserveVolume, friction, restitution, collisionMemberships, collisionFilter, canSleep, and for "Mesh" the cellSize of its cells and collideWith ("Cage" or "Surface"). The material (stiffness, damping, poisson, the plastic fields, inflation, shapeMatching, preserveVolume, friction, restitution, the collision groups) and the solver are applied to the running body in place, and a raised repairs count restores the shape the body was built in. The other fields are read when the body is built, so writing one rebuilds it at the entity's transform. attachments (a list of { target, region } records holding regions of the body to rigid bodies) is applied to the built body without rebuilding it, and applied again to a rebuilt one. A "Custom" or "Rope" body is built from particles, elements, cells and triangles (with particleRadius its contact thickness), and one with no cells and no triangles is drawn as its elements, each a tube of its thickness unless it is hidden; its elements' laws (kind, stiffness, damping, bounds, yield, break limits, drive, groups) are applied to the running body in place, and its particles and links rebuild it. regions (a list of records each stating a part of the body and the full material it takes) is applied to the running body in place, and planeNormal / planePoint hold the body to a plane.