Game Development Reference
In-Depth Information
Swept Sphere Intersection
To this point, we have covered instantaneous collision detection algorithms. This
means the algorithm checks to see if the two objects collide on the current frame.
Although this can work in many cases, there are some instances where it won't.
If a bullet is fired at a piece of paper, it's unlikely there will be a precise frame
where the bullet and the paper intersect with each other. That's because the bullet
is travelling so fast and the paper is so thin. This problem is fittingly known as
the bullet-through-paper problem , and is illustrated in Figure 7.10 . In order to
solve this problem, a form of continuous collision detection (CCD) is necessary.
Generic CCD is a topic that's well beyond the scope of this topic, but it's worth
covering at least one algorithm that does not have to worry about bullet-through-
paper.
Figure 7.10 Bullet-through-paper problem.
In swept sphere intersection , there are two moving spheres. The inputs are the
positions of both spheres during the last frame ( t = 0) and the current frame ( t = 1).
Given these values, we can determine whether or not the two spheres collided at
any point between the two frames. So unlike the instantaneous sphere-sphere in-
tersection, it won't miss out on any intersections that occur between frames. This
is shown in Figure 7.11 .
Search WWH ::




Custom Search