p.Chaos.DebugDraw.SingleActorMaxRadius

p.Chaos.DebugDraw.SingleActorMaxRadius

#Overview

name: p.Chaos.DebugDraw.SingleActorMaxRadius

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.SingleActorMaxRadius is to set the maximum radius for debug drawing around a single actor in the Chaos physics system of Unreal Engine 5.

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

The value of this variable is set in the C++ code, initialized to 1000.0f. It’s exposed as a console variable, which means it can be dynamically adjusted during runtime or set in configuration files.

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

Developers must be aware that this variable affects the debug visualization of physics objects. If set too low, it might limit the visibility of larger objects. If set too high, it could potentially impact performance due to excessive debug drawing.

Best practices when using this variable include:

  1. Adjusting it based on the scale of your game world and objects.
  2. Using it in conjunction with other debug drawing settings for comprehensive physics visualization.
  3. Remembering to disable or reduce debug drawing in release builds for performance reasons.

Regarding the associated variable ChaosDebugDraw_SingleActorMaxRadius:

The purpose of ChaosDebugDraw_SingleActorMaxRadius is identical to p.Chaos.DebugDraw.SingleActorMaxRadius, as they share the same value and functionality.

It’s used in the UChaosDebugDrawComponent::TickComponent function to determine whether to set a region of interest for debug drawing. If an actor’s bounding radius is less than or equal to this value, it sets the region of interest for debug drawing centered on that actor.

The value is set and can be modified through the console variable system, allowing for runtime adjustments.

This variable directly interacts with p.Chaos.DebugDraw.SingleActorMaxRadius, and they are essentially two ways to access the same setting.

Developers should be aware that this variable directly affects the debug visualization in the Chaos physics system. Setting it appropriately is crucial for effective debugging of physics interactions.

Best practices include adjusting this value based on the size of the physics objects in your scene, and potentially exposing it in debug menus for easy adjustment during development and testing.

#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:43

Scope: file

Source code excerpt:


float ChaosDebugDraw_SingleActorMaxRadius = 1000.0f;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActorMaxRadius(TEXT("p.Chaos.DebugDraw.SingleActorMaxRadius"), ChaosDebugDraw_SingleActorMaxRadius, TEXT("Set the max radius to draw around the single actor."));

float ChaosDebugDraw_ShowPIEServer = false;
FAutoConsoleVariableRef CVarChaos_DebugDraw_ShowPIEServer(TEXT("p.Chaos.DebugDraw.ShowPIEServer"), ChaosDebugDraw_ShowPIEServer, TEXT("When running in PIE mode, show the server debug draw"));

float ChaosDebugDraw_ShowPIEClient = true;
FAutoConsoleVariableRef CVarChaos_DebugDraw_ShowPIEClient(TEXT("p.Chaos.DebugDraw.ShowPIEClient"), ChaosDebugDraw_ShowPIEClient, TEXT("When running in PIE mode, show the client debug draw"));

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

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."));

float ChaosDebugDraw_SingleActorMaxRadius = 1000.0f;
FAutoConsoleVariableRef CVarChaosDebugDraw_SingleActorMaxRadius(TEXT("p.Chaos.DebugDraw.SingleActorMaxRadius"), ChaosDebugDraw_SingleActorMaxRadius, TEXT("Set the max radius to draw around the single actor."));

float ChaosDebugDraw_ShowPIEServer = false;
FAutoConsoleVariableRef CVarChaos_DebugDraw_ShowPIEServer(TEXT("p.Chaos.DebugDraw.ShowPIEServer"), ChaosDebugDraw_ShowPIEServer, TEXT("When running in PIE mode, show the server debug draw"));

float ChaosDebugDraw_ShowPIEClient = true;
FAutoConsoleVariableRef CVarChaos_DebugDraw_ShowPIEClient(TEXT("p.Chaos.DebugDraw.ShowPIEClient"), ChaosDebugDraw_ShowPIEClient, TEXT("When running in PIE mode, show the client debug draw"));

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

Scope (from outer to inner):

file
function     void UChaosDebugDrawComponent::TickComponent

Source code excerpt:

						HitResult.GetActor()->GetActorBounds(true, Origin, BoxExtent);
						const float Radius = BoxExtent.Size();
						if (Radius <= ChaosDebugDraw_SingleActorMaxRadius)
						{
							FDebugDrawQueue::GetInstance().SetRegionOfInterest(Origin, Radius);
						}
					}
				}
			}