diff --git a/Cargo.toml b/Cargo.toml index ad067f0d..23a5eb16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,27 +18,27 @@ all-features = true members = ["crates/*", "backends/*"] [dependencies] -bevy_app = { version = "0.14.0", default-features = false } -bevy_core = { version = "0.14.0", default-features = false } -bevy_core_pipeline = { version = "0.14.0", optional = true, default-features = false } -bevy_ecs = { version = "0.14.0", default-features = false } -bevy_math = { version = "0.14.0", default-features = false } -bevy_reflect = { version = "0.14.0", default-features = false } -bevy_render = { version = "0.14.0", default-features = false } -bevy_text = { version = "0.14.0", optional = true, default-features = false, features = [ +bevy_app = { version = "0.14", default-features = false } +bevy_core = { version = "0.14", default-features = false } +bevy_core_pipeline = { version = "0.14", optional = true, default-features = false } +bevy_ecs = { version = "0.14", default-features = false } +bevy_math = { version = "0.14", default-features = false } +bevy_reflect = { version = "0.14", default-features = false } +bevy_render = { version = "0.14", default-features = false } +bevy_text = { version = "0.14", optional = true, default-features = false, features = [ "default_font", ] } -bevy_utils = { version = "0.14.0", default-features = false } -bevy_window = { version = "0.14.0", default-features = false } +bevy_utils = { version = "0.14", default-features = false } +bevy_window = { version = "0.14", default-features = false } # Optional -bevy_color = { version = "0.14.0", optional = true, default-features = false } -bevy_ui = { version = "0.14.0", optional = true, default-features = false } +bevy_color = { version = "0.14", optional = true, default-features = false } +bevy_ui = { version = "0.14", optional = true, default-features = false } -bevy_eventlistener = "0.8.0" -bevy_egui = { optional = true, version = "0.28.0" } # >=0.28, <=0.XX -bevy_rapier3d = { optional = true, version = "0.27.0-rc.1" } -bevy_xpbd_3d = { optional = true, version = "0.5.0" } +bevy_eventlistener = "0.8" +bevy_egui = { optional = true, version = "0.28" } # >=0.28, <=0.XX +bevy_rapier3d = { optional = true, version = "0.27" } +bevy_xpbd_3d = { optional = true, version = "0.5" } avian3d = { optional = true, version = '0.1' } # Local @@ -55,7 +55,7 @@ bevy_picking_xpbd = { optional = true, path = "backends/bevy_picking_xpbd", vers bevy_picking_avian = { optional = true, path = "backends/bevy_picking_avian", version = "0.20.0" } [dev-dependencies] -bevy = { version = "0.14.0", default-features = false, features = [ +bevy = { version = "0.14", default-features = false, features = [ "bevy_winit", "x11", "bevy_gltf", diff --git a/src/debug.rs b/src/debug.rs index 3f49128e..597884d8 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -292,6 +292,7 @@ pub fn update_debug_data( pub fn debug_draw_egui( mut egui: bevy_egui::EguiContexts, pointers: Query<(&pointer::PointerId, &PointerDebug)>, + debug_mode: Res, ) { use bevy_egui::egui::{self, Color32}; use bevy_render::camera::NormalizedRenderTarget; @@ -310,25 +311,27 @@ pub fn debug_draw_egui( let to_egui_pos = |v: Vec2| egui::pos2(v.x, v.y); let dbg_painter = ctx.layer_painter(egui::LayerId::debug()); - dbg_painter.circle( - to_egui_pos(location.position), - 20.0, - Color32::from_rgba_unmultiplied(255, 255, 255, 32), - stroke, - ); - - debug.drag_start.iter().for_each(|(button, drag_start)| { - let (start, end) = (to_egui_pos(*drag_start), to_egui_pos(location.position)); - dbg_painter.line_segment([start, end], stroke); - dbg_painter.circle(start, 20.0, egui::Color32::TRANSPARENT, stroke); - let drag_dist = location.position - *drag_start; - dbg_painter.debug_text( - ((end.to_vec2() + start.to_vec2()) * 0.5).to_pos2(), - egui::Align2::CENTER_CENTER, - Color32::WHITE, - format!("{button:?}: [{:.1}, {:.1}]", drag_dist.x, drag_dist.y), + if matches!(*debug_mode, DebugPickingMode::Noisy) { + dbg_painter.circle( + to_egui_pos(location.position), + 20.0, + Color32::from_rgba_unmultiplied(255, 255, 255, 32), + stroke, ); - }); + + debug.drag_start.iter().for_each(|(button, drag_start)| { + let (start, end) = (to_egui_pos(*drag_start), to_egui_pos(location.position)); + dbg_painter.line_segment([start, end], stroke); + dbg_painter.circle(start, 20.0, egui::Color32::TRANSPARENT, stroke); + let drag_dist = location.position - *drag_start; + dbg_painter.debug_text( + ((end.to_vec2() + start.to_vec2()) * 0.5).to_pos2(), + egui::Align2::CENTER_CENTER, + Color32::WHITE, + format!("{button:?}: [{:.1}, {:.1}]", drag_dist.x, drag_dist.y), + ); + }); + } let text = format!("{id:?} {debug}"); let alignment = egui::Align2::LEFT_TOP;