Broadphase: spatial partitioning

The same collision problem, three ways of deciding which pairs are even worth testing.

object actually overlapping the structure's cells

What to notice. Push the count up with brute force selected and watch the pair-test number climb as the square of it. Switch to the grid: same objects, same collisions found, a fraction of the tests. Then set the cell size far too small or far too large and watch the saving evaporate — cell size wants to be about one object wide. The quadtree costs more to build but doesn't care how clumped things are.

← all demos