I have two 3D convex, flat, polygons P0 and P1. I wish to detect if they collide. I will use the separating axis theorem. In this theorem a subset of the test axes are generated from the cross products of pairs edges in P0 and P1
axes = for all
| 0 <= n < N ; N is the count of edges on P0
| 0 <= m < M ; M is the count of edges on P1
Vector3.Cross(P0.Edge[n].Vector,P1.Edge[m].Vector);
However what is missing in all descriptions of the SAT I have found is what to do when the cross product of the two generating vectors is zero.
I'm of two minds. I can either
- Discard this axis from the test set
- Generate a random axis in the plane normal to the two edge vectors
Or perhaps there is another correct way to handle this problem.