-
-
Notifications
You must be signed in to change notification settings - Fork 263
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 example to output a debugdump #576
Conversation
bevy_rapier2d/examples/debugdump2.rs
Outdated
pub fn display_events( | ||
mut collision_events: EventReader<CollisionEvent>, | ||
mut contact_force_events: EventReader<ContactForceEvent>, | ||
) { | ||
for collision_event in collision_events.read() { | ||
println!("Received collision event: {collision_event:?}"); | ||
} | ||
|
||
for contact_force_event in contact_force_events.read() { | ||
println!("Received contact force event: {contact_force_event:?}"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User systems are not strictly neeed and maybe should be removed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let’s just stick to the rapier systems here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
bevy_rapier2d/examples/debugdump2.rs
Outdated
pub fn display_events( | ||
mut collision_events: EventReader<CollisionEvent>, | ||
mut contact_force_events: EventReader<ContactForceEvent>, | ||
) { | ||
for collision_event in collision_events.read() { | ||
println!("Received collision event: {collision_event:?}"); | ||
} | ||
|
||
for contact_force_event in contact_force_events.read() { | ||
println!("Received contact force event: {contact_force_event:?}"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let’s just stick to the rapier systems here.
# Objective - I appreciate graphs from [`bevy_mod_debugdump`](https://github.com/jakobhellermann/bevy_mod_debugdump), this PR merely starts a discussion on adding some "first party" interest to such graphs. - it can be useful to compare with bevy_rapier: dimforge/bevy_rapier#576 ## Solution - Add an example to generate those Run with: `cargo run --example debugdump_3d > avian.dot && dot -Tsvg avian.dot > avian.svg` ## Output for 3d <details><summary>PhysicsSchedule</summary> <p> ![dump_physics](https://github.com/user-attachments/assets/0ac6d299-0cb2-4f1f-987a-763afcc2f57c) </p> </details> <details><summary>SubstepSchedule</summary> <p> ![dump_substeps](https://github.com/user-attachments/assets/189a1141-95d8-459f-8d28-a4807f38ed4e) </p> </details> <details><summary>FixedPostUpdate</summary> <p> ![dump_fixed_update](https://github.com/user-attachments/assets/12488f54-932a-494c-a90b-929320c363aa) </p> </details> <details><summary>Update</summary> <p> ![dump_update](https://github.com/user-attachments/assets/051a4d79-a626-4a3c-905d-084d16afd798) </p> </details> --- ## Changelog - Add an example to generate systems ordering graphs. --------- Co-authored-by: Joona Aalto <jondolf.dev@gmail.com>
This kind of example can be useful to both maintainers and users, to help understanding current state of the plugin, how things interact together.
Also there are some system ambiguities which are difficult to reason about in code, this visualization can help with that: