Re: Rabbyt collision detection

8 views
Skip to first unread message

Matthew Marshall

unread,
Dec 22, 2009, 6:45:20 PM12/22/09
to Hello3171, rab...@googlegroups.com
On Tue, Dec 22, 2009 at 2:06 PM, Hello3171 <hell...@googlemail.com> wrote:
Hi, I'm using your rabbyt library and I would have posted in google groups but the group is really messed up...

Anyway, I am mainly using the collision module alongside pyglet and I found that rabbyt.collisions.collide_single(single, objects) does not work as I thought it did. The collision between the single and the objects works by using the bounding_radius of the objects but treating single as being a single point.

In fact, just now I was double checking my code and upon further investigation I cannot find any pattern as to how this collision works!

Is this a confirmed bug or will I need to provide some example code for this in order to confirm this?

The bounding_radius is optional and defaults to 0.  So if you pass it a tuple of (x,y) or if you pass it an object without a bounding_radius attribute, it'll collide against a point.

Or at least that's how it *should* be.. there very well could be a bug.  (That's been known to happen.)

The following two lines should be more or less equivalent:

collide_single(obj, items)
collide_single((obj.x, obj.y, obj.bounding_radius), items)

If you get different results, let me know.  :-)

MWM
Reply all
Reply to author
Forward
0 new messages