Game Development Reference
In-Depth Information
where u is the impulsive torque, I is the inertia tensor, and θ is the angular velocity, as
before. This is the direct equivalent of equation 7.5, which dealt with linear impulses.
And correspondingly the change in angular velocity θ is
θ
I 1 u
=
[14.1]
In all these equations I should be in world coordinates, as discussed in section 10.2.3.
Impulses behave just like forces. In particular for a given impulse there will be
both a linear component and an angular component. Just as the amount of torque is
given by
τ
=
p f ×
f
so the impulsive torque generated by an impulse is given by
u
=
p f ×
g
[14.2]
In our case, for collisions the point of application ( p f ) is given by the contact
point and the origin of the object:
p f =
q
p
where q is the position of the contact in world coordinates and p is the position of
the origin of the object in world coordinates.
14.1.2
R OTATING C OLLISIONS
The effect of the impulse at the collision is to have the points of each object in collision
bounce apart. The movement of the colliding objects at the collision point still follows
the same equations that we met in chapter 7. In other words, if we tracked the two
collision points (one from each object) around the time of the collision, we'd see that
their separating velocity is given by
v s =−
cv s
where v s is the relative velocity of the objects immediately before the collision, v s
is the relative velocity after the collision, and c is the coefficient of restitution. In
other words, the separation velocity is always in the opposite direction to the closing
velocity, and is a constant proportion of its magnitude. The constant c depends on
the materials of both objects involved.
Depending on the characteristics of the objects involved, and the direction of the
contact normal, this separation velocity will be made up of a different degree of lin-
ear and rotational motion. Figure 14.2 shows different objects engaged in the same
collision (again illustrated with an unmoving ground for clarity). In each part of the