Merge branch 'invert-y-rot' of https://github.com/Tryibion/FlaxEngine into Tryibion-invert-y-rot

This commit is contained in:
Wojtek Figat
2024-08-21 22:37:02 +02:00
2 changed files with 9 additions and 0 deletions

View File

@@ -24,6 +24,13 @@ namespace FlaxEditor.Options
[DefaultValue(1.0f), Limit(0.01f, 100.0f)] [DefaultValue(1.0f), Limit(0.01f, 100.0f)]
[EditorDisplay("General"), EditorOrder(101), Tooltip("The mouse wheel sensitivity applied to zoom in orthographic mode.")] [EditorDisplay("General"), EditorOrder(101), Tooltip("The mouse wheel sensitivity applied to zoom in orthographic mode.")]
public float MouseWheelSensitivity { get; set; } = 1.0f; public float MouseWheelSensitivity { get; set; } = 1.0f;
/// <summary>
/// Gets or sets whether to invert the Y rotation of the mouse in the editor viewport.
/// </summary>
[DefaultValue(false)]
[EditorDisplay("General"), EditorOrder(102), Tooltip("Whether to invert the Y rotation of the mouse in the editor viewport.")]
public bool InvertMouseYAxisRotation { get; set; } = false;
/// <summary> /// <summary>
/// Gets or sets the total amount of steps the camera needs to go from minimum to maximum speed. /// Gets or sets the total amount of steps the camera needs to go from minimum to maximum speed.

View File

@@ -1720,6 +1720,8 @@ namespace FlaxEditor.Viewport
// Update // Update
moveDelta *= dt * (60.0f * 4.0f); moveDelta *= dt * (60.0f * 4.0f);
mouseDelta *= 0.1833f * MouseSpeed * _mouseSensitivity; mouseDelta *= 0.1833f * MouseSpeed * _mouseSensitivity;
if (options.Viewport.InvertMouseYAxisRotation)
mouseDelta *= new Float2(1, -1);
UpdateView(dt, ref moveDelta, ref mouseDelta, out var centerMouse); UpdateView(dt, ref moveDelta, ref mouseDelta, out var centerMouse);
// Move mouse back to the root position // Move mouse back to the root position