T-009: Soft-body physics
Goal
The physics that lets bodies made of bonded cells move in many different ways. This ticket
decides whether the world can ever show varied locomotion, so it matters more than most.
See docs/DESIGN.md section 5.
Scope
- Bonds as position-based constraints with per-bond stiffness. Bodies must hold a shape, bend, and survive hard muscle pulls without exploding. Stable at the step size T-001 chose.
- Muscles: bonds whose rest length is driven by a control value each step. The control system (T-013) will supply that value. Expose the interface and test it with a scripted wave.
- Drag that depends on direction (a rod moving sideways resists more than one moving lengthwise) with a linear part and a squared part, so small slow bodies and large fast bodies live in different regimes. Interior cells are shielded.
- Buoyancy and gravity from per-cell density. A current field pushes everything.
- Terrain: collision with a height field, with friction, so crawling is possible. Anchors bond a cell to the terrain.
- Cell-to-cell collision between different bodies, using the shared spatial index.
- All coefficients in
Params.
Done when
- ☐ Hand-built test bodies each move by a different mechanism under scripted muscle waves: an undulating chain swims, a rower with two limbs swims, a pulsing bell rises, a floor crawler crawls, a float rises and an armored lump sinks.
- ☐ A tiny body with a simple open-and-close stroke makes almost no progress, while a large one does (the two drag regimes work).
- ☐ No explosions in a 100,000-step soak test with random muscle input.
- ☐ Benchmark from T-001 re-run and logged. Say what the physics costs per cell.
Notes
- The water itself is not simulated. No wakes or vortices.
- Volume or shape preservation for blobs of cells is a gap in the design. Decide how bodies resist collapsing and record it.