Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Computing distance
PostPosted: Fri Mar 17, 2006 9:40 pm 
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 117
Location: Newyork, USA
Hi!
Anyone know of algorithm that compute the distances between two bodies as well as the penetration depth?
Could I modify Bullet to get the distances?

I need that distance because some time steppers use "prevent penetration" not "penetration correction" approach, so the distances are needed.

I'd guess SWIFT++ could return distance but no penetration
thanks


Top
 Profile  
 
 Post subject: Re: Computing distance
PostPosted: Fri Mar 17, 2006 10:40 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 4055
Location: California, USA
ngbinh wrote:
Hi!
Anyone know of algorithm that compute the distances between two bodies as well as the penetration depth?
Could I modify Bullet to get the distances?

I need that distance because some time steppers use "prevent penetration" not "penetration correction" approach, so the distances are needed.

I'd guess SWIFT++ could return distance but no penetration
thanks


Bullet GJK gives you already the closest distance. See in ConvexHullDistance demo:

Code:
   PointCollector gjkOutput;
   GjkPairDetector::ClosestPointInput input;
   input.m_transformA = tr[0];
   input.m_transformB = tr[1];
   convexConvex.GetClosestPoints(input ,gjkOutput);


Code:
struct PointCollector : public DiscreteCollisionDetectorInterface::Result
{
   SimdVector3 m_normalOnBInWorld;
   SimdVector3 m_pointInWorld;
   SimdScalar   m_distance;//negative means penetration
...



There is currently penetration depth estimation, and a EPA implementation is contributed but not added to CVS yet. And more high-level interfaces, but in those cases there is broadphase culling, which prevents calculation of closest distance if objects are too far apart.

Erwin


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 11:21 pm 
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 117
Location: Newyork, USA
OK. That's great!
I didn't really dwell into Bullet, just messing around with higher level interfaces.

Thanks alot.


Top
 Profile  
 
 Post subject: Re: Computing distance
PostPosted: Sun Mar 19, 2006 6:19 pm 
Offline
Physics Researcher

Joined: Mon Jun 27, 2005 9:28 am
Posts: 23
Location: Helmond, Netherlands
ngbinh wrote:
Hi!
Anyone know of algorithm that compute the distances between two bodies as well as the penetration depth?
Could I modify Bullet to get the distances?

I need that distance because some time steppers use "prevent penetration" not "penetration correction" approach, so the distances are needed.

I'd guess SWIFT++ could return distance but no penetration
thanks


SOLID 3.5 computes both the distance and the penetration depth for any combination of convex shape types. SOLID 3.5 can be downloaded from http://www.dtecta.com.

Cheers,

Gino


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 05, 2006 9:25 pm 
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 117
Location: Newyork, USA
Hi!
Another question:

Let me describe the scenario first:
Two body A,B are close (or already) in contact, I'd like to get all the features distance that < some epsilon not just the closet one?

That features of collision detection are essential for my current time stepper to prevent intepenetrations, not just recover from penetration.

A side question: Anyone know of any physics engine implementation using that technique?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 05, 2006 9:46 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 4055
Location: California, USA
This is called contact manifold generation. There have been a couple of similar postings/questions recently.
When using GJK, you need to gather multiple points. Several methods exist, Bullet uses currently Persistent Manifold that adds one closest point at a time, and keeps a small point set persistent over frames. Please see other postings about this:

http://continuousphysics.com/Bullet/php ... .php?t=288

Another approach, very suitable for polyhedra and in combination with Separating Axis Test based collision detection: you can explicitly build the manifold by finding two parallel planes and perform clipping using edge-planes.
If I got time I might start writing some white-paper about Contact Manifold generation in combination with GJK.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 05, 2006 10:09 pm 
Offline

Joined: Fri Aug 12, 2005 3:47 pm
Posts: 117
Location: Newyork, USA
Thanks for the quick response!
It's really hard to work on the dynamics part alone (without knowing about stuff in CD).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group