bevy/crates/bevy_picking/src
Chris Juchem c620eb7833
Return Results from Camera's world/viewport conversion methods (#14989)
# Objective

- Fixes https://github.com/bevyengine/bevy/issues/14593.

## Solution

- Add `ViewportConversionError` and return it from viewport conversion
methods on Camera.

## Testing

- I successfully compiled and ran all changed examples.

## Migration Guide

The following methods on `Camera` now return a `Result` instead of an
`Option` so that they can provide more information about failures:
 - `world_to_viewport`
 - `world_to_viewport_with_depth`
 - `viewport_to_world`
 - `viewport_to_world_2d`

Call `.ok()` on the `Result` to turn it back into an `Option`, or handle
the `Result` directly.

---------

Co-authored-by: Lixou <82600264+DasLixou@users.noreply.github.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Zachary Harrold <zac@harrold.com.au>
2024-09-03 19:45:15 +00:00
..
input Mod picking upstream 2 (#14686) 2024-08-09 23:16:37 +00:00
backend.rs Return Results from Camera's world/viewport conversion methods (#14989) 2024-09-03 19:45:15 +00:00
events.rs rename Drop to bevy::picking::events::DragDrop to unclash std::ops:Drop (#14926) 2024-08-26 18:38:56 +00:00
focus.rs Have EntityCommands methods consume self for easier chaining (#14897) 2024-08-26 18:24:59 +00:00
lib.rs Add bevy_picking sprite backend (#14757) 2024-08-26 18:01:32 +00:00
pointer.rs Upstream CorePlugin from bevy_mod_picking (#13677) 2024-06-15 11:59:57 +00:00