[Editor][3D] Fix panning, orbiting, and freelook - #123109
Open
adamscott wants to merge 1 commit into
Open
Conversation
adamscott
force-pushed
the
revamp-3d-editor-view-3d-controller
branch
from
September 2, 2026 15:26
e42fc33 to
f5d106e
Compare
adamscott
force-pushed
the
revamp-3d-editor-view-3d-controller
branch
from
September 2, 2026 16:20
f5d106e to
52e9987
Compare
Member
Author
|
Removed the "breaks compat" tag due to the added automatic conversion. |
adamscott
force-pushed
the
revamp-3d-editor-view-3d-controller
branch
from
September 2, 2026 16:24
52e9987 to
a3d19bd
Compare
Mickeon
reviewed
Sep 2, 2026
|
@adamscott |
adamscott
force-pushed
the
revamp-3d-editor-view-3d-controller
branch
3 times, most recently
from
September 3, 2026 18:58
074eded to
bbdc0a9
Compare
Member
Author
|
As suggested by @Mickeon, instead of using And as it was just a few number of lines, I also renamed |
Also: - Rename `editor/3d/navigation_feel/translation_inertia` to `editor/3d/navigation_feel/pan_inertia`
adamscott
force-pushed
the
revamp-3d-editor-view-3d-controller
branch
from
September 3, 2026 19:02
bbdc0a9 to
7ef25ec
Compare
adamscott
commented
Sep 3, 2026
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.

What problem(s) does this PR solve?
Additional information
This PR fixes the pan, orbit, and freelook features of the 3D editor by relying on real distances travelled by the mouse. By projecting the relative motion in 3D (based on the camera distance from the cursor (i.e. the target of the camera)), we can get the real distance travelled by the mouse without the need of an approximation of speed/radians per pixel.
Warning
It removes 3 editor parameters and adds 3 back. It is due to the fact that the "sensitivity" properties were in fact
m/pixelfor the pan and°/pixelfor orbit and freelook. Also, the default values of these parameters were not1. The new factor properties are simple multipliers and are all defaulting to1.Removes:
editors/3d/navigation_feel/orbit_sensitivityeditors/3d/navigation_feel/translation_sensitivityeditors/3d/freelook/freelook_sensitivityAdds:
editors/3d/navigation_feel/orbit_factoreditors/3d/navigation_feel/translation_factoreditors/3d/freelook/freelook_factorEdit: I added an automatic conversion based on the ratio of the current value and the default value.
My solution even has the bonus to be natively 100% compatible with funky FOV values without any need of any hacks (as it was needed previously), as shown below.
funky_fovs.webm
(If you don't recognize the view settings popup, don't worry. This is my WIP to update the popup, it is NOT included in this PR.)
How does it work?
Pan
For the pan, the negative of the difference between the final position of the mouse and the start position is applied to the position of the cursor.
Orbit
For the orbit, this PR use the linear distance travelled by the mouse as the length of an arc. That arc length is then used to find the actual equivalent radians for an arc in a circle that has a radius of the camera distance from the cursor.
On the left, the movement made by the user on the screen translates to two 3D positions. By calculating the length of it, we can calculate the angle of rotation.
Freelook
For the freelook, it's essentially the same calculation of the orbit.
Preview
Pan
pr_100_pan_small.webm
pr_100_pan_large.webm
pr_200_pan.webm
Orbit
pr_100_orbit_small.webm
pr_100_orbit_large.webm
pr_200_orbit.webm
Freelook
pr_100_freelook_small.webm
pr_100_freelook_large.webm
pr_200_freelook.webm
Todo