Avoid more sources of camera update re-entrancy that can lead to stack overflow (#1136)
This commit is contained in:
committed by
GitHub
parent
34449e2fc9
commit
30eedc1c55
@@ -2887,9 +2887,12 @@ void EditorViewportWidget::UpdateCameraFromViewportContext()
|
|||||||
AZ::Matrix3x4 matrix;
|
AZ::Matrix3x4 matrix;
|
||||||
matrix.SetBasisAndTranslation(cameraState.m_side, cameraState.m_forward, cameraState.m_up, cameraState.m_position);
|
matrix.SetBasisAndTranslation(cameraState.m_side, cameraState.m_forward, cameraState.m_up, cameraState.m_position);
|
||||||
auto m = AZMatrix3x4ToLYMatrix3x4(matrix);
|
auto m = AZMatrix3x4ToLYMatrix3x4(matrix);
|
||||||
|
|
||||||
|
m_updatingCameraPosition = true;
|
||||||
SetViewTM(m);
|
SetViewTM(m);
|
||||||
SetFOV(cameraState.m_fovOrZoom);
|
SetFOV(cameraState.m_fovOrZoom);
|
||||||
m_Camera.SetZRange(cameraState.m_nearClip, cameraState.m_farClip);
|
m_Camera.SetZRange(cameraState.m_nearClip, cameraState.m_farClip);
|
||||||
|
m_updatingCameraPosition = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorViewportWidget::SetAsActiveViewport()
|
void EditorViewportWidget::SetAsActiveViewport()
|
||||||
|
|||||||
@@ -387,6 +387,11 @@ namespace Camera
|
|||||||
|
|
||||||
void CameraComponentController::OnTransformChanged([[maybe_unused]] const AZ::Transform& local, const AZ::Transform& world)
|
void CameraComponentController::OnTransformChanged([[maybe_unused]] const AZ::Transform& local, const AZ::Transform& world)
|
||||||
{
|
{
|
||||||
|
if (m_updatingTransformFromEntity)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_view)
|
if (m_view)
|
||||||
{
|
{
|
||||||
CCamera& camera = m_view->GetCamera();
|
CCamera& camera = m_view->GetCamera();
|
||||||
|
|||||||
Reference in New Issue
Block a user