p.Chaos.DebugDraw.ColorShapesByInternalCluster
p.Chaos.DebugDraw.ColorShapesByInternalCluster
#Overview
name: p.Chaos.DebugDraw.ColorShapesByInternalCluster
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to check if the particle is an internal cluster to define its color (black : regular particle: red :internal cluster )
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.ColorShapesByInternalCluster is to control the debug drawing color of shapes in the Chaos physics system, specifically to differentiate between regular particles and internal clusters.
This setting variable is part of the Chaos physics system in Unreal Engine 5, which is an experimental physics solver. It’s primarily used for debugging and visualization purposes within the physics simulation.
The Chaos physics module relies on this setting variable, as evidenced by its location in the ChaosDebugDraw.cpp file within the Experimental/Chaos directory.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through the console or configuration files. It’s initialized to false by default.
This variable interacts with other debug drawing variables in the same scope, such as bChaosDebugDebugDrawColorShapesBySimQueryType and bChaosDebugDebugDrawColorShapesByConvexType. These variables collectively control different aspects of the debug visualization for the Chaos physics system.
Developers must be aware that this is a debug feature and should only be used during development and testing. It’s not intended for use in shipping builds or performance-critical scenarios.
Best practices when using this variable include:
- Use it in conjunction with other debug drawing options for a comprehensive view of the physics simulation.
- Be aware of potential performance impacts when enabling debug drawing in complex scenes.
- Disable it in shipping builds to avoid unnecessary overhead.
Regarding the associated variable bChaosDebugDebugDrawColorShapesByInternalCluster:
This is the actual boolean variable that stores the state of the debug drawing option. It’s directly tied to the console variable p.Chaos.DebugDraw.ColorShapesByInternalCluster.
When set to true, it changes the color of shapes in the debug visualization based on whether they are regular particles (black) or internal clusters (red). This helps developers visually distinguish between different types of physics objects in the simulation.
The variable is used in the DrawShapesImpl function to determine the color of shapes during debug drawing. If enabled, it sets the ShapeColor to black by default and then checks if the particle is a clustered particle, potentially changing the color further based on other conditions.
Developers should use this variable when they need to visually debug the internal structure of clustered particles in the Chaos physics simulation. It’s particularly useful when working with complex physics setups involving multiple interconnected objects or hierarchical structures.
#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:61
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
bool bChaosDebugDebugDrawColorShapesByInternalCluster = false;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawColorShapesByInternalCluster(TEXT("p.Chaos.DebugDraw.ColorShapesByInternalCluster"), bChaosDebugDebugDrawColorShapesByInternalCluster, TEXT("Whether to check if the particle is an internal cluster to define its color (black : regular particle: red :internal cluster )"));
bool bChaosDebugDebugDrawColorShapesBySimQueryType = false;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawColorShapesBySimQueryType(TEXT("p.Chaos.DebugDraw.ColorShapesBySimQueryType"), bChaosDebugDebugDrawColorShapesBySimQueryType, TEXT("Whether to show with different colors shapes that are sim enabled and query enabled (sim : blue, query : orange)"));
bool bChaosDebugDebugDrawColorShapesByConvexType = false;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawColorShapesByConvexType(TEXT("p.Chaos.DebugDraw.ColorShapesByConvexType"), bChaosDebugDebugDrawColorShapesByConvexType, TEXT("Whether to show with different colors shapes that are convex and simplified (simplified : green, normal : orange)"));
#Associated Variable and Callsites
This variable is associated with another variable named bChaosDebugDebugDrawColorShapesByInternalCluster
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:60
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
FAutoConsoleVariableRef CVarChaosDebugDebugDrawColorShapesByIsland(TEXT("p.Chaos.DebugDraw.ColorShapesByIsland"), bChaosDebugDebugDrawColorShapesByIsland, TEXT("Whether to use particle island to define the color of the shapes instead of using the particle state "));
bool bChaosDebugDebugDrawColorShapesByInternalCluster = false;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawColorShapesByInternalCluster(TEXT("p.Chaos.DebugDraw.ColorShapesByInternalCluster"), bChaosDebugDebugDrawColorShapesByInternalCluster, TEXT("Whether to check if the particle is an internal cluster to define its color (black : regular particle: red :internal cluster )"));
bool bChaosDebugDebugDrawColorShapesBySimQueryType = false;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawColorShapesBySimQueryType(TEXT("p.Chaos.DebugDraw.ColorShapesBySimQueryType"), bChaosDebugDebugDrawColorShapesBySimQueryType, TEXT("Whether to show with different colors shapes that are sim enabled and query enabled (sim : blue, query : orange)"));
bool bChaosDebugDebugDrawColorShapesByConvexType = false;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawColorShapesByConvexType(TEXT("p.Chaos.DebugDraw.ColorShapesByConvexType"), bChaosDebugDebugDrawColorShapesByConvexType, TEXT("Whether to show with different colors shapes that are convex and simplified (simplified : green, normal : orange)"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:779
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
function void DrawShapesImpl
Source code excerpt:
ShapeColor = GetIslandColor(IslandId, true);
}
if (bChaosDebugDebugDrawColorShapesByInternalCluster)
{
ShapeColor = FColor::Black;
if (const FPBDRigidClusteredParticleHandle* ClusteredParticle = Particle->CastToClustered())
{
if (bChaosDebugDebugDrawColorShapesByClusterUnion)
{