Presentation is loading. Please wait.

Presentation is loading. Please wait.

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?

Similar presentations


Presentation on theme: "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?"— 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'.n c = -v.n c Perfectly plastic collision: v'.n c = 0 "Coefficient of restitution": linear interpolation between these extremes – v'.n c = -c v.n c

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.n c )n c – Unpacking: v is relative velocity n c 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 -1 L

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


Download ppt "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?"

Similar presentations


Ads by Google