Game Development Reference
In-Depth Information
- V 2
M 2
N
M 1
V 1
V 2
Figure 12.13
Computing the amount of relative velocity
acting parallel to the surface normal
law (though not the only one) that can be used to discriminate between
these cases is Newton's collision law. This law introduces the coe cient of
restitution, denoted e, which is a fractional number that relates the mag-
nitude of the relative velocity along the surface normal after the collision
with the same value measured just before the collision. When e = 0, the
post-collision velocity along the normal is zero, and we have a perfectly
inelastic collision. Using e = 1 produces a perfectly elastic collision, where
the relative velocity along the normal has the same magnitude (but op-
posite sign) as before the collision. Dropping a beanbag onto carpet is a
close example of an inelastic collision, whereas dropping a SuperBall is a
highly elastic collision. Using the formulas from Section 11.6, we can also
show that, if an object is dropped and allowed to bounce multiple times,
the coe cient of restitution gives the ratio of apex heights at successive
bounces.
Let's denote the magnitude of the collision response impulse as k. The
first mass, m 1 , will receive the (vector) impulse −k n , while m 2 undergoes
the opposite change in momentum of k n . The signs are based on our ar-
bitrary choice of the direction of the surface normal. Now that we know
what we want, calculating the proper k to cancel the relative velocity is a
straightforward algebraic exercise. As before, we denote the post-collision
values with primes. An impulse is an instantaneous change of momentum,
so the post-collision momentum of the first object is P
−k n . Divid-
ing by the mass and remembering P = m v , we express the post-collision
velocities as
1 = P 1
v
1 = v 1
− k n /m 1 ,
v
2 = v 2 + k n /m 2 .
Post-collision velocities
1
The post-collision relative velocity is simply their difference, v
2 .
We solve for k by expressing the resulting relative velocity along the normal
rel = v
v
 
Search WWH ::




Custom Search