Game Development Reference

In-Depth Information

Figure 4.3.
Contact reduction and stability. For stability, the center-of-mass projection

(the
×
) should be within the contact manifold. (a) Stable full-contact manifold. (b) Unsta-

ble reduced-contact manifold. (c) and (d) Stable reduced-contact manifold.

F

Feature (vertex, edge, or face)

P

Plane

Ta b l e 4 . 1 .
Notation guide.

time. However, more contact points will often mean more-precise simulations, so

it's a trade-off between quality and speed. If speed is of higher priority, then

reducing the contact manifold is probably a win. The solver will generally go

through the contact points multiple times and execute more complex code than

contact reduction. So it's rather safe to assume that the time spent reducing con-

tact points will be a net win.

In case of concave contact areas, we only need to keep the convex hull of

contact points as the contact manifold, as in Figure 4.1. But even then, we may

reduce the contact points further, as in Figure 4.3(d).

Three or more contact points are necessary to keep an object statically stable.

As a rule of thumb, the center of mass should project along the gravity vector (
not

along the contact normal) well inside the contact manifold formed by them, as

in Figure 4.3(a), (c), and (d) (obviously, only when it's possible). It's convenient

to choose those points among the unreduced contact manifold corners, as shown

in Figure 4.3(c), but it's not always stable. Instead we may opt to leave four or

more points, like in Figure 4.3(a) and (d), of the originally computed manifold,

potentially using some heuristic to reduce other points, like in Figure 4.3(d).

One heuristic is to sort manifold vertices by their angle and reduce those with

the highest angle (updating the neighboring vertex angles). We need to always

keep the contact point with the most penetration, or otherwise compensate for the

penetration by assigning high penetration to other points to resolve it.

Resampling the contact manifold is another possible heuristic. If we choose

to resample every 90
◦
, we are guaranteed not to miss manifold vertices with 90
◦

or sharper angle. See Figure 4.14.