Here is just one idea.
Make new filtering algorithm based on new one (collision groups). Add optional variable “tagId” or something like that, and if two nodes have same “tagId”, they do not collide.
Complicate it a bit more:
Add another bitmask to node, if two nodes have same “tagId” they will use that new bitmasks to check whether they should collide. If they have different “tagId” use “ordinary” collision filtering (symmetrical matrix from groups).
tagId would be some int that we provide or that you create from string.
so i would call .setCustomMagicTagName(“player1”)
for player capsule,weapon,ammo going out,each body part.
Then i would disable collision between body capsule(used for walking on terrain) and body parts and weapons (close combat or ranged, does not matter).
So player for example would not cut himself with sword , but would be able to hit enemies with same sword
I used “tagId”, “groupId” is probably better name, but it could lead to some confusion regarding collision groups.
For almost all scenarios i could think of, special handling of collision is needed only for objects in one group. And with this approach you dont need to traverse array of deny objects
So basically its just one “if” on top of current group based system, and some extra stuff in memory.
I am aware of my problem with explaining things, so if you prefer i could write some python (others call it pseudo code ) its rather simple system.
if obj1.tagId == obj2.tagId:
#use "secondary" bitmasks of both objects
#use "normal" bitmasks for both objects