Game Development Reference

In-Depth Information

Figure 4.18.
Detection of arc-arc intersection and the direction of
s
.

Figure 4.19.
Edge-edge cases: not candidate support pairs.

4.7.3 Non-Three-Dimensional Polytopes

In order for the arc-arc intersection test in Equation (4.9) to work, direction
e
must

is easy to establish that
e
=
norm
||·||
(
n
0
×

n
1
) but that
n
0
×

n
1
=
0
in the case

where
n
1
=

n
0
, i.e., in the case of a wedge collision shape. Furthermore, the

tetrahedron test also breaks down unless we replace
n
0
×

−

n
1
with a valid nonzero

direction.

Fortunately, this special case is easy to handle with a little bit of precompu-

tation. The main requirements for
e
are that it is orthogonal to the arc plane and

is the axis of right-hand-rule rotation from
n
0
to
n
1
(it also implies
e

⊥

n
0
and

e

n
1
),

see
Figure 4.20(a)
)
, and in the unfolded angle case (
Figure 4.20(b)
)
, we can

⊥

n
1
). This automatically holds in common cases (
e
=
norm
||·||
(
n
0
×