Collisions Collision Avoidance - force fields, steer to avoid, etc. - as in flocking Collision Detection - calculating when objects overlap - during a time interval Collision Response - computation v. accuracy - back up time v. after-the-fact
Point-Plane Collision - Detect Collision Every time step, see if point is one “wrong” side of plane Detect collision by planar equation if a*x+b*y+c*z +d < 0 => collision Either back time up to point of collision and go from there Or Respond to collision only at time steps d1+d2 d1 d2 T = t + Dt*d1/(d1+d2)
Kinematic Response Negate velocity component in direction of normal v’ = v - 2*(v.N) N v N (v.N) N
Penalty Method F = k*d d Spring with zero rest length
Testing Planar Polyhedra Point inside a convex/concave polyhedron test Edge-plane intersection Temporal aliasing
Swept Volumes Compute motion of one relative to other Compute swept volume Determine if other object intersects swept volume Tractable only for simple motion
Impulse Force of Collision J = F * Dt J = F * Dt = M*a*Dt = M*Dv = D (M*v) = DP (Notation: J = j*N) v+rel = -e*v -rel Effect of collision has linear and angular components
Relative velocity Determine contact normal AxB A B Velocity of a point (pA (t)) = linear + angular velocities = vA(t) + wA (t) X rA Relative velocity is difference of velocity of 2 points of contact
Update Velocities after Collision v+A = v - A + j*n/M A v+B = v - B + j*n/M B w + A = w - A + I -1A(t)*(r A x j*n) w + B = w - B + I -1 B(t)*(r B x j*n)
Computing Impulse v+rel = -e*v -rel pA (t)) = vA(t) + wA (t) X rA v+rel = n* (p+A(t) - p+B(t)) v+rel = n * (v+A(t) + w+A(t) x r A -v+B(t) - w+B(t) x rB)
Computing Impulse Forces Given: two points of contact and normal of contact Compute velocities of points of contact: va, vb Compute relative velocities in direction of normal If Vrelative > threshold // actually colliding Compute j PA += J PB -= J LA += rA x J LB -= rB x J Else if Vrelative < -threshold, then resting contact Else they are moving away from each other
Other Forces Gravity Friction Viscosity Springs (Hooke’s law)
Friction Supporting object Static friction Fs = us * FN Fs Resting contact F Normal force FN
Friction Supporting object Fk = uk * FN Kinetic friction Fk v Resting contact F FN Normal force Static friction Fs = us * FN
Gravity Fgravity = G*m1*m2/r2 a object= F/m object = G*mearth/r2earth = 32 ft/s2 = 9.8 m/s2
Viscosity Fvis = -K*n*v K - depends on shape of object n - depends on properties of liquid K = 6*p*r For spherical object: Terminal velocity - viscosity and gravity balance m*g = 6*p*r*n*v
Springs (Hooke’s law) Spring’s rest length: exerts zero force Fspring = kspring * (x - xrest) x xrest F x F
Spring Mesh Edges => springs Internal springs to stabilize shape
Damping Calm down spring oscillations Fdamping = - kdamping * v F = (x’ - xrest) * kspring - v * kdamper
Forces - Recap Based on position: springs, gravity, wind, Based on velocity: viscosity, dampers, Based on object interactions: collisions, friction Give rise to accelerations