2D SAT Collision Detection not working when using certain polygons (With example)
- by sFuller
My SAT algorithm falsely reports that collision is occurring when using certain polygons. I believe this happens when using a polygon that does not contain a right angle. Here is a simple diagram of what is going wrong:
Here is the problematic code:
std::vector<vec2> axesB = polygonB->GetAxes();
//loop over axes B
for(int i = 0; i <…