feat(select): orange hover / blue selection highlight for all objects

Solids (meshes) now tint on rollover and selection: hover washes orange,
selection washes blue, with selection winning when both apply. Meshes
re-upload their tint when the highlight set changes, and the rollover pick
now also hits shaded solid bodies and hatches (mirroring the click-select
order: wire → hatch → block hatch → solid).

Wires get the same scheme: the selection xray overlay recolours selected
entities blue and the hovered entity orange (previously both blue). Drops
the now-unused highlight_handles union helper and its cache.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-19 09:33:53 +03:00
1 parent c6b3975fd4
commit e7eeff5945
6 files changed
+134 -60

No files matched your search

-22
View File
@@ -849,7 +849,6 @@ pub struct Scene {
/// Cached `selected ∪ hover` handle set for the GPU xray overlay, keyed by
/// `selection_generation`. Rebuilt only when the selection changes so
/// `build_primitive` doesn't clone the set every frame.
highlight_set_cache: RefCell<Option<(u64, Arc<HashSet<Handle>>)>>,
/// Per-entity tessellation memo for the culled Model render path (Phase
/// 2.2). Maps a top-level handle to its already-tessellated wires so a
/// single-entity edit re-tessellates only the changed entity and reuses the
@@ -928,7 +927,6 @@ impl Scene {
last_model_wire_gen: std::cell::Cell::new(0),
wire_force_nonce: std::cell::Cell::new(0),
split_cache: RefCell::new(None),
highlight_set_cache: RefCell::new(None),
tess_memo: RefCell::new(HashMap::default()),
tess_memo_guard: std::cell::Cell::new(0),
}
@@ -1072,26 +1070,6 @@ impl Scene {
self.selection_generation = self.selection_generation.wrapping_add(1);
}
/// `selected ∪ hover` handles, cached per `selection_generation`. Drives the
/// GPU xray overlay that highlights the current selection without baking it
/// into the wire tessellation.
pub(super) fn highlight_handles(&self) -> Arc<HashSet<Handle>> {
{
let c = self.highlight_set_cache.borrow();
if let Some((gen, arc)) = &*c {
if *gen == self.selection_generation {
return Arc::clone(arc);
}
}
}
let mut hl = self.selected.clone();
if let Some(h) = self.hover_highlight {
hl.insert(h);
}
let arc = Arc::new(hl);
*self.highlight_set_cache.borrow_mut() = Some((self.selection_generation, Arc::clone(&arc)));
arc
}
/// Re-evaluate every cached mesh's color through `render_style` so a
/// Register a Model-tab solid: cache its truck B-rep (for boolean ops) and