[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Pixel perfect collision detection sugestion



Looks intresting!

Could this be the time to join forces and add pixel perfect collision
detection to PyGame?? So that PyGame users doesn't have to reinvent the
wheel every time.

What do you all think?

Best Regards
/John

>
> On Fri, 2005-09-09 at 17:26 +1000, Rene Dudfield wrote:
> > There may be a faster way with bitsets or RLE encoding.  However
those
> > are a bit(HAR HAR) more complicated.  So if we make it a HitMask
> > object, and have the functions use those, then we can implement the
> > bitset/rle stuff later.
>
> This has already been written once in the SDL SCAM library. It was a
> great old library that even had bindings to pygame itself. Unfortunately
> the old site seems to be dead.
>
> It was able to build as an optional pygame module, but still remain
> independent from the pygame source.
>
> The problem the author found was that in the situation where he was
> colliding many-to-many objects, most of the time was spent in finding
> which sprites to even try the pixel tests. There are good algorithms for
> generating trees of "nearest neighbors" which may be of help
here. The
> SCAM author was starting to develop this sort of thing but it got very
> complicated, and he never ported any of his "higher level
collision"
> stuff into the python binding. (mainly because I don't think he ever got
> it working to his liking).
>
> Hmm, a bit of internet sleuthing uncovereed this.
> http://www.ifm.liu.se/~ulfek/projects/2d_Collision_Detection.html
>
> This is the 'next generation' of the old Scam library. I assume it's a
> little simpler and faster. Although I suspect it may not include the
> python bindings? Downloading now.
>
>
>
>
>