mirror of
https://github.com/bevyengine/bevy
synced 2025-03-07 08:47:24 +00:00
picking: disable raycast backface culling for Mesh2d (#16657)
# Objective - This fixes raycast picking with lyon - reverse winding of 2D meshes currently results in them being rendered but not pickable as the raycast passes through the backface and would only hit "from below" ## Solution - Disables backface culling for Mesh2d ## Testing - Tested picking with bevy_prototype_lyon - Could probably use testing with Mesh3d (should not be affected) and SimplifiedMesh (no experience with that, could have the same issue if used for 2D?) --------- Co-authored-by: Aevyrie <aevyrie@gmail.com>
This commit is contained in:
parent
d3241c4f8d
commit
e763b71591
1 changed files with 4 additions and 3 deletions
|
@ -274,9 +274,10 @@ impl<'w, 's> MeshRayCast<'w, 's> {
|
|||
return;
|
||||
};
|
||||
|
||||
let backfaces = match has_backfaces {
|
||||
true => Backfaces::Include,
|
||||
false => Backfaces::Cull,
|
||||
// Backfaces of 2d meshes are never culled, unlike 3d mehses.
|
||||
let backfaces = match (has_backfaces, mesh2d.is_some()) {
|
||||
(false, false) => Backfaces::Cull,
|
||||
_ => Backfaces::Include,
|
||||
};
|
||||
|
||||
// Perform the actual ray cast.
|
||||
|
|
Loading…
Add table
Reference in a new issue