
# Objective Add a convenient immediate mode drawing API for visual debugging. Fixes #5619 Alternative to #1625 Partial alternative to #5734 Based off https://github.com/Toqozz/bevy_debug_lines with some changes: * Simultaneous support for 2D and 3D. * Methods for basic shapes; circles, spheres, rectangles, boxes, etc. * 2D methods. * Removed durations. Seemed niche, and can be handled by users. <details> <summary>Performance</summary> Stress tested using Bevy's recommended optimization settings for the dev profile with the following command. ```bash cargo run --example many_debug_lines \ --config "profile.dev.package.\"*\".opt-level=3" \ --config "profile.dev.opt-level=1" ``` I dipped to 65-70 FPS at 300,000 lines CPU: 3700x RAM Speed: 3200 Mhz GPU: 2070 super - probably not very relevant, mostly cpu/memory bound </details> <details> <summary>Fancy bloom screenshot</summary>  </details> ## Changelog * Added `GizmoPlugin` * Added `Gizmos` system parameter for drawing lines and wireshapes. ### TODO - [ ] Update changelog - [x] Update performance numbers - [x] Add credit to PR description ### Future work - Cache rendering primitives instead of constructing them out of line segments each frame. - Support for drawing solid meshes - Interactions. (See [bevy_mod_gizmos](https://github.com/LiamGallagher737/bevy_mod_gizmos)) - Fancier line drawing. (See [bevy_polyline](https://github.com/ForesightMiningSoftwareCorporation/bevy_polyline)) - Support for `RenderLayers` - Display gizmos for a certain duration. Currently everything displays for one frame (ie. immediate mode) - Changing settings per drawn item like drawing on top or drawing to different `RenderLayers` Co-Authored By: @lassade <felipe.jorge.pereira@gmail.com> Co-Authored By: @The5-1 <agaku@hotmail.de> Co-Authored By: @Toqozz <toqoz@hotmail.com> Co-Authored By: @nicopap <nico@nicopap.ch> --------- Co-authored-by: Robert Swain <robert.swain@gmail.com> Co-authored-by: IceSentry <c.giguere42@gmail.com> Co-authored-by: Carter Anderson <mcanders1@gmail.com>
61 lines
1.4 KiB
Rust
61 lines
1.4 KiB
Rust
#[doc(hidden)]
|
|
pub use crate::{
|
|
app::prelude::*, core::prelude::*, ecs::prelude::*, hierarchy::prelude::*, input::prelude::*,
|
|
log::prelude::*, math::prelude::*, reflect::prelude::*, time::prelude::*,
|
|
transform::prelude::*, utils::prelude::*, window::prelude::*, DefaultPlugins, MinimalPlugins,
|
|
};
|
|
|
|
pub use bevy_derive::{bevy_main, Deref, DerefMut};
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_asset")]
|
|
pub use crate::asset::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_audio")]
|
|
pub use crate::audio::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_animation")]
|
|
pub use crate::animation::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_core_pipeline")]
|
|
pub use crate::core_pipeline::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_pbr")]
|
|
pub use crate::pbr::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_render")]
|
|
pub use crate::render::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_scene")]
|
|
pub use crate::scene::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_sprite")]
|
|
pub use crate::sprite::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_text")]
|
|
pub use crate::text::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_ui")]
|
|
pub use crate::ui::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_dynamic_plugin")]
|
|
pub use crate::dynamic_plugin::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_gizmos")]
|
|
pub use crate::gizmos::prelude::*;
|
|
|
|
#[doc(hidden)]
|
|
#[cfg(feature = "bevy_gilrs")]
|
|
pub use crate::gilrs::*;
|