June 2015
Intermediate to advanced
388 pages
7h 31m
English
We did this last because there is a more complicated final step. As in the border detection, we will need to translate and rotate our object's vertices. However this time, we will need to do it for two objects.
Furthermore, once we rotated and translated the asteroid's vertices, we will need to handle them in pairs of vertices that form a line. These are lines that we will test against each and every vertex from the other object. This test is of course our crossing number method that we discussed.
We need to do all of this within the body of the if (distance < cp1.radius + cp2.radius) { ...}, where we previously just set the collided Boolean to true.
There is quite a lot of code, so we will split it into ...
Read now
Unlock full access