Graphics Reference
In-Depth Information
E ( p )
0
E ( p ) 0
E ( p ) 0
FIGURE 7.14
Point-plane collision.
function, a , b , c , d are coefficients of the planar equation, and p is, for example, a particle's position in
space that has no physical extent of its own. Points on the plane satisfy the planar equation, that is,
E ( p )
0. Assuming for now that the plane represents the ground, the planar equation can be formed
so that for points above the plane the planar equation evaluates to a positive value, E ( p )
¼
>
0; for
points below the plane, E ( p )
<
0.
p
Þ¼ap x þ bp y þ cp z þ d ¼
0
(7.51)
The particle travels toward the plane as its position is updated according to its average velocity over
the time interval, as in Equation 7.52 .Ateachtimestep t i , the particle is tested to see if it is still above the
plane, E ( p ( t i ))
>
0. As long as this evaluates to a positive value, there is no collision. The first time t at
which E ( p ( t i ))
0 indicates that the particle has collided with the plane at some time between t i 21 and t i .
What to do now? The collision has already occurred and something has to be done about it.
<
p
ðt i Þ¼
p
ðt 1 Þþ
v ave ðtÞDt
(7.52)
In simple kinematic response, when penetration is detected, the velocity of the particle is
decomposed, using the normal to the plane ( N ), into the normal component and the perpendicular-
to-the-normal component ( Figure 7.15 ) . The normal component of the velocity vector is negated by
subtracting it out of the original velocity vector and then subtracting it out again. To reduce the height
of each successive bounce, a damping factor, 0
1, can be applied when subtracting it out the
second time ( Eq. 7.53 ). This bounces the particle off a surface at a reduced velocity This approach
< k <
v ( t i )
v ( t i )
N
N
v ( t i ) N
v ( t i 1 )
v ( t i )
FIGURE 7.15
Kinematic solution for collision reaction.
 
Search WWH ::




Custom Search