_mouse
This commit is contained in:
@@ -155,18 +155,22 @@ namespace FlaxEditor.Viewport
|
|||||||
private float _movementSpeed;
|
private float _movementSpeed;
|
||||||
private float _minMovementSpeed;
|
private float _minMovementSpeed;
|
||||||
private float _maxMovementSpeed;
|
private float _maxMovementSpeed;
|
||||||
|
#if !PLATFORM_SDL
|
||||||
private float _mouseAccelerationScale;
|
private float _mouseAccelerationScale;
|
||||||
private bool _useMouseFiltering;
|
private bool _useMouseFiltering;
|
||||||
private bool _useMouseAcceleration;
|
private bool _useMouseAcceleration;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
|
|
||||||
internal bool _disableInputUpdate;
|
internal bool _disableInputUpdate;
|
||||||
private bool _isControllingMouse, _isViewportControllingMouse, _wasVirtualMouseRightDown, _isVirtualMouseRightDown;
|
private bool _isControllingMouse, _isViewportControllingMouse, _wasVirtualMouseRightDown, _isVirtualMouseRightDown;
|
||||||
private int _deltaFilteringStep;
|
|
||||||
private Float2 _startPos;
|
private Float2 _startPos;
|
||||||
|
#if !PLATFORM_SDL
|
||||||
private Float2 _mouseDeltaLast;
|
private Float2 _mouseDeltaLast;
|
||||||
|
private int _deltaFilteringStep;
|
||||||
private Float2[] _deltaFilteringBuffer = new Float2[FpsCameraFilteringFrames];
|
private Float2[] _deltaFilteringBuffer = new Float2[FpsCameraFilteringFrames];
|
||||||
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The previous input (from the previous update).
|
/// The previous input (from the previous update).
|
||||||
@@ -522,10 +526,11 @@ namespace FlaxEditor.Viewport
|
|||||||
: base(task)
|
: base(task)
|
||||||
{
|
{
|
||||||
_editor = Editor.Instance;
|
_editor = Editor.Instance;
|
||||||
|
#if !PLATFORM_SDL
|
||||||
_mouseAccelerationScale = 0.1f;
|
_mouseAccelerationScale = 0.1f;
|
||||||
_useMouseFiltering = false;
|
_useMouseFiltering = false;
|
||||||
_useMouseAcceleration = false;
|
_useMouseAcceleration = false;
|
||||||
|
#endif
|
||||||
_camera = camera;
|
_camera = camera;
|
||||||
if (_camera != null)
|
if (_camera != null)
|
||||||
_camera.Viewport = this;
|
_camera.Viewport = this;
|
||||||
@@ -1671,7 +1676,7 @@ namespace FlaxEditor.Viewport
|
|||||||
moveDelta *= 4.0f;
|
moveDelta *= 4.0f;
|
||||||
if (_input.IsControlDown)
|
if (_input.IsControlDown)
|
||||||
moveDelta *= 0.3f;
|
moveDelta *= 0.3f;
|
||||||
|
|
||||||
#if PLATFORM_SDL
|
#if PLATFORM_SDL
|
||||||
var mouseDelta = _mouseDelta;
|
var mouseDelta = _mouseDelta;
|
||||||
_mouseDelta = Float2.Zero;
|
_mouseDelta = Float2.Zero;
|
||||||
@@ -1724,9 +1729,7 @@ namespace FlaxEditor.Viewport
|
|||||||
mouseDelta *= 0.1833f * MouseSpeed * _mouseSensitivity;
|
mouseDelta *= 0.1833f * MouseSpeed * _mouseSensitivity;
|
||||||
UpdateView(dt, ref moveDelta, ref mouseDelta, out var centerMouse);
|
UpdateView(dt, ref moveDelta, ref mouseDelta, out var centerMouse);
|
||||||
|
|
||||||
#if PLATFORM_SDL
|
#if !PLATFORM_SDL
|
||||||
#else
|
|
||||||
|
|
||||||
// Move mouse back to the root position
|
// Move mouse back to the root position
|
||||||
if (centerMouse && (_input.IsMouseRightDown || _input.IsMouseLeftDown || _input.IsMouseMiddleDown || _isVirtualMouseRightDown))
|
if (centerMouse && (_input.IsMouseRightDown || _input.IsMouseLeftDown || _input.IsMouseMiddleDown || _isVirtualMouseRightDown))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user