p.Chaos.DebugDraw.SingleActor
p.Chaos.DebugDraw.SingleActor
#Overview
name: p.Chaos.DebugDraw.SingleActor
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, then we draw for the actor the camera is looking at.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.SingleActor is to enable debug drawing for a single actor that the camera is focusing on in the Chaos physics system of Unreal Engine 5.
This setting variable is used primarily in the Chaos physics system, which is part of Unreal Engine’s experimental ChaosSolverEngine module. It’s specifically utilized in the debug drawing functionality of this system.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as a boolean value, initialized to false, and can be toggled on or off using the console command “p.Chaos.DebugDraw.SingleActor”.
There are several other variables that interact with p.Chaos.DebugDraw.SingleActor:
- ChaosDebugDraw_SingleActorTraceLength: Defines the trace length from the camera used to select the single actor.
- ChaosDebugDraw_SingleActorMaxRadius: Sets the maximum radius to draw around the single actor.
Developers should be aware that this variable is part of a debug drawing system and should only be used during development or debugging processes. It’s not intended for use in final, shipped versions of a game.
Best practices when using this variable include:
- Only enable it when necessary for debugging physics issues.
- Be aware that enabling debug drawing may impact performance.
- Use in conjunction with the other related variables (TraceLength and MaxRadius) for more precise control over the debug visualization.
The associated variable bChaosDebugDraw_SingleActor is the actual boolean variable that stores the state of this setting. It’s used in the UChaosDebugDrawComponent::TickComponent function to determine whether to perform the single-actor debug drawing.
When bChaosDebugDraw_SingleActor is true, the system will attempt to identify the actor the camera is looking at and draw debug information for that actor only. This can be useful for isolating and examining the physics behavior of a specific object in a complex scene.
Developers should treat bChaosDebugDraw_SingleActor and p.Chaos.DebugDraw.SingleActor as effectively the same variable, as they are linked through the FAutoConsoleVariableRef system. Changing one will affect the other.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/ChaosSolverEngine/Private/Chaos/ChaosDebugDrawComponent.cpp:37
Scope: file
Source code excerpt:
bool bChaosDebugDraw_SingleActor = false;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActor(TEXT("p.Chaos.DebugDraw.SingleActor"), bChaosDebugDraw_SingleActor, TEXT("If true, then we draw for the actor the camera is looking at."));
float ChaosDebugDraw_SingleActorTraceLength = 2000.0f;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActorTraceLength(TEXT("p.Chaos.DebugDraw.SingleActorTraceLength"), ChaosDebugDraw_SingleActorTraceLength, TEXT("Set the trace length from the camera that is used to select the single actor."));
float ChaosDebugDraw_SingleActorMaxRadius = 1000.0f;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActorMaxRadius(TEXT("p.Chaos.DebugDraw.SingleActorMaxRadius"), ChaosDebugDraw_SingleActorMaxRadius, TEXT("Set the max radius to draw around the single actor."));
#Associated Variable and Callsites
This variable is associated with another variable named bChaosDebugDraw_SingleActor
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/ChaosSolverEngine/Private/Chaos/ChaosDebugDrawComponent.cpp:36
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarChaos_DebugDraw_SeeThrough(TEXT("p.Chaos.DebugDraw.SeeThrough"), ChaosDebugDraw_SeeThrough, TEXT("When enabled , lines will be drawn on top of all geometry"));
bool bChaosDebugDraw_SingleActor = false;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActor(TEXT("p.Chaos.DebugDraw.SingleActor"), bChaosDebugDraw_SingleActor, TEXT("If true, then we draw for the actor the camera is looking at."));
float ChaosDebugDraw_SingleActorTraceLength = 2000.0f;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActorTraceLength(TEXT("p.Chaos.DebugDraw.SingleActorTraceLength"), ChaosDebugDraw_SingleActorTraceLength, TEXT("Set the trace length from the camera that is used to select the single actor."));
float ChaosDebugDraw_SingleActorMaxRadius = 1000.0f;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActorMaxRadius(TEXT("p.Chaos.DebugDraw.SingleActorMaxRadius"), ChaosDebugDraw_SingleActorMaxRadius, TEXT("Set the max radius to draw around the single actor."));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/ChaosSolverEngine/Private/Chaos/ChaosDebugDrawComponent.cpp:291
Scope (from outer to inner):
file
function void UChaosDebugDrawComponent::TickComponent
Source code excerpt:
if (World->ViewLocationsRenderedLastFrame.Num() > 0)
{
if (bChaosDebugDraw_SingleActor)
{
if (const APlayerController* Controller = GEngine->GetFirstLocalPlayerController(World))
{
FVector CamLoc;
FRotator CamRot;
Controller->GetPlayerViewPoint(CamLoc, CamRot);