Game Development Reference
In-Depth Information
13
G ENERATING
C ONTACTS
The algorithms in the previous chapter produce a list of object pairs that then
needs to be checked in more detail to see whether the pairs do in fact collide.
Many collision detection systems perform this check for each pair and return a
single point of maximum interpenetration if the objects are in contact. That is not
what we need. We need contact generation. Two objects that are colliding can have
more than one point of contact between them. Representing the collision with just a
single contact works okay for some combinations of objects (such as a sphere and a
plane), but not for others (such as a car and a plane: which wheel do we choose?).
Contact generation is more complex than single-intersection collision detection
and takes more processor time to complete. Often we will have a two-stage process
of contact generation: a fine collision detection step to determine whether there are
contacts to generate and then a contact generation step to work out the contacts that
are present.
Just because we have performed a coarse filtering step, it doesn't mean we can take
as much time as we like to perform fine collision detection and contact generation.
We need to make sure that fine collision detection runs as fast as possible. We can
dramatically improve the speed by performing collision detection against a simplified
geometry rather than the full-resolution rendering geometry.
The bulk of this chapter looks at generating the contacts between geometric prim-
itives that are useful as stand-in collision geometry. There are lots of combinations,
and this chapter tries to cover a representative selection.
Coarse collision detection is just the first stage of collision-generating contacts.
Search Nedrilad ::




Custom Search