Fix several viewport issues (#1045)

* Fix some FOV calculation viewport issues:
-Avoid calculating FOV if we've got an invalid viewport
-Don't override game mode FOV, let the active camera components manage it instead

* Fix viewport font positioning

This updates code in a few places to respect an API change/fix made to AtomFont - also switched the default value of m_virtual800x600ScreenSize to false as it's really behavior you want to opt into

* Don't activate CameraComponentController when in the Editor / not in game mode
This commit is contained in:
Nicholas Van Sickle
2021-06-01 12:20:15 -07:00
committed by GitHub
parent 853cf291be
commit 087677b326
6 changed files with 28 additions and 29 deletions
@@ -34,20 +34,9 @@ namespace Camera
auto controllerConfig = m_controller.GetConfiguration();
controllerConfig.m_editorEntityId = GetEntityId().operator AZ::u64();
// The Editor manages active camera state, so while we're in Editor we explicitly
// disable the request to make this the active view at edit component activation time.
bool prevShouldActivateViewOnActivation = controllerConfig.m_makeActiveViewOnActivation;
controllerConfig.m_makeActiveViewOnActivation = false;
m_controller.SetConfiguration(controllerConfig);
// Call base class activate, which in turn calls Activate on our controller.
EditorCameraComponentBase::Activate();
// Reset the original `m_makeActiveViewOnActivation' setting, so that the intended value is serialized, used in BuildGameEntity, etc.
controllerConfig.m_makeActiveViewOnActivation = prevShouldActivateViewOnActivation;
m_controller.SetConfiguration(controllerConfig);
AzFramework::EntityDebugDisplayEventBus::Handler::BusConnect(GetEntityId());
EditorCameraNotificationBus::Handler::BusConnect();
EditorCameraViewRequestBus::Handler::BusConnect(GetEntityId());