New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Editor] Improve Cameracontrol in Editor #1879
[Editor] Improve Cameracontrol in Editor #1879
Conversation
* Change: Remove check for altIsDown
* Change: Use Mousewheel during movement to control the movement speed of the camera
* Change: Do not use basespeed multiplier, to be independent from current movement speed multiplier
@@ -248,7 +261,7 @@ protected void UpdateCameraBase(ref float yaw, ref float pitch, ref Vector3 posi | |||
if (input.isPanning) | |||
{ | |||
float panningSpeed = asOrthographic ? Component.OrthographicSize : revolutionRadius; | |||
panningSpeed *= MouseMoveSpeedFactor * baseSpeed; | |||
panningSpeed *= (MouseMoveSpeedFactor * baseSpeed) / 30f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for this division here? Shouldn't baseSpeed be modified instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention here was to reduce the calculated panning speed (depending on the current movement speed) at a constant fraction to have a better feeling and control. This value was evaluated during testing.
So panning speed should be higher if the movement speed is higher or lower if the movement speed gets lower, too. But not "equal", to not be too fast. Its adapting some fraction of the current choosen movement speed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, since this is called every frame, can you make the division become multiplication instead and extract the constant 1/30 like
const float panningSpeedModifier = 1/30f;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have implemented your mention. Its now a fixed value, which I have predefined, too.
Additionally I have extended the increments a little further and improved the Camera speed settings in the UI.
It now shows the current speedvalue and the Slider is a little wider, to have better control over the extended increments.
Here you can see the changes to the UI :)
I'm done now with all I wanted to do. Hope it is okay now and can be merged :)
* Change: Calculate panningspeed by multiplication & predefine the factor * Change: Add more speed increments * Change: Improve Layout in Sceneview -> Camerasettings (add display of current speed-value and extended sliderbar size, due to more increments)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Last thing - can you put a screenshot of the updated UI in the PR description?
I have now updated the description and added a screenshot showing the difference :) |
PR Details
New: Add possibility to change Camera movement speed while pressing RMB (Scroll Mousewheel Up/Down)
Change: Add more gradations in subdivisions of different movement speeds (not linear)
Change: Improve UI Layout for Cameraspeed Settings in Sceneview and show the current used value
Change: Improve panning speed calculation base on current movement speed
Change: Enable panning while "Alt"-Key is beeing pressed
Needs a mention in the Documentation for the new Navigation Controls?!
-> While pressing RMB it is possible to change the movement speed using the Mousewheel.
Related Issue
Motivation and Context
At the moment it is not possible to change the movement speed of the Scenecamera while navigation around.
To not have to open the camera menu everytime and dragging the slider to the required movement speed, it is now possible to change it "on the fly" by using the RMB and Scrollwheel while moving around.
It can be annoying beeing blocked on panning by holding "Alt"-Key pressed.
For example if just pressed "F"-Key to focus on an object and than not beeing able to pan quickly afterwards, until "Alt"-Key was released.
Types of changes
Checklist