2D colliding n-body simulation (fast Collision Detection for large number of balls)
This first step in physics simulation is the broad-phase collision detection. There are several approaches outlined here Broad-Phase Collision Detection with CUDA but the two basics ones are:
- spatial partitioning: dividing the objects into a grid
- sort-and-sweep: sorting all the objects along two axes