Lecture 8 (Collision Detection) Flashcards
What is collision detection?
Detection of an intersection between different objects in a virtual environment
- Prevents objects from just going through each other
- Produce realistic virtual environments by having objects react accordingly when a collision happens
What are the collision detection approaches?
- Continuous (a priori)
- Discrete (a posteriori)
Describe: Continuous (a priori)
We predict if a collision is going to occur BASED ON THE TRAJECTORIES of the objects.
- i.e. calculate if they will hit before they actually hit
** Is computationally complex, can affect performance
What are the drawbacks of Continous (a priori)?
If you have 1 object with 100 triangles, and another one with 200 triangles.
Then there are 100 * 200 = 20,000 different potential intersections to calculate.
- i.e. It is computationally complex, can affect performance
Describe: Discrete (a posteriori)
Registers the collision after it has happened.
- i.e. Think of it like a quick rewind in time.
Much more efficient than continuous (a posterior)
What are the drawbacks of Discrete (a posteriori)?
Tunnelling may occur.
What is Tunnelling?
When a very fast object passes through another object, and the engine doesn’t even get the chance to detect the collision.
Happens with Discrete (a posteriori).
What are bounding volumes? Why are they useful? Give examples
Used to further simplify collision detection - don’t need to detect every polygon.
Volumes will enclose the whole object and should be as small as possible for accuracy.
- Axis Aligned Bounding Box (AABB)
- Oriented Bounding Box (OBB)
- Bounding Spheres
What is ‘Axis Aligned Bounding Box’ (AABB)?
Bounding box remains oriented WITH RESPECT TO THE MAIN AXES
Pros and Cons of Axis Aligned Bounding Box (AABB)?
Pros:
- Very simple to compute
- Translation invariant (never changing)
Cons:
- The box will not change if you move every point of the object by the SAME amount in a given direction, but for other movements, box will no longer remain axis-aligned
- Bounding box needs to be recomputed on every frame
What is ‘Oriented Bounding Box’ (OBB)?
Bounding box is oriented WITH RESPECT TO THE OBJECT
Pros and Cons of Oriented Bounding Box (OBB)?
Pros:
- Transformation invariant (never changing)
- Translation
- Reflection
- Rotation
- Volume is more compact than AABB, therefore there is less empty space
Cons:
- The computation of intersections is, however, much more complex as box orientation is dynamic
What are ‘Bounding Spheres’?
Collision detection approach similar to Oriented Bounding Box, but instead of box, we using spheres
Pros and Cons of Bounding Spheres?
Pros:
- Transformation invariant
- Translation
- Reflection
- Rotation
- Simple collision detection calculation
- Bounding spheres collide if distance between centres of two objects is less than sum of radii
Cons:
- More empty space in the volume
What are the two-phase approaches to improve bounding box efficiency?
Broad phase (simple, low cost) and Narrow phase (complex, high cost).
- Broad phase does initial general sweep, if it picks something up, it then activates the Narrow phase to pinpoint the exact collision point.