p.Chaos.DebugDraw.ShowCollisionParticles
p.Chaos.DebugDraw.ShowCollisionParticles
#Overview
name: p.Chaos.DebugDraw.ShowCollisionParticles
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to show the collision particles if present
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.ShowCollisionParticles is to control the debug visualization of collision particles in Unreal Engine’s Chaos physics system. This setting variable is used for debugging and development purposes within the physics simulation.
This setting variable is primarily used in the Chaos physics subsystem, which is part of Unreal Engine’s experimental features. It’s specifically utilized in the debug drawing functionality of the Chaos module.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized as a boolean value (false by default) and can be toggled on or off during runtime.
The associated variable bChaosDebugDebugDrawCollisionParticles directly interacts with p.Chaos.DebugDraw.ShowCollisionParticles. They share the same value, with the console variable controlling the boolean flag.
Developers must be aware that this variable is part of the debug drawing system and should only be used during development and debugging phases. It’s not intended for use in production builds or final game releases.
Best practices when using this variable include:
- Only enable it when specifically debugging collision-related issues in the Chaos physics system.
- Be mindful of potential performance impact when enabled, especially in complex scenes with many physics objects.
- Use it in conjunction with other debug drawing options for a comprehensive view of the physics simulation.
- Remember to disable it before building final release versions of the game.
Regarding the associated variable bChaosDebugDebugDrawCollisionParticles:
- Its purpose is to serve as the actual boolean flag that controls whether collision particles are drawn or not.
- It’s used within the DrawShapesImpl function to determine if collision particles should be visualized for rigid particles.
- The value is set by the console variable p.Chaos.DebugDraw.ShowCollisionParticles.
- It directly affects the debug visualization output of the Chaos physics system.
- Developers should treat this variable as read-only within their code, as its value is controlled by the console variable system.
#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:46
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
bool bChaosDebugDebugDrawCollisionParticles = false;
FAutoConsoleVariableRef CVarChaosDebugDrawShapeParticles(TEXT("p.Chaos.DebugDraw.ShowCollisionParticles"), bChaosDebugDebugDrawCollisionParticles, TEXT("Whether to show the collision particles if present"));
bool bChaosDebugDebugDrawInactiveContacts = true;
FAutoConsoleVariableRef CVarChaosDebugDrawInactiveContacts(TEXT("p.Chaos.DebugDraw.ShowInactiveContacts"), bChaosDebugDebugDrawInactiveContacts, TEXT("Whether to show inactive contacts (ones that contributed no impulses or pushout)"));
bool bChaosDebugDebugDrawContactIterations = false;
FAutoConsoleVariableRef CVarChaosDebugDrawContactIterations(TEXT("p.Chaos.DebugDraw.ShowContactIterations"), bChaosDebugDebugDrawContactIterations, TEXT("Whether to show an indicator of how many iterations a contact was active for"));
#Associated Variable and Callsites
This variable is associated with another variable named bChaosDebugDebugDrawCollisionParticles
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:45
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
FAutoConsoleVariableRef CVarChaosDebugDrawShapeBounds(TEXT("p.Chaos.DebugDraw.ShowShapeBounds"), bChaosDebugDebugDrawShapeBounds, TEXT("Whether to show the bounds of each shape in DrawShapes"));
bool bChaosDebugDebugDrawCollisionParticles = false;
FAutoConsoleVariableRef CVarChaosDebugDrawShapeParticles(TEXT("p.Chaos.DebugDraw.ShowCollisionParticles"), bChaosDebugDebugDrawCollisionParticles, TEXT("Whether to show the collision particles if present"));
bool bChaosDebugDebugDrawInactiveContacts = true;
FAutoConsoleVariableRef CVarChaosDebugDrawInactiveContacts(TEXT("p.Chaos.DebugDraw.ShowInactiveContacts"), bChaosDebugDebugDrawInactiveContacts, TEXT("Whether to show inactive contacts (ones that contributed no impulses or pushout)"));
bool bChaosDebugDebugDrawContactIterations = false;
FAutoConsoleVariableRef CVarChaosDebugDrawContactIterations(TEXT("p.Chaos.DebugDraw.ShowContactIterations"), bChaosDebugDebugDrawContactIterations, TEXT("Whether to show an indicator of how many iterations a contact was active for"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:920
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
function void DrawShapesImpl
Source code excerpt:
}
if (bChaosDebugDebugDrawCollisionParticles && (Particle != nullptr))
{
if (const TPBDRigidParticleHandle<FReal, 3>* Rigid = Particle->CastToRigidParticle())
{
const TUniquePtr<FBVHParticles>& Particles = Rigid->CollisionParticles();
if (Particles != nullptr)
{