Search code examples
collision-detectiongame-developmentseparating-axis-theorem

How get a collision point with SAT


I have implemented SAT collision detection system in 2D , but I don't get how get a collision impact point.

For the moment I obtain the mtv and the separating axis, so I can resolve the collision but not apply correct forces on it, because impact point is missing.


Solution

  • A response here https://www.gamedev.net/forums/topic/588070-seperating-axis-theorem---how-to-resolve-contact-points/ from Dirk Gregorius, helped me to resolve the problem. As described you have to found the two edge closest and watch where they collide, if not it means it's edge/edge collision The " first" face is the esaier one, because it's the one perpendicular to your seprating axis. For the other face I choose to make a dot a product of my first face with all other edges and found the one with the less dot product. Then I check if the two segment collide.