HUD edit: mouse-wheel zoom of the HUD layer (find off-screen HUDs, fine editing) #413

Closed
opened 2026-10-05 07:48:54 +00:00 by sky_line · 0 comments
Owner

In other viewers, when you edit a HUD attachment (build mode with a HUD object selected), the mouse wheel zooms the HUD layer in and out. That lets you work on small HUD details, and zoom out to find HUD objects that sit off screen (a common problem after attaching a HUD that saves its position off the edge, or switching screen aspect ratio). Slipstream needs this.

What's already in the code

  • The input side exists. LLAgentCamera::cameraZoomIn (llagentcamera.cpp ~1047) checks inBuildMode() && selection is SELECT_TYPE_HUD and updates mHUDTargetZoom instead of the camera. getAgentHUDTargetZoom() (~883) and the reset at ~386 exist too.
  • The animation step is missing. Nothing moves mHUDCurZoom toward mHUDTargetZoom; the only assignment is its initialisation. LL's per-frame lerp seems to have gone with the GL display code. Everything that reads the current zoom therefore always sees 1.0:
    • get_hud_matrices (llviewerdisplay.cpp ~385)
    • the manipulators (llmaniptranslate.cpp, llmanipscale.cpp, llmanip.cpp)
    • altoolalign.cpp
  • Check the Vulkan HUD pass. Confirm whether it uses get_hud_matrices or its own HUD projection. If it builds its own, it must apply the zoom (and the pick / hover / manipulator projections must match it).

Do

  1. Smoothing: restore the per-frame smoothing of mHUDCurZoom toward the HUD target zoom (an LL-style lerp), and reset it when leaving HUD edit.
  2. One projection everywhere: the zoom must apply to the HUD render pass, HUD picking (selecting HUD prims), the manipulator gizmos and the selection highlight, so they all agree.
  3. Limits and reset:
    • Zoom out far enough to bring off-screen HUDs into view, e.g. down to ~0.1x.
    • Zoom in for fine work, e.g. up to ~10x.
    • Reset with Esc / Reset View, as other viewers do.
  4. Optionally keep the zoom centred on the cursor or the selection rather than the screen centre (check what Firestorm does).

Test

  • Attach a HUD, edit it, and scroll: the HUD scales smoothly.
  • Selection, wireframe and gizmos follow the zoom, and clicking HUD prims selects the right one at every zoom level.
  • Move a HUD prim partly off screen, zoom out, drag it back.
  • Leaving edit restores the normal HUD scale.
In other viewers, when you edit a HUD attachment (build mode with a HUD object selected), the **mouse wheel zooms the HUD layer in and out**. That lets you work on small HUD details, and zoom out to find HUD objects that sit off screen (a common problem after attaching a HUD that saves its position off the edge, or switching screen aspect ratio). Slipstream needs this. ## What's already in the code - **The input side exists.** `LLAgentCamera::cameraZoomIn` (`llagentcamera.cpp` ~1047) checks `inBuildMode() && selection is SELECT_TYPE_HUD` and updates `mHUDTargetZoom` instead of the camera. `getAgentHUDTargetZoom()` (~883) and the reset at ~386 exist too. - **The animation step is missing.** Nothing moves `mHUDCurZoom` toward `mHUDTargetZoom`; the only assignment is its initialisation. LL's per-frame lerp seems to have gone with the GL display code. Everything that reads the current zoom therefore always sees 1.0: - `get_hud_matrices` (`llviewerdisplay.cpp` ~385) - the manipulators (`llmaniptranslate.cpp`, `llmanipscale.cpp`, `llmanip.cpp`) - `altoolalign.cpp` - **Check the Vulkan HUD pass.** Confirm whether it uses `get_hud_matrices` or its own HUD projection. If it builds its own, it must apply the zoom (and the pick / hover / manipulator projections must match it). ## Do 1. **Smoothing:** restore the per-frame smoothing of `mHUDCurZoom` toward the HUD target zoom (an LL-style lerp), and reset it when leaving HUD edit. 2. **One projection everywhere:** the zoom must apply to the HUD render pass, HUD picking (selecting HUD prims), the manipulator gizmos and the selection highlight, so they all agree. 3. **Limits and reset:** - **Zoom out** far enough to bring off-screen HUDs into view, e.g. down to ~0.1x. - **Zoom in** for fine work, e.g. up to ~10x. - **Reset** with Esc / Reset View, as other viewers do. 4. **Optionally** keep the zoom centred on the cursor or the selection rather than the screen centre (check what Firestorm does). ## Test - Attach a HUD, edit it, and scroll: the HUD scales smoothly. - Selection, wireframe and gizmos follow the zoom, and clicking HUD prims selects the right one at every zoom level. - Move a HUD prim partly off screen, zoom out, drag it back. - Leaving edit restores the normal HUD scale.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#413
No description provided.