Add bevy_picking sprite backend#14757
Conversation
|
This doesn't test against alpha, which might be surprising in a first-party implementation. Would be nice to document on the plugin. Additionally, it would be courteous to co-author the downstream contributors in a commit here. |
Not sure what you mean by "test against alpha". Could you elaborate?
Absolutely! I thought I'd opened this in draft and I hadn't planned on it getting merged without crediting you. Since you're the original author, is there anyone else you'd like listed as co-author? I also have to say I've never added a co-author, so I might mess it up a couple times, haha |
Co-authored-by: Aevyrie <[email protected]>
5e820c8 to
d19c4ba
Compare
Co-authored-by: Aevyrie <[email protected]>
|
The generated |
Exactly. I think most users would expect fully transparent pixels to not be hittable. Might be something where the backend/component specifies a threshold, so any alpha below that value will be ignored. Doesn't need to be added right now, but would be nice to mention in the plugin docs.
There are a bunch of people who have contributed to this backend. I'd take a look at the commit history here - I'm not sure if there is an easier way to do this: https://github.com/aevyrie/bevy_mod_picking/commits/main/backends/bevy_picking_sprite/src/lib.rs
No worries! I think git makes it pretty simple, you just need to add the names/emails separated by newlines in a commit. |
kristoff3r
left a comment
There was a problem hiding this comment.
A few non-blocking code quality comments. I also tested the example on both linux and wasm.
Objective
Add
bevy_pickingsprite backend as part of thebevy_mod_pickingupstreamening (#12365).Solution
More or less a copy/paste from
bevy_mod_picking, with the changes here. I'm putting that link here since those changes haven't yet made it through review, so should probably be reviewed on their own.Testing
I couldn't find any sprite-backend-specific tests in
bevy_mod_pickingand unfortunately I'm not familiar enough with Bevy's testing patterns to write tests for code that relies on windowing and input. I'm willing to break the pointer hit system into testable blocks and add some more modular tests if that's deemed important enough to block, otherwise I can open an issue for adding tests as follow-up.Follow-up work