collisions
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 PresentationTRANSCRIPT
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
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)
Rick Parent - CIS682
(v.N) N
Kinematic Response
Negate velocity component in direction of normal
v
N v’ = v - 2*(v.N) N
Rick Parent - CIS682
Penalty Method
F = k*d
d
Spring with zero rest length
Rick Parent - CIS682
Testing Planar Polyhedra
Point inside a convex/concave polyhedron test
Edge-plane intersection
Temporal aliasing
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
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)
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
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)
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
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
Rick Parent - CIS682
Other Forces
Gravity
Friction
Viscosity
Springs (Hooke’s law)
Rick Parent - CIS682
Friction
Supporting object
Resting contact
Normal force FN
F
Static friction Fs = us * FN
Fs
Rick Parent - CIS682
Friction
Supporting object
Resting contact
Normal force
Static friction Fs = us * FN
FN
v
Fk = uk * FNKinetic friction
Fk
F
Rick Parent - CIS682
Gravity
Fgravity = G*m1*m2/r2
a object= F/m object = G*mearth/r2earth = 32 ft/s2 = 9.8 m/s2
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:
Rick Parent - CIS682
Springs (Hooke’s law)
Fspring = kspring * (x - xrest)
Spring’s rest length: exerts zero force
xrest
x
x
F
F
Rick Parent - CIS682
Spring MeshEdges => springs
Internal springs to stabilize shape
Rick Parent - CIS682
Damping
Fdamping = - kdamping * v
Calm down spring oscillations
F = (x’ - xrest) * kspring - v * kdamper
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