* qtFRED: rotate around the centre of a multi-selection
Rotate Around Object (Alt+R) and the orbit pivot both used the current
object's position, so with several ships marked the camera still
circled whichever one happened to be current. Add
EditorViewport::selectionCenter(), which returns the centroid of the
marked objects when more than one is marked and the given object's
position otherwise, and use it at the three places that chose the
point: the look-at camera update, orbitCameraGetPivot(), and the Alt+R
handler that turns the camera toward the target when the mode is
switched on.
orbitCameraGetPivot() also serves middle-mouse orbit and wheel zoom in
normal mode, so those pivot on the selection centre as well. Every
marked type counts at full weight, including waypoints and jump nodes.
With a single object marked nothing changes.
Fixes#7724
* Make EditorViewport::selectionCenter const
It only reads the marked-object list and the editor's marked count;
clang-tidy (readability-make-member-function-const) flagged it in CI.
* Mirror the multi-selection orbit pivot to FRED, trim comments
FRED gets the same selection_center() as qtFRED's selectionCenter(),
used at the same three places: the look-at camera update, the orbit
pivot, and the Rotate Around Object toggle. Also removes the qtFRED
comments flagged in review.
* Make the selection-center pivot optional and share object bounds
Look-at and orbit use the current object again unless the new option is
on (qtFRED: Preferences > Controls; FRED: View menu), and the selection
center is now the bounding-box midpoint. view_universe in both editors,
the pivot, and qtFRED's selection radius all use get_object_bounds() in
missioneditor/common.
* Reset the cached orbit pivot when the selection-center option changes
Wheel zoom reuses the orbit pivot until the camera moves, so without this
the option only took effect for scrolling after the next camera move.
* Address review: move and rename the selection-centroid option
- FRED: the option moves from the View menu to Settings (and Misc in the
classic layout), under Move Ships When Undocking, with hover help, and is
renamed Rotate Around Selection Centroid.
- qtFRED: the checkbox moves next to Move Ships When Undocking in the
preferences dialog, with the same name.
- setOrbitSelectionCenter only resets the orbit when the value changes.
- get_object_bounds iterates with list_range.
- The bounds test resets the object system with obj_init and takes objects
off the free list, so it leaves a valid state for other tests.
* Rename the option to Selection Midpoint, move it to qtFRED's Controls tab, and document it
* Fix overlapping Appearance rows in qtFRED Preferences, realign a settings line
The last commit renumbered the Viewport label size row of the Appearance
group from 4 to 3, which is the Long list menu style row, so the label
size pair fell out of the layout and its spin box drew over the group
title. Put it back at row 4.
---------
Co-authored-by: Dustinspace217 <[email protected]>
The text labels drawn in the main editor viewport were always rendered at the fixed FONT1 size. Add options to scale the font from 50% to 400%.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
PR #7082 rearranged the FRED2 menu layout to match qtFRED (see issue #6985),
but some users preferred the previous Editors/Misc layout. This adds a
"Classic menu layout" toggle (under Settings in the current layout, and under
Misc in the classic layout) that swaps the whole menu bar on demand. The
choice is persisted to the registry and reapplied on startup.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Implement a spherical-coordinate orbit camera for both the MFC (FRED2)
and Qt (qtFRED) editors, providing intuitive 3D viewport navigation
similar to other 3D editing tools.
Controls:
- Middle mouse drag: orbit rotate around pivot point
- Shift + middle mouse drag: pan the pivot point
- Right mouse drag: orbit rotate (alternative to middle mouse)
- Shift + right mouse drag: pan (alternative to shift + middle mouse)
- Mouse wheel: zoom in/out
- Right click without drag: context menu (preserving existing feature)
Camera pivot selection:
- If an object is selected, orbit around that object
- Otherwise, intersect the camera forward ray with the current grid
plane to find a natural pivot point
- Falls back to grid center if the camera is parallel to the grid
Grid-plane awareness:
- Orbit axes are derived from The_grid->gmatrix using vm_vec_rotate
and vm_vec_unrotate, so the camera orbits correctly on all three
grid planes (XZ, XY, YZ), not just the default XZ plane
- The look-at matrix uses the grid's up vector (uvec) rather than a
hardcoded world-up direction
Robust zoom/pan scaling:
- Zoom uses an exponential formula (powf) so the distance multiplier
is always positive regardless of physics_speed setting (1-500)
- Pan uses a clamped speed factor to avoid excessive movement at high
physics_speed values
State management:
- Keyboard camera movement (process_controls) invalidates orbit state,
so the next mouse drag re-initializes from the current view
- Orbit state is per-viewport in qtFRED (EditorViewport members) and
global in FRED2 (matching existing conventions in each codebase)
Implementation:
- FRED2: orbit math in fredrender.cpp, mouse handlers in fredview.cpp
- qtFRED: orbit math in EditorViewport.cpp, mouse/wheel handlers in
renderwidget.cpp; RenderWindow::event() updated to forward middle
button and wheel events to RenderWidget
Also fix an AND vs OR bug in FRED's process_controls().
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
A few visual improvements requested on Discord:
1. Use a configurable LOD to draw the outline wireframe, defaulting to LOD 1
2. Draw subsystem names with a dark outline to make them more visible
3. Draw the subsystem boundary boxes with thicker lines
* add wing display names
Adds display name capability for wings, matching the pattern and infrastructure of display names for ships. As in #7234, wing display names take precedence over ship display names, if both are provided; because if ship display names took precedence, a ship would have the same display name in every wave.
All the relevant display locations are handled, including the HUD, escort list, message box, and mission log. Lua API support is provided as well.
Adds full support for both FRED and QtFRED, including the always-save-display-names setting.
Addresses #7189 and the last request from #1730.
* add help text from #7234
A ship which has a display name and belongs to a wing will display that name no matter what wave it appears in. Since this should only be done when the mission designer deliberately wants it to be done, omit this case from the cases covered by the "Always save display names" feature. (To always save a display name in this case would require saving one for the wing, but a wing display name feature does not yet exist.)
Fixes#7140. Followup to #6810.
When a mission is loaded in FRED the "immobile" flag is migrated to "don't-change-position" and "don't-change-orientation". So, notify the FREDder that this is happening, and add checks to the "potential issues" checker to guard against mixing the old and new flags.
Follow-up to #6304. Resolves#6489.