Skip to content

mesh_picking behaves erratically in 0.16-dev #18495

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

Closed
aloucks opened this issue Mar 22, 2025 · 2 comments
Closed

mesh_picking behaves erratically in 0.16-dev #18495

aloucks opened this issue Mar 22, 2025 · 2 comments
Labels
A-Picking Pointing at and selecting objects of all sorts C-Bug An unexpected or incorrect behavior S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Milestone

Comments

@aloucks
Copy link
Contributor

aloucks commented Mar 22, 2025

Bevy version

main 0244a84

Relevant system information

I checked on both macOS and Windows.

What you did

cargo run --example mesh_picking

What went wrong

Picking doesn't fire depending on the angle of intersection or the normal of the intersection is computed incorrectly. It could also possibly be intersecting on the back face.

Additional information

Screen.Recording.2025-03-22.at.6.02.41.PM-1.mov
@aloucks aloucks added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 22, 2025
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Mar 22, 2025
@alice-i-cecile alice-i-cecile added S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! A-Picking Pointing at and selecting objects of all sorts and removed S-Needs-Triage This issue needs to be labelled labels Mar 22, 2025
@alice-i-cecile
Copy link
Member

I suspect this is a bug introduced via #18232. We should consider reverting at this stage if we can't get a prompt fix.

github-merge-queue bot pushed a commit that referenced this issue Mar 25, 2025
…ces. (#18533)

# Objective

- #18495 

## Solution

- The code in the PR #18232 accidentally used a vertex index as a
triangle index, causing the wrong triangle to be used for normal
computation and if the triangle went out of bounds, it would skip the
ray-hit.
- Don't do that.

## Testing

- Run `cargo run --example mesh_picking`
@aloucks
Copy link
Contributor Author

aloucks commented Mar 25, 2025

confirmed fixed

@aloucks aloucks closed this as completed Mar 25, 2025
mockersf pushed a commit that referenced this issue Mar 25, 2025
…ces. (#18533)

# Objective

- #18495 

## Solution

- The code in the PR #18232 accidentally used a vertex index as a
triangle index, causing the wrong triangle to be used for normal
computation and if the triangle went out of bounds, it would skip the
ray-hit.
- Don't do that.

## Testing

- Run `cargo run --example mesh_picking`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Picking Pointing at and selecting objects of all sorts C-Bug An unexpected or incorrect behavior S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

No branches or pull requests

2 participants