Remove Cry -> Atom camera sync. (#2047)
Signed-off-by: nvsickle <nvsickle@amazon.com>
This commit is contained in:
committed by
GitHub
parent
0d82c1e670
commit
8eb8088a36
@@ -463,25 +463,7 @@ void EditorViewportWidget::Update()
|
||||
SetFOV(cameraState.m_fovOrZoom);
|
||||
m_Camera.SetZRange(cameraState.m_nearClip, cameraState.m_farClip);
|
||||
}
|
||||
else if (!ed_useNewCameraSystem)
|
||||
{
|
||||
m_renderViewport->GetViewportContext()->SetCameraTransform(LYTransformToAZTransform(m_Camera.GetMatrix()));
|
||||
}
|
||||
|
||||
// Don't override the game mode FOV
|
||||
if (!GetIEditor()->IsInGameMode())
|
||||
{
|
||||
AZ::Matrix4x4 clipMatrix;
|
||||
AZ::MakePerspectiveFovMatrixRH(
|
||||
clipMatrix,
|
||||
GetFOV(),
|
||||
aznumeric_cast<float>(width()) / aznumeric_cast<float>(height()),
|
||||
m_Camera.GetNearPlane(),
|
||||
m_Camera.GetFarPlane(),
|
||||
true
|
||||
);
|
||||
m_renderViewport->GetViewportContext()->SetCameraProjectionMatrix(clipMatrix);
|
||||
}
|
||||
// Reset the camera update flag now that we're finished updating our viewport context
|
||||
m_updateCameraPositionNextTick = false;
|
||||
|
||||
@@ -637,7 +619,6 @@ void EditorViewportWidget::SetViewEntity(const AZ::EntityId& viewEntityId, bool
|
||||
void EditorViewportWidget::ResetToViewSourceType(const ViewSourceType& viewSourceType)
|
||||
{
|
||||
LockCameraMovement(true);
|
||||
m_pCameraFOVVariable = nullptr;
|
||||
m_viewEntityId.SetInvalid();
|
||||
m_cameraObjectId = GUID_NULL;
|
||||
m_viewSourceType = viewSourceType;
|
||||
@@ -2416,13 +2397,26 @@ void EditorViewportWidget::CenterOnSliceInstance()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void EditorViewportWidget::SetFOV(float fov)
|
||||
{
|
||||
if (m_pCameraFOVVariable)
|
||||
if (m_viewEntityId.IsValid())
|
||||
{
|
||||
m_pCameraFOVVariable->Set(fov);
|
||||
Camera::CameraRequestBus::Event(m_viewEntityId, &Camera::CameraComponentRequests::SetFov, AZ::RadToDeg(fov));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_camFOV = fov;
|
||||
// Set the active camera's FOV
|
||||
{
|
||||
AZ::Matrix4x4 clipMatrix;
|
||||
AZ::MakePerspectiveFovMatrixRH(
|
||||
clipMatrix,
|
||||
GetFOV(),
|
||||
aznumeric_cast<float>(width()) / aznumeric_cast<float>(height()),
|
||||
m_Camera.GetNearPlane(),
|
||||
m_Camera.GetFarPlane(),
|
||||
true
|
||||
);
|
||||
m_renderViewport->GetViewportContext()->SetCameraProjectionMatrix(clipMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_viewPane)
|
||||
@@ -2449,13 +2443,7 @@ float EditorViewportWidget::GetFOV() const
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pCameraFOVVariable)
|
||||
{
|
||||
float fov;
|
||||
m_pCameraFOVVariable->Get(fov);
|
||||
return fov;
|
||||
}
|
||||
else if (m_viewEntityId.IsValid())
|
||||
if (m_viewEntityId.IsValid())
|
||||
{
|
||||
float fov = AZ::RadToDeg(m_camFOV);
|
||||
Camera::CameraRequestBus::EventResult(fov, m_viewEntityId, &Camera::CameraComponentRequests::GetFov);
|
||||
|
||||
Reference in New Issue
Block a user