bevy_xpbd
bevy_xpbd copied to clipboard
Implement PartialEq for Collider
All the bevy_xpbd components I'm using implement PartialEq except for Collider.
Having PartialEq is really useful for various netcode bits that check what's changed in generic systems.
Collider is a wrapper over parry's SharedShape, and not all parry Shapes implement PartialEq
For those that do, i'm using it. For the rest, i'm comparing what is necessary manually – eg, border radius for rounded versions of shapes.
I took the big match on shape types from the implementation of fmt::Debug for Collider, so PartialEq will work for all the same shapes.
Thanks! Ideally, this would be implemented for Parry's SharedShape directly, but this works as a workaround for now. We could also make a PR to add this to Parry though.
https://github.com/dimforge/parry/pull/162