Title: Collision Detection
1Collision Detection
- Jason Stine
- CS 4473
- 25 FEB 2000
2What is Collision Detection?
- Report geometric contact between objects
- Convey enough information to determine logical
consequences - A major computational bottleneck - O(N2)
3Categories of CD Problems
- Polygon soup - no geometric connections, no
topology information - Structured polygons - solid objects
- Constructive Solid Geometry (CSG)
4Categories of CD Problems
- Implicit surfaces - defined by functions
(quadrics) - Parametric surfaces - defined by parametric
functions (NURBS)
5Convex vs. Concave Objects
- Easy case -----------------------gt
- Harder case ---------------------gt
- Really difficult -----------------gt
6What does the model need to know?
- Simplest case - do two objects touch?
- What parts touch?
- What is the minimum distance between disjoint
objects? - If objects penetrate, by how much?
- When will the next contact happen?
7Brute Force Approach
- Algebraically solve for the intersection of each
pair of polygons - Simple and good for very small models
8Brute Force Approach
- O(N2) quickly becomes unworkable for larger
models - Improved with use of a collidable field
9Bounding Volumes
- Complex objects are enclosed by bounding regions
- Easier to test mathematically
- If volumes intersect, more exact tests may be done
10Bounding Volume Problems
- Still O(N2) for objects in scene
- Very effective for rejection tests - much less
so for close proximity - Revert to O(N2) for polygons if the scene becomes
crowded - Too much wasted space with cubes and spheres
11Collisions in Vega
- Isectors define collision behavior
- Volume associated is converted to a set of line
segments - Line segments tested for intersection against the
scene graph - 32 bit bitmask determines if the collision is of
interest
12Collisions in Vega
- Polygons indicated are tested for exact
intersection - This method determines height above terrain, HPR
orientation, terrain following, and line of sight
13Collisions in Java3D
- Bounding volumes can be defined as spheres,
boxes, or polytopes - Each frame, all objects that have the COLLIDABLE
field set to true are tested for intersection
with each other - Intersections return a collision event
14Collisions in Java3D
- Event listener structure must be used to control
the applications response - Most effective when used in conjunction with
picking - Picking is highly optimized in version 1.2
15Collisions in Java3D
- Problems
- Discrete nature of samplings - can miss
collisions - Highly inefficient for large, complex
environments - Return collisions only on bounding volumes, not
on objects
16Advanced Approaches
- Better bounding regions
- Clever ordering of the virtual world
- Know when to revert to brute force method
17Voronoi Regions
- A set of points closer to a feature than to any
other feature - One region (plane) per face and edge
- Constraint planes separate them
18Voronoi Regions - 2D Example
- Set distance from sides - region side length
polygon side length - connect side region boundaries to form corner
region boundaries
19Voronoi Regions in Practice
- CP eliminates Cell 1, points to Cell 2
- VB and Pa are returned as the closest pair
20Voronoi Regions in Practice
- Both internal and external regions used
- Internal not computed as carefully
21Internal vs. External Voronoi Region
22RAPID - Oriented Bounding Boxes
- Developed at UNC in 1996
- Uses a data structure for progressively more
detailed Voronoi regions - RAPID includes both the OBB algorithm and a fast
way to implement it
23OBB Tree Development
- Recursive partitioning along major axis
- Stops when each box contains one polygon
- Two-dimensional example at right
24Sweep and Prune
- Volumes are projected onto each axis
- Sorted list of objects - relies on temporal,
geometric coherence - 1-D example at right
25I-COLLIDE Advanced Collision Detection
- Requires data structure separate from rendering
structures - Takes advantage of temporal and geometric
coherence
26Step 1Axis-Aligned Bounding Boxes
27Step2Oriented Bounding Boxes/Voronoi Regions
- When the sweep and prune indicates collision, OBB
tree takes over - Voronoi regions allow identification of closest
pairs
28I-COLLIDE /RAPID Performance
29I-COLLIDE /RAPID Performance
30IMMPACT - Industrial Strength CD
- For very large (107) numbers of polygons, even
these are too slow - IMMPACT combines I-COLLIDE with overlap graphs of
regions of interest
31IMMPACT Flowchart
32IMMPACT collisions