Game Development Reference
In-Depth Information
Oriented Bounding Box
An oriented bounding box is similar to an axis-aligned bounding box, but with
the parallel restrictions removed. That is to say, it is a rectangle (in 2D) or a rect-
angular prism (in 3D) with sides that may not necessarily be parallel to the co-
ordinate axes/planes. The big advantage ofan OBB is that it can rotate as the game
object rotates; therefore, regardless of the orientation of the game object, the OBB
will have the same degree of accuracy. But this increased accuracy comes with a
price; compared to an AABB, the collision calculations for an OBB are far more
complicated.
An OBB can be represented in a game in multiple ways, including eight vertexes
or six planes. But the OBB calculations are complex enough that this topic does
not outline any algorithms related to them. However, if you'd like to use them in
your game, take a look at Real-time Collision Detection in the references at the
end of this chapter.
Capsule
In 2D, a capsule can be thought of as an AABB with two semicircles (half circles)
attached to the top and bottom. It's called a capsule because it looks very similar
to a medicine capsule. If we expand the capsule to 3D, it becomes a cylinder with
two hemispheres attached to the top and bottom. Capsules are also a popular form
of collision representation for humanoid characters because they are slightly more
accurate than an AABB, as illustrated in Figure 7.4(a) .
Search WWH ::




Custom Search