Edit: Solved with help from LibGDX IRC
I’ve tried the LibGDX forums (no replies), LibGDX IRC (few replies, none knew why it didn’t work), and the JGO IRC (no one knew), so after exhausting all of my options, I am going to post here.
When the PointLight’s filter is applied, the light goes through all bodies, no matter what type they are, and when it is not applied, it collides with all bodies.
// Here are my category and mask bits:
public static final short BIT_WALL_SOLID = 0x0001;
public static final short BIT_WALL_TRANS = 0x0002;
public static final short BIT_LIGHT = 0x0004;
public static final short BIT_ENTITY = 0x0008;
public static final short MASK_WALL_SOLID = BIT_ENTITY | BIT_LIGHT;
public static final short MASK_WALL_TRANS = BIT_ENTITY;
public static final short MASK_LIGHT = BIT_ENTITY | BIT_WALL_SOLID;
public static final short MASK_ENTITY = BIT_ENTITY | BIT_WALL_SOLID | BIT_LIGHT;
Then later it sets the PointLight’s collision filter
Filter lightFilter = new Filter();
lightFilter.categoryBits = Map.BIT_LIGHT;
lightFilter.maskBits = Map.MASK_WALL_TRANS;
PointLight.setContactFilter(lightFilter);
new PointLight(rayHandler, 20, Color.CYAN, 40, -3f, -3f);
If I change the filter to this, the light collides with everything, as expected.
Filter lightFilter = new Filter();
lightFilter.categoryBits = (short) 0xFFFF;
lightFilter.maskBits = (short) 0xFFFF;
Then, when creating the walls, (box2d bodies) it sets their collision filter like this
fdef = new FixtureDef();
if (type == TYPE.DOOR || type == TYPE.WINDOW)
{
fdef.filter.categoryBits = Map.BIT_WALL_TRANS;
fdef.filter.maskBits = Map.MASK_WALL_TRANS;
}
else if (type == TYPE.WALL)
{
fdef.filter.categoryBits = Map.BIT_WALL_SOLID;
fdef.filter.maskBits = Map.MASK_WALL_SOLID;
}