Page 1 of 1

General Weld Questions

Posted: Wed Sep 28, 2011 12:51 am
by Socram
So I'm working on a project that involves building vehicles with a bunch of separate physical bodies and I'm trying to figure out the best way to weld them together to have the most stability and best performance and such. Should I weld everything to a parent object in the center? Weld everything to one another in a consecutive pattern? Weld everything to everything?!

Or does it even matter?

Re: Weld Heirarchy for Stability

Posted: Wed Sep 28, 2011 2:00 am
by Norbo
It's hard to say for sure without testing a bit with a given simulation. However, there are some general tips:

1) Mass ratios must be managed with some care. If a car's wheels weigh 0.5 and the body weighs 300, there will be substantial instability even with high numbers of solver iterations. It's better to equalize mass ratios or ensure that things that have lots of dependencies are heavy relative to the things that it supports. For example, your wheels might be a bit heavy compared to real life.

2) An overconstrained system with tons of welds competing against each other can be a little hard on the solver. If you notice instability, consider changing the weld's constituent joint spring settings to be a bit softer. By default, a joint's SpringSettings.Stiffness and Damping are very high and rigid.

3) Try to minimize the length of lever arms. If a weld spans a huge gap and one of the connections has an extremely long offset to the anchor point, it will be harder to simulate. Positioning anchors at the midpoint and ensuring that the anchor is close to both objects is a pretty decent rule of thumb.

Some of the later posts in this thread show how this problem happens and how to resolve it: http://www.bepu-games.com/forums/viewto ... f=4&t=1344

4) Think of the connections as a sort of graph. The simpler the graph and the less edgewise distance to other nodes, the more stable the simulation will be because impulses can propagate through the system faster.

Re: Weld Heirarchy for Stability

Posted: Wed Sep 28, 2011 4:23 am
by Socram
Thanks for the quick reply, I'm really loving the awesome support this library has, my best experience by far. You rock.

I'll definitely do some testing, I just wanted to some guidelines and some direction on how to keep the simulation stable. Thanks again.