News for hackers. Stuff that matters.
Re:Sort, sweep, and prune: Collision detection algorithms by qwery on Wednesday August 14, 2024 @09:14AM (#41245716)
The "optimisation" of starting the inner loop at `j = i + 1` is done to avoid testing every pair of objects twice.

[Ed: I should add that it also prevents testing an object against itself.]

The algorithm is O(n^2) because every pair will be checked once.

There are no comments on this comment yet.