[racket] Doing collision detection in universe.ss (related question)

From: Hendrik Boom (hendrik at topoi.pooq.com)
Date: Thu Nov 29 11:38:16 EST 2012

On Wed, Nov 28, 2012 at 02:26:56PM +0100, Stephan Houben wrote:
> Apart from introducing a bounding box check, I would
> suggest converting each scanline into a single exact integer
> with 1 bits corresponding to alpha unequal 0. Then for each scanline,
> you can use arithmetic-shift and bitwise-and, and then check the result for
> being non-zero.
> 
> Stephan

When the situation gets intense (i.e., lots and lots of objects) one of 
the big wins is not even to prefilter with bounding boxes, but to find 
ways of sorting objects by location (bearing in mind they aren't point 
masses) and managing never to even consider objects that are nowhere 
near each other.

Sometimes the most efficient way to accomplish something is not to do 
it.

-- hendrik

Posted on the users mailing list.