Cloth
No springs, no stiffness, no forces between the threads. Just moving the links back to the right length, over and over.
What it is
A grid of points joined by links, pinned along the top. Drag it. Pull hard enough and it tears.
The buttons change one number: how many times per frame the links get pulled back towards their correct length. At one pass it behaves like a loose net, at sixteen it behaves like fabric. Nothing else differs.
How it works
There’s no spring constant anywhere in this. The method is Verlet integration plus constraint relaxation, and both halves are unusually direct.
Verlet: a point’s velocity isn’t stored, it’s implied by the gap between where the point is and where it was. Advance by that gap, add gravity, and momentum comes out for free. There’s a test that checks exactly this. Set a point’s previous position five units behind it, integrate with no gravity, and it has to move five units.
Relaxation: after moving everything, walk the links and for any that’s the wrong length, move both ends towards each other until it’s right. That breaks the other links, so do it again. Each pass leaves the whole cloth closer to consistent.
Measured stretch after settling falls monotonically with passes, and sixteen passes is more than four times stiffer than one. That single parameter is the entire material model.
What surprised me
Stiffness is a budget, not a property.
Everything I’d previously assumed about cloth simulation involved choosing a stiffness and solving for it. Here stiffness is the number of times you were willing to iterate before the frame had to be drawn. It’s a compute allowance wearing a physics costume. A stiffer fabric isn’t a different material, it’s the same material given more attention.
That has an odd consequence. The cloth’s behaviour depends on frame rate in a way a force-based model wouldn’t. A machine that can afford more passes has stiffer cloth. That’s either a bug or the reason the technique is used in games, depending on whether you needed the answer to be right or on time.
Tearing falls out for nothing too. A link stretched beyond some multiple of its rest length gets marked broken and skipped forever after. There’s a test that it never un-breaks, because a monotone-only quantity is easy to get wrong when the same code runs sixteen times a frame.
What I would do next
Self-collision, so the cloth can’t pass through itself. That’s where this technique stops being cheap.