Is there a collision groups feature in box2d of any kind?

Good evening people, i was wondering if there is a function in box2d where you can define the bodys that a certain body will collide with? for example if I wanted 3 boxes to not collide with each other but collide with everything else in the world, is there a way to set this up? thanks and sorry if the answer is stupidly obvious 🙂

Tom
Yes, there is. Box2d supports collisions groups, which are probably what you want. Set all 3 boxes to have the same negative integer in groupIndex, and they will not generate collisions with each other, but behave normally for everything else.

Other ways of controlling collision involve using collision masks, and also specifying joints between bodies. In 2.0, for complete control, you will be able to override the collision filter, and make object-by-object decisions. See the manual for details.

Guys, I think this is why we really need to get a wiki up and running. There are so many common questions people have, and the current documentation is clearly not sufficient. For every question like this we see on the forum, there must be 10 people who have given up frustrated instead.
The current documentation covers the majority of the supported API for version 1.4.3.

I just checked the online documentation and there is a section called "Collision Filtering" that covers collision categories, masks, and groups.

I suppose a wiki could also document the API, but I would rather have one central manual and restrict the future wiki to cover techniques and applications. The forum is already a great repository for this sort of information.

The wiki will come, but not before I update the manual for 2.0.
Quote:
I just checked the online documentation and there is a section called "Collision Filtering" that covers collision categories, masks, and groups.

It's not that the manual is incomplete, after all the answer to this question was in there. But it is about halfway through, with no index, and someone just starting up is not going to read the manual from start to finish. I envisage the use of a wiki to provide a FAQ and/or new users guide, updated as people find new problems. And of course for advanced techniques and applications. The manual would be a fall back for reference, rather than readability (particularly if Doxygen is put in place).

Quote:
The forum is already a great repository for this sort of information.

With all due respect, a forum is a terrible way to address these issues. I have not been a member here a long time, but I still see the same issues come up repeatedly. Information is not organized in any coherent way, and users are not inclined to use the search feature. Brainclog's FAQ is an attempt to provide that structure, but he admits it is a stopgap solution too. It is essentially using forum software to emulate a wiki, with him the sole editor.

I am not sure why you have reluctance to the idea. Setting up a wiki is pretty easy, and then you don't have to any further work, that's the whole point. Surely that sounds easier than answering every question repeatedly, personally (though I do appreciate such a level of care in your user base).

I can understand worries that encouraging documentation or extrapolation of 2.0 could lead to difficulties as it has not stabilized yet. But simply ban by fiat documentation of 2.0 until it comes out, or insist on warning disclaimers at the top of each wiki page.
I'm not resistant to setting up a wiki, it is a matter of priorities. Keep in mind that I work on Box2D as a hobby. I have full-time work and family life that also keeps me quite busy. Just maintaining this forum requires a significant amount of time.

I receive a large amount of feature requests for Box2D. I have setup a TODO list so that I can show people that I have not forgotten about their feature requests. In return, I expect people to be patient. As it is, 2.0 has been an incredible amount of work. Continuous collision detection is one of the hardest problems in game physics. Supporting shape editing has also been a lot of work.

I do not expect a wiki to be a panacea. Just as with the manual, some people will ignore it, and ask the same questions over and over. My hope is that as the user base grows and people become more experienced with Box2D, we will have more folks like yourself, brainclog, ewjordan, and skatehead that will help out on the forum. BTW, I am truly grateful for this support as I can not possibly answer all the questions posed on this forum.

So I do not have the time yet to setup a wiki, let alone administrate it and fill it with content. It is ok with me if someone would like to setup a wiki now, rather than wait for me to do it for 2.1.
I'm sorry, I did not mean to be rude.
BorisTheBrave wrote:
It's not that the manual is incomplete, after all the answer to this question was in there. But it is about halfway through, with no index, and someone just starting up is not going to read the manual from start to finish.


The manual really isn't that long. And it looks like its been updated with a table of contents, so no worries there.

Original thread: https://box2d.org/forum/viewtopic.php?t=361