p.Chaos.DebugDraw.ConnectionGraph.ShowInternalStrains
p.Chaos.DebugDraw.ConnectionGraph.ShowInternalStrains
#Overview
name: p.Chaos.DebugDraw.ConnectionGraph.ShowInternalStrains
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When displaying connection graphs show strain values of each node
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.ConnectionGraph.ShowInternalStrains is to control the debug visualization of internal strain values for each node in connection graphs within the Chaos physics system of Unreal Engine 5.
This setting variable is primarily used by the Chaos physics subsystem, specifically in its debug drawing functionality. It’s part of the Experimental Chaos module, which is responsible for advanced physics simulations 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 changed at runtime through console commands or configuration files.
The associated variable bChaosDebugDrawConnectionGraphShowInternalStrains directly interacts with p.Chaos.DebugDraw.ConnectionGraph.ShowInternalStrains. They share the same value, with the console variable controlling the boolean flag.
Developers should be aware that this variable is specifically for debug purposes. It’s used to visualize internal strains in the connection graph, which can be crucial for understanding the behavior of physics simulations, particularly in complex scenarios involving multiple connected bodies or soft bodies.
Best practices when using this variable include:
- Use it primarily during development and debugging phases, not in production builds.
- Combine it with other Chaos debug draw options for a comprehensive view of the physics system.
- Be aware of potential performance impact when enabled, especially in complex scenes.
Regarding the associated variable bChaosDebugDrawConnectionGraphShowInternalStrains:
Its purpose is to serve as the actual boolean flag that controls whether internal strains are shown in the connection graph debug visualization.
This variable is used within the Chaos DebugDraw namespace, specifically in the DrawConnectionGraphImpl function. When true, it causes the debug drawing system to render text showing the internal strain value for each child node in the connection graph.
The value of this variable is set by the console variable system, mirroring p.Chaos.DebugDraw.ConnectionGraph.ShowInternalStrains.
Developers should be aware that this variable directly affects the debug output. When enabled, it adds additional visual information to the connection graph visualization, which can be helpful for diagnosing physics behavior but may also clutter the debug view.
Best practices for using this variable include:
- Use it in conjunction with other debug visualization tools to get a complete picture of the physics state.
- Toggle it on and off as needed to focus on specific aspects of the physics simulation.
- Consider the performance impact of rendering additional debug text, especially in scenes with many physics objects.
#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:125
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
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;
bool bChaosDebugDebugDrawBVHBounds = true;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawBVHLevel(TEXT("p.Chaos.DebugDraw.BVHLevel"), ChaosDebugDebugDrawBVHLevel, TEXT("Which level of the BVH to draw (-1 = Leaf)"));
FAutoConsoleVariableRef CVarChaosDebugDebugDrawBVHShapes(TEXT("p.Chaos.DebugDraw.BVHShapes"), bChaosDebugDebugDrawBVHShapes, TEXT("Whether to draw the shapes in each BVH node (colorized)"));
#Associated Variable and Callsites
This variable is associated with another variable named bChaosDebugDrawConnectionGraphShowInternalStrains
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:124
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
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;
bool bChaosDebugDebugDrawBVHBounds = true;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawBVHLevel(TEXT("p.Chaos.DebugDraw.BVHLevel"), ChaosDebugDebugDrawBVHLevel, TEXT("Which level of the BVH to draw (-1 = Leaf)"));
FAutoConsoleVariableRef CVarChaosDebugDebugDrawBVHShapes(TEXT("p.Chaos.DebugDraw.BVHShapes"), bChaosDebugDebugDrawBVHShapes, TEXT("Whether to draw the shapes in each BVH node (colorized)"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:1980
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
function void DrawConnectionGraphImpl
lambda-function
Source code excerpt:
FDebugDrawQueue::GetInstance().DrawDebugPoint(GetClusterTransform(Child).GetLocation(), PointColor, false, UE_KINDA_SMALL_NUMBER, uint8(Settings.DrawPriority), Settings.LineThickness * 10);
if (bChaosDebugDrawConnectionGraphShowInternalStrains)
{
FDebugDrawQueue::GetInstance().DrawDebugString(Child->GetX(), FString::Printf(TEXT("%.1f"), Child->GetInternalStrains()), nullptr, FColor::White, UE_KINDA_SMALL_NUMBER, false, 1.0);
}
const FConnectivityEdgeArray& Edges = Child->ConnectivityEdges();
for (const TConnectivityEdge<FReal>& Edge : Edges)