p.Chaos.DebugDraw.ShowCollisionParticles

p.Chaos.DebugDraw.ShowCollisionParticles

#Overview

name: p.Chaos.DebugDraw.ShowCollisionParticles

This variable is created as a Console Variable (cvar).

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:

  1. Only enable it when specifically debugging collision-related issues in the Chaos physics system.
  2. Be mindful of potential performance impact when enabled, especially in complex scenes with many physics objects.
  3. Use it in conjunction with other debug drawing options for a comprehensive view of the physics simulation.
  4. Remember to disable it before building final release versions of the game.

Regarding the associated variable bChaosDebugDebugDrawCollisionParticles:

#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)
					{