p.Chaos.Collision.DebugDrawProbeDetection

p.Chaos.Collision.DebugDrawProbeDetection

#Overview

name: p.Chaos.Collision.DebugDrawProbeDetection

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.Collision.DebugDrawProbeDetection is to enable or disable the debug drawing of probe constraint detection in the Chaos physics system of Unreal Engine 5. This setting variable is primarily used for debugging and visualization purposes within the collision detection system.

This setting variable is used in the Chaos physics module, which is part of the Experimental namespace in Unreal Engine 5. Specifically, it’s used in the PBDCollisionConstraints system, which handles collision detection and resolution using Position Based Dynamics.

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 DebugDrawProbeDetection directly interacts with p.Chaos.Collision.DebugDrawProbeDetection. They share the same value, with DebugDrawProbeDetection being the actual boolean variable used in the code logic.

Developers must be aware that this variable is only effective when CHAOS_DEBUG_DRAW is defined. It’s specifically used in debug builds or when debug drawing is enabled for the Chaos physics system.

Best practices when using this variable include:

  1. Use it only for debugging purposes, not in production builds.
  2. Be aware of potential performance impact when enabled, as it triggers additional drawing calls.
  3. Use in conjunction with other Chaos debug drawing tools for comprehensive physics visualization.

Regarding the associated variable DebugDrawProbeDetection:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDCollisionConstraints.cpp:87

Scope (from outer to inner):

file
namespace    Chaos

Source code excerpt:


	bool DebugDrawProbeDetection = false;
	FAutoConsoleVariableRef CVarDebugDrawProbeDetection(TEXT("p.Chaos.Collision.DebugDrawProbeDetection"), DebugDrawProbeDetection, TEXT("Draw probe constraint detection."));

#if CHAOS_DEBUG_DRAW
	namespace CVars
	{
		extern DebugDraw::FChaosDebugDrawSettings ChaosSolverDebugDebugDrawSettings;
	}

#Associated Variable and Callsites

This variable is associated with another variable named DebugDrawProbeDetection. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDCollisionConstraints.cpp:86

Scope (from outer to inner):

file
namespace    Chaos

Source code excerpt:

	FAutoConsoleVariableRef CVarCollisionsEnableSubSurfaceCollisionPruning(TEXT("p.Chaos.Collision.EnableSubSurfaceCollisionPruning"), bCollisionsEnableSubSurfaceCollisionPruning, TEXT(""));

	bool DebugDrawProbeDetection = false;
	FAutoConsoleVariableRef CVarDebugDrawProbeDetection(TEXT("p.Chaos.Collision.DebugDrawProbeDetection"), DebugDrawProbeDetection, TEXT("Draw probe constraint detection."));

#if CHAOS_DEBUG_DRAW
	namespace CVars
	{
		extern DebugDraw::FChaosDebugDrawSettings ChaosSolverDebugDebugDrawSettings;
	}

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDCollisionConstraints.cpp:595

Scope (from outer to inner):

file
namespace    Chaos
function     void FPBDCollisionConstraints::DetectProbeCollisions

Source code excerpt:


#if CHAOS_DEBUG_DRAW
				if (DebugDrawProbeDetection)
				{
					DebugDraw::FChaosDebugDrawSettings Settings = CVars::ChaosSolverDebugDebugDrawSettings;
					Settings.DrawDuration = 1.f;
					DebugDraw::DrawCollidingShapes(FRigidTransform3(), *Contact, 1.f, 1.f, &Settings);
				}
#endif