feat(ucs): interactive UCS icon with origin-snap grips, world-fixed compass

The UCS icon now anchors to the projected UCS origin when it is on-screen
(falling back to the bottom-left corner), and becomes a selectable object:
hover highlights it, a click shows draggable grips, and dragging the origin
grip relocates the UCS while the X/Y tip grips rotate it. Drags snap to
geometry/grid through the existing snapper, and the new UCS is persisted on
release. The icon stays selectable while parked in the corner.

Also make the ViewCube compass (N/E/S/W) world-fixed: the cube body still
reorients with the active UCS, but the cardinals project through a camera-only
rotation and snap in world frame, so the directions no longer spin with the UCS.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-27 01:12:45 +03:00
1 parent a502379048
commit edcf24e324
10 files changed
+525 -41

No files matched your search

+10
View File
@@ -176,6 +176,16 @@ impl DocumentTab {
super::helpers::UcsXform::from_active(self.active_ucs.as_ref())
}
/// World-space UCS origin in full f64 precision (stored f64 in the header /
/// viewport). Used to anchor the UCS icon and as the cursor-pick plane point
/// — `UcsXform`'s origin is f32 and would quantize the anchor at UTM scale.
pub(super) fn ucs_origin_world(&self) -> glam::DVec3 {
self.active_ucs
.as_ref()
.map(|u| glam::dvec3(u.origin.x, u.origin.y, u.origin.z))
.unwrap_or(glam::DVec3::ZERO)
}
/// True when the active pane edits **model-space** geometry: the Model tab,
/// or inside a floating viewport (MSPACE). The UCS applies in both; plain
/// paper space (no active viewport) is excluded. Single predicate so every