Box2d collision filtering, can it be done?

Hi all,

I’ve been trying to find some information on whether vvvv’s implementation of box2d can handle collision filtering, and I’ve had some conflicting results.

First, there’s this video: http://vimeo.com/9237177 by vux, which seems to demonstrate collision filtering. There’s also the main feature list on this website which lists it as a feature.

However, I can’t find any node which can do this, or information about said nodes. Also, there’s a post by vux from two years or so ago which claims that it hasn’t been implemented yet, and isn’t a priority.

So I’m confused. Is it that vux has got it working, but just hasn’t created a node to handle it yet? Or am I missing something.

Thanks.

In the shape pins (Box/EdgeChain/Circle/Polygon), you need to set the group index pin to a negative value.

Any objects with the same negative value will never collide between each other.

To update group index on the fly UpdateShape(Box2d) can make you do that.

Thanks heaps, that’s very helpful.

Hi again.

That works fine, but I’m wondering now if a slightly more complex interaction would be possible. Is it possible to create something like this:

Group 1: Collides with everything.
Group 2: Collides with Group 1 but not Group 3.
Group 3: Collides with Group 1 and itself, but not Group 2.

As far as I can see, setting negative values only works to stop a group from colliding with itself, not another group.

Thanks.

I did a bit of googling and it seems like it can be done in box2d using maskBit and categoryBit, but I get the impression that these aren’t part of vvvv’s implementation of Box2d. Am I mistaken?

Hello, indeed Collision Bits are not there, I’ll look to add them for next release thanks.

Awesome… no text …