dimforge / parry

2D and 3D collision-detection library for Rust.
https://parry.rs
Apache License 2.0
555 stars 96 forks source link

Not all Shapes implement PartialEq<Self> #51

Open dstaatz opened 2 years ago

dstaatz commented 2 years ago

As of the 0.7 release:

2D Shapes that implement PartialEq:

2D Shapes that don't implement PartialEq:

3D Shapes that implement PartialEq:

3D Shapes that don't implement PartialEq:

I don't understand why some of these shapes don't implement PartialEq<Self>. Is there any particular reason for this?

Compound would be harder because of SharedShape, but the rest mostly seem like they could derive it.

RoundShape could implement it with the following:

impl<S: Shape + PartialEq> PartialEq for RoundShape<S> {
  fn eq(&self, other: &Self) -> bool {
    self.border_radius == other.border_radius && self.base_shape == other.base_shape
  }
}
RJ commented 1 year ago

Can anyone comment on the feasibility of this?

I'm working on rollback networking, and pretty much all my components I need to rollback are PartialEq except my struct Collider(parry::SharedShape).

Is there any reason why SharedShape couldn't be made PartialEq, if I put in the work to impl PartialEq for the remaining shapes, like the RoundShape example above? What are the likely pitfalls?

thanks!

rowanfr commented 7 months ago

Is there any update as to why the PR #162 hasn't been merged?