HTML and CSS Reference
In-Depth Information
Chapter 9
Collision Detection
What we'll cover in this chapter:
Collision detection methods
Geometric hit testing methods
Distance-based collision detection
Multiple-object collision detection strategies
As you've progressed through the topic, you've seen how to make objects move and make them interact
with the space they occupy. Now, you're going to make these objects interact with each other. For the
most part, this will involve determining when two objects have touched each other. This is a subject known
as collision detection or hit testing.
This chapter will attempt to cover just about everything you need to know about detecting collisions. This
includes hit testing between two objects, hit testing between an object and a point, distance-based collision
detection, and multiple-object collision testing strategies. First, let's see what options are available for
collision detection.
Collision detection methods
Collision detection, or hit testing, is a simple concept: You want to know whether two objects are
occupying any part of the same space at the same time. Of course, you may have more than two objects,
and you may want to know whether any of them are hitting any others. But when you break it down, you
need to test each object, one at a time, against each other object.
There are a couple of ways of performing collision detection:
 
Search WWH ::




Custom Search