Repository navigation
camera: let the mouse wheel zoom in close to the playfield - #647
Merged
Merged
Conversation
[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
SummaryThis PR lowers the camera's minimum zoom distance and makes right-drag pan follow the sloped playfield.
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
force-pushed
the
fix/orbit-close-zoom
branch
from
November 25, 2026 21:15
b7d6432 to
cc063ce
Compare
| 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; |
There was a problem hiding this comment.
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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