Skip to content

Pick the prefab hover ghost from draft geometry - #1377

Merged
saworbit merged 1 commit into
mainfrom
fix/prefab-hover-draft-pick
Oct 21, 2026
Merged

saworbit merged 1 commit into
mainfrom
fix/prefab-hover-draft-pick

Conversation

@saworbit

Copy link
Copy Markdown
Owner

The prefab hover ghost cast a physics ray, and draft brushes and entities have no body, so over a placed copy the ray met nothing and the ghost was hidden on every motion.

  • The ghost now starts from the face the Select tool's hover outline already picks, so a motion walks the brushes once. HFBrushSystem.update_hover() returns that face.
  • The click pick's entity pass is split out as pick_node_past_face(), and the click and the ghost both use it, so the nearest piece wins and a plain brush or entity in front of a copy hides the ghost.
  • HFPrefabOverlay.update_hover() hides at once in a level with no copies, and runs the entity pass only when the brush under the pointer is a piece or some copy holds an entity.
  • clear_hover() hides the ghost too, so it shows with the Select tool and goes when you switch tools. The physics-ray update_prefab_hover is gone.

Cost, measured at 3,025 brushes and 300 entities: the face pick (18 to 24 ms) was already paid by the outline on every Select motion. The ghost adds nothing in a level with no copies. It adds the entity pass (about 12 ms) only over a piece or when a copy holds an entity.

Tests: five hover tests in test_prefab_enhancements.gd on draft geometry with no StaticBody3D (over nothing, over a brush in no copy, nearest wins, entity-only copy, entity in front, clear). One test through the real plugin in test_picking_correctness.gd (Select motion ghosts, Draw motion clears). All fail on main. test_prefab_enhancements 38/38, test_picking_correctness 19/19, plus the pointer, gesture, drop and selection scripts.

Fixes #1363

@saworbit
saworbit enabled auto-merge (squash) October 21, 2026 00:12
@github-actions github-actions Bot added area: build Brushes, drawing, vertex/edge editing (Build tab) area: objects Entities, prefabs, I/O wiring (Objects tab) area: architecture Subsystem structure, decomposition, code quality area: docs README, guides, spec, roadmap, changelog tests The GUT suite and its fixtures labels Oct 21, 2026
@saworbit
saworbit merged commit 0b51117 into main Oct 21, 2026
11 checks passed
@saworbit
saworbit deleted the fix/prefab-hover-draft-pick branch October 21, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: architecture Subsystem structure, decomposition, code quality area: build Brushes, drawing, vertex/edge editing (Build tab) area: docs README, guides, spec, roadmap, changelog area: objects Entities, prefabs, I/O wiring (Objects tab) tests The GUT suite and its fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Prefabs] The hover overlay never shows over draft geometry

1 participant