Physics Simulation Forum

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Generating contacts with SATPosted: Wed Sep 14, 2011 2:45 am

Joined: Sun Jun 14, 2009 8:34 pm
Posts: 3
Hoping someone here might be able to give me some ideas I've been toying around with speculative contacts as described here. I'm using SAT to generate the contacts. The problem I'm running into is as follows:

The blue box is dynamic and the red and yellow boxes are static (my floor). The problem is that there's two possible speculative contacts to be found between the blue and red box. Using the X-axis as the separating axis gives me a contact with n = <1, 0, 0> and distance = 0. Using the Y-axis as a separating axis gives me a contact with n = <0, 1, 0> and distance = 0. The contact I choose comes down to the order I test the axis. If I test the Y-axis first then I'm fine. When I test the X-axis I see the distance is no further than my existing best contact and I ignore it. If it's the other way around I'll end up stuck on the seam between the red and yellow box. I can just always test the Y-axis first but then my problem becomes sliding along walls instead of the floor.

Here's a snippet from my SAT routine if it's not clear how I'm finding the contacts:

Code:

ShapeUtils.GetProjectionInterval(shapeA, axis, out min1, out max1);
ShapeUtils.GetProjectionInterval(shapeB, axis, out min2, out max2);
float dist = ShapeUtils.GetIntervalDistance(min1, max1, min2, max2);
if (dist > bestContact.Distance)
{
bestContact.Normal = (Vector3.Dot(displacement, axis) < 0) ? -axis : axis;
bestContact.Distance = dist;
}

How does one handle this? If I were generating contacts only on intersection I don't think this would be a problem assuming I resolved contacts with the closest bodies first.

Top

 Post subject: Re: Generating contacts with SATPosted: Wed Sep 14, 2011 5:20 am

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3825
Location: California, USA
It looks like you are hitting 'internal edges', this is a difficult problem. One solution/workaround is to adjust the contact normals afterwards, using additional information.

For triangle meshes, you can compute concave/convex internal edge information for this. For touching objects, you will need to perform some analysis, either manually or automatically, to recognize this case.

There are some slides in my GDC presentation that deal with this. Also see the 'internal edge utility' in Bullet, in Bullet/Demos/InternalEdgeDemo. Although it only deals with triangle meshes, the general idea can be applied to internal edges of neighboring objects.
Thanks,
Erwin

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities