bevy/examples/math
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
..
cubic_splines.rs Return Results from Camera's world/viewport conversion methods (#14989) 2024-09-03 19:45:15 +00:00
custom_primitives.rs Use Isometry in bevy_gizmos wherever we can (#14676) 2024-08-28 01:37:19 +00:00
random_sampling.rs Use AccumulatedMouseMotion, AccumulatedMouseScroll in examples (#14488) 2024-07-29 23:38:59 +00:00
render_primitives.rs Use Isometry in bevy_gizmos wherever we can (#14676) 2024-08-28 01:37:19 +00:00
sampling_primitives.rs Apply unused_qualifications lint (#14828) 2024-08-21 12:29:33 +00:00