Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix too short picking ray in pinhole-only scenarios #7899

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/viewer/re_space_view_spatial/src/ui_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,14 @@ fn add_picking_ray(
let mut line_batch = line_builder.batch("picking ray");

let origin = ray.point_along(0.0);

// No harm in making this ray _very_ long. (Infinite messes with things though!)
let fallback_ray_end = ray.point_along(scene_bbox.size().length() * 10.0);
//
// There are some degenerated cases where just taking the scene bounding box isn't enough:
// For instance, we don't add pinholes & depth images to the bounding box since
// the default size of a pinhole visualization itself is determined by the bounding box.
let fallback_ray_end =
ray.point_along((scene_bbox.size().length() * 10.0).at_least(thick_ray_length * 10.0));
let main_ray_end = ray.point_along(thick_ray_length);

line_batch
Expand Down
Loading