How do engines avoid "Phase Lock" (multiple objects in same location) in a Physics Engine?

Posted by C0M37 on Game Development See other posts from Game Development or by C0M37
Published on 2012-12-17T05:08:04Z Indexed on 2012/12/17 5:14 UTC
Read the original article Hit count: 291

Let me explain Phase Lock first: When two objects of non zero mass occupy the same space but have zero energy (no velocity).

Do they bump forever with zero velocity resolution vectors or do they just stay locked together until an outside force interacts?

In my home brewed engine, I realized that if I loaded a character into a tree and moved them, they would signal a collision and hop back to their original spot. I suppose I could fix this by implementing impulses in the event of a collision instead of just jumping back to the last spot I was in (my implementation kind of sucks).

But while I make my engine more robust, I'm just curious on how most other physics engines handle this case. Do objects that start in the same spot with no movement speed just shoot out from each other in a random direction? Or do they sit there until something happens? Which option is generally the best approach?

© Game Development or respective owner

Related posts about physics

Related posts about 2d-physics