10-Collision Response
Collision Response Collision Response [Moore and Wilhelms 88]: “ automatic suggestions about the motions of objects immediately following a collision; animation systems using dynamical simulation inherently must respond to collisions automatically and realistically ” Intersection/contact information alone (i.e. Yes/no answer to whether objects are colliding) is very useful for interaction, picking, collision avoidance etc. In self-regulating dynamic simulations (e.g. virtual environments) collisions are the basis for interaction between different objects, between users and objects
Problems of Collision Response In Physically Based Animation, objects need to behave in ways similar to their real-world counterparts We need to ensure that objects react according to believable dynamics We need to enforce non-interpenetration Collisions are a source of unpredictable simulation discontinuities. As a result they create additional workload for the simulation mechanism.
Rigid Body Representation RigidBody Mass = m InertialTensor = I BODY Position = x( t ) Orientation = R( t ) Y ( t ) = LinearMomentum = P( t ) AngularMomentum = L( t ) Simulation involves finding the change of Y over time: Force = F ( t ) Torque = t ( t ) ( ) ( ) x t v t ω ( ) ( ) * ( ) R t t R t d d ( ) Y t Rigid body geometry ( ) ( ) dt dt P t F t Dynamics Proxy Display Mesh τ ( ) ( ) L t t for collision detection, mass distribution: Inertial tensor I, center of *Baraff, Witkin, Kass ‘01+ mass
Integrating Rigid Body State ( ) ( ) x t v t P ( t ) : Linear ω ( ) ( ) * ( ) Momentum = m v ( t ) R t t R t d d ( ) Y t L ( t ) : Angular ( ) ( ) P F dt dt t t Momentum = I ( t ) w ( t ) τ ( ) ( ) L t t ( ) ( ) x v t t ω ( ) ( ) * ( ) R R t t t d d ( ) Y t ( ) ( ) m v t F t dt dt τ ( ) ( ) ( ) I t w t t
Spring Based Response Places a virtual spring at each collision point to push two objects apart Easy to understand and program, applies equally well to rigid and non-rigid bodies Numerical effort increases with violence of collision (smaller time-steps required) A.K.A. Penalty methods Objects allowed to penetrate Spring force proportional to interpentration
Collision events
Soft Collision
Hard Collision
Impulse
Impulse-based Collision Response Collision events are discontinuities in the Simulation Loop An instantaneous change of Rigid-Body state Quick local calculation of instantaneous change in velocities is possible at contact points Good solution for rigid body impact but it is difficult to accurately model resting contact and static friction
Rigid Body Collisions Collisions are a source of discontinuity in the simulation process Particularly in the case of rigid bodies we need to compute an (almost) instantaneous change in state at the time of collision Discontinuity to prevent colliding objects from penetrating Steady simulation is interrupted by discontinuity due to collision
Physics Pipeline With Collisions
Constraint based methods Makes a distinction between contact and collisions For two objects in contact (relative velocity F 0) ensure that the right force is applied to prevent them from interpenetrating m g For objects moving towards each other (negative relative velocities), force applied over time is often not enough to prevent interpenetration Changing nature of constraints can cause high computational demand
Particle Plane (Impulse response) v - - v v v || || Change in velocity caused by ˆ J j n application of an Impulse in V- direction normal to plane, and of magnitude j J V+ v v ..... (1) m ˆ J n j ˆ 0 n .v 1 j
Rigid Body Impulse Effect of an impulse (or for that matter a force) on objects linear and angular momentum is independent Impulsive Torque Linear component Angular component Causes change in angular velocity Similar to particles inversely proportional to moment causing change in velocity (determined from inertial tensor) inversely proportional to mass as Dependent on position of if force was applied at c.o.m. impulse 1 ω ) I (r J J v 1 ( ) ) I ( p x J m p (t) x (t) x (t) But what is the value of J?
Rigid Body Collision v v rel rel ˆ ( ) v n p p x b rel a b Relative velocity of colliding points on two object is the p input into the magnitude of the impulse. x a How do we get this? May be collocated but p a and p b are p p p N.B C a b separate points on respective objects with different velocities
Aside: Angular Velocity A p w Angular velocity: rate at o which orientation changes Think of it as magnitude w and axis A w Speed at which changes ( ) ( ) t t w ω ( ) ( ) ( ) t t A t A Instantaneous speed of a point p on circle (radius r) due to its rotation is: w ( ) ( ) p t t r ω ( ) ( ) ( ) Linear Velocity : v t t r t ω ( ) ( ) ( ( ) ) v t t p t o
Rigid Body Collision v v rel rel ˆ ( ) v n p p rel a b x b p ω p v (p x ) a a a a a x a ω p v (p x ) b b b b b Linear velocity Linear velocity of point p due to its rotation. component See previous slide
Collision Impulse Post-collision velocity should be We want to compute this in terms of previous state of object (pre- ω p v r collision values) a a a a ˆ j n ˆ ω ω 1 v v ( ) I r j n a a a a a a m a ˆ n j ˆ ω 1 p v I r j n r a a a a a a m a ˆ n ˆ ω 1 v r I r n r j a a a a a a m a ˆ n ˆ 1 p p j I r n r a a a a a m a ˆ n ˆ 1 p p I r n r j Similarly (by b b b b b m Newton 3): b
Collision Impulse Magnitude ˆ ( ) v n p p v v We know that and rel a b rel rel ˆ ˆ n n ˆ ˆ ˆ 1 1 p I r n r j p j I r n r v n b b b b a a a a rel m m a b 1 1 ˆ ˆ ˆ ˆ ˆ 1 1 ( ) v n p p j n I r n r n I r n r rel a b a a a b b b m m a b 1 1 ˆ ˆ ˆ ˆ 1 1 v v j n I r n r n I r n r rel rel a a a b b b m m a b ( ) 1 v rel j 1 1 ˆ ˆ ˆ ˆ 1 1 n I r n r n I r n r a a a b b b m m a b
Impulse Equations Impulse magnitude is given by: ( ) 1 v rel j 1 1 ˆ ˆ ˆ ˆ 1 1 n I r n r n I r n r a a a b b b m m a b ˆ The actual impulse vector is simply J n j This is applied to the objects as follows: J p J v Linear momentum m t ω 1 ( ) ( ) L r J I r J Angular momentum IMPULSE
Collision Impulse Magnitude Where the variables come from ( ) 1 v rel j 1 1 ˆ ˆ ˆ ˆ 1 1 n I r n r n I r n r a a a b b b m m a b Constants RB State variables Derived values Contact variables p is the contact point Associated with a contact direction n
Recommend
More recommend