1 / 14

Color Problem

Color Problem. Have a black-box function that returns a bright color in 24-bit RGB Want a paler version of the output What to do?. Collision Resolution. Collision resolution. Pre-collision positions, velocities known Collision: black box Post-collision positions, velocities known

anise
Download Presentation

Color Problem

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Color Problem • Have a black-box function that returns a bright color in 24-bit RGB • Want a paler version of the output • What to do?

  2. Collision Resolution

  3. Collision resolution • Pre-collision positions, velocities known • Collision: black box • Post-collision positions, velocities known • Assumption: we know collision location

  4. Impulse • Instantaneous change in momentum • j = ∆P • Apply within one timestep • Effectively, infinite force

  5. Aside: Alternatives • Not the only approach to collision resolution • "soft body": force proportional to penetration distance (one-way spring force)

  6. One-body collisions • Most common case: collision of object with scenery • Calculations generalize to two-body • perform 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 way

  7. Collision Normal • direction in which bodies collide • often simple: • line joining centres • normal of collision point on obstacle (often good approximation anyway)

  8. Closing Velocity • velocity with which things collide • magnitude: dot product of velocity and collision normal • If colliding: negative value • If separating: positive

  9. Post-Collision Velocity • Perfectly elastic collision: v'.nc = -v.nc • Perfectly plastic collision: v'.nc = 0 • "Coefficient of restitution": linear interpolation between these extremes • v'.nc = -c v.nc

  10. Contact • Contact management: avoid rattling effects of tiny collisions • Threshold for contact: if closing velocity smaller than threshold, set coefficient of restitution to zero • and perhaps stop simulating this object for now

  11. Impulse • Given output velocity, update velocity of body using momentum (impulse): j = -(1+c)(v.nc)nc • Unpacking: • v is relative velocity • nc is collision normal • c is coefficient of restitution

  12. 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 point • r = distance from body centre to collision point • if using angular momentum, ω = I-1L

  13. Impulsive torque • Compute impulse as before: have j = ∆P • Now, compute impulsive torque ∆L • Actually simple: ∆L = r x j • recall τ = r x F, same idea

  14. 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

More Related