p.Chaos.DebugDraw.Radius
p.Chaos.DebugDraw.Radius
#Overview
name: p.Chaos.DebugDraw.Radius
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Set the radius from the camera where debug draw capture stops (0 means infinite)
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.Radius is to set the radius from the camera where debug draw capture stops in the Chaos physics system of Unreal Engine 5. This setting is specifically for debugging and visualization purposes within the Chaos physics simulation.
-
The Chaos physics system, which is part of Unreal Engine’s experimental ChaosSolverEngine module, relies on this setting variable.
-
The value of this variable is set to 3000.0f by default, as seen in the source code. It can be modified at runtime through the console variable system.
-
This variable interacts closely with ChaosDebugDraw_Radius, which is the actual float variable storing the value. p.Chaos.DebugDraw.Radius is the console variable reference to ChaosDebugDraw_Radius.
-
Developers must be aware that setting this value to 0 means an infinite radius for debug drawing, which could potentially impact performance if there are many physics objects in the scene.
-
Best practices when using this variable include:
- Adjusting it to focus on specific areas of interest in the physics simulation.
- Being mindful of performance implications when setting a large radius or using 0 (infinite).
- Using it in conjunction with other Chaos debug draw settings for comprehensive debugging.
Regarding the associated variable ChaosDebugDraw_Radius:
- Its purpose is to store the actual float value of the debug draw radius.
- It is used directly in the UChaosDebugDrawComponent::TickComponent and UChaosDebugDrawComponent::CreateDebugDrawActor functions to set the region of interest for debug drawing.
- The value is set through the console variable system and can be modified at runtime.
- It interacts with the FDebugDrawQueue singleton to define the area where debug information is rendered.
- Developers should be aware that this variable directly affects the visualization of the physics simulation and can impact performance if set too high.
- Best practices include using this in development and debugging scenarios, and potentially disabling or reducing its value in release builds to optimize performance.
#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:31
Scope: file
Source code excerpt:
float ChaosDebugDraw_Radius = 3000.0f;
FAutoConsoleVariableRef CVarChaos_DebugDraw_Radius(TEXT("p.Chaos.DebugDraw.Radius"), ChaosDebugDraw_Radius, TEXT("Set the radius from the camera where debug draw capture stops (0 means infinite)"));
bool ChaosDebugDraw_SeeThrough = true;
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."));
#Associated Variable and Callsites
This variable is associated with another variable named ChaosDebugDraw_Radius
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/ChaosSolverEngine/Private/Chaos/ChaosDebugDrawComponent.cpp:30
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarChaos_DebugDraw_MaxElements(TEXT("p.Chaos.DebugDraw.MaxLines"), ChaosDebugDraw_MaxElements, TEXT("Set the maximum number of debug draw lines that can be rendered (to limit perf drops)"));
float ChaosDebugDraw_Radius = 3000.0f;
FAutoConsoleVariableRef CVarChaos_DebugDraw_Radius(TEXT("p.Chaos.DebugDraw.Radius"), ChaosDebugDraw_Radius, TEXT("Set the radius from the camera where debug draw capture stops (0 means infinite)"));
bool ChaosDebugDraw_SeeThrough = true;
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."));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/ChaosSolverEngine/Private/Chaos/ChaosDebugDrawComponent.cpp:321
Scope (from outer to inner):
file
function void UChaosDebugDrawComponent::TickComponent
Source code excerpt:
else
{
FDebugDrawQueue::GetInstance().SetRegionOfInterest(World->ViewLocationsRenderedLastFrame[0], ChaosDebugDraw_Radius);
}
}
FDebugDrawQueue::GetInstance().SetMaxCost(ChaosDebugDraw_MaxElements);
const bool bIsPaused = World->IsPaused();
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/ChaosSolverEngine/Private/Chaos/ChaosDebugDrawComponent.cpp:394
Scope (from outer to inner):
file
function void UChaosDebugDrawComponent::CreateDebugDrawActor
Source code excerpt:
// We also call it every tick (which is at the end of each frame)
Chaos::FDebugDrawQueue::GetInstance().SetMaxCost(ChaosDebugDraw_MaxElements);
Chaos::FDebugDrawQueue::GetInstance().SetRegionOfInterest(FVector::ZeroVector, ChaosDebugDraw_Radius);
#endif
}