Common 3D Navigation and Settings for the Editor Viewport#10439
Open
FabiPhun wants to merge 13 commits intoFacepunch:masterfrom
Open
Common 3D Navigation and Settings for the Editor Viewport#10439FabiPhun wants to merge 13 commits intoFacepunch:masterfrom
FabiPhun wants to merge 13 commits intoFacepunch:masterfrom
Conversation
- rewrote CameraOrbit logic - moved panning from FirstPersonCamera to CameraOrbit - changed logic within SceneViewportWidget / PageSceneView / EditorPreferences to adjust for new SceneEditorExtension changes
- final code clean-up - fixed a issue where when the raycast within zoom didn't hit anything, it used the world origin as the reference point instead of the last hit performed by either orbit/zoom or pan
…n/sbox-public into ImprovedViewportControls
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.
Pull Request
Thanks for contributing to s&box ❤️
Please fill out the sections below to help us review your change efficiently.
Summary
Rewrote the 3D Viewport Navigation within the S&box editor, to be closely resembling common 3D Software while keeping the "WASD" and camera "look around" functionality (flying camera in short) fully functional.Motivation & Context
I have posted a feature request on the S&box GitHub discussing the poor navigation.Having talked to other members on the S&box Discord, people seemed quite enthused with the idea of a navigation experience resembling most common 3D Software, I therefore created a JS prototype within a week as a proof of concept.
Fixes:
Implementation Details
Files edited:
Works in both Perspective and Orthographic Views
Point Specific Navigation
A ray is shot from mousePos/Screenspace, when it hits something it uses the distance and position to change the zoom speed, the point around which the camera orbits and it gives the pan the necessary data to stick the point where the user clicked to the mouse cursor ( includes FOV calculations' ).
SceneViewportWidget.cs
I had quite the fight with some of the specific exception logic and errors while adapting the new Inputs - I did some hacks here and there and would recommend the FP to find a new approach to using exceptions and Inputs within the viewport.
Navigation Styles
I added the option for Software specific Navigation Styles instead of just one set style, the reasoning here is so anyone can use their favorite Style of Navigation.
Screenshots / Videos (if applicable)
Showcase Video:
https://github.com/user-attachments/assets/fe579fe6-38bc-4a66-978f-1213164f0b44
Settings Screenshot:

Pull Request
##Checklist