From 8a0dad9b39cea8a776b06c802dd7d8ffa325d569 Mon Sep 17 00:00:00 2001 From: Emmanuel AYME Date: Fri, 26 Dec 2025 19:18:25 +0100 Subject: [PATCH] Add camera transition smoothness --- The Callisto Protocol/dllmain.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/The Callisto Protocol/dllmain.cpp b/The Callisto Protocol/dllmain.cpp index 925e7ce..44d85e4 100644 --- a/The Callisto Protocol/dllmain.cpp +++ b/The Callisto Protocol/dllmain.cpp @@ -40,6 +40,7 @@ static bool g_WorldTimeDilation_fix_enabled = false; static int g_AdditionalFOVValue = 0; static int g_CameraOffset = 0; static float g_WorldTimeDilationValue = 1.f; +static float g_CameraSmoothnessValue = 3.5f; static float g_TransitionCameraOffset = 0.f; static float g_NativeCameraDistance = 80.f; static float g_LastCameraDeltaTime = 1.f / 60.f; // fallback @@ -288,6 +289,11 @@ extern "C" __declspec(dllexport) void SetWorldTimeDilation(float timeDilation) { g_WorldTimeDilationValue = timeDilation; } +extern "C" __declspec(dllexport) void SetCameraSmoothness(float smoothness) { + g_CameraSmoothnessValue = smoothness; +} + + // Getters for Reshade addon call extern "C" __declspec(dllexport) void GetGameInfos(GameInfos* infos) { if (!infos) return; @@ -501,16 +507,16 @@ static void CameraFixEnabled() { } float dt = g_LastCameraDeltaTime; - float fadeInSpeed = 3.5f; // Camera speed when it's getting closer - float fadeOutSpeed = 3.5f; // Camera speed when it moves away + float fadeInSpeed = g_CameraSmoothnessValue; // Camera speed when it's getting closer + float fadeOutSpeed = g_CameraSmoothnessValue; // Camera speed when it moves away // sécurité if (dt <= 0.f || dt > 0.1f) dt = 1.f / 60.f; - float targetOffset = (bIsInPrinterMode || bIsInCinematicMode || bIsAiming) ? - g_NativeCameraDistance : // Minimum offset - (float)g_CameraOffset; // User offset + float targetOffset = g_CameraOffset; + if (bIsInCinematicMode || bIsAiming) targetOffset = g_NativeCameraDistance; if (bIsInventoryOpen) targetOffset = INVENTORY_CAM_OFFSET; - if (bIsInPrinterMode) targetOffset = FORGE_CAM_OFFSET; + else if (bIsInPrinterMode) targetOffset = FORGE_CAM_OFFSET; + float interpSpeed = (targetOffset < g_TransitionCameraOffset) ? fadeInSpeed : fadeOutSpeed; g_TransitionCameraOffset = UKismetMathLibrary::FInterpTo(g_TransitionCameraOffset,