-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Upstream DebugPickingPlugin
from bevy_mod_picking
#17177
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
Upstream DebugPickingPlugin
from bevy_mod_picking
#17177
Conversation
Vast majority of this code is taken as-is from `bevy_mod_picking` aside from changes to ensure compilation and code style Main changes * `selection` feature flag and support - the relevant code was explicitly not included in the process of upstreaming the rest of the package, so it also has been ommitted here. * `bevy_egui` support - the old package had a preference for using `bevy_egui` instead of `bevy_ui` if possible, I couldn't see a way to support this in a core crate, so this has been removed. Relevant code has been added to the `bevy_dev_tools` crate instead of `bevy_picking` as it is a better fit and requires a dependency on `bevy_ui` for drawing debug elements. --------- Co-authored-by: Aevyrie <[email protected]>
Might make more sense to put the example in the picking group. That way people looking for the feature will see it. That, or just enable for all picking examples instead of making a standalone example. |
You added a new example but didn't add metadata for it. Please update the root Cargo.toml file. |
Sounds reasonable - I don't have a strong opinion here, so I'll wait on some other reviewers to chime in before doing this. |
…am-debug-picking
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.
The code is a bit janky tbh. I'm not sure if it makes sense to store the data as a component instead of just holding a map in a resource. At times like this I really wish bevy UI was immediate mode.
This is probably fine to upstream as-is, but I'm not super pleased with the code quality, which is my own fault.
@alice-i-cecile this is missing the pointer click and drag overlay that the egui version has, because it's such a pita to just draw shapes on the screen in bevy. We really need screen space gizmos (screen space immediate mode line drawing) to do this kind of thing. This also highlights the usefulness of immediate mode UI when you just need to throw text, boxes, and circles on screen with a system, especially in dev tools. This entire feature could be a single system with imgui.
Edit: @skimmedsquare the criticism here is directed at myself, to be clear. Thanks for doing this legwork!
You added a new example but didn't add metadata for it. Please update the root Cargo.toml file. |
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.
Just a bit of cleanup to do, but this is almost ready.
You added a new example but didn't add metadata for it. Please update the root Cargo.toml file. |
@alice-i-cecile Any thoughts on the suggestion from @aevyrie above? Was waiting on this before fixing the |
Mild preference to move it into the picking group :) |
You added a new example but didn't add metadata for it. Please update the root Cargo.toml file. |
You added a new example but didn't add metadata for it. Please update the root Cargo.toml file. |
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.
That cleaned up nicely. Thanks!
# Objective The debug features (`DebugPickingPlugin`) from `bevy_mod_picking` were not upstreamed with the rest of the core changes, this PR reintroduces it for usage inside `bevy_dev_tools` ## Solution Vast majority of this code is taken as-is from `bevy_mod_picking` aside from changes to ensure compilation and code style, as such @aevyrie was added as the co-author for this change. ### Main changes * `multiselection` support - the relevant code was explicitly not included in the process of upstreaming the rest of the package, so it also has been omitted here. * `bevy_egui` support - the old package had a preference for using `bevy_egui` instead of `bevy_ui` if possible, I couldn't see a way to support this in a core crate, so this has been removed. Relevant code has been added to the `bevy_dev_tools` crate instead of `bevy_picking` as it is a better fit and requires a dependency on `bevy_ui` for drawing debug elements. ### Minor changes * Changed the debug text size from `60` to `12` as the former was so large as to be unreadable in the new example. ## Testing * `cargo run -p ci` * Added a new example in `dev_tools/picking_debug` and visually verified the in-window results and the console messages --------- Co-authored-by: Aevyrie <[email protected]> Co-authored-by: Alice Cecile <[email protected]>
Objective
The debug features (
DebugPickingPlugin
) frombevy_mod_picking
were not upstreamed with the rest of the core changes, this PR reintroduces it for usage insidebevy_dev_tools
Solution
Vast majority of this code is taken as-is from
bevy_mod_picking
aside from changes to ensure compilation and code style, as such @aevyrie was added as the co-author for this change.Main changes
multiselection
support - the relevant code was explicitly not included in the process of upstreaming the rest of the package, so it also has been omitted here.bevy_egui
support - the old package had a preference for usingbevy_egui
instead ofbevy_ui
if possible, I couldn't see a way to support this in a core crate, so this has been removed.Relevant code has been added to the
bevy_dev_tools
crate instead ofbevy_picking
as it is a better fit and requires a dependency onbevy_ui
for drawing debug elements.Minor changes
60
to12
as the former was so large as to be unreadable in the new example.Testing
cargo run -p ci
dev_tools/picking_debug
and visually verified the in-window results and the console messages