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

add a Debug impl for SharedShape #179

Merged
merged 3 commits into from
Mar 24, 2024

Conversation

whatf0xx
Copy link
Contributor

Based on this issue in rapier: dimforge/rapier#577

I implemented Debug for SharedShape by using the trait method to get the ShapeType, and then using that as the basis of the debug info.

This is my first PR, I hope it's ok! I will post a corresponding one to rapier.

@sebcrozet
Copy link
Member

Hi! Thank you for this PR. This is a great start.
It sounds more useful to use .as_typed_shape() instead of .shape_type(), that way you can print the actual geometry instead of just the type. Perhaps Debug could be implemented for TypedShape.

@whatf0xx
Copy link
Contributor Author

Thanks for your feedback and sorry for the slow response, it's been a busy few weeks:)

I extended the #[derive(Debug)] to TypedShape and hence to all of its enum variants that didn't support it already. The only one which got a blanket/dummy implementation was TriMesh; I was confused because it threw an error trying to derive Debug for Qbvh here but elsewhere this wasn't an issue (for Polyline, for example). I would be happy enough to dig a little deeper and sort out a useful Debug implementation for TriMesh, too, but I'm not sure how useful that would immediately be, especially since the original issue was to just have a Debug implementation a few abstraction levels up...

@whatf0xx
Copy link
Contributor Author

whatf0xx commented Mar 12, 2024

Hi! I checked that I can now build* with cargo build -p parry2d so this should pass the tests.

*with no warnings

@sebcrozet sebcrozet force-pushed the collider-builder-debug branch from 7a7212f to f8f52ab Compare March 24, 2024 10:26
@sebcrozet sebcrozet merged commit 29bc715 into dimforge:master Mar 24, 2024
5 checks passed
@sebcrozet
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants