p.Chaos.DebugDraw.SeeThrough

p.Chaos.DebugDraw.SeeThrough

#Overview

name: p.Chaos.DebugDraw.SeeThrough

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.SeeThrough is to control the visibility of debug drawing lines in the Chaos physics system of Unreal Engine 5. It determines whether these lines should be drawn on top of all geometry, making them visible even when obscured by other objects in the scene.

This setting variable is primarily used by the Chaos physics system, which is part of the experimental ChaosSolverEngine module in Unreal Engine 5. It’s specifically utilized in the debug drawing functionality of this system.

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’s initialized to true by default.

The associated variable ChaosDebugDraw_SeeThrough directly interacts with p.Chaos.DebugDraw.SeeThrough. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable affects the depth priority of debug draw commands. When enabled, it allows debug lines to be drawn on top of all geometry, which can be useful for visualizing physics interactions that might otherwise be hidden.

Best practices when using this variable include:

  1. Use it primarily for debugging and development purposes, not in production builds.
  2. Be aware that enabling this might impact performance, especially in complex scenes with many debug draw calls.
  3. Consider using it in conjunction with other Chaos debug draw variables (like p.Chaos.DebugDraw.SingleActor) for more focused debugging.

Regarding the associated variable ChaosDebugDraw_SeeThrough:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/ChaosSolverEngine/Private/Chaos/ChaosDebugDrawComponent.cpp:34

Scope: file

Source code excerpt:


bool ChaosDebugDraw_SeeThrough = true;
FAutoConsoleVariableRef CVarChaos_DebugDraw_SeeThrough(TEXT("p.Chaos.DebugDraw.SeeThrough"), ChaosDebugDraw_SeeThrough, TEXT("When enabled , lines will be drawn on top of all geometry"));

bool bChaosDebugDraw_SingleActor = false;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActor(TEXT("p.Chaos.DebugDraw.SingleActor"), bChaosDebugDraw_SingleActor, TEXT("If true, then we draw for the actor the camera is looking at."));

float ChaosDebugDraw_SingleActorTraceLength = 2000.0f;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActorTraceLength(TEXT("p.Chaos.DebugDraw.SingleActorTraceLength"), ChaosDebugDraw_SingleActorTraceLength, TEXT("Set the trace length from the camera that is used to select the single actor."));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/ChaosSolverEngine/Private/Chaos/ChaosDebugDrawComponent.cpp:33

Scope: file

Source code excerpt:

FAutoConsoleVariableRef CVarChaos_DebugDraw_Radius(TEXT("p.Chaos.DebugDraw.Radius"), ChaosDebugDraw_Radius, TEXT("Set the radius from the camera where debug draw capture stops (0 means infinite)"));

bool ChaosDebugDraw_SeeThrough = true;
FAutoConsoleVariableRef CVarChaos_DebugDraw_SeeThrough(TEXT("p.Chaos.DebugDraw.SeeThrough"), ChaosDebugDraw_SeeThrough, TEXT("When enabled , lines will be drawn on top of all geometry"));

bool bChaosDebugDraw_SingleActor = false;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActor(TEXT("p.Chaos.DebugDraw.SingleActor"), bChaosDebugDraw_SingleActor, TEXT("If true, then we draw for the actor the camera is looking at."));

float ChaosDebugDraw_SingleActorTraceLength = 2000.0f;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActorTraceLength(TEXT("p.Chaos.DebugDraw.SingleActorTraceLength"), ChaosDebugDraw_SingleActorTraceLength, TEXT("Set the trace length from the camera that is used to select the single actor."));

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/ChaosSolverEngine/Private/Chaos/ChaosDebugDrawComponent.cpp:110

Scope (from outer to inner):

file
function     void DebugDrawChaos

Source code excerpt:

		for (const FLatentDrawCommand& Command : DrawCommands)
		{
			const uint8 DepthPriority = ChaosDebugDraw_SeeThrough ? Command.DepthPriority: 0;
			switch (Command.Type)
			{
			case FLatentDrawCommand::EDrawType::Point:
				DrawDebugPoint(World, Command.LineStart, Command.Thickness, Command.Color, Command.bPersistentLines, CommandLifeTime(Command, bIsPaused), DepthPriority);
				break;
			case FLatentDrawCommand::EDrawType::Line: