What are the initial lines good for?
It makes sure a direction N and a direction -N are seen as the same axis. For example (0.5, 0.5, 0) should be the same as (-0.5, -0.5 ,0). I keep the one with a positive X only (this is arbitrary).
precomputing projection values for face normals (results are already known for one object at least)
The standard SAT test does 3 things:
- tests face normals from convex A
- tests face normals from convex B
- tests edge cross products from AxB
The thing is that we have to project both A and B on each of those axes. For the face normals, we can precompute the projection values for one of the convex, since we're projecting along its own normals.
culling features more aggressively
I only culled vertices/edges using the first thing that came to mind. It should be possible to do better
How do you compute the contact position for the edge cases from your example code? The two edges that build the axis of minimum separation must not necessarily realize the contact. So is there an extra step to find the "support edge" in the direction of the separating axis?
Yes, there is an extra step. The code in the test only computes the penetration vector, giving the same result as, say EPA. But contact generation is another thing entirely. Which is actually another big optimization: most of the time you don't really need to compute the penetration vector at all. At least we didn't in Novodex. It was only done once in a while.
- Pierre
PS: expect lags in future answers, going to Sweden tomorrow for some days!