Sign in to follow this  

help- about obb contact

This topic is 4594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i want to compute the exact contact point of two obb,which are penetrating each other. i don't know how,and i'm even not sure what the contact point mean when two obb penetrating each other,or how the contact point defined when in a penetratable rigid body dynamic simulation like ode.i guess it's not just the exact intersecting point .i found code for this problem in ode,it's too hard for me to read,and it's seem to have some thing with the axis with the smallest penetrate depth.could somebody tell me what is the contact point and how to compute it,or show me some link

Share this post


Link to post
Share on other sites
It sounds like you're refering to static collision detection, that is, the motion of the objects is not taken into account. In this case the intersection will usually be a volume rather than a point.

This volume isn't of particular interest; what is more likely to be important to a physics simulation is a unit-length direction vector and a distance along that vector. This is the 'smallest penetration depth' that you refered to. I haven't used Ode but I'm guessing it requires this information to resolve collisions.

With OBBs this information can be acquired fairly easily using the separating axis method. It's actually quite a bit easier than calculating the first point(s) of intersection for moving objects. All you have to do is keep track of the axis with the least overlap when performing the separating axis test.

Here is a document that provides an overview of the SAT. I'm not sure if it covers the smallest penetration depth specifically, but if not that part is pretty easy to derive.

Share this post


Link to post
Share on other sites
There isn't a single "contact point" when to obb intersect. However, you can easily get a list of points by intersecting the edges of one box with the faces of the other (and vice versa). Then eliminate duplicate/almost duplicate points. If you transform the second box into an axis-aligned box this test is easy/quick to do.

Share this post


Link to post
Share on other sites
Quote:
Original post by jyk
Here is a document that provides an overview of the SAT. I'm not sure if it covers the smallest penetration depth specifically, but if not that part is pretty easy to derive.

The method in that document can just deal with boxes without rotation.While the boxes are rotating,the potential seperating directions are changing with the time.

Share this post


Link to post
Share on other sites
Quote:
Original post by MrRowl
There isn't a single "contact point" when to obb intersect. However, you can easily get a list of points by intersecting the edges of one box with the faces of the other (and vice versa). Then eliminate duplicate/almost duplicate points. If you transform the second box into an axis-aligned box this test is easy/quick to do.


But I don't know whether can these point be used as contact point in regular collide response method.Most collide response method assume you have found the exatly contact point,or two points from each body,which are close enough. I'm looking for methods which are base on a penetration situation.

Share this post


Link to post
Share on other sites
Quote:
Original post by snooopy
Quote:
Original post by MrRowl
There isn't a single "contact point" when to obb intersect. However, you can easily get a list of points by intersecting the edges of one box with the faces of the other (and vice versa). Then eliminate duplicate/almost duplicate points. If you transform the second box into an axis-aligned box this test is easy/quick to do.


But I don't know whether can these point be used as contact point in regular collide response method.


I don't know what you mean by a "regular collide response", but I certainly use this in my collision response code. For example, a box sitting on a bigger box has one object-object contact, but 4 contact points. An extruded hexagon (on its end) has one object-object contact, but 6 contact points, etc... If you try to represent the contact with just one point you'll either get:

1. "Jiggling" if you select a corner point, as the contact forces will be applied at corners of your box, and the contact point will change from one integration step to the next.

2. bad friction behaviour if you select an average point (e.g. you might choose the average of the 4 corner points).

Representing the object-object contact with multiple contact points will solve the first problem, and give a better friction behaviour (especially in the case where your box is rotating around a vertical axis as it sits there).

There's a chapter in game programming gems 4 about this.

Share this post


Link to post
Share on other sites
This:
Quote:
The method in that document can just deal with boxes without rotation. While the boxes are rotating,the potential seperating directions are changing with the time.
Seems to indicate that you are interested in a swept test, and that furthermore you want to incorporate angular velocity as well as linear.

But this:
Quote:
I'm looking for methods which are base on a penetration situation.
Suggests that you want a static test.

If you want a static test and a penetration vector and depth, again, I recommend the SAT and the article I linked to initially. If you want a swept test with linear velocity, the SAT can be adapted to provide the first time and point(s) of contact. If you want to incorporate angular velocity as well you can take a look at this, but it's quite a bit more involved than the other two methods.

Share this post


Link to post
Share on other sites

This topic is 4594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this