Finding the contact point with SAT
Posted
by
Kai
on Game Development
See other posts from Game Development
or by Kai
Published on 2012-04-06T04:34:07Z
Indexed on
2012/04/06
5:42 UTC
Read the original article
Hit count: 416
The Separating Axis Theorem (SAT) makes it simple to determine the Minimum Translation Vector, i.e., the shortest vector that can separate two colliding objects. However, what I need is the vector that separates the objects along the vector that the penetrating object is moving (i.e. the contact point).
I drew a picture to help clarify. There is one box, moving from the before to the after position. In its after position, it intersects the grey polygon. SAT can easily return the MTV, which is the red vector. I am looking to calculate the blue vector.
My current solution performs a binary search between the before and after positions until the length of the blue vector is known to a certain threshold. It works but it's a very expensive calculation since the collision between shapes needs to be recalculated every loop.
Is there a simpler and/or more efficient way to find the contact point vector?
© Game Development or respective owner