groupIndex & maskBits

I'm really kinda stuck on this problem i'm having.

I have multiple players, but they should not collide with each other, so i gave them a groupIndex:
playerShapeDef.filter.groupIndex = -1;

But i also have bullets, but the player who shot a bullet can't collide with them, only other players should collide.
I know which player is shooting: if(player.ownPlayer) { // i'm shooting }

But i can't figure out how to use the filter.maskBits property to make this work.

I hope somebody can help me out on this one.
i think maskBits require corresponding categoryBits.

this thread might help some.
viewtopic.php?f=3&t=197
I saw that topic already and tried what i said.

I did this on my player:
Code:
if(ownPlayer)
         {
            playerShapeDef.filter.categoryBits = 0x0001;
         }


And then i used the maskBits on my bullet:
Quote:
bulletShapeDef.filter.maskBits = 0x0001;


but they still seem to collide
So i tried using maskBits rather then using that groupIndex:
Code:
if(ownPlayer)
         {
            playerShapeDef.filter.categoryBits = 0x0001;
         }
         else
         {
            playerShapeDef.filter.categoryBits = 0x0002;
            playerShapeDef.filter.maskBits = 0x0001;
         }

But this still isn't working

my bullets still got this:
bulletShapeDef.filter.maskBits = 0x0001;
I still don't got this working, but the problem is getting more complex.

This should be the rules:
- players can't collide with each other
- a bullet fired by your own player can't collide with your player
- a bullet fired by another player can't collide with your player and your bullets

I really hope somebody can help me out, because everything i try with categoryBit & maskBits is just not working like it should
Even when i try something simple like this it's not working:

Quote:
playerShapeDef.filter.categoryBits = 0x0001;
playerShapeDef.filter.maskBits = 0x0001;


So i basically mask out every shape with categoryBets 0x0001 (which is every player), but yeah, nothing seem to happen
Have a look at the b2ContactFilter.ShouldCollide to see how masks and categories work.
Also, be aware what the defaults:
public var categoryBits: uint = 0x0001;
public var maskBits: uint = 0xFFFF;

I.e. everything is in category 1.
Yesterday i was looking at the b2ContactListener, and i found the b2ContactFilter, where i was able to check everything, now it's working like a charm.

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