I'm trying to experiment with 2D physics engines in C++. So far, it seems the most popular is Box2D. Unfortunately, Box2D is a rigid body physics engine and that's not really going to help me with what I want to try.
I want to be able to define a shape which has a number of vertices joined by springs, such that when this shape collides with rigid or other non-rigid shapes its shape will be flexible.
Now I've tried to think of ways of doing this in Box2D using only rigid bodies, but there always seems to be flaws:
So what is the best way to do this kind of physics in C++? Preferably without having to write an entire physics engine. Maybe I'm just missing a feature of Box2D. Maybe it's just not the right choice. Then what is the right choice?
There are several packages/engines out there that support deformable/soft bodies. If you want something free you can for example check out Phyz, SOFA or Bullet.
There is a detailed listing on wikipedia. Most of these are 3D-based but you can adapt them to a 2D model by setting up the scene as a plane.
Happy coding!