diff --git a/Cargo.lock b/Cargo.lock index ab118f4..128a118 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1008,6 +1008,18 @@ dependencies = [ "uuid", ] +[[package]] +name = "bevy_prototype_lyon" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02ff6a3e8b4867eaed81a2bb2cc0bcddc33150849eefa369b4a170ef337aaa8" +dependencies = [ + "bevy", + "lyon_algorithms", + "lyon_tessellation", + "svgtypes", +] + [[package]] name = "bevy_ptr" version = "0.15.1" @@ -2198,6 +2210,12 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "float_next_after" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8" + [[package]] name = "fnv" version = "1.0.7" @@ -2404,6 +2422,7 @@ dependencies = [ "bevy", "bevy-inspector-egui", "bevy_mod_debugdump", + "bevy_prototype_lyon", "bevy_rapier2d", "num-traits", ] @@ -2731,6 +2750,16 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "kurbo" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89234b2cc610a7dd927ebde6b41dd1a5d4214cffaef4cf1fb2195d592f92518f" +dependencies = [ + "arrayvec", + "smallvec", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -2825,6 +2854,48 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "lyon_algorithms" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f13c9be19d257c7d37e70608ed858e8eab4b2afcea2e3c9a622e892acbf43c08" +dependencies = [ + "lyon_path", + "num-traits", +] + +[[package]] +name = "lyon_geom" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8af69edc087272df438b3ee436c4bb6d7c04aa8af665cfd398feae627dbd8570" +dependencies = [ + "arrayvec", + "euclid", + "num-traits", +] + +[[package]] +name = "lyon_path" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e0b8aec2f58586f6eef237985b9a9b7cb3a3aff4417c575075cf95bf925252e" +dependencies = [ + "lyon_geom", + "num-traits", +] + +[[package]] +name = "lyon_tessellation" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579d42360a4b09846eff2feef28f538696c7d6c7439bfa65874ff3cbe0951b2c" +dependencies = [ + "float_next_after", + "lyon_path", + "num-traits", +] + [[package]] name = "mach2" version = "0.4.2" @@ -4105,6 +4176,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "skrifa" version = "0.22.3" @@ -4218,6 +4295,16 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce5d813d71d82c4cbc1742135004e4a79fd870214c155443451c139c9470a0aa" +[[package]] +name = "svgtypes" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc" +dependencies = [ + "kurbo", + "siphasher", +] + [[package]] name = "swash" version = "0.1.19" diff --git a/Cargo.toml b/Cargo.toml index d2856d0..40bf765 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ edition = "2021" bevy = "0.15.1" bevy-inspector-egui = "0.28.1" bevy_mod_debugdump = "0.12.1" +bevy_prototype_lyon = "0.13.0" bevy_rapier2d = "0.28.0" num-traits = "0.2.19" diff --git a/src/debug.rs b/src/debug.rs index 12273ad..891cc46 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -7,14 +7,16 @@ pub struct DebugSet; impl Plugin for DebugPlugin { fn build(&self, app: &mut App) { - app.configure_sets(Last, DebugSet.run_if(is_debug_enabled)); + app.configure_sets(Last, DebugSet.run_if(is_debug_enabled)) + .configure_sets(PostUpdate, DebugSet.run_if(is_debug_enabled)); app.insert_resource(DebugMode::off()) .add_plugins(( bevy_inspector_egui::quick::WorldInspectorPlugin::new().run_if(is_debug_enabled), bevy_rapier2d::prelude::RapierDebugRenderPlugin::default(), )) - .add_systems(Update, debug_toggle); + .add_systems(Update, debug_toggle) + .add_systems(PostUpdate, draw_debug.in_set(DebugSet)); } } @@ -43,3 +45,7 @@ fn debug_toggle(input: Res>, mut debug_mode: ResMut