More camera fixes for the new CameraInput system (#667)

* use new ViewportContext interface to set camera transform on load

* WIP fixes for camera viewport handler callbacks

* disable synchonization with old camera when new camera system is enabled

* further updates to camera-input

* ensure event is signalled when camera transform is set

* updates to ModernViewportCameraController

* fix for right click menu appearing with camera

* updates following review feedback

* convert std:: usage to AZStd::
This commit is contained in:
Tom Hulton-Harrop
2021-05-11 13:38:09 +01:00
committed by GitHub
parent 7b2e19c86e
commit b5e5a3bfee
10 changed files with 144 additions and 82 deletions
@@ -211,6 +211,15 @@ namespace UnitTest
EXPECT_EQ(screenPoint, ScreenPoint(45, 170));
}
TEST(ViewportScreen, ScreenVectorLengthReturned)
{
using AzFramework::ScreenVector;
EXPECT_NEAR(AzFramework::ScreenVectorLength(ScreenVector(1, 1)), 1.41421f, 0.001f);
EXPECT_NEAR(AzFramework::ScreenVectorLength(ScreenVector(3, 4)), 5.0f, 0.001f);
EXPECT_NEAR(AzFramework::ScreenVectorLength(ScreenVector(12, 15)), 19.20937f, 0.001f);
}
TEST(ViewportScreen, CanGetCameraTransformFromCameraViewAndBack)
{
const auto screenDimensions = AZ::Vector2(1024.0f, 768.0f);