p.Chaos.DebugDraw.ShowOptimizedConvexes
p.Chaos.DebugDraw.ShowOptimizedConvexes
#Overview
name: p.Chaos.DebugDraw.ShowOptimizedConvexes
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.ShowOptimizedConvexes is to control the debug drawing of optimized convex shapes in the Chaos physics system of Unreal Engine 5. This setting is part of the debug visualization tools for the Chaos physics engine.
-
The Chaos physics subsystem within Unreal Engine 5 relies on this setting variable. It is specifically used in the debug drawing functionality of the Chaos module.
-
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be changed at runtime through the console or configuration files. It is initialized to false by default.
-
This variable interacts directly with its associated boolean variable bChaosDebugDebugDrawShowOptimizedConvexes. They share the same value and are used interchangeably in the code.
-
Developers must be aware that enabling this debug draw option may have performance implications, especially in scenes with many convex shapes. It should be used primarily for debugging and visualization purposes, not in production builds.
-
Best practices when using this variable include:
- Only enable it when necessary for debugging convex shape optimizations.
- Disable it in production or performance-critical scenarios.
- Use it in conjunction with other Chaos debug draw options for comprehensive physics visualization.
Regarding the associated variable bChaosDebugDebugDrawShowOptimizedConvexes:
-
Its purpose is to serve as the actual boolean flag that controls whether optimized convexes are shown in the debug draw.
-
It is used directly in the DrawConvexOptimizerShapes function to determine whether to proceed with drawing the optimized convex shapes.
-
The value is set through the console variable p.Chaos.DebugDraw.ShowOptimizedConvexes, allowing for runtime toggling of this debug feature.
-
This variable doesn’t seem to interact with other variables beyond its connection to the console variable.
-
Developers should be aware that this variable directly affects the execution of debug drawing code, so toggling it will immediately impact visualization without needing to restart the engine.
-
Best practices include using this variable in conjunction with performance profiling tools when investigating physics-related issues, and ensuring it’s disabled when not actively debugging to avoid unnecessary performance overhead.
#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:92
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
bool bChaosDebugDebugDrawShowOptimizedConvexes = false;
FAutoConsoleVariableRef CVarChaosDebugDrawShowOptimizedConvexes(TEXT("p.Chaos.DebugDraw.ShowOptimizedConvexes"), bChaosDebugDebugDrawShowOptimizedConvexes, TEXT(""));
bool bChaosDebugDebugDrawIslands = true;
FAutoConsoleVariableRef CVarChaosDebugDrawIslands(TEXT("p.Chaos.DebugDraw.ShowIslands"), bChaosDebugDebugDrawIslands, TEXT("Whether to show the iosland boxes when drawing islands (if you want only the contact graph)"));
bool bChaosDebugDebugDrawContactGraph = false;
FAutoConsoleVariableRef CVarChaosDebugDrawContactGraph(TEXT("p.Chaos.DebugDraw.ShowContactGraph"), bChaosDebugDebugDrawContactGraph, TEXT("Whether to show the contactgraph when drawing islands"));
#Associated Variable and Callsites
This variable is associated with another variable named bChaosDebugDebugDrawShowOptimizedConvexes
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:91
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
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(""));
bool bChaosDebugDebugDrawIslands = true;
FAutoConsoleVariableRef CVarChaosDebugDrawIslands(TEXT("p.Chaos.DebugDraw.ShowIslands"), bChaosDebugDebugDrawIslands, TEXT("Whether to show the iosland boxes when drawing islands (if you want only the contact graph)"));
bool bChaosDebugDebugDrawContactGraph = false;
FAutoConsoleVariableRef CVarChaosDebugDrawContactGraph(TEXT("p.Chaos.DebugDraw.ShowContactGraph"), bChaosDebugDebugDrawContactGraph, TEXT("Whether to show the contactgraph when drawing islands"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:947
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
function bool DrawConvexOptimizerShapes
Source code excerpt:
bool DrawConvexOptimizerShapes(const FVec3& P, const FRotation3& Q, const FGeometryParticleHandle* Particle, const FColor& InColor, const FChaosDebugDrawSettings& Settings)
{
if (!bChaosDebugDebugDrawShowOptimizedConvexes)
{
return false;
}
if(auto ClusteredParticle = Particle->CastToClustered())
{