Game Development Reference
In-Depth Information
Figure 9.10
The AABB and
bounding sphere for
various objects
case, the size of the rifle is the same, and only the orientation is different.
Also notice that the bounding spheres are the same size since bounding
spheres are not sensitive to the orientation of the object. When the objects
are free to rotate, some of the advantage of AABBs can be eroded. There
is an inherent trade-off between a tighter volume (OBB) and a compact,
fast representation (bounding spheres). Which bounding primitive is best
will depend highly on the application.
9.4.4 Transforming AABBs
Sometimes we need to transform an AABB from one coordinate space to
another. For example, let's say that we have the AABB in object space
(which, from the perspective of world space, is basically the same thing as
an OBB; see Section 9.4) and we want to get an AABB in world space.
Of course, in theory, we could compute a world-space AABB of the object
itself. However, we assume that the description of the object shape (perhaps
a triangle mesh with a thousand vertices) is more complicated than the
AABB that we already have computed in object space. So to get an AABB
in world space, we will transform the object-space AABB.
What we get as a result is not necessarily axially aligned (if the object
is rotated), and is not necessarily a box (if the object is skewed). However,
computing an AABB for the “transformed AABB” (we should perhaps
call it a NNAABNNB—a “not-necessarily axially aligned bounding not-
necessarily box”) is faster than computing a new AABB for all but the
most simple transformed objects because AABBs have only eight vertices.
 
Search WWH ::




Custom Search