bevy_xpbd icon indicating copy to clipboard operation
bevy_xpbd copied to clipboard

Implement PartialEq for Collider

Open RJ opened this issue 2 years ago • 2 comments

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.

RJ avatar Aug 30 '23 20:08 RJ

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.

Jondolf avatar Aug 31 '23 19:08 Jondolf

https://github.com/dimforge/parry/pull/162

RJ avatar Aug 31 '23 20:08 RJ