Game Development Reference
In-Depth Information
Bounding Sphere
The simplest type of collision geometry is the bounding sphere (or in 2D games, a
bounding circle). A sphere can be defined with only two variables—a vector rep-
resenting the center of the sphere, and a scalar for the radius of the sphere:
class BoundingSphere
Vector3 center
float radius
end
As illustrated in Figure 7.2 , certain objects, such as an asteroid, fit well with
bounding spheres. But other types of objects, including humanoid characters, end
upwithalotofemptyspacebetweentheedgeofthecharacter andthesphere.This
means that for many types of objects, bounding spheres can have a large number
of false positives . This happens when two game objects have intersecting colli-
sion geometry, yet the game objects themselves are not actually intersecting. False
positives can be really frustrating for the player, because it will be apparent if the
two game objects aren't actually intersecting when a collision is detected.
Figure 7.2 Bounding spheres for different objects.
Because of the relative inaccuracy of bounding spheres for most game objects, it
usually is not appropriate to use bounding spheres as the only collision geometry.
Search WWH ::




Custom Search