Fix mesh_picking not working due to mixing vertex and triangle indices.#18533
Fix mesh_picking not working due to mixing vertex and triangle indices.#18533alice-i-cecile merged 1 commit intobevyengine:mainfrom
mesh_picking not working due to mixing vertex and triangle indices.#18533Conversation
kristoff3r
left a comment
There was a problem hiding this comment.
I tested the example and this fixes the problem.
It would be nice to have a test that triggers it, this code already has a bunch of tests but apparently none of them caught this issue.
|
Yeah I agree, but personally idk what the test should be. |
tbillington
left a comment
There was a problem hiding this comment.
Nice catch! I did add more tests, obviously not enough though 😅
|
This fix also worked for me on Linux. (openSUSE Tumbleweed, wayland) |
Yeah something like that, just the simplest possible thing that will error on main but not with this. Bonus points if it can be manually validated, but for a regression test even a hardcoded, known good example is fine. |
…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`
Objective
0.16-dev#18495Solution
Testing
cargo run --example mesh_picking