p.Chaos.DebugDraw.ConnectionGraph.ShowAreas
p.Chaos.DebugDraw.ConnectionGraph.ShowAreas
#Overview
name: p.Chaos.DebugDraw.ConnectionGraph.ShowAreas
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When displaying connection graphs show connection areas as disks
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.ConnectionGraph.ShowAreas is to enable the visualization of connection areas as disks when displaying connection graphs in the Chaos physics system’s debug drawing functionality.
This setting variable is primarily used in the Chaos physics subsystem of Unreal Engine 5, specifically in the debug drawing module. It is part of the Experimental/Chaos runtime module, which suggests it’s still in an experimental stage and may be subject to changes.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands or configuration files.
The associated variable bChaosDebugDrawConnectionGraphShowAreas directly interacts with p.Chaos.DebugDraw.ConnectionGraph.ShowAreas. They share the same value, and bChaosDebugDrawConnectionGraphShowAreas is used in the actual implementation to control the debug drawing behavior.
Developers must be aware that this is a debug visualization tool and should only be used for development and debugging purposes. It may have performance implications when enabled, so it should be turned off in production builds.
Best practices when using this variable include:
- Only enable it when actively debugging connection graphs in the Chaos physics system.
- Be mindful of potential performance impact when enabled.
- Use it in conjunction with other Chaos debug drawing tools for a comprehensive view of the physics system.
- Remember to disable it when not needed to avoid unnecessary rendering overhead.
Regarding the associated variable bChaosDebugDrawConnectionGraphShowAreas:
The purpose of bChaosDebugDrawConnectionGraphShowAreas is to serve as the actual boolean flag that controls whether connection areas are shown as disks in the debug drawing implementation.
This variable is used directly in the DrawConnectionGraphImpl function within the Chaos::DebugDraw namespace. When set to true, it causes the debug drawing system to render circular representations of connection areas between particles in the physics simulation.
The value of this variable is set by the console variable system through p.Chaos.DebugDraw.ConnectionGraph.ShowAreas.
Developers should be aware that this variable directly affects the debug visualization and should be used in tandem with p.Chaos.DebugDraw.ConnectionGraph.ShowAreas. Any changes to one will affect the other.
Best practices for using bChaosDebugDrawConnectionGraphShowAreas include:
- Avoid modifying this variable directly in code; instead, use the console variable to ensure consistency.
- Use it in debugging scenarios where visualizing connection areas is necessary for understanding the physics behavior.
- Be prepared for potential performance impact when this flag is set to true, especially in complex scenes with many connections.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:122
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
bool bChaosDebugDrawConnectionGraphShowAreas = false;
FAutoConsoleVariableRef CVarChaosDebugDrawConnectionGraphShowAreas(TEXT("p.Chaos.DebugDraw.ConnectionGraph.ShowAreas"), bChaosDebugDrawConnectionGraphShowAreas, TEXT("When displaying connection graphs show connection areas as disks"));
bool bChaosDebugDrawConnectionGraphShowInternalStrains = false;
FAutoConsoleVariableRef CVarChaosDebugDrawConnectionGraphShowInternalStrains(TEXT("p.Chaos.DebugDraw.ConnectionGraph.ShowInternalStrains"), bChaosDebugDrawConnectionGraphShowInternalStrains, TEXT("When displaying connection graphs show strain values of each node"));
int32 ChaosDebugDebugDrawBVHLevel = -1;
bool bChaosDebugDebugDrawBVHShapes = false;
#Associated Variable and Callsites
This variable is associated with another variable named bChaosDebugDrawConnectionGraphShowAreas
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:121
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
FAutoConsoleVariableRef CVarChaosConnectionGraphDrawLevelOffset(TEXT("p.Chaos.DebugDraw.ConnectionGraphLevelOffset"), ChaosConnectionGraphDrawLevelOffset, TEXT("If 0, draws the connection graph between children particles of active particles. If 1, draws the connection grpah between grand-children particles of active particles, etc."));
bool bChaosDebugDrawConnectionGraphShowAreas = false;
FAutoConsoleVariableRef CVarChaosDebugDrawConnectionGraphShowAreas(TEXT("p.Chaos.DebugDraw.ConnectionGraph.ShowAreas"), bChaosDebugDrawConnectionGraphShowAreas, TEXT("When displaying connection graphs show connection areas as disks"));
bool bChaosDebugDrawConnectionGraphShowInternalStrains = false;
FAutoConsoleVariableRef CVarChaosDebugDrawConnectionGraphShowInternalStrains(TEXT("p.Chaos.DebugDraw.ConnectionGraph.ShowInternalStrains"), bChaosDebugDrawConnectionGraphShowInternalStrains, TEXT("When displaying connection graphs show strain values of each node"));
int32 ChaosDebugDebugDrawBVHLevel = -1;
bool bChaosDebugDebugDrawBVHShapes = false;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:1892
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
function void DrawConnectionGraphImpl
lambda-function
Source code excerpt:
FDebugDrawQueue::GetInstance().DrawDebugLine(Pos0, Pos1, Color, false, UE_KINDA_SMALL_NUMBER, uint8(Settings.DrawPriority), Settings.LineThickness);
if (bChaosDebugDrawConnectionGraphShowAreas)
{
const FReal Radius = FMath::Sqrt(FMath::Abs(Connection.Strain / UE_PI)); // represent area as a circle
const FMatrix Axes = FRotationMatrix::MakeFromX(Normal);
FDebugDrawQueue::GetInstance().DrawDebugCircle((Pos0 + Pos1) * 0.5, Radius, 24, Color, false, UE_KINDA_SMALL_NUMBER, uint8(Settings.DrawPriority), Settings.LineThickness, Axes.GetUnitAxis(EAxis::Y), Axes.GetUnitAxis(EAxis::Z), false);
}