p.Chaos.DebugDraw.ShowSimOnly

p.Chaos.DebugDraw.ShowSimOnly

#Overview

name: p.Chaos.DebugDraw.ShowSimOnly

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of p.Chaos.DebugDraw.ShowSimOnly is to control the debug drawing of simulation-only shapes in the Chaos physics system of Unreal Engine 5. This setting variable is part of the debug drawing functionality for the Chaos physics engine.

Based on the callsites, this variable is primarily used in the Chaos physics subsystem, specifically in the debug drawing module. It is part of the Experimental/Chaos runtime module of Unreal Engine.

The value of this variable is set using an FAutoConsoleVariableRef, which means it can be changed at runtime through the console. It is initialized to true by default.

This variable interacts with other debug drawing variables such as p.Chaos.DebugDraw.ShowQueryOnly and p.Chaos.DebugDraw.ShowProbeOnly. These variables together control which types of physics shapes are visualized during debug drawing.

Developers must be aware that this variable specifically controls the visibility of simulation-only shapes. When set to false, it will prevent the drawing of shapes that are used only for simulation and not for queries or probes.

Best practices when using this variable include:

  1. Use it in conjunction with other debug drawing variables to get a complete picture of the physics simulation.
  2. Be aware that enabling debug drawing can impact performance, so it should be used judiciously, especially in production builds.
  3. Use this variable to isolate and debug issues specific to simulation-only shapes in the physics system.

Regarding the associated variable bChaosDebugDebugDrawShowSimOnlyShapes:

This is a boolean variable that directly controls the behavior defined by p.Chaos.DebugDraw.ShowSimOnly. It is used in the implementation of the debug drawing functions to determine whether simulation-only shapes should be drawn.

The purpose of bChaosDebugDebugDrawShowSimOnlyShapes is to provide a runtime-accessible flag that can be quickly checked in the drawing code to determine if sim-only shapes should be rendered.

This variable is used in the DrawShapesImpl and DrawParticleTransformImpl functions to filter out simulation-only shapes when it is set to false.

Developers should be aware that modifying this variable directly in code will not affect the console variable. To ensure consistency, changes should be made through the console variable system.

Best practices for using bChaosDebugDebugDrawShowSimOnlyShapes include:

  1. Avoid modifying it directly in code; instead, use the console variable system.
  2. Use it as a quick check in performance-sensitive debug drawing code.
  3. Consider its state when debugging physics issues, as it may affect the visibility of certain physics objects.

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

Scope (from outer to inner):

file
namespace    Chaos
namespace    DebugDraw

Source code excerpt:


		bool bChaosDebugDebugDrawShowSimOnlyShapes = true;
		FAutoConsoleVariableRef CVarChaosDebugDebugDrawShowSimOnlyShapes(TEXT("p.Chaos.DebugDraw.ShowSimOnly"), bChaosDebugDebugDrawShowSimOnlyShapes, TEXT("Whether to show SimOnly shapes"));

		bool bChaosDebugDebugDrawShowProbeOnlyShapes = true;
		FAutoConsoleVariableRef CVarChaosDebugDebugDrawShowProbeOnlyShapes(TEXT("p.Chaos.DebugDraw.ShowProbeOnly"), bChaosDebugDebugDrawShowProbeOnlyShapes, TEXT("Whether to show ProbeOnly shapes"));

		bool bChaosDebugDebugDrawConvexVertices = false;
		bool bChaosDebugDebugDrawCoreShapes = false;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:78

Scope (from outer to inner):

file
namespace    Chaos
namespace    DebugDraw

Source code excerpt:

		FAutoConsoleVariableRef CVarChaosDebugDebugDrawShowQueryOnlyShapes(TEXT("p.Chaos.DebugDraw.ShowQueryOnly"), bChaosDebugDebugDrawShowQueryOnlyShapes, TEXT("Whether to show QueryOnly shapes"));

		bool bChaosDebugDebugDrawShowSimOnlyShapes = true;
		FAutoConsoleVariableRef CVarChaosDebugDebugDrawShowSimOnlyShapes(TEXT("p.Chaos.DebugDraw.ShowSimOnly"), bChaosDebugDebugDrawShowSimOnlyShapes, TEXT("Whether to show SimOnly shapes"));

		bool bChaosDebugDebugDrawShowProbeOnlyShapes = true;
		FAutoConsoleVariableRef CVarChaosDebugDebugDrawShowProbeOnlyShapes(TEXT("p.Chaos.DebugDraw.ShowProbeOnly"), bChaosDebugDebugDrawShowProbeOnlyShapes, TEXT("Whether to show ProbeOnly shapes"));

		bool bChaosDebugDebugDrawConvexVertices = false;
		bool bChaosDebugDebugDrawCoreShapes = false;

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:826

Scope (from outer to inner):

file
namespace    Chaos
namespace    DebugDraw
function     void DrawShapesImpl

Source code excerpt:

				}
			}
			if (Shape && !bChaosDebugDebugDrawShowSimOnlyShapes)
			{
				if (!Shape->GetQueryEnabled() && !Shape->GetIsProbe())
				{
					return;
				}
			}

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:1112

Scope (from outer to inner):

file
namespace    Chaos
namespace    DebugDraw
function     void DrawParticleTransformImpl

Source code excerpt:

				}
			}
			if (!bChaosDebugDebugDrawShowSimOnlyShapes)
			{
				if (IsParticleSimOnly(InParticle))
				{
					return;
				}
			}