Have a blackbox function that returns a bright color in 24bit RGB Want a paler version of the output What to do Collision Resolution Collision resolution Precollision positions velocities known ID: 188638
Download Presentation The PPT/PDF document "Color Problem" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Color Problem
Have a black-box function that returns a bright color in 24-bit RGBWant a paler version of the outputWhat to do?Slide2
Collision ResolutionSlide3
Collision resolution
Pre-collision positions, velocities knownCollision: black boxPost-collision positions, velocities known
Assumption: we know collision locationSlide4
Impulse
Instantaneous change in momentumj = ∆P
Apply within one timestepEffectively, infinite forceSlide5
Aside: Alternatives
Not the only approach to collision resolution"soft body": force proportional to penetration distance (one-way spring force)Slide6
One-body collisions
Most common case: collision of object with sceneryCalculations generalize to two-bodyperform calculations in reference frame where one body is at rest, i.e., add one body's velocity to the other before starting
Simpler to set up this waySlide7
Collision Normal
direction in which bodies collideoften simple:line joining centresnormal of collision point on obstacle (often good approximation anyway)Slide8
Closing Velocity
velocity with which things collidemagnitude: dot product of velocity and collision normalIf colliding:
negative valueIf separating: positiveSlide9
Post-Collision Velocity
Perfectly elastic collision: v'.nc = -v.n
cPerfectly plastic collision: v'.nc = 0"Coefficient of restitution": linear interpolation between these extremesv'.n
c = -c v.ncSlide10
Contact
Contact management: avoid rattling effects of tiny collisionsThreshold for contact: if closing velocity smaller than threshold, set coefficient of restitution to zeroand perhaps stop simulating this object for nowSlide11
Impulse
Given output velocity, update velocity of body using momentum (impulse):j = -(1+c)(v.n
c)ncUnpacking:v is relative velocity
nc is collision normalc is coefficient of restitutionSlide12
Closing rotational velocity
Recall that rotation produces instantaneous linear velocity: v = ω x r
so, add this velocity to centre of mass velocity to get velocity of collision pointr = distance from body centre to collision pointif using angular momentum, ω = I-1
LSlide13
Impulsive torque
Compute impulse as before: have j = ∆PNow, compute impulsive torque ∆LActually simple: ∆L = r x j
recall τ = r x F, same ideaSlide14
Wrapping up
Apply impulse, impulsive torque to both bodies (one positive, one negative)If one body is fixed: effectively infinite mass, moment of inertia (zero inverse mass) so no resulting velocity