Yes this just a chain of n-1 springs attaching n objects. Any of the objects can be a ‘handle’.
Using box2d give me the opportunity to have access to other physics properties if I need (i.e. gravity), but I 'm still interested to approach this in a different way.
One thing I want to achieve, is to have several of those chains and to detect the ‘collisions’ and overlap between them. This in order to detect/define the shapes created by the overlap of 2 chains.
If you wanted to roll your own springs, here is some example code, assuming it is part of a particle class:
void Particle::spring(Particle * p, float const k, float const springDist, float const drag) {
float dis = pos.distance(p->pos); //distance between two particles
dis = springDist-dis; //distance from resting position of spring
// find the direction to the other particle
ofxVec3f dir = ((ofxVec3f)(p->pos - pos)).normalized();
float force = (-k/(mass*p->mass))*(dis/drag); //spring force equation
//add velocity to both particles
vel += dir*(force/mass);
p->vel += dir*(-force/p->mass);
}