Skip to content
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

Merged
merged 14 commits into from Oct 7, 2023

Conversation

SVNMLR
Copy link
Contributor

@SVNMLR SVNMLR commented Oct 2, 2023

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
    New_Cameraspeed_UI-Layout

  • 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

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@SVNMLR SVNMLR changed the title Improve Cameracontrol in Editor [Editor] Improve Cameracontrol in Editor Oct 2, 2023
@@ -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;
Copy link
Member

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?

Copy link
Contributor Author

@SVNMLR SVNMLR Oct 3, 2023

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.

Copy link
Member

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;

Copy link
Contributor Author

@SVNMLR SVNMLR Oct 4, 2023

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 :)
Camera_Speedsettings

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)
Copy link
Member

@manio143 manio143 left a 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?

@SVNMLR
Copy link
Contributor Author

SVNMLR commented Oct 5, 2023

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 :)

@manio143 manio143 merged commit b4442c1 into stride3d:master Oct 7, 2023
1 check passed
@SVNMLR SVNMLR deleted the improve-editor-cameracontrol branch October 7, 2023 07:57
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.

None yet

2 participants