Graphics Reference
In-Depth Information
A ( t )
v B ( t )
p A
x A ( t )
p B
B ( t )
x B ( t )
v A ( t )
FIGURE 7.23
Configuration of colliding objects.
p A ðtÞ¼ v A ðtÞþo A ðtÞ r A ðtÞ
_
(7.59)
p B ðtÞ¼
v B ðtÞþo B ðtÞ
r B ðtÞ
ð v A
; w
B
The linear and angular velocities of the objects before the collision
Þ
are updated by the
ð v A
; w þ
B
impulse to form the linear and angular velocities after the collision
. The linear velocities are
updated by adding in the effect of the impulse scaled by one over the mass ( Eq. 7.60 ). The angular
velocities are updated by computing the effect of the impulse on the angular velocity of the objects
( Eq. 7.61 ).
Þ
j N
M A
v A ðtÞ¼
v A ðtÞþ
(7.60)
j N
M B
v B ðtÞ¼
v B ðtÞþ
o A ðtÞ¼o A ðtÞþI A ðr A ðtÞjNÞ
o B ðtÞ¼o B ðtÞþI B ðr B ðtÞjNÞ
(7.61)
To solve for the impulse, form the difference between the velocities of the contact points after
collision in the direction of the normal to the surface of contact ( Eq. 7.62 ) . The version of
Equation 7.59 for velocities after collision is substituted into Equation 7.62 . Equations 7.60 and
7.61 are then substituted into that to produce Equation 7.63 . Finally, substituting into Equation 7.56
and solving for j produces Equation 7.64 .
v A ðtÞ¼ðð p A ðtÞ p B ðtÞÞ
N
Þ
N
(7.62)
v A ðtÞþo A ðtÞ
v rel ðtÞ¼
v B ðtÞþo B
N
ð
r A ðtÞð
r B ðtÞÞÞ
(7.63)
ðð 1 þ kÞv rel
j ¼
(7.64)
M A þ
1
M B þ N ðI 1
1
A ðtÞð r A ðtÞ N Þ r A ðtÞI 1
B ðtÞð r B ðtÞ N Þ r B ðtÞÞ
Contact between two objects is defined by the point on each object involved in the contact and the
normal to the surface of contact. A point of contact is tested to see if an actual collision is taking place.
When collision is tested for, the velocity of the contact point on each object is calculated. A collision is
detected if the component of the relative velocity of the two points in the direction of the normal indi-
cates the contact points are approaching each other.
 
Search WWH ::




Custom Search