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
Computing distance
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Computing distance
Bullet GJK gives you already the closest distance. See in ConvexHullDistance demo: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
Code: Select all
PointCollector gjkOutput;
GjkPairDetector::ClosestPointInput input;
input.m_transformA = tr[0];
input.m_transformB = tr[1];
convexConvex.GetClosestPoints(input ,gjkOutput);
Code: Select all
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
-
- Posts: 117
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: Newyork, USA
-
- Physics Researcher
- Posts: 22
- Joined: Mon Jun 27, 2005 9:28 am
- Location: Helmond, Netherlands
Re: Computing distance
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.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
Cheers,
Gino
-
- Posts: 117
- Joined: Fri Aug 12, 2005 3:47 pm
- 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
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
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- 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.
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.
-
- Posts: 117
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: Newyork, USA