constrained rigid body
play

Constrained rigid body Detect collision simulation Compute - PowerPoint PPT Presentation

constraints Constrained rigid body Detect collision simulation Compute velocity change for colliding contact Compute contact forces when rigid bodies are in resting contact Bisection Collision detection Determine when the collision occurs


  1. constraints Constrained rigid body Detect collision simulation Compute velocity change for colliding contact Compute contact forces when rigid bodies are in resting contact Bisection Collision detection Determine when the collision occurs within a Y ( t 0 ) numerical tolerance Y ( t 0 + 1 2 ∆ t ) Determine all pairs of bounding boxes that overlap Y ( t c ) � Y ( t 0 + ∆ t ) Further check contact points between rigid bodies defined as convex polyhedra

  2. Bounding boxes Bounding boxes Each bounding box i can be described as an interval Use bounding boxes to reduce the number of ( b i , e i ) pairwise collision/contact determinations Find all pairs of interval that intersect If two bounding boxes have no overlap, no further comparisons are needed All the b i and e i are sorted from lowest to highest in a list Determining all pairs of boxes that overlap can be done in Maintain an active list which is initially empty time O( nlog d-2 n + k ) for d -dimensional bounding boxes Whenever b i is encountered, all intervals on the active list Coherence can substantially improve the performance are output as overlapping with i , and i is added to the list Bounding boxes Bounding boxes Sweep and sort algorithm We only need to do a full sort and sweep initially I 5 I 6 What is the cost of the sorting process? I 3 I 4 Subsequent comparisons can be improved by I 1 utilizing coherence I 2 What is best sorting algorithm for a nearly sorted list? b 3 b 5 b 1 e 5 e 1 b 6 b 2 e 3 b 4 e 6 e 4 e 2

  3. Convex polyhedra Convex polyhedra Check all possible edges or faces to find a separating plane at the Two polyhedra do not inter-penetrate if and only if a very first time step of simulation or the first time two rigid bodies separating plane between them exists become close enough to require more than a bounding box test Separating plane Separating plane Convex polyhedra Convex polyhedra Utilize coherence by caching defining faces or defining The defining face no longer separate the polyhedra and a new separating edges plane must be found Defining face Defining face Defining face Defining face If no separating plane is found, an inter-penetration has occurred at some earlier time Y ( t 0 ) Y ( t 0 + ∆ t ) The simulator must back up until the collision time is determined

  4. Contact points Contact points Once we determine which bodies contact, we also need to determine the exact contact points We consider two types of contacts vertex/faces 4 vertex/face 2 vertex/face edge/edge 2 edge/edge Contact points Velocity of the contact point p a A p a ( t c ) = v a ( t c ) + ω a ( t c ) × ( p a ( t c ) − x a ( t c )) ˙ p b B p a ( t c ) p a ( t ) A A p b ( t c ) = v b ( t c ) + ω b ( t c ) × ( p b ( t c ) − x b ( t c )) ˙ ˆ n p b ( t c ) p b ( t ) B B ˆ ˆ n n v r = ˆ n ( t c ) · ( ˙ p a ( t c ) − ˙ p b ( t c )) Although p a ( t ) and p b ( t ) are coincident at time t c , the This quantity gives the component of the relative velocity velocity of the two points may be different in the normal direction

  5. Velocity of the contact point Collision process v r > 0 v r = 0 v r < 0 Separation Resting contact Colliding contact ∆ t p a ( t c ) − ˙ ˙ p b ( t c ) p a ( t c ) − ˙ ˙ p b ( t c ) p a ( t c ) − ˙ ˙ p b ( t c ) no force no force A A A B B B ˆ ˆ ˆ � n n n Impulse: f dt = J = M ∆ v A soft collision A harder collision Force Velocity Force Velocity ∆ t ∆ t

  6. An infinitely hard collision Impulse and impulsive tor que In the rigid body world, we want velocity to chance instantaneously Force Velocity use impulse to change velocity instead of force J = � P = M � v If the impulse acts on a point p , then just as a force produces a torque, J produces an impulsive torque � imp = ( p - x ( t )) � J ∆ t = 0 impulsive torque gives rise to a change in angular f imp = ∞ f imp ∆ t = J momentum: � imp = � L = I ( t c ) � ( t c ) Colliding contact Colliding contact p + p + ˙ a ( t c ) − ˙ b ( t c ) ˙ a ( t c ) − ˙ b ( t c ) p − p − A A A before after j ˆ j ˆ n n B B collision B collision ˆ n ˆ ˆ n n When two bodies collide, we apply an impulse between them to change If we can solve for j , we then can compute the linear velocity of the rigid their velocity body after the collision For frictionless bodies, the direction of the impulse will be in the normal Relative velocity before and after the application of the impulse direction ˆ n ( t c ) J = j ˆ n ( t c ) r = ˆ n ( t c ) · ( ˙ a ( t 0 ) − ˙ b ( t 0 )) v − p − p − v + p + p + r = ˆ n ( t c ) · ( ˙ a ( t 0 ) − ˙ b ( t 0 )) Body A is subject to this impulse J , while body B is subject to an equal but opposite impulse - J To solve for j , we need one more piece of information

  7. The empirical law compute the impulse Now we are ready so solve for the impulse v + r = − � v − r Let’s first define the displacements from center of mass of the body r a = p a ( t c ) − x a ( t c ) r b = p b ( t c ) − x b ( t c ) and Coefficient of restitution: The pre-impulse velocity of p a : ˙ a = v − a ( t c ) + ω − a ( t c ) × r a p − � = 0 � = 0 Resting contact � = 0 . 5 V − � = 1 The post-impulse velocity of p a : p + ˙ a = v + a ( t c ) + ω + a ( t c ) × r a r � = 1 Perfect bounce A a ( t c ) + j ˆ n ( t c ) v + v + p + Replace with in a ( t c ) a ( t c ) = v − ˙ a ( t c ) B M a ˆ n ω + a ( t c ) + I − 1 ( t c )( r a × j ˆ ω + p + ˙ Replace with in a ( t c ) a ( t c ) = ω − n ( t c )) a ( t c ) compute the impulse compute the impulse � ˆ n ( t c ) � p + ˙ a ( t c ) = ˙ + ( I − 1 a ( t c )( r a × ˆ p − a + j n ( t c ))) × r a − (1 + � ) v − M a r j = 1 1 n ( t c ) · ( I − 1 n ( t c ) · ( I − 1 M a + M b + ˆ a ( t c )( r a × ˆ n ( t c ))) × r a + ˆ b ( t c )( r b × ˆ n ( t c ))) × r b ) � ˆ n ( t c ) � p + + ( I − 1 ˙ b ( t c ) = ˙ b + j b ( t c )( r b × ˆ n ( t c ))) × r b p − M b Now we can compute the impulse and impulsive torque for body A and B v + r = ˆ n ( t c ) · ( ˙ p + a ( t c ) − ˙ p + b ( t c )) b ( t c )) + j ( 1 + 1 A: B: J = j ˆ n ( t c ) J = − j ˆ n ( t c ) n ( t c ) · ( I − 1 = ˆ n ( t c ) · ( ˙ a ( t c ) − ˙ + ˆ a ( t c )( r a × ˆ n ( t c ))) × r a + p − p − M a M b τ imp = r a × J τ imp = r b × J n ( t c ) · ( I − 1 ˆ b ( t c )( r b × ˆ n ( t c ))) × r b ) r + j ( 1 + 1 n ( t c ) · ( I − 1 n ( t c ) · ( I − 1 = v − +ˆ a ( t c )( r a × ˆ n ( t c ))) × r a +ˆ b ( t c )( r b × ˆ n ( t c ))) × r b ) Finally, apply the change in linear momentum and angular momentum to M a M b the current state r + j ( 1 + 1 P ( t c + h ) = P ( t c ) + J n ( t c ) · ( I − 1 n ( t c ) · ( I − 1 v − +ˆ a ( t c )( r a × ˆ n ( t c ))) × r a +ˆ b ( t c )( r b × ˆ n ( t c ))) × r b ) = − � v − r M a M b L ( t c + h ) = L ( t c ) + τ imp

  8. Resting contact Resting contact In this case, all n contact points have the zero In the case of colliding contact, we established the relation relative velocity between the velocity of the contact points and j , subject to the empirical law At each contact point there is some force , f i ˆ n ( t c ) where f i is an unknown scalar For resting contact, we will establish the relation between acceleration of the contact points and f i ’s subject to three Our goal is to determine what each f i is and all the conditions f i ’s must be determined at the same time Non-penetration Non-penetration Since , we have to keep from decreasing; that is, we d i ( t c ) = 0 d i ( t c ) d i ( t ) = ˆ n i ( t ) · ( p a ( t ) − p a ( t )) ˙ have to keep d i ( t c ) ≥ 0 d i ( t ) = ˙ ˙ n i ( t ) · ( p a ( t ) − p b ( t )) + ˆ ˆ n i · ( ˙ p a ( t ) − ˙ p b ( t )) p a ( t ) p b ( t ) p a ( t ) p b ( t ) p b ( t ) A A A At time t c , p a ( t c ) = p b ( t c ) This means that B B p a ( t ) B ˆ ˆ ˆ n n ˙ n d i ( t c ) = v r d i ( t ) > 0 d i ( t ) = 0 d i ( t ) < 0 The definition of two bodies in resting contact: This is what we want to avoid d i ( t c ) = ˙ d i ( t c ) = 0

  9. Non-penetration Repulsive force ˙ Since describes the separation distance and describes the d i ( t c ) d i ( t c ) The contact forces can push bodies apart, but can never ¨ separation velocity, measures how two bodies are accelerating d i ( t c ) act like “glue” and hold bodies together towards each other at the contact point ¨ If ,the bodies have an acceleration towards each other and d i ( t c ) < 0 Therefore, each contact force must act outward the penetration will occur Therefore, the first condition is f i ≥ 0 ¨ d i ( t c ) ≥ 0 Workless force Resting contact conditions The contact force at the a contact point becomes zero if Condition 1: Non-penetration the bodies begin to separate ¨ d i ( t c ) ≥ 0 ¨ where d i ( t ) = ˆ n i ( t ) · ( p a ( t ) − p b ( t )) If contact is breaking , then f i should be zero d i ( t c ) > 0 A f ˆ n If f i is not zero, then the contact is not breaking ¨ Condition 2: Repulsive force d i ( t c ) = 0 B f i ≥ 0 ˆ n What is the equation that satisfies these two cases? Condition 3: Workless force f i ¨ f i ¨ d i ( t c ) = 0 d i ( t c ) = 0

Recommend


More recommend