
CHAPTER 4 ■ WORKING WITH MODELS
383
Figure 4-27. CheckingwhetherthecollisionPointisinsidethetriangle
In the left part of Figure 4-27, the collisionPoint is outside the triangle. First concentrate
on the T0,T1 boundary of the triangle. You want to find out on which side of the boundary the
collisionPoint is. Look at vectors A = (collisionPoint – T0) and B = (T1-T0) in the left part
of Figure 4-27. If you rotate from A to B, you’re rotating in a counterclockwise way.
However, in the right part of Figure 4-27, the collisionPoint is inside the triangle and
thus at the other side of the T0,T1 boundary. In this case, when you rotate from A ...