compute contact of OBB intersection

Started by
1 comment, last by oliii 16 years, 1 month ago
Hello, I've implemented the 15 tests of the separate axis theorem. That's ok. I've calculated too, the point where the contact is (computing the closest point): ( for each point of the other OBB: dot with the 3 unit vector of the axis of the OBB, clamp if greater than the box extents, and the closest point is the sum of the 3 dot products multiplied by the corresponding unit vector of the axis ) But I wonder about determining the normal of the contact: How to determinate which face of the OBB contain this point ? (determining too, if it is a vertex-face (the vertex is near 1 face), an edge-face(the vertex is near 2 faces), or a vertex-vertex (..3...) contact) - angle between center and this point - distance from the face, when computing which face is colliding thanks
Advertisement
The contact point generation for two boxes works like this:

You test all potential separating axes and find the axis of minimum penetration. If this axis comes from a face you define this to be your reference face. Next you find the incident face to the reference face on the other shape and clip this against the *side* planes of the reference face. Finally keep contact points "below" the reference face. If the axis of minimum penetration is an edge combination you compute the closest points between the two edge segments.

An implementation of this can be found e.g. in the ODE. Look for dBoxBox here. You might also want to look into Erin Catto's presentation here (or look at the Box2D_Lite code): http://www.gphysics.com/files/GDC2007_ErinCatto.zip

These are two presentations. One deals with constraint solving and the other with contact point generation. It is in 2D, but the face cases can easily be translated to 3D. To get you started you can consider to ignore the edge cases first. For simple stacks or just a box that drops on a plane this is sufficient.
based on something similar. The SAT will give you the normal of collision, as well as teh depth (for an intersection test).

With the normal, you find teh support points on the two boxes. could be a face, a vertex or an edge.

then you need to compute the 'intersection' between the two features (edge vs face, face vs face, vertex vs face, edge vs edge...), using common sense and a 3D clipping algorithm.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement