Fix issue with mouse input for viewport camera (#3210)

* fix for drift accumulating in the viewport camera

Signed-off-by: hultonha <hultonha@amazon.co.uk>

* fix typo and update how events are stored

Signed-off-by: hultonha <hultonha@amazon.co.uk>

* respond to PR feedback and fix linux and windows build issues

Signed-off-by: hultonha <hultonha@amazon.co.uk>

* fix failing unit tests in camera input

Signed-off-by: hultonha <hultonha@amazon.co.uk>
This commit is contained in:
hultonha
2021-08-19 09:06:24 +01:00
committed by GitHub
parent 586678a5f9
commit 80e08dd947
18 changed files with 538 additions and 134 deletions
@@ -0,0 +1,41 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzFramework/Windowing/WindowBus.h>
#include <gmock/gmock.h>
namespace UnitTest
{
class MockWindowRequests : public AzFramework::WindowRequestBus::Handler
{
public:
void Connect(AzFramework::NativeWindowHandle handle)
{
AzFramework::WindowRequestBus::Handler::BusConnect(handle);
}
void Disconnect()
{
AzFramework::WindowRequestBus::Handler::BusDisconnect();
}
// AzFramework::WindowRequestBus overrides ...
MOCK_METHOD1(SetWindowTitle, void(const AZStd::string&));
MOCK_CONST_METHOD0(GetClientAreaSize, AzFramework::WindowSize());
MOCK_METHOD1(ResizeClientArea, void(AzFramework::WindowSize clientAreaSize));
MOCK_CONST_METHOD0(GetFullScreenState, bool());
MOCK_METHOD1(SetFullScreenState, void(bool));
MOCK_CONST_METHOD0(CanToggleFullScreenState, bool());
MOCK_METHOD0(ToggleFullScreenState, void());
MOCK_CONST_METHOD0(GetDpiScaleFactor, float());
MOCK_CONST_METHOD0(GetSyncInterval, uint32_t());
MOCK_CONST_METHOD0(GetDisplayRefreshRate, uint32_t());
};
} // namespace UnitTest