r.CameraShakeDebug.Rotation
r.CameraShakeDebug.Rotation
#Overview
name: r.CameraShakeDebug.Rotation
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to show camera shakes\' rotation modifications (defaults to true)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.CameraShakeDebug.Rotation is to control the debug visualization of camera shake rotation modifications in Unreal Engine 5. This setting is part of the camera system’s debugging features.
-
This setting variable is primarily used by the camera system, specifically for debugging camera shake effects. It is part of the Engine module, as evident from its location in the Engine/Source/Runtime/Engine directory.
-
The Unreal Engine camera system, particularly the camera shake functionality, relies on this setting variable. It is used in conjunction with other debug variables to control what aspects of camera shake are visualized for debugging purposes.
-
The value of this variable is set through a console command. It’s initialized with a default value of true in the C++ code, but can be changed at runtime using the console command “r.CameraShakeDebug.Rotation”.
-
This variable interacts with other debug variables, notably GShowCameraShakeDebugCVar and GShowCameraShakeDebugLocationCVar. These variables work together to determine what aspects of camera shake (rotation, location, or both) should be visualized for debugging.
-
Developers should be aware that this is a debugging tool and should be used primarily during development and testing. It may have performance implications if left enabled in a shipping build.
-
Best practices for using this variable include:
- Use it in conjunction with other camera shake debug variables for a comprehensive view of camera shake effects.
- Remember to disable it in shipping builds to avoid any potential performance impact.
- Use it when fine-tuning camera shake effects to visualize how rotation modifications are applied.
Regarding the associated variable GShowCameraShakeDebugRotationCVar:
The purpose of GShowCameraShakeDebugRotationCVar is to serve as the C++ representation of the r.CameraShakeDebug.Rotation console variable. It allows the C++ code to access and modify the value of this debug setting.
-
This variable is used internally by the camera system to check the current state of the rotation debug visualization setting.
-
It’s part of the same Engine module and camera shake debugging system as r.CameraShakeDebug.Rotation.
-
The value of this variable is set automatically by the console variable system when r.CameraShakeDebug.Rotation is modified.
-
It interacts directly with r.CameraShakeDebug.Rotation, essentially serving as its in-code counterpart.
-
Developers should be aware that this is an internal variable and should generally interact with r.CameraShakeDebug.Rotation instead of directly manipulating GShowCameraShakeDebugRotationCVar.
-
Best practices include:
- Use the console command to modify the debug setting rather than directly changing this variable.
- When reading the value in code, use the GetValueOnGameThread() method to ensure thread-safe access.
#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:30
Scope: file
Source code excerpt:
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)"));
TAutoConsoleVariable<bool> GCameraShakeDebugLargeGraphCVar(
TEXT("r.CameraShakeDebug.LargeGraph"),
false,
TEXT("Draws larger graphs for camera shake debug info"));
#Associated Variable and Callsites
This variable is associated with another variable named GShowCameraShakeDebugRotationCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:29
Scope: file
Source code excerpt:
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)"));
TAutoConsoleVariable<bool> GCameraShakeDebugLargeGraphCVar(
TEXT("r.CameraShakeDebug.LargeGraph"),
false,
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Camera/CameraModifier_CameraShake.cpp:573
Scope (from outer to inner):
file
function void UCameraModifier_CameraShake::DisplayDebugGraphs
Source code excerpt:
GShowCameraShakeDebugLocationCVar.GetValueOnGameThread();
const bool bShowRotationDebug = GShowCameraShakeDebugCVar.GetValueOnGameThread() &&
GShowCameraShakeDebugRotationCVar.GetValueOnGameThread();
bRecordDebugData = bShowLocationDebug || bShowRotationDebug;
if (!bRecordDebugData)
{
return;
}