Boxes around objects
A bounding volume hierarchy, or BVH, is a tree where each node holds a simple bounding volume, often an axis aligned box, that fully encloses everything beneath it. Leaves contain the actual objects.
- A parent box encloses all of its children.
- The boxes are cheap to test against, unlike the detailed shapes.
Accelerating queries
For a query such as a ray in rendering or a moving body in collision detection, you test the query against a node's box first.
- If the query misses the box, every object inside is skipped at once.
- If it hits, you recurse into the children.
This lets a single cheap rejection prune large subtrees, which is why BVHs power ray tracing and physics engines.
Building a good tree
Construction quality matters. A common heuristic is the surface area heuristic, which splits objects to minimize the expected cost of traversal by balancing box surface area against the objects contained.
- Tight, non overlapping boxes give the best pruning.
- Overlap forces both branches to be visited.
Key idea
A bounding volume hierarchy nests objects inside enclosing boxes, so a query that misses a box discards the whole subtree at once, accelerating ray tracing and collision tests when boxes are tight and non overlapping.