From f8918bc3f7e211322f1142a7b35eca19bff5277c Mon Sep 17 00:00:00 2001 From: originalnicodr Date: Fri, 15 Mar 2024 18:49:01 -0300 Subject: [PATCH] Use the gameplay far clip plane value if the default value is still being used. Also changed the default near clip plane to be bigger, since it seems that having a super small near clip value affects how far the far clip value actually affects the gameworld. --- src/UI/Panels/FreeCamPanel.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 1d39d52..e44adae 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -127,6 +127,15 @@ namespace UnityExplorer.UI.Panels usingGameCamera = true; ourCamera = lastMainCamera; MaybeToggleCinemachine(false); + + // If the farClipPlaneValue is the default one try to use the one from the gameplay camera + if (farClipPlaneValue == 2000){ + farClipPlaneValue = ourCamera.farClipPlane; + farClipPlaneInput.Text = farClipPlaneValue.ToString(); + // Let the default farClipPlane value exceed the slider max value + if (farClipPlaneValue <= farClipPlaneSlider.maxValue) + farClipPlaneSlider.value = farClipPlaneValue; + } } } @@ -316,11 +325,11 @@ namespace UnityExplorer.UI.Panels UpdateClippingPlanes(); }); // Default value - nearClipPlaneValue = 0.001f; + nearClipPlaneValue = 0.1f; nearClipPlaneSlider.m_FillImage.color = Color.clear; nearClipPlaneSlider.minValue = 0.001f; nearClipPlaneSlider.maxValue = 100; - nearClipPlaneSlider.value = nearClipPlaneValue; + nearClipPlaneSlider.value = 0.1f; // doesn't take nearClipPlaneValue for some reason?? AddSpacer(5);