Graphics Reference
In-Depth Information
environments if many closely spaced collisions occur. However, for a point-plane collision, the
impulse can be simplified because the angular velocity can be ignored.
The actual time of collision within a time interval can be searched for by using a binary search strat-
egy. If it is known that a collision occurred between t i 1 and t i , these times are used to initialize the lower
( L ¼ t i 1 ) and upper ( U¼ t i ) bounds on the time interval to be tested. At each iteration of the search, the
point's position is tested at the middle of the bounded interval. If the test indicates that the point has not
collided yet, then the lower bound is replaced with the middle of the time interval. Otherwise, the upper
bound is replaced with the middle of the time interval. This test repeats with the middle of the new time
interval and continues until some desired tolerance is attained. The tolerance can be based either on the
length of the time interval or on the range of distances the point could be on either side of the surface.
Alternatively, a linear-path constant-velocity approximation can be used over the time interval to
simplify the calculations. The position of the point before penetration and the position after penetration
can be used to define a linear path. The point of intersection along the line with a planar surface can be
calculated analytically. The relative position of the intersection point along this line can be used to
estimate the precise moment of impact ( Figure 7.21 ) .
As previously discussed, at the time of impact, the normal component of the point's velocity can be
modified as the response to the collision. A scalar, the coefficient of restitution, between zero and one
can be applied to the resulting velocity to model the degree of elasticity of the collision ( Figure 7.22 ).
Computing impulse forces
Once a collision is detected and the simulation has been backed up to the point of intersection, the
reaction to the collision can be calculated. By working back from the desired change in velocity
due to a collision, an equation that computes the required change in momentum can be formed. This
equation uses a new term, called impulse , expressed in units of momentum. The impulse,
J
, can be
viewed as a large force acting over a short time interval ( Eq. 7.54 ) . The change in momentum
P
,
and therefore the change in velocity, can be computed once the impulse is known ( Eq. 7.55 ).
J ¼ FDt
(7.54)
J ¼ FDt ¼ MaDt ¼ MDa ¼ DðMvÞ¼DP
(7.55)
To characterize the elasticity of the collision response, the user selects the coefficient of restitution,
in the range 0
1, which relates the relative velocity before the collision, v rel þ to the relative
k
s ( t i t i 1 )
L
t t i
point p at t i 1
L
s
point p at t i
FIGURE 7.21
Linearly estimating time of impact,
t.
 
Search WWH ::




Custom Search