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

experimentation with debugdump #383

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/avian2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ bevy_math = { version = "0.14", features = ["approx"] }
approx = "0.5"
criterion = { version = "0.5", features = ["html_reports"] }
insta = "1.0"
bevy_mod_debugdump = "0.11"

[[example]]
name = "dynamic_character_2d"
Expand Down Expand Up @@ -117,6 +118,10 @@ required-features = ["2d", "default-collider"]
name = "revolute_joint_2d"
required-features = ["2d", "default-collider"]

[[example]]
name = "debugdump_2d"
required-features = ["2d"]

[[bench]]
name = "pyramid"
required-features = ["2d", "default-collider"]
Expand Down
18 changes: 18 additions & 0 deletions crates/avian2d/examples/debugdump_2d.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//! Run with:
//! `cargo run --example debugdump_2d > dump.dot && dot -Tsvg dump.dot > dump.svg`

use avian2d::prelude::*;
use bevy::prelude::*;

fn main() {
let mut app = App::new();

app.add_plugins((PhysicsPlugins::default(), PhysicsDebugPlugin::default()));

// Schedules of interest:
// - PhysicsSchedule
// - SubstepSchedule
// - FixedPostUpdate
// - Update
bevy_mod_debugdump::print_schedule_graph(&mut app, PhysicsSchedule);
}
6 changes: 5 additions & 1 deletion crates/avian3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bevy_math = { version = "0.14", features = ["approx"] }
approx = "0.5"
criterion = { version = "0.5", features = ["html_reports"] }
insta = "1.0"

bevy_mod_debugdump = "0.11"

[[example]]
name = "dynamic_character_3d"
Expand Down Expand Up @@ -136,6 +136,10 @@ required-features = ["3d", "default-collider", "bevy_scene"]
name = "collider_constructors"
required-features = ["3d", "default-collider", "bevy_scene"]

[[example]]
name = "debugdump_3d"
required-features = ["3d"]

[[bench]]
name = "cubes"
required-features = ["3d", "default-collider"]
Expand Down
19 changes: 19 additions & 0 deletions crates/avian3d/examples/debugdump_3d.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//! Run with:
//! `cargo run --example debugdump_3d > dump.dot && dot -Tsvg dump.dot > dump.svg`

use avian3d::debug_render::PhysicsDebugPlugin;
use avian3d::prelude::*;
use bevy::prelude::*;

fn main() {
let mut app = App::new();

app.add_plugins((PhysicsPlugins::default(), PhysicsDebugPlugin::default()));

// Schedules of interest:
// - PhysicsSchedule
// - SubstepSchedule
Copy link
Contributor Author

@Vrixyz Vrixyz Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of f161a74 ; Attempting to make a graph for SubstepSchedule results in an error.

// - FixedPostUpdate
// - Update
bevy_mod_debugdump::print_schedule_graph(&mut app, PhysicsSchedule);
}
2 changes: 1 addition & 1 deletion crates/examples_common_2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ bevy = { version = "0.14", default-features = false, features = [
"ktx2",
"zstd",
"bevy_winit",
"x11", # github actions runners don't have libxkbcommon installed, so can't use wayland
"x11", # github actions runners don't have libxkbcommon installed, so can't use wayland
] }
avian2d = { path = "../avian2d", default-features = false }
2 changes: 1 addition & 1 deletion crates/examples_common_3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ bevy = { version = "0.14", default-features = false, features = [
"png",
"zstd",
"bevy_winit",
"x11", # github actions runners don't have libxkbcommon installed, so can't use wayland
"x11", # github actions runners don't have libxkbcommon installed, so can't use wayland
] }
avian3d = { path = "../avian3d", default-features = false }