Improve camera panning

* add camera panning speed option to camera settings context menu
* add relative panning speed based on distance to camera target to camera settings context menu
* add relative panning option to camera settings context menu

* fix float comparisons
* remove invert panning entry from view widget
* remove unused show/hide method for camera widget
This commit is contained in:
Christopher Rothert
2023-10-04 21:05:21 +02:00
parent 3dcd1a5ffb
commit 67536f04e9
2 changed files with 74 additions and 42 deletions

View File

@@ -259,7 +259,10 @@ namespace FlaxEditor.Viewport.Cameras
// Pan
if (input.IsPanning)
{
var panningSpeed = 0.8f;
var panningSpeed = (Viewport.RelativePanning)
? Mathf.Abs((position - TargetPoint).Length) * 0.005f
: Viewport.PanningSpeed;
if (Viewport.InvertPanning)
{
position += up * (mouseDelta.Y * panningSpeed);