# Physics Simulation Forum

 Page 1 of 1 [ 7 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Computing distancePosted: Fri Mar 17, 2006 9:40 pm

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

 Post subject: Re: Computing distancePosted: Fri Mar 17, 2006 10:40 pm

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

 Post subject: Posted: Fri Mar 17, 2006 11:21 pm

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

 Post subject: Re: Computing distancePosted: Sun Mar 19, 2006 6:19 pm
 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

 Post subject: Posted: Wed Apr 05, 2006 9:25 pm

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

 Post subject: Posted: Wed Apr 05, 2006 9:46 pm

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

 Post subject: Posted: Wed Apr 05, 2006 10:09 pm

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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 7 posts ]

#### Who is online

Users browsing this forum: No registered users and 4 guests

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

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities