Jump to content
  • Advertisement
Sign in to follow this  
martinperry

Collisions - set of contact points

This topic is 2996 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 am trying to find somewhere a picture ilustrating set of contact points between two boxes, but without luck.
If two boxes are intersecting, how should contact pairs (manifold) looked like ? Can someone post me a picture ? All I found was pictures, when boxes are only "touching" but in my physics engine, boxes not always only touching each other, but before applying physics, they are intersected (eg. First box is in half of second)

Fow example in this case\can someone show me contact manifold ?

Share this post


Link to post
Share on other sites
Advertisement
A suggestion:
the fact your boxes are intersecting (inter-penetrating) implies that the their projection intervals on all candidates for separating axis, intersect.
The intersection of two intervals is an interval, when they intersect. Hence computing those intervals of intersection gives you the projections of the volume of intersection (of the two boxes) on these candidates for separating axis.

You will never find such an implementation because collision (detection) response deals with contacts of the type "face-face", "face-edge", "face-vertex", "edge-egde", ... There's no point computing a volume of intersection (set of all points of box1 inside box2): it is not needed.
Or people compute a penetration depth, and some other informations related to it.

Share this post


Link to post
Share on other sites
I already have infos from SAT (penetration depth, normal). So I should move those boxes out of colision state first - then I got face-edge case and solve that ?

Share this post


Link to post
Share on other sites
Quote:
Original post by martinperry
I already have infos from SAT (penetration depth, normal). So I should move those boxes out of colision state first - then I got face-edge case and solve that ?

Yes, you can do that. From there, you can know exactly what type of contact you've got.

Share this post


Link to post
Share on other sites
You can create a set of several contact points using the following algorithm:

1) Use SAT to identify the axis of minimum penetration. For now we just assume that this is a face normal as in your example. Let's call this the reference face.
2) Find the incident face on the other shape. This is simply the most anti-parallel face.
3) Clip the face polygon of the incident face against the side planes of the reference face.
4) Keep all vertices of this clipped face which are below the reference face

Some hints:
- The face normal of the reference face defines the contact normal (for all points)
- The penetration depth of the each contact point is the distance of each vertex to the reference face plane
- Move all points onto the reference if you want cull the contact points to e.g. a maximum of four points

Finally note that I didn't handle edge contacts here. This happens if the axis of minimum penetration is the cross product of two edges. Anyway, this should get you going.



HTH,
-Dirk

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!