Posted by: Art Comben on Wed 24th Nov 2010 at 1:07pm
Tags: Labs, Processing
Source code: collisiontest
We've taken our first tentative steps into the world of Processing. For those of you who aren't in the know, processing is a free software sketchbook that makes it a doddle to work up quick programming prototypes. In this post I'm going to be using Processing to try out a method of speeding up many to many collision detection.
Click anywhere above to switch between using the grid and using brute force. You should be able to see that the brute force method, checking the distance of every circle to every other circle, is noticeably slower than the default grid method, which only checks the distance of each circle to circles occupying adjacent grid cells.
I'm going to be using this in my next post to optimise my natural selection simulator, which I hope will become a fun, visual and accelerated approximation of simple microbial life evolving into specialist groups. So far they tend to split into a group of herbivores and a group of carnivores. The carnivores then eat all the herbivores and starve to death, leaving a pleasantly green pasture, but unfortunately no creatures to admire it.
There are no comments made so far.