120 likes | 348 Views
The Procedure of Collision Detection. COMP7970, Spring,’07 Jian Fang. Collision Resolution. Is the process after a collision is predicted. Is complex process, sometimes: -- A collision prediction does not mean a real collision.
E N D
The Procedure of Collision Detection COMP7970, Spring,’07 Jian Fang
Collision Resolution • Is the process after a collision is predicted. • Is complex process, sometimes: -- A collision prediction does not mean a real collision. -- Compute the closest contact points can be tricky. • Collision resolution may take many forms: ignored,visible actions, or invisible actions. • Includes three phases: Prologue, collision, and epilogue.
Forms of Collision Resolution • Ignored: collision does not effect position and trajectory objects. • Visible Effect: Physics laws are applied, i.e., gravity and deformation. • Invisible Effect: Physical presence of objects are not changed, but trigger other events.
Three Phases of Collision Resolution • Prologue: A collision is known to happen. Signal objects that involve in the collision through event triggers. • Collision: A collision happens; what actions should be applied to colliding objects, i.e., stop moving. • Epilogue: Propagate post-collision effect, i.e., destroy objects, deform objects, and play sound.
Brief Review of Collision Detection • Overlap Testing: -- If there is an overlap, use bisection method to detect the position of collision. -- Collision position usually can be found within 5 iterations. -- May fail when objects move too fast. • Intersection Testing: --Testing the geometry of object swept against other objects swept. -- More computation efficient and can predict collision. -- Not applicable to network games and complex physics effect.
Resolution of Overlap Testing • Extract the collision normal. • Extract the penetration depth. • Make penetration depth be 0. • Compute new velocities. • Apply post-collision effect.
Demo of Overlap Testing 1 2 * Step 2 won’t be seen; the collision was solved before being rendered.
Resolution of Intersection Testing • Pre-computation ensures no overlap. • Extract normal. • Compute new velocities. • Apply post-collision effect.
Demo of Intersection Resolution * Collision position can be pre-determined.
Further Readings • 1. Collision Detection: http://www.harveycartel.org/metanet/tutorials/tutorialA.html • 2.Collision Detection and resolution: http://www.peroxide.dk/download/tutorials/tut10/pxdtut10.ht • 3. A demo of collision detection: http://robotduck.com/content/articles/director/collision/getPixel/
Collision Resolution Demo with OpenGL • 1. Collision with no resolution. • 2. Trigger events (prologue) • 3. Collision occurs (collision) • 4. Apply new velocity (epilogue) • 5. Apply post-collision effect (epilogue)
Questions? Thank You!