General Weld Questions

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Socram
Posts: 20
Joined: Sat Sep 24, 2011 4:33 am

General Weld Questions

Post 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?
Last edited by Socram on Sun Oct 02, 2011 10:08 pm, edited 1 time in total.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Weld Heirarchy for Stability

Post 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.
Socram
Posts: 20
Joined: Sat Sep 24, 2011 4:33 am

Re: Weld Heirarchy for Stability

Post 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.
Post Reply