Graphics Reference
In-Depth Information
B
B
B
A
A
A
(a)
(b)
(c)
Figure 4.4 (a) AABBs A and B in world space. (b) The AABBs in the local space of A . (c) The
AABBs in the local space of B .
4.2.2 Computing and Updating AABBs
Bounding volumes are usually specified in the local model space of the objects they
bound (which may be world space). To perform an overlap query between two bound-
ing volumes, the volumes must be transformed into a common coordinate system.
The choice stands between transforming both bounding volumes into world space
and transforming one bounding volume into the local space of the other. One benefit
of transforming into local space is that it results in having to perform half the work
of transformation into world space. It also often results in a tighter bounding volume
than does transformation into world space. Figure 4.4 illustrates the concept. The
recalculated AABBs of objects A and B overlap in world space (Figure 4.4a). However,
in the space of object B , the objects are found to be separated (Figure 4.4c).
Accuracy is another compelling reason for transforming one bounding volume
into the local space of the other. A world space test may move both objects far away
from the origin. The act of adding in the translation during transformation of the local
near-origin coordinates of the bounding volume can force many (or even all) bits of
precision of the original values to be lost. For local space tests, the objects are kept
near the origin and accuracy is maintained in the calculations. Note, however, that by
adjusting the translations so that the transformed objects are centered on the origin
world space transformations can be made to maintain accuracy as well.
Transformation into world space becomes interesting when updated bounding
volumes can be temporarily cached for the duration of a time step. By caching a
bounding volume after transformation, any bounding volume has to be transformed
just once into any given space. As all bounding volumes are transformed into the
same space when transforming into world space, this becomes a win in situations
in which objects are being checked for overlap multiple times. In contrast, caching
updated bounding volumes does not help at all when transforming into the local
space of other bounding volumes, as all transformations involve either new objects
 
Search WWH ::




Custom Search