GJK - from simplex to feature

Please don't post Bullet support questions here, use the above forums instead.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

GJK - from simplex to feature

Post by Dirk Gregorius »

When I use GJK for distance computation on two polytopes I would like to know the features that contain the closest points. Can I extract this information from the current simplex or is it possible to track this information somehow during the usual GJK iteration?
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Post by John McCutchan »

I have not done this -- but if your polytope support function also returns a feature id (perhaps triangle#), you should be able to store that in the simplex along side W,P,Q. Then you can extract the set of features from both polytopes from the final simplex.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

In collaboration with a game company, we've done this last year, to get the triangle index to allow for per-triangle friction values for convex polyhedra (it was already trivially supported for concave trimeshes).

They contributed this anonymously for the public Bullet version, but I haven't had bandwidth to integrate it yet. I barely have the bandwidth to discuss in-depth how we retrieved the info from the simplex solver (voronoi in Bullet's case), passed the info on, and did a lookup on each polytope to get the triangle (based on vertex ID, position and normal).

Erwin