Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection ...
-
date post
20-Dec-2015 -
Category
Documents
-
view
217 -
download
4
Transcript of Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection ...
![Page 1: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/1.jpg)
Oct 26, Fall 2006 IAT 410 1
Collision Detection
![Page 2: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/2.jpg)
Oct 26, Fall 2006 IAT 410 2
Collision Detection
Essential for many games– Shooting – Kicking, punching, beating, whacking,
smashing, hitting, chopping, dicing, slicing, julienne fries…
– Car crashes Expensive
– tests!!)( 2NO
![Page 3: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/3.jpg)
Oct 26, Fall 2006 IAT 410 3
Collision Detection
For each object i containing polygons p– Test for intersection with object j with
polygons q– (j > i)
For polyhedral objects, test if object i penetrates surface of j– Test if vertices of i straddle polygon q of j
• If straddle, then test intersection of polygon q with polygon p of object i
![Page 4: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/4.jpg)
Oct 26, Fall 2006 IAT 410 4
Collision Detection
Efficiency hacks/cheats– Fewer tests: Exploit spatial coherence
• Use bounding boxes/spheres• Hierarchies of bounding boxes/spheres
![Page 5: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/5.jpg)
Oct 26, Fall 2006 IAT 410 5
Bounding Boxes
Axis-aligned vs. Object-aligned
Axis-aligned BBox change as object moves
Approximate by rotating BBoxSwept volume
![Page 6: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/6.jpg)
Oct 26, Fall 2006 IAT 410 6
Collision Detection
Convex objects– Look for separating plane
• Test all faces
• Test each edge from obj 1 against vertex of obj 2
– Save separating plane for next animation frame
![Page 7: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/7.jpg)
Oct 26, Fall 2006 IAT 410 7
Collision Detection
Concave Objects– Break apart– Convex hull
• Automatic or artist-created
![Page 8: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/8.jpg)
Oct 26, Fall 2006 IAT 410 8
Collision Detection
To go faster– Sort on one dimension
• Bucket sort (i.e. discretize in 1 dimension)
– Exploit temporal coherence• Maintain a list of object pairs that are close
to each other• Use current speeds to estimate likely
collisions
– Use cheaper tests
![Page 9: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/9.jpg)
Oct 26, Fall 2006 IAT 410 9
))()(( 221
221 yyxxsqrtd
Collision Detection
Cheaper distance calculation:– Compare against
Approximation:
– Manhattan distance - Shortest side/2
)()( 2121 yyabsxxabsd
2d
5.55.143'
54,3
d
ddydx
2/))(),(min( 2121 yyabsxxabs
![Page 10: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/10.jpg)
Oct 26, Fall 2006 IAT 410 10
Collision Detection: Sprites
AND for each pixel in sprites
![Page 11: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/11.jpg)
Oct 26, Fall 2006 IAT 410 11
Collision Detection
Discretization in 3D Create a voxel array
– Store an ID in each voxel where an object is– Collision where voxel has an ID already– Difficult to determine good voxel size– Huge memory– Hash table -- gives constant time point
queries
![Page 12: Oct 26, Fall 2006IAT 4101 Collision Detection. Oct 26, Fall 2006IAT 4102 Collision Detection Essential for many games –Shooting –Kicking, punching,](https://reader036.fdocument.pub/reader036/viewer/2022062714/56649d4d5503460f94a2ba56/html5/thumbnails/12.jpg)
Oct 26, Fall 2006 IAT 410 12
Inter-Object Distance A related problem:
– Collision Avoidance Part of motion planning is to avoid
collisions Many collision detection algorithms
take time into account Estimate Collision Time, distance www.cs.unc.edu/~geom/collision.html