Game Development Reference
In-Depth Information
CHAPTER 6
■ ■ ■
Collisions
I n Chapter 5, you learned how to model a projectile flying through the air. Eventually all
projectiles, whether they are bullets or baseballs, are going to hit something. An important
aspect of physics modeling for games is what happens when two objects collide. Do they bounce
off each other or stick and travel together? If the objects do bounce off each other, what direction
do they travel after the collision and what speed do they travel? This chapter will answer some
of these questions by developing models used to describe object collisions.
This chapter will introduce the concept of momentum, both linear and angular, and
describe how momentum is used to model collisions. We'll see how and why momentum is
conserved. A couple of sample games will be developed that will demonstrate some aspects of
collisions and allow you to play a stirring game of Pong. Some of the specific topics covered in
this chapter include the following:
Linear momentum and impulse : How these concepts can be used to describe the collision
of objects that are moving linearly, like the collision of a golf club head with a golf ball.
Conservation of linear momentum : This concept allows you to compute the post-collision
velocities of two objects.
Two-body linear collisions : We'll develop the mathematical equations that describe the
collision of two objects.
Elastic and inelastic collisions : An important distinction that defines the extent to
which objects will rebound after a collision.
Determining when a collision occurs : A crucial step in collision analysis.
Angular momentum and impulse : In addition, we'll also see how these concepts can be
used to model the collision of rotating objects.
Conservation of angular momentum : This concept allows the determination of the
post-collision angular velocity (that is, spin) of two objects.
General two-body collisions : How to model the collisions of objects that are in transla-
tional motion and spinning at the same time.
139
Search WWH ::




Custom Search