Add 'Goto entity' support for the new Editor camera (#743)
* add find entity in viewport functionality to new camera * fix AZ_CVAR usage * updates following review feedback - updated comment styles from /// to //! - retrieve fov of camera (add test for fov access) * update namespace naming, fix AZ_CVAR usage * update missed namespace and use AZ::Transform::CreateLookAt * add missing include * move EditorViewportSettings to EditorLib * update DLL import/export API and rename namespace usage
This commit is contained in:
committed by
GitHub
parent
1c1b34cf76
commit
f4106fe73f
@@ -237,4 +237,23 @@ namespace UnitTest
|
||||
EXPECT_THAT(cameraTransform, IsClose(cameraTransformFromView));
|
||||
EXPECT_THAT(cameraView, IsClose(cameraViewFromTransform));
|
||||
}
|
||||
|
||||
TEST(ViewportScreen, FovCanBeRetrievedFromProjectionMatrix)
|
||||
{
|
||||
using ::testing::FloatNear;
|
||||
|
||||
auto cameraState = AzFramework::CreateIdentityDefaultCamera(AZ::Vector3::CreateZero(), AZ::Vector2(800.0f, 600.0f));
|
||||
|
||||
{
|
||||
const float fovRadians = AZ::DegToRad(45.0f);
|
||||
AzFramework::SetCameraClippingVolume(cameraState, 0.1f, 100.0f, fovRadians);
|
||||
EXPECT_THAT(AzFramework::RetrieveFov(AzFramework::CameraProjection(cameraState)), FloatNear(fovRadians, 0.001f));
|
||||
}
|
||||
|
||||
{
|
||||
const float fovRadians = AZ::DegToRad(90.0f);
|
||||
AzFramework::SetCameraClippingVolume(cameraState, 0.1f, 100.0f, fovRadians);
|
||||
EXPECT_THAT(AzFramework::RetrieveFov(AzFramework::CameraProjection(cameraState)), FloatNear(fovRadians, 0.001f));
|
||||
}
|
||||
}
|
||||
} // namespace UnitTest
|
||||
|
||||
Reference in New Issue
Block a user