Skip to content

camera: let the mouse wheel zoom in close to the playfield - #647

Merged
freezy merged 1 commit into
masterfrom
fix/orbit-close-zoom
Nov 25, 2026
Merged

freezy merged 1 commit into
masterfrom
fix/orbit-close-zoom

Conversation

@freezy

@freezy freezy commented Nov 25, 2026

Copy link
Copy Markdown
Owner

The player's orbit camera stopped zooming in at half a metre from its pivot, too far away to look at a post or an insert.

  • The mouse wheel now zooms in to 6 cm. The player's near plane is at 1 cm, and its camera poses take a playfield hit closer than 5 cm as the pivot, so a saved close-up restores as it was.
  • The right-drag pan now moves the pivot along the playfield's plane, sloped as at runtime, instead of the screen's. Panning no longer takes the pivot under the playfield, so zooming in afterwards doesn't take the camera through the surface. The pan direction is continuous at any camera pitch.

Tested in the player on an EM test table (3.6° slope). Zooming all the way in leaves the camera 5 cm above the playfield, and an 18 cm rearward pan keeps the pivot exactly on the playfield plane.

Fixes VisualPinball/VisualPinball.Engine.Player#57

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Confidence Score: 4/5 · Fix the minimum zoom distance before merging so the camera reaches the promised 6 cm close-up.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect camera controls within the player experience.

Fix the minimum zoom distance before merging so the camera reaches the promised 6 cm close-up.

Findings

  1. P1 Close zoom stops early ▶

Summary

This PR lowers the camera's minimum zoom distance and makes right-drag pan follow the sloped playfield.

  • The orbit camera can zoom closer to playfield details.
  • Right-drag panning follows the playfield's tilted plane.

Reviews (2) · Last reviewed commit: "camera: let the mouse wheel zoom in clos..." · Reviewed by Greptile

The orbit camera stopped zooming in at half a metre from its pivot, too far
to look at a post or an insert. It now goes in to 6 cm (the player's near
plane is at 1 cm, and its poses take a playfield hit closer than 5 cm as the
pivot).

To keep the pivot on the playfield when zoomed in that close, the right-drag
pan now moves it along the playfield's (sloped) plane instead of the screen's,
so a pan no longer takes it under the playfield and a zoom after it through
the surface.

Fixes VisualPinball/VisualPinball.Engine.Player#57
@freezy
freezy force-pushed the fix/orbit-close-zoom branch from b7d6432 to cc063ce Compare November 25, 2026 21:15
private const float RadiusMin = 0.5f;
// close enough to look at a post or an insert (the player's near plane is at 1 cm), and just past where the
// player still takes a pose's playfield hit as its pivot (5 cm)
private const float RadiusMin = 0.2f;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Close zoom stops early

The mouse wheel still stops at 20 cm, not the 6 cm described in this PR. RadiusMin is used directly as a world-space distance by the zoom clamp and camera placement, so users cannot reach the intended close-up views of posts and inserts. Set it to 0.06f to allow the promised distance.

Suggested change
private const float RadiusMin = 0.2f;
private const float RadiusMin = 0.06f;

@freezy
freezy merged commit 2fe1aae into master Nov 25, 2026
15 checks passed
@freezy
freezy deleted the fix/orbit-close-zoom branch November 25, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant