Margins...

Post Reply
User avatar
tasora
Posts: 26
Joined: Mon Aug 15, 2005 8:57 am
Location: Italy
Contact:

Margins...

Post by tasora »

Hallo,
I'm using Bullet in my own physics engine (I mean, I use only the
collision detection feature of Bullet, not the dynamics, so I simply
perform CD, fetch the contacts from the manifolds and put them
in my LCP solver).
It already works, but I noticed that contacts are created, in most
cases, when the two margins of the two shapes intersect: since the
contact points are placed right over the manifold surfaces, this means
that Bullet most often produce contacts with negative distance...
This is a problem because I noticed that my solver is more stable
if contacts are feed into the LCP a bit in advance (ex. 0.01 before
margins come into contact) and this makes everything less bouncy and
less unstable. Currently I am solving this by artificially moving apart the
contact points a bit inside the margin volumes
, as soon as I fetch them from
Bullet, so that in my dynamics solver (say) 50% margin is penetration (negative
distance) and the other 50% is for 'near to contact' situation (positive distance).
By the way this would also require that I adjust the geometry of my OpenGL shapes,
which would not match either the original shapes nor the expanded shapes
with margin. Also, think about the custom sphere-sphere case: it won't
ever create a contact until the spheres are intersecting. Etc. etc..


This is not a very 'clean' approach and I wonder if I am missing something
here...

Or should I simply wait for the _continuous_ collision detection
algorithm planned for next release of Bullet?

regards, Alessandro Tasora
Post Reply