Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PartialEq for Collider #139

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

RJ
Copy link
Contributor

@RJ RJ commented Aug 30, 2023

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.

@Jondolf
Copy link
Owner

Jondolf commented Aug 31, 2023

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.

@RJ
Copy link
Contributor Author

RJ commented Aug 31, 2023

dimforge/parry#162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants