Title: KIPA Game Engine Seminars
1KIPA Game Engine Seminars
Day 10
- Jonathan Blow
- Ajou University
- December 6, 2002
2Collision Detection Methods
- Early today Ill overview some of the simpler
methods and talk about real-world issues about
integrating them in games - bounding spheres, boxes, bsp
- find time of collision, prevent tunneling
- Later well go to some of the more advanced
collision detection schemes - GJK algorithm
- Lin/Canny Closest Features
3Bounding Spheres
- Simplest, fastest bounding volume
- Least information to store
- Isotropic
- Means it may be a poor fit
- Better fit perhaps use the centroid, not the
origin (or find the two furthest points) - But this takes more information per sphere
4Bounding BoxesAxis Aligned
- Dont take much information to store
- May be a poor fit for diagonal data
- Easy to test them against each other for
intersection - Abbreviated AABB
- (Axis-Aligned Bounding Box)
5Bounding BoxesOriented
- Better fit than AABB
- But a little more complicated to compute
- More complicated intersection detection
- See Gottschalks 1998 paper
- I will include this in the course notes
- Unclear in the end whether its better than AABB
or spheres - Probably depends on the nature of your data
- Abbreviated OBB
- (Oriented Bounding Box)
- Software toolkit RAPID
6Bounding Volume Hierarchies
- Method of saving computation time
- It costs memory, though
- Form volumes around pieces of a mesh so that you
can early-reject
7BSP Tree
- Can be viewed as a hierarchical bounding volume
system - The split planes are spheres with infinite radius
- So an individual sphere has poor spatial
locality, but the hierarchy makes up for that
8BSP Tree
- What might a BSP tree be like that didnt use
planes as its splitting surface? - Spheres of finite radius?
- Other curved surfaces?
9Animated Meshes
- How are we to adapt hierarchical bounding volumes
to animated meshes? - Fully recompute every time
- Try to do an incremental update, but quality will
decay - Always slow!
10Animated Mesh Example
- In Barbaric Smackdown I made a set of spheres
that track the skeleton (not the mesh) - The spheres animate with the mesh, and we collide
against the spheres - This is faster than colliding against the mesh
- Also faster than building spheres from the mesh
vertices each frame
11Intersection Primitives
- Box/box, sphere/sphere, etc
- What kind of information do they return?
- What kind of information do we get from a
triangle vs. triangle intersection routine?
12Finding the time of intersection
- Necessary for good physics?
- How do you do it given a triangle/triangle
intersection style primitive? - Move through time in very small samples and
interpolate? - Binary search through time
13Preventing tunneling
- When long frame times happen, objects might pass
through each other - What do we do here?
- Raycasting solution
- Analytic method?
14Closed-form intersection testfor spheres
- Without acceleration
- With acceleration (constant over time period)
15Separating Axis Theorem
- Convex objects and separating planes
- But we want non-convex objects!
- Model them as unions of convex objects and do
separate collision tests - Still very difficult (Maya is not a solid
modeling program) - BSP the thing?
- This can be harder than you would think
- Also it produces a lot of pieces
- Try to re-join the pieces?
16Algorithms that help usestimate collision times
- Maybe tell us how much two entities are
colliding, so that we can better guide our search
for the collision time - Example of two spheres, or sphere vs plane
17GJK Collision DetectionAlgorithm
- Gilbert-Johnson-Keerthi
- Operates on convex solids
- Again, thats a problem!
- Uses Minkowski sums
18Minkowski Sum / Minkowski Difference
19Lin-Canny Closest Feature Tracking
- Tells you the closest features between two
objects - A feature can be a point, line segment, or face
- Relies on frame coherence
- (example on whiteboard)
20Hierarchical Bounding VolumeQuantization/Packing
- Sphere tree, bounding box tree
- Exploit multiscale nature of hierarchy
- BSP Tree
- Exploit recurrence of plane equations
21AI, A search,and speculative collision
detection
22Higher-Level Scene Management
- Indoor shooter level
- BSP
- Portals
- Terrain
- Flight / Space Sim / Heavily occupied environment