Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 24 Jul 2005
Offline Last Active Oct 26 2012 04:27 PM

#4797972 OBB-OBB Collision data

Posted by erwincoumans on 13 April 2011 - 08:49 AM

One approximate way to generate contact points between two convex polyhedra A and B, is the following recipe:

1) find a separating axis between A and B using your favorite method (SAT, GJK etc)
2) find reference face on A and a incident face on B with a normal that is closest to this separating axis
3) perform Sutherland-Hodgman clipping on the vertices of this face on A against the polyhedron B
This clipping can be performed either in worldspace or in the local space of B, using the faces connected to face B

I recently implemented this method in the open source Bullet physics library, part of the Bullet 2.78 release, so you can test the implementation and read the code here:
http://code.google.c...actClipping.cpp in particular btPolyhedralContactClipping::clipHullAgainstHull and clipFace.

For general convex polyhedra you need to compute the connectivity and connected faces (m_connectedFaces in above code), Bullet uses the btConvexHullComputer for this. For the special case of OBB-OBB this information can be hard-coded, you can see the OBB-OBB clipping code in ODE/Bullet here: http://code.google.com/p/bullet/source/browse/trunk/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp#574


#4789766 Rigid body contact scenario requiring global solver

Posted by erwincoumans on 23 March 2011 - 07:41 PM

Here is one global conflict scenario: the two dynamic objects are not aware that after CCD they end up in the same location.

There are more complicated cases, but this could be a start.

Attached Thumbnails

  • global_conflict.jpg

#4781971 Sweep test and physics

Posted by erwincoumans on 04 March 2011 - 09:10 PM

I created a proof of concept for predictive contacts in the Bullet SDK, thanks Paul for motivating me to do this. We discussed speculative contacts previously here.

You can check out a Windows demo here:http://code.google.com/p/bullet/downloads/detail?name=SpeculativeContactsWin32.zip
and see the minimal changes needed to enable them in this commit: http://code.google.c...e/detail?r=2326
The demo allows you to toggle between predictive contacts and conservative advancement using the P key. Shoot boxes using mouse button or . key.

In a nutshell, expand the bounding boxes with the motion, and for predictive contacts (with positive distance) adjust the constraint solver target velocity,
so that after integration the object will be in touching contact.