230 likes | 514 Views
Collision Detection. Michael Fuller. Overlap testing. Most Common Technique Most Error Prone Test if two bodies overlap. Overlap Example. TIME STEP 1. TIME STEP 2. TIME STEP 3. TIME STEP 4. Overlap Limitations. Fails for Small or Fast Moving Objects. TIME STEP 1. TIME STEP 2.
E N D
Collision Detection Michael Fuller
Overlap testing • Most Common Technique • Most Error Prone • Test if two bodies overlap
Overlap Example TIME STEP 1 TIME STEP 2 TIME STEP 3 TIME STEP 4
Overlap Limitations • Fails for Small or Fast Moving Objects TIME STEP 1 TIME STEP 2 TIME STEP 3
Intersection Testing • Predicts future collision before they happen • Multiple collision can occur in one time sample • Tests geometry of two swept objects
Intersection Example Planned Path Testing
Intersection Limitations • Networked Games cannot reliably use this method. • Needs perfect information to be accurate • Packet loss can cause sync errors with timing • Assumes no Acceleration during steps • Engine would have to accommodate for this.
Complexity • Testing every object against each other • Complex Geometry • Very Tedious and Time Consuming
Geometry Testing • Very Tedious to Test Every Edge • Instead use simplified geometry Alex from Half-Life 2, Model, Hit Boxes, Physics Model
Simplified Geometry • Use Simplified models for Testing • Not acceptable for all games Physics Model Render Model
Minkowski Sum • Merge two shapes and create a new volume • Determine Overlap by testing if a single point is contained inside of the sum.
Minkowski Sum Example Test Square & Circle Collision Square + Circle Minkowski Sum Test
Bounding Volumes • Turn Complex objects into bounded areas for testing • Fast, but not reliable • Great 1st test, but should be followed by another test
Bounding Sphere • Simplest Way to bound an object • Good for small or round objects
Bounding Boxes • Axis Aligned Vs Orientated Orientated More Expensive Axis Aligned Cheaper
More Bounding Boxes • Use of Multiple Bounding Boxes • Chain of Bounding Boxes G-Man, Dog & Alex from Half-Life 2
Time Complexity • Test for Collisions Faster • Partitioning • Put Every Object into a Cell • Test Adjacent Cells • Plane Sweep • Test Objects who have colliding planes
Terrain Collisions • How to test for collisions within a 3d landscape • Most terrains are height maps • No Cliffs, or Overhead Terrain • Used in Oblivion, Half-life 2 & Supreme Commander • Non-Uniform Terrains (TINs) • Polygon Meshes for terrain, ex. Caves, interiors.
Triangulated Irregular Networks • Irregular meshes can still be parsed using oct-trees. • Oct-trees are useful, because they subdivide into smaller segments. So knowing which oct-tree your in allows the engine to search within in, until the correct polygon is found. • Also can be used to make simpler geometry for distant scenery.