Use solid edges for normal selection

This commit is contained in:
ramox81 committed 2026-09-02 14:38:22 +03:00
1 parent bde9cc2715
commit a706858ff1
6 files changed
+222 -18

No files matched your search

+51
View File
@@ -8206,6 +8206,57 @@ impl Scene {
)
}
/// Normal object selection for shaded 3D bodies is edge based. This keeps
/// the broad face interior available to modelling commands without making
/// it part of ordinary object picking.
pub fn solid_edge_click_hit(
&self,
cursor: iced::Point,
view_rot: glam::Mat4,
eye: glam::DVec3,
bounds: iced::Rectangle,
_candidate_handles: Option<&HashSet<Handle>>,
tolerance_px: f32,
) -> Option<Handle> {
let meshes = self.interaction_meshes_arc();
pick::hit_test::mesh_edge_click_hit(
cursor,
meshes.iter().filter_map(|set| {
let handle = set.entity_handle()?;
let (edges, edges_low) = set.geometry_edges();
(!edges.is_empty()).then_some((
handle,
edges,
edges_low,
set.instance_transform,
))
}),
view_rot,
eye,
bounds,
tolerance_px,
)
}
pub fn solid_edge_hover_hit(
&self,
cursor: iced::Point,
view_rot: glam::Mat4,
eye: glam::DVec3,
bounds: iced::Rectangle,
candidate_handles: Option<&HashSet<Handle>>,
tolerance_px: f32,
) -> Option<Handle> {
self.solid_edge_click_hit(
cursor,
view_rot,
eye,
bounds,
candidate_handles,
tolerance_px,
)
}
pub fn solid_click_point_for(
&self,
cursor: iced::Point,