
324 Chapter 13 Generating Contacts
them, I created them on the fly before each test. This means that if I find a test that
passes and I exit the routine, I won’t have wasted time calculating the remaining axes
I never tested. This interleaving of concerns makes the code harder to read, howev er,
so I have used a simplified version here. See the full code for the alternative approach.
The final stage is to calculate and fill the contact data. As described in the previous
section, the approach at this point depends on whether our best contact fell on a face–
axis test, or an edge–axis test.
Contact Based on Face Axis
In the face–axis test we know we’l