Game Development Reference
In-Depth Information
Dealing with objects that can rotate adds a few complications. First,
we earlier referred to “the” velocity of an object. But when an object is
rotating, the different points on the object have different linear velocities.
The velocity we need is not the velocity of the object's center of mass, but
rather the velocity at the point of contact. So we must extend our velocity
calculation to account for the angular velocity. Likewise, our prediction
of the post-impulse velocities at the points of impact must also take into
consideration rotational effects. Application of an impulse at the point
of contact will create an angular impulse, which will change the rate of
rotation. In general, when objects are free to rotate, a smaller impulse will
su ce to resolve the collision, since the impulse has two ways by which to
reduce the point velocities. The change in angular velocity will cause the
points of contact to move away from each other faster than their centers
of mass do. Indeed, the centers of mass may still be moving towards each
other after the collision.
In Section 12.4.2, we started with the equation
rel
v
n = −e v rel n
and then expanded the math and solved for k, the magnitude of the impulse.
(It's hidden in the left hand side.) The same strategy works here, only we
need to derive new expressions for the point velocities before and after the
impulse that take into consideration the rotational effects. First, let's check
the notation. We use r i to denote the position of the point of impact on
object i relative to its center of mass, ω i for the angular velocity of the
object, m i for the mass, and J i for the inertia tensor. For linear velocity,
we need to introduce some new notation to distinguish between the linear
velocities at the point of contact, which we denote as u i , and the linear
velocities of the center of mass, denoted v i . As before, primes on the
quantities refer to their values after the collision.
With this notation, we compute the point velocity of each object by
adding the velocity due to the motion of the center of mass, plus that
portion caused by the rotation, according to Equation (11.31):
Computing the point
velocities
u 1 = v 1 + ω 1 × r 1 ,
u 2 = v 2 + ω 2 × r 2 .
The velocities after the collision depend on the change in linear velocity
of the center of mass, and also the change in angular velocity. These are
computed by
Post-impulse linear and
angular velocities of the
bodies
1 = v 1 − k n /m 1 ,
2 = v 2 + k n /m 2 ,
v
v
−1
−1
2 ,
where the sign conventions are determined by our arbitrary choice to have
the collision normal n point from the first object to the second. Combining
ω
1 = ω 1
− ( r 1
× k n ) J
1 ,
ω
2 = ω 2 + ( r 2
× k n ) J
Search WWH ::




Custom Search