public Chain(PointMass from, PointMass to, int count, float k, float damping, float mass)
{
this.damping = 0.99f;
this.pointmass_list = new List<PointMass>();
this.spring_list = new List<Spring>();
float length = Vector2.Distance(from.position, to.position) / count;
Vector2 direction = to.position - from.position;
direction.Normalize();
for (int i = 0; i < count+1; i++)
pointmass_list.Add(new PointMass(new Vector2(from.position.X + direction.X * length * i, from.position.Y + direction.Y * length* i), mass));
pointmass_list[0] = from;
pointmass_list[count] = to;
for (int i = 1; i < count+1; i++)
spring_list.Add(new Spring(pointmass_list[i - 1], pointmass_list[i - 0], k, damping));
}