Graphics Reference
In-Depth Information
large speedups. Due to big differences between the speed at which CPUs operate
and the speeds at which main memory can provide data for it to operate on (with the
speed advantage for the CPU), how collision geometry and other data are stored in
memory can also have a huge speed impact on a collision system. These issues are
covered in detail in Chapter 13.
2.6 Robustness
Collision detection is one of a number of geometrical applications where robustness
is very important. In this topic, robustness is used simply to refer to a program's
capability of dealing with numerical computations and geometrical configurations
that in some way are difficult to handle. When faced with such problematic inputs,
a robust program provides the expected results. A nonrobust program may in the
same situations crash or get into infinite loops. Robustness problems can be broadly
categorized into two classes: those due to lack of numerical robustness and those due
to lack of geometrical robustness .
Numerical robustness problems arise from the use of variables of finite precision
during computations. For example, when intermediate calculations become larger
than can be represented by a floating-point or an integer variable the intermediate
result will be invalid. If such problems are not detected, the final result of the com-
putation is also likely to be incorrect. Robust implementations must guarantee such
problems cannot happen, or if they do that adjusted valid results are returned in their
stead.
Geometrical robustness entails ensuring topological correctness and overall geo-
metrical consistency. Problems often involve impossible or degenerate geometries,
which may be the result of a bad numerical calculation. Most algorithms, at some
level, expect well-formed inputs. When given bad input geometry, such as triangles
degenerating to a point or polygons whose vertices do not all lie in the plane, anything
could happen if these cases are not caught and dealt with.
The distinction between numerical and geometrical robustness is sometimes diffi-
cult to make, in that one can give rise to the other. To avoid obscure and difficult-to-fix
runtime errors, robustness should be considered throughout both design and devel-
opment of a collision detection system. Chapters 11 and 12 discuss robustness in
more depth.
2.7 Ease of Implementation and Use
In the case of a collision detection system implemented from scratch, the issue of
expected development time might be as important as the desired feature set. For
example, games are often on tight budgets and time frames, and the delay of any
Search WWH ::




Custom Search