collisions

20
Rick Parent - CIS68 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

Upload: emma-parks

Post on 30-Dec-2015

21 views

Category:

Documents


1 download

DESCRIPTION

Collision Response - computation v. accuracy - back up time v. after-the-fact. Collisions. Collision Avoidance - force fields, steer to avoid, etc. - as in flocking. Collision Detection - calculating when objects overlap - during a time interval. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Collisions

Rick Parent - CIS682

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

Page 2: Collisions

Rick Parent - CIS682

Point-Plane Collision - Detect Collision

Detect collision by planar equationif a*x+b*y+c*z +d < 0 => collision

Every time step, see if point is one “wrong” side of plane

Either back time up to point of collision and go from thereOrRespond to collision only at time steps

d1+d2d1

d2T = t + t*d1/(d1+d2)

Page 3: Collisions

Rick Parent - CIS682

(v.N) N

Kinematic Response

Negate velocity component in direction of normal

v

N v’ = v - 2*(v.N) N

Page 4: Collisions

Rick Parent - CIS682

Penalty Method

F = k*d

d

Spring with zero rest length

Page 5: Collisions

Rick Parent - CIS682

Testing Planar Polyhedra

Point inside a convex/concave polyhedron test

Edge-plane intersection

Temporal aliasing

Page 6: Collisions

Rick Parent - CIS682

Swept Volumes

Compute motion of one relative to other

Compute swept volume

Determine if other object intersects swept volume

Tractable only for simple motion

Page 7: Collisions

Rick Parent - CIS682

Impulse Force of Collision

J = F * t

v+rel = -*v -

rel

Effect of collision has linear and angular components

J = F * t = M*a*t = M*v = (M*v) = P

(Notation: J = j*N)

Page 8: Collisions

Rick Parent - CIS682

Relative velocity

Relative velocity is difference of velocity of 2 points of contact

Determine contact normal

AxB

A B

Velocity of a point (pA (t)) = linear + angular velocities = vA(t) + A (t) X rA

Page 9: Collisions

Rick Parent - CIS682

Update Velocities after Collision

v+A = v - A + j*n/M A

v+B = v - B + j*n/M B

+ A = - A + I -1A(t)*(r A x j*n)

+ B = - B + I -1 B(t)*(r B x j*n)

Page 10: Collisions

Rick Parent - CIS682

Computing Impulse

v+rel = n* (p+

A(t) - p+B(t))

v+rel = n * (v+

A(t) + +A(t) x r A -v+

B(t) - +B(t) x rB)

v+rel = -*v -

rel

pA (t)) = vA(t) + A (t) X rA

Page 11: Collisions

Rick Parent - CIS682

Computing Impulse Forces

If Vrelative > threshold // actually colliding

Compute velocities of points of contact: va, vb

Compute relative velocities in direction of normal

Given: two points of contact and normal of contact

Compute j

PA += JPB -= J

LA += rA x JLB -= rB x J

Else if Vrelative < -threshold, then resting contact

Else they are moving away from each other

Page 12: Collisions

Rick Parent - CIS682

Other Forces

Gravity

Friction

Viscosity

Springs (Hooke’s law)

Page 13: Collisions

Rick Parent - CIS682

Friction

Supporting object

Resting contact

Normal force FN

F

Static friction Fs = us * FN

Fs

Page 14: Collisions

Rick Parent - CIS682

Friction

Supporting object

Resting contact

Normal force

Static friction Fs = us * FN

FN

v

Fk = uk * FNKinetic friction

Fk

F

Page 15: Collisions

Rick Parent - CIS682

Gravity

Fgravity = G*m1*m2/r2

a object= F/m object = G*mearth/r2earth = 32 ft/s2 = 9.8 m/s2

Page 16: Collisions

Rick Parent - CIS682

Viscosity

Fvis = -K*n*v

K - depends on shape of object

n - depends on properties of liquid

Terminal velocity - viscosity and gravity balance

m*g = 6**r*n*v

K = 6**rFor spherical object:

Page 17: Collisions

Rick Parent - CIS682

Springs (Hooke’s law)

Fspring = kspring * (x - xrest)

Spring’s rest length: exerts zero force

xrest

x

x

F

F

Page 18: Collisions

Rick Parent - CIS682

Spring MeshEdges => springs

Internal springs to stabilize shape

Page 19: Collisions

Rick Parent - CIS682

Damping

Fdamping = - kdamping * v

Calm down spring oscillations

F = (x’ - xrest) * kspring - v * kdamper

Page 20: Collisions

Rick Parent - CIS682

Forces - Recap

Based on position: springs, gravity, wind,

Based on velocity: viscosity, dampers,

Give rise to accelerations

Based on object interactions: collisions, friction