p.Chaos.DebugDraw.ShowConvexVertices
p.Chaos.DebugDraw.ShowConvexVertices
#Overview
name: p.Chaos.DebugDraw.ShowConvexVertices
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to show the vertices of convex shapes
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.ShowConvexVertices is to control the debug visualization of convex shape vertices in the Chaos physics system of Unreal Engine 5. This setting variable is part of the debug drawing functionality for the Chaos physics engine.
This setting variable is primarily used by the Chaos physics subsystem, specifically within its debug drawing module. Based on the callsites, it’s clear that this variable is utilized in the Experimental/Chaos runtime module of Unreal Engine.
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 bChaosDebugDebugDrawConvexVertices directly interacts with p.Chaos.DebugDraw.ShowConvexVertices. They share the same value, with the console variable controlling the boolean flag.
Developers should be aware that this variable is specifically for debug visualization purposes. Enabling it will cause the engine to draw additional debug lines representing the vertices of convex shapes in the physics simulation. This can be useful for debugging physics interactions but may impact performance if left enabled in a release build.
Best practices when using this variable include:
- Only enable it when actively debugging convex shape issues in the physics simulation.
- Disable it in release builds to avoid unnecessary performance overhead.
- Use in conjunction with other Chaos debug draw options for a more comprehensive view of the physics state.
Regarding the associated variable bChaosDebugDebugDrawConvexVertices:
- Its purpose is to serve as the actual boolean flag that controls whether convex vertices are drawn in the debug visualization.
- It’s used directly in the drawing code to determine if vertex visualization should occur.
- The value is set by the console variable system through p.Chaos.DebugDraw.ShowConvexVertices.
- It interacts closely with other debug drawing flags in the same system.
- Developers should be aware that this flag directly affects the rendering of debug information and should be used judiciously.
- Best practices include using it in development and testing environments but ensuring it’s disabled for performance reasons in shipping builds.
#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:87
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
bool bChaosDebugDebugDrawCoreShapes = false;
bool bChaosDebugDebugDrawExactCoreShapes = false;
FAutoConsoleVariableRef CVarChaosDebugDrawConvexVertices(TEXT("p.Chaos.DebugDraw.ShowConvexVertices"), bChaosDebugDebugDrawConvexVertices, TEXT("Whether to show the vertices of convex shapes"));
FAutoConsoleVariableRef CVarChaosDebugDrawCoreShapes(TEXT("p.Chaos.DebugDraw.ShowCoreShapes"), bChaosDebugDebugDrawCoreShapes, TEXT("Whether to show the core (margin-reduced) shape where applicable"));
FAutoConsoleVariableRef CVarChaosDebugDrawExactShapes(TEXT("p.Chaos.DebugDraw.ShowExactCoreShapes"), bChaosDebugDebugDrawExactCoreShapes, TEXT("Whether to show the exact core shape. NOTE: Extremely expensive and should only be used on a small scene with a couple convex shapes in it"));
bool bChaosDebugDebugDrawShowOptimizedConvexes = false;
FAutoConsoleVariableRef CVarChaosDebugDrawShowOptimizedConvexes(TEXT("p.Chaos.DebugDraw.ShowOptimizedConvexes"), bChaosDebugDebugDrawShowOptimizedConvexes, TEXT(""));
#Associated Variable and Callsites
This variable is associated with another variable named bChaosDebugDebugDrawConvexVertices
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:84
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
FAutoConsoleVariableRef CVarChaosDebugDebugDrawShowProbeOnlyShapes(TEXT("p.Chaos.DebugDraw.ShowProbeOnly"), bChaosDebugDebugDrawShowProbeOnlyShapes, TEXT("Whether to show ProbeOnly shapes"));
bool bChaosDebugDebugDrawConvexVertices = false;
bool bChaosDebugDebugDrawCoreShapes = false;
bool bChaosDebugDebugDrawExactCoreShapes = false;
FAutoConsoleVariableRef CVarChaosDebugDrawConvexVertices(TEXT("p.Chaos.DebugDraw.ShowConvexVertices"), bChaosDebugDebugDrawConvexVertices, TEXT("Whether to show the vertices of convex shapes"));
FAutoConsoleVariableRef CVarChaosDebugDrawCoreShapes(TEXT("p.Chaos.DebugDraw.ShowCoreShapes"), bChaosDebugDebugDrawCoreShapes, TEXT("Whether to show the core (margin-reduced) shape where applicable"));
FAutoConsoleVariableRef CVarChaosDebugDrawExactShapes(TEXT("p.Chaos.DebugDraw.ShowExactCoreShapes"), bChaosDebugDebugDrawExactCoreShapes, TEXT("Whether to show the exact core shape. NOTE: Extremely expensive and should only be used on a small scene with a couple convex shapes in it"));
bool bChaosDebugDebugDrawShowOptimizedConvexes = false;
FAutoConsoleVariableRef CVarChaosDebugDrawShowOptimizedConvexes(TEXT("p.Chaos.DebugDraw.ShowOptimizedConvexes"), bChaosDebugDebugDrawShowOptimizedConvexes, TEXT(""));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:490
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
function void DrawShapesConvexImpl
Source code excerpt:
// Vertex and face normal
if (bChaosDebugDebugDrawConvexVertices)
{
FDebugDrawQueue::GetInstance().DrawDebugLine(OuterP0 + ExplodeDelta, OuterP0 + ExplodeDelta + Settings.DrawScale * 20.0f * N0, FColor::Green, false, Duration, uint8(Settings.DrawPriority), Settings.LineThickness);
}
}
}
}