bevy_xpbd
                                
                                
                                
                                    bevy_xpbd copied to clipboard
                            
                            
                            
                        Use a single layer as the default membership instead of all.
Objective
Using ALL memberships requires a lot more effort to correctly use the layer system in gameplay, since interactions you wanted exclusive to one object now trigger on all defaulted objects as well.
This system is similar to those used in Box2d (one memberships, all filters) and Godot (one memberships, one filters), ~however the current system is the same as Rapier and Unity (all memberships, all filters).~ Unity is actually exclusively one membership, all filters with configurable filters in your project.
Solution
- Reserve layer 
1 << 0for a default layer. ~- AdjustPhysicsLayerderive to start at1 << 1.~ keep it the same, just document the change, this shouldn't actually change any behavior aside from other special interactions relying on the default being all membership (which should be few and might indicate a bug) 
Additional Questions
~- Should we use the default layer for filters as well?~ No, this doesn't make sense unless we swap to using || for the calculation and/or allow default configuration as it forbids some valid usecases like a default member not interacting with default.
Changelog
- Reserved 
1 << 0as a defaultLayerMask, defaultCollisionLayersnow only includes a single bit for membership, while including all bits for filters. 
Migration Guide
- Make sure your 
1 << 0/1collision layer is fine with being a default membership, you may need to add aCollisionLayerscomponent to entities that have did not have one before to allow interactions to happen again. However this may also indicate a bug in logic.