bevy
bevy copied to clipboard
Add a "screen ray" method
Basically this: https://docs.amethyst.rs/stable/amethyst_rendy/camera/enum.Projection.html#method.screen_ray
I think it's an essential utility for 3D games.
+1 for some camera helpers.. amethyst's might be cleaner but I have some related code that can be donated:
- Ray/Ray and Line/Plane intersection using glam: https://github.com/aclysma/minimum/blob/WIP/minimum-math/src/functions.rs
- I had a "viewport" abstraction that essentially does the same thing the amethyst code is doing: https://github.com/aclysma/minimum/blob/WIP/minimum-game/src/resources/viewport.rs
- For editor support, I combined the two to draw world-space UI with an immediate-mode API and do click detection. Given a constraint (a line or a plane) it would convert 2D movement back to 3D in a way that that felt pretty good (a surprisingly non-trivial thing to do).
@cart do you think that would be a good first issue? It seems like nice project for someone getting into bevy
#615 should solve this. Looking forward to your feedback!
done: https://docs.rs/bevy/latest/bevy/render/camera/struct.Camera.html#method.viewport_to_world