I'm currently transferring some collision/physics code from bullet to chipmunk, but I'm having a hard time with the cpShape::group and cpShape::layers attribute. Currently I've got the following system:
- A shape can be added to zero or more groups. When a shape is created, it doesn't belong to any group and thus doesn't collide with any other shape.
- A group can be set to collide with zero or more other groups.
- A group can collide with itself, but doesn't have to.
The problem is: How do I map this scenario to the groups and layers? I don't want transitivity as in: The players collide with the bullets, the bullets collide with the enemies, but the enemies should not collide with the players.