OBB and cotact points generation

Please don't post Bullet support questions here, use the above forums instead.
jamesbond
Posts: 2
Joined: Fri Sep 04, 2009 5:12 pm

OBB and cotact points generation

Post by jamesbond »

Hi everybody.

I know, that there is already topic about this (http://www.bulletphysics.com/Bullet/php ... =&f=&t=288). But I don t want to opne that old one.

I am now dealing with, for me, huge problem. 3weeks gone and I still have nothing :? :cry: I undestarnd almost everything else (physics, sat tests etc.), but i can´t calculate contact manifold for my boxes.
I tried use data from sat (mtd, ncoll) and calculate those points, bud with no luck.

Algorithm from book "Game Physics Engine Development" work neither

1. Consider each vertex of object A.
2. Calculate the interpenetration of that vertex with object B.
3. The deepest such interpenetration is retained.
4. Do the same with object B’s vertices against object A.
5. The deepest interpenetration overall is retained.

Algorithm found vertices, which are outside of both boxes (http://www.perry.cz/files/noLuckToday.png) :?:

I also try to calculate those points with brutal - force. With this i got the best results (for my eyes :))


for (int i = 0; i < 6; i++) //faces
for (int j = 0; j < 12; j++) //edges
if (face.LineSegmentPlaneIntersection(edge, ref intersectionPoint))
if (face.IsInsidePlane(intersectionPoint)) {
intersection point is one of manifold
}

I got something like this http://www.perry.cz/files/Clipboard01.png

Or better this http://www.perry.cz/files/asiOK.png - combination of brutal force and supporting vertices - for me best results and almost ok, but I dont´t know haw contact manifold shoul look for this case http://www.perry.cz/files/body.png

But in this, I dont know how to solve, which points belong to boxA and which to boxB ? If I react in all points, the physics act funny :)

Or how can I solve those points another way ? Clipping algorithm doesn ´t work for me, and I dont´t know why... :( I use algorithm from source code on this page http://www.xbdev.net/physics/RigidBodyImpulseCubes/.

What will be very helpfull for me are some example images, how contact manifold in different situations look like. Everywhere I can see only theory or running programs.
fishboy82
Posts: 91
Joined: Wed Jun 10, 2009 4:01 am

Re: OBB and cotact points generation

Post by fishboy82 »

As you mentioned you know SAT,so why not try use to test the overlap of 2 box and their contact point and penetrate depth . it is simple and strong enough for box(polyhedron object), basically you test all the axis and find the separating axis with the minimum ovelapping and the 2 feature of the seperate axis then you clip the 2 feature .You can look bullet 's box-box detector algo code (copyed from ODE),aslo in Erin Catto's GDC 2006 <Fast and Simple Physics using Sequential Impulses> have a reference about this algo
jamesbond
Posts: 2
Joined: Fri Sep 04, 2009 5:12 pm

Re: OBB and cotact points generation

Post by jamesbond »

fishboy82:

Thans. Eric Catto's article give me some idea how to do this. I decided to try it first in 2D, which is much more simple (I think :))