## Solution to the rubber constraint problem?

Moose
Posts: 31
Joined: Mon Nov 04, 2013 10:58 am

### Solution to the rubber constraint problem?

Hello all,

I have generic physics simulation system here based on bullet. It allows people to create constraints and (mostly triangle mesh) shapes to simulate within their own existing application. A little like the Blender integration.

So basically everbody likes it and so do I but a major buzzkill in our use cases is the problem with very unprecise constraints. Things like hinges, ball-socket or 6dof do what they should but instead of behaving like rigid stiff objects they behave like made from very soft rubber and generally allow for a lot of movement that they shouldn't. I was asking quite a few questions here about that myself and I read a lot of discussions by other people and the general opinion seems to be along the lines of "That's just the way it is. Deal with it."

Now this was OK for a while but my users are specifically asking to solve this and so I want to ask that question just to confirm: Is this really something that I have to live with using bullet or is there some silver bullet (pun intended) that I can use to make my constraints nice and precise?

Back then I have cranked up the solver iterations to very high values and fiddled with every paramenter I can think of. To no avail. But is it possible at all? Are there bullet integrations that don't have that issue? And if so, what is a good starting point? How should one start to tackle this?

Any hints are much appreciated!

Moose
Erwin Coumans
Posts: 4232
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

### Re: Solution to the rubber constraint problem?

Using a smaller internal timestep helps better than using more solver iterations.
Furthermore, if the masses are very different, the iterative constraint solver has issues finding the right solution.
If possible, try making the masses of all objects involved more similar.

float internalTimeStep = 1.f/1000.f;
So use world->stepSimulation(deltaTime, 100, internalTimeStep);
In combination with a smaller internal time step, using double-precision could help.

Another option is using a better constraint solver, for example the Dantzig MLCP solver.
Yes another option is using reduced coordinate constraints, using the btMultiBody.

Hope this helps,
Erwin
Moose
Posts: 31
Joined: Mon Nov 04, 2013 10:58 am

### Re: Solution to the rubber constraint problem?

Hi Erwin,

thanks, that's quite a bit of food for thought. I will give these options a shot and see how I go.

Thanks a bunch,

Moose