Jump to content
  • Advertisement
Sign in to follow this  

SAT response

This topic is 1505 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

Hi there,


I implemented the separating axes theorem described in "Real time collision detection" by Ericson for my OBB vs OBB collision, which works fine :)

But now I also want a the necessary data to feed into my collision response system.

What I need: 

- contact point 

- contact normal

- penetration depth


My first idea was to keep track of all the projected radii and determine somehow the penetration depth. 

Unfortunately I am stuck right now :(

Share this post

Link to post
Share on other sites

After the SAT you have a feature (either edges or face) which defines the axis of minimum penetration. 


If this feature is a face:

- The face defines the so called reference face

- Find the incident face on the other shape 

- This face defines the incident face

- Clip the incident face against the side planes of the reference face

- Keep all point below the reference face

- The distance of the clipped vertices to the reference face is your penetration


If the witness features are edge

- Compute the closest point between the edges

- The contact point is the average of the two points

- The penetration is the distance between the two witness points


I recommend to look into a bunch of example. E.g. in the ODE there is a function dBoxBox which shows how to build contacts for two OBBs. In Box2D you can find examples for building contacts between convex hull. In 3D you need to add the edge case.


Erin gave a bunch of presentation and one deals with contact creation. Have a look here: www.box2d.org  

I think Erwin gave a presentation on contact creation as well. Look at the Bullet website




Share this post

Link to post
Share on other sites

Thanks so far :)


Just two more questions:


Currently I solve all my collision by moving the objects appart from each other using penetration depth and contact normal. Wouldn't it be a better solution to calculate the time of contact/impact and then resolve the collisions?


Regarding the SAT and Epsilon is used to counteract the problem with the cross product getting 0. Currently I use a value around 0.01. I didn't find any real value someone uses so I absolute have no clue in what range this value should be :D



Share this post

Link to post
Share on other sites

Okay I am still struggling with collecting my collision data.

So far I get the penetration depth by keeping track of the lowest penetration of the axis. Furthermore I use the axis with the least penetration as normal for my collision. 

I know this is not the ideal solution, because I need to flip the normal sometimes (haven't figured out when exactly).


Also my current solution finding the contact points is just a rough implementation, as I find the closest Points on each of the boxes and use the midpoint of these two.


I had a look into the box2d source, but I cannot really get much out of it as it looks very complex. You already told me to find the reference and incident faces/edges. Using SAT I know my supporting face/edge, but how do I get to know the corresponding face/edge of the second box?


I know this might be just basic stuff but I really love to make it work :)

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!