You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
world_to_ndc gives infinite values instead of returning None or some other result type or valid values
bevy_ui::layout panics on invalid position values, which can easily happen when multiplying floats around. I would feel much better if this was an error log
I initially thought this was related to #16765 but the UI node has no parent/hierarchy, focuses on the panic on inf, and doesn't mention world_to_ndc.
Backtraces from the panic:
RUST_BACKTRACE=1
thread 'Compute Task Pool (2)' panicked at /Users/choc/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/num/f32.rs:1406:9:
min > max, or either was NaN. min = 0.0, max = NaN
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: bevy_ui::ui_node::BorderRadius::resolve_single_corner
3: bevy_ui::layout::ui_layout_system::update_uinode_geometry_recursive
4: bevy_ui::layout::ui_layout_system
5: <bevy_ecs::system::function_system::FunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run_unsafe
Bevy version
0.15.2
(0.15.3 does not have commits related to this)What you did
I'm creating worldspace UI using
Camera::world_to_ndc
to translate worldspace positions to screen space to positionbevy_ui
elements.What went wrong
The below call to
world_to_ndc
outputs aVec3::INFINITY
.Camera
is the defaultCamera3d
required component.The
inf
ended up being used to position aNode
, resulting innode.left = Val::Px(inf);
.This ended up triggering a panic in
bevy_ui::layout
because the layout code is not robust against this invalid value.Additional information
Shifting the translation to be non-zero avoids the infinite values from
world_to_ndc
.This seems to be 2 issues
world_to_ndc
gives infinite values instead of returningNone
or some other result type or valid valuesbevy_ui::layout
panics on invalid position values, which can easily happen when multiplying floats around. I would feel much better if this was an error logI initially thought this was related to #16765 but the UI node has no parent/hierarchy, focuses on the panic on inf, and doesn't mention
world_to_ndc
.Backtraces from the panic:
RUST_BACKTRACE=1
RUST_BACKTRACE=full
The text was updated successfully, but these errors were encountered: