notes_COSqueues

0 radius vx vx if ry vydt radius ry

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: icle-wall collision Change state only when something happens. Collision prediction and resolution. ・Between collisions, particles move in straight-line trajectories. ・Focus only on times when collisions occur. ・Maintain PQ of collision events, prioritized by time. ・Remove the min = get next collision. ・Particle of radius s at position (rx, ry). ・Particle moving in unit box with velocity (vx, vy). ・Will it collide with a vertical wall? If so, when? Collision prediction. Given position, velocity, and radius of a particle, s resolution (at time t + dt) when will it collide next with a wall or another particle? velocity after collision = ( − vx , vy) position after collision = ( 1 − s , ry + vydt) prediction (at time t) dt Collision resolution. If collision occurs, update colliding particle(s) according to laws of elastic collisions. time to hit wall = distance/velocity = (1 − s − rx )/vx wall at x=1 (rx , ry ) vy vx 1 − s − rx prediction (at time t) particles hit unless one passes intersection point before the other arrives (see Exercise 3.6.X) Predicting and resolving a particle-wall collision resolution (at time t + dt) velocities of both particles change after collision (see Exercise 3.6.X) Predicting and resolving a particle-particle collision 45 46 Particle-particle collision prediction Particle-particle collision prediction Collision prediction. Collision prediction. ・Particle i: radius s , position (rx , ry ), velocity (vx , vy ). ・Particle j: radius s , position (rx , ry ), velocity (vx , vy ). ・Will particles i and j collide? If so, when? i i i i j j j j ・Particle i: radius s , position (rx , ry ), velocity (vx , vy ). ・Particle j: radius s , position (rx , ry ), velocity (vx , vy ). ・Will particles i and j collide? If so, when? i i j i i i i j j j j j (vxi', vyi') (vxj', vyj') mi si ⎧ྏ ⎪ྏ ∞ ⎪ྏ Δt = ⎨ྏ ∞ ⎪ྏ Δv ⋅ Δr + d ⎪ྏ ⎩ྏ Δv ⋅ Δv (vxi , vyi ) (rxi , ryi) otherwise (rxi', ryi') d = (Δv ⋅ Δr )2 − (...
View Full Document

Ask a homework question - tutors are online