r.CameraShakeDebug.Location
r.CameraShakeDebug.Location
#Overview
name: r.CameraShakeDebug.Location
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to show camera shakes\' location modifications (defaults to true)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.CameraShakeDebug.Location is to control the debugging output for camera shake location modifications in Unreal Engine 5. This setting variable is part of the camera system, specifically for debugging camera shakes.
This setting variable is primarily used in the Engine module, specifically within the camera shake debugging functionality. Based on the callsites, it’s utilized in the CameraModifier_CameraShake.cpp file, which is part of the camera system in Unreal Engine.
The value of this variable is set through a console variable (CVar) named GShowCameraShakeDebugLocationCVar. It’s initialized with a default value of true, meaning camera shake location debug information is displayed by default.
This variable interacts with another console variable, GShowCameraShakeDebugCVar, which controls the overall camera shake debugging. The location debug output is only shown when both GShowCameraShakeDebugCVar and GShowCameraShakeDebugLocationCVar are true.
Developers should be aware that this variable is specifically for debugging purposes and requires the “showdebug CAMERA” command to be active to see the debug information. It’s not meant for use in production builds but rather for development and troubleshooting camera shake issues.
Best practices when using this variable include:
- Use it in conjunction with “showdebug CAMERA” command for comprehensive camera debugging.
- Be aware that enabling this debug output may have a performance impact, so it should be used judiciously.
- Remember to disable it in production builds to avoid unnecessary overhead.
Regarding the associated variable GShowCameraShakeDebugLocationCVar:
This is the actual console variable that controls the r.CameraShakeDebug.Location setting. It’s a boolean variable that determines whether to show camera shakes’ location modifications.
The purpose of GShowCameraShakeDebugLocationCVar is to provide a programmatic way to control the debug output for camera shake location modifications. It’s used in the DisplayDebugGraphs function of the UCameraModifier_CameraShake class to determine whether to record and display location debug data.
This variable is set when the game initializes and can be changed at runtime through console commands. It interacts with GShowCameraShakeDebugCVar to determine the final output of debug information.
Developers should be aware that this variable is part of the internal implementation of the camera shake debug system. While it can be accessed directly in code, it’s generally better to use the console command “r.CameraShakeDebug.Location” to modify its value during runtime for debugging purposes.
Best practices for using GShowCameraShakeDebugLocationCVar include:
- Use it in conjunction with GShowCameraShakeDebugCVar for full control over camera shake debugging.
- Be cautious about modifying its value directly in code, as it’s primarily intended to be controlled via console commands.
- Consider the performance implications of leaving it enabled, especially in non-development builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:26
Scope: file
Source code excerpt:
TEXT("Show extra debug info for camera shakes (requires `showdebug CAMERA`)"));
TAutoConsoleVariable<bool> GShowCameraShakeDebugLocationCVar(
TEXT("r.CameraShakeDebug.Location"),
true,
TEXT("Whether to show camera shakes' location modifications (defaults to true)"));
TAutoConsoleVariable<bool> GShowCameraShakeDebugRotationCVar(
TEXT("r.CameraShakeDebug.Rotation"),
true,
TEXT("Whether to show camera shakes' rotation modifications (defaults to true)"));
#Associated Variable and Callsites
This variable is associated with another variable named GShowCameraShakeDebugLocationCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:25
Scope: file
Source code excerpt:
false,
TEXT("Show extra debug info for camera shakes (requires `showdebug CAMERA`)"));
TAutoConsoleVariable<bool> GShowCameraShakeDebugLocationCVar(
TEXT("r.CameraShakeDebug.Location"),
true,
TEXT("Whether to show camera shakes' location modifications (defaults to true)"));
TAutoConsoleVariable<bool> GShowCameraShakeDebugRotationCVar(
TEXT("r.CameraShakeDebug.Rotation"),
true,
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:571
Scope (from outer to inner):
file
function void UCameraModifier_CameraShake::DisplayDebugGraphs
Source code excerpt:
// See if we should be recording and display shake data.
const bool bShowLocationDebug = GShowCameraShakeDebugCVar.GetValueOnGameThread() &&
GShowCameraShakeDebugLocationCVar.GetValueOnGameThread();
const bool bShowRotationDebug = GShowCameraShakeDebugCVar.GetValueOnGameThread() &&
GShowCameraShakeDebugRotationCVar.GetValueOnGameThread();
bRecordDebugData = bShowLocationDebug || bShowRotationDebug;
if (!bRecordDebugData)
{