p.Chaos.DebugDraw.ConnectionGraphLevelOffset
p.Chaos.DebugDraw.ConnectionGraphLevelOffset
#Overview
name: p.Chaos.DebugDraw.ConnectionGraphLevelOffset
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
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.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.ConnectionGraphLevelOffset is to control the level of detail in the debug drawing of connection graphs within the Chaos physics system in Unreal Engine 5. It determines which level of child particles to display in the connection graph visualization.
This setting variable is primarily used by the Chaos physics subsystem, specifically within its debug drawing functionality. It’s part of the Experimental Chaos module in Unreal Engine 5.
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 adjusted at runtime through console commands or configuration files.
The associated variable ChaosConnectionGraphDrawLevelOffset directly interacts with p.Chaos.DebugDraw.ConnectionGraphLevelOffset. They share the same value and are used interchangeably in the code.
Developers must be aware that:
- This variable affects the visualization only and does not impact the actual physics simulation.
- The value determines the depth of child particles shown in the connection graph. A value of 0 shows direct children, 1 shows grandchildren, and so on.
- Changing this value can significantly affect the complexity and performance of the debug visualization.
Best practices when using this variable include:
- Start with lower values (0 or 1) to get an overview of the connection graph structure.
- Increase the value gradually if more detailed information about deeper levels of the particle hierarchy is needed.
- Be cautious with high values in complex scenes, as they may impact performance or create visual clutter.
- Use in conjunction with other Chaos debug drawing settings for a comprehensive view of the physics system.
Regarding the associated variable ChaosConnectionGraphDrawLevelOffset:
- Its purpose is identical to p.Chaos.DebugDraw.ConnectionGraphLevelOffset.
- It’s used directly in the implementation of the debug drawing functionality.
- The variable is defined locally within the Chaos::DebugDraw namespace and is linked to the console variable system.
- It’s used in the DrawConnectionGraphImpl function to determine which level of child particles to include in the visualization.
- Developers should treat this variable as the internal representation of the console variable and avoid modifying it directly, instead using the console variable system to adjust its value.
#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:119
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
int32 ChaosConnectionGraphDrawLevelOffset = 0;
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"));
#Associated Variable and Callsites
This variable is associated with another variable named ChaosConnectionGraphDrawLevelOffset
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:118
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
FAutoConsoleVariableRef CVarChaosDebugDrawCollisionAnchors(TEXT("p.Chaos.DebugDraw.ShowCollisionAnchors"), bChaosDebugDrawCollisionAnchors, TEXT(""));
int32 ChaosConnectionGraphDrawLevelOffset = 0;
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"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:1915
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
function void DrawConnectionGraphImpl
lambda-function
Source code excerpt:
if (const FRigidClustering::FRigidHandleArray* CurrentChildren = Clustering.GetChildrenMap().Find(Next.Key))
{
if (Next.Value == ChaosConnectionGraphDrawLevelOffset)
{
Children.Append(*CurrentChildren);
}
else
{
for (FPBDRigidParticleHandle* Child : *CurrentChildren)