Game Development Reference
In-Depth Information
F IGURE 14.3
The three sets of coordinates: world, local, and contact.
of the contact points. As we saw in the previous section, we have an equation that
tells us what the final separating velocity needs to be, so we'd like to be able to apply
it simply.
The velocity of a point on an object is related to both its linear and angular veloc-
ity, according to equation 9.5:
= θ
˙
×
+ ˙
q
( q
p )
p
Because we are only interested in the movement of the colliding points at this stage, we
can simplify the mathematics by doing calculations relative to the point of collision.
Recall from chapter 13 that each contact has an associated contact point and con-
tact normal. If we use this point as the origin, and the contact normal as one axis, we
can form an orthonormal basis around it: a set of three axes. Just as we have a set of
world coordinates and a set of local coordinates for each object, we will have a set of
contact coordinates for each contact.
Figure 14.3 shows the contact coordinates for one contact. Notice that we are ig-
noring interpenetration at this stage. As part of the contact generation, we calculated
a single representative point for each contact.
The Contact Coordinate Axes
The first step of converting to contact coordinates is to work out the direction of each
axis. We do this using the algorithm to calculate an orthonormal basis, as shown in