## Understanding soft constraints

Here's the place to get help and discuss features. The focus is on the C++ version, but generic questions are welcome.
rahul.meda
Posts: 2
Joined: Wed Mar 01, 2017 2:54 pm

### Understanding soft constraints

Hey Erin,

I have been working on 3D physics for my game (really inspired by your talks on game physics )
I am in love with constraints, and tried implementing a few simple ones.
Here's the results from my experiments on distance joints.

Connected 10 (1mx1mx1m) boxes linked to each other with distance joints to simulate a chain.
One end of the chain is connected to a fixed ceiling, and the other end to a load of 64 KG.
Set the pendulum into oscillation and found this:
Pendulum is very unstable with link mass of 1KG (the rope stretches too much, and links oscillate out of control)
Somewhat stable with link mass 2KG
Very stable with link mass 3KG
Gravity = 9.8m/s^2, Integrator: semi-implicit Euler, time-step: 1/60, position stabilization: baumgarte

Do those mass ratios (link mass to load mass) seem reasonable to you, or am I missing something?

Here's a video on youtube to show the results: http://bit.ly/Load3

Those mass ratio numbers are nowhere near what I wanted to achieve in my game. (want to make suspension bridges with stiff ropes, and heavy planks)
After going through your presentation on soft constraints (GDC 2011), I thought implementing soft constraints would solve my problem (If I understand it correctly)
I plugged in the magic formulas as you presented.
frequency = 60, damping ratio = 0.25 (calculated beta and gamma like you suggested)
This seemed to alleviate the position drifts somewhat, but made the links oscillate even worse.
Video on youtube showing the results: http://bit.ly/2mMJval

I would really appreciate any suggestions on how to approach this problem.

Thank you