bevy/crates/bevy_render
Johannes Ringler 683b08fec9
Respect viewport position in coordinate conversion functions (#17633)
# Objective

- In `Camera::viewport_to_world_2d`, `Camera::viewport_to_world`,
`Camera::world_to_viewport` and `Camera::world_to_viewport_with_depth`,
the results were incorrect when the `Camera::viewport` field was
configured with a viewport position that was non-zero. This PR attempts
to correct that.
- Fixes #16200 

## Solution

- This PR now takes the viewport position into account in the functions
mentioned above.
- Extended `2d_viewport_to_world` example to test the functions with a
dynamic viewport position and size, camera positions and zoom levels. It
is probably worth discussing whether to change the example, add a new
one or just completely skip touching the examples.

## Testing

Used the modified example to test the functions with dynamic camera
transform as well as dynamic viewport size and position.
2025-03-10 21:19:26 +00:00
..
macros Add a new #[data] attribute to AsBindGroup that allows packing data for multiple materials into a single array. (#17965) 2025-02-24 21:38:55 +00:00
src Respect viewport position in coordinate conversion functions (#17633) 2025-03-10 21:19:26 +00:00
Cargo.toml Decoupled naga for wgpu testing (#18099) 2025-03-09 21:49:48 +00:00
LICENSE-APACHE Cleanup publish process (#17728) 2025-02-09 17:46:19 +00:00
LICENSE-MIT Cleanup publish process (#17728) 2025-02-09 17:46:19 +00:00
README.md

Bevy Render

License Crates.io Downloads Docs Discord