body density best practice

General discussion about Box2D tutorials
Post Reply
vkreal
Posts: 66
Joined: Sun Jan 13, 2013 7:29 pm

body density best practice

Post by vkreal »

I have motorcycle and rider...I am struggling to figure what density I should give each b2body for motorcycle and rider parts . Any suggestions or examples?


Much Thanks!
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: body density best practice

Post by iforce2d »

Unfortunately the short answer is trial and error... you can spend all day (and I have done) tweaking the various settings for joints, body masses etc. A general rule of thumb though, is that the more bodies must mutually affect each other through joints, the more similar their masses should be.

In the motorcycle example, the bike body and the wheels mutually affect each other quite a lot, so they should not be too different (I find if the sum of the wheel masses is similar to the body works ok). But smaller pieces that do not affect the overall movement much can be considered to 'follow the leader' and would be much lighter.

Probably the best resource I can point you to is this video, which covers all the boring details of one example I made last year: http://www.youtube.com/watch?v=bBIXpu-D_Zo
vkreal
Posts: 66
Joined: Sun Jan 13, 2013 7:29 pm

Re: body density best practice

Post by vkreal »

Thanks for the quick reply! I had a feeling it was trial and error, but thought to ask if there are some secret sauce someone wanted to share.

By the way thanks for the link!
Post Reply