This project has moved. For the latest updates, please go here.

Help on Soft Body

Topics: Developer Forum, Project Management Forum, User Forum
May 31, 2011 at 7:03 AM

hey guys,

we are developing a game with soft bodies. thing is.. the 2 soft bodies are attaches to each other by an elastic spring. the mechanics of the spring we are finding difficulty to code. need help. 

Jun 2, 2011 at 12:14 PM
Edited Jun 2, 2011 at 2:09 PM

so you need a spring formula?!?

the basic formula is F=-k*d      k is the Stiffness of the spring and d the distance

expanded it's (as code)

Vector2 force = -Stiffness * (dist / dist.Length()) * (dist.Length() - defdDistance);

defdistance it the default lenght of the spring

btw i don't know why you just use the farseer spring joint