p.Chaos.DebugDraw.ShowCoreShapes

p.Chaos.DebugDraw.ShowCoreShapes

#Overview

name: p.Chaos.DebugDraw.ShowCoreShapes

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.ShowCoreShapes is to control the debug visualization of core shapes in the Chaos physics system within Unreal Engine 5. This setting variable is specifically used for debugging and development purposes in the physics simulation.

This setting variable is primarily used by the Chaos physics subsystem, which is part of Unreal Engine’s experimental features. It’s specifically utilized in the debug drawing functionality of Chaos.

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 adjusted at runtime through the console or configuration files.

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

Developers must be aware that this variable is intended for debugging purposes only. Enabling it may have performance implications, especially in complex scenes with many physics objects.

Best practices when using this variable include:

  1. Only enable it when actively debugging physics issues related to core shapes.
  2. Be cautious when using it in production or shipping builds, as it may impact performance.
  3. Use it in conjunction with other debug drawing options for a comprehensive view of the physics simulation.

Regarding the associated variable bChaosDebugDebugDrawCoreShapes:

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

Scope (from outer to inner):

file
namespace    Chaos
namespace    DebugDraw

Source code excerpt:

		bool bChaosDebugDebugDrawExactCoreShapes = false;
		FAutoConsoleVariableRef CVarChaosDebugDrawConvexVertices(TEXT("p.Chaos.DebugDraw.ShowConvexVertices"), bChaosDebugDebugDrawConvexVertices, TEXT("Whether to show the vertices of convex shapes"));
		FAutoConsoleVariableRef CVarChaosDebugDrawCoreShapes(TEXT("p.Chaos.DebugDraw.ShowCoreShapes"), bChaosDebugDebugDrawCoreShapes, TEXT("Whether to show the core (margin-reduced) shape where applicable"));
		FAutoConsoleVariableRef CVarChaosDebugDrawExactShapes(TEXT("p.Chaos.DebugDraw.ShowExactCoreShapes"), bChaosDebugDebugDrawExactCoreShapes, TEXT("Whether to show the exact core shape. NOTE: Extremely expensive and should only be used on a small scene with a couple convex shapes in it"));

		bool bChaosDebugDebugDrawShowOptimizedConvexes = false;
		FAutoConsoleVariableRef CVarChaosDebugDrawShowOptimizedConvexes(TEXT("p.Chaos.DebugDraw.ShowOptimizedConvexes"), bChaosDebugDebugDrawShowOptimizedConvexes, TEXT(""));

		bool bChaosDebugDebugDrawIslands = true;

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    Chaos
namespace    DebugDraw

Source code excerpt:


		bool bChaosDebugDebugDrawConvexVertices = false;
		bool bChaosDebugDebugDrawCoreShapes = false;
		bool bChaosDebugDebugDrawExactCoreShapes = false;
		FAutoConsoleVariableRef CVarChaosDebugDrawConvexVertices(TEXT("p.Chaos.DebugDraw.ShowConvexVertices"), bChaosDebugDebugDrawConvexVertices, TEXT("Whether to show the vertices of convex shapes"));
		FAutoConsoleVariableRef CVarChaosDebugDrawCoreShapes(TEXT("p.Chaos.DebugDraw.ShowCoreShapes"), bChaosDebugDebugDrawCoreShapes, TEXT("Whether to show the core (margin-reduced) shape where applicable"));
		FAutoConsoleVariableRef CVarChaosDebugDrawExactShapes(TEXT("p.Chaos.DebugDraw.ShowExactCoreShapes"), bChaosDebugDebugDrawExactCoreShapes, TEXT("Whether to show the exact core shape. NOTE: Extremely expensive and should only be used on a small scene with a couple convex shapes in it"));

		bool bChaosDebugDebugDrawShowOptimizedConvexes = false;
		FAutoConsoleVariableRef CVarChaosDebugDrawShowOptimizedConvexes(TEXT("p.Chaos.DebugDraw.ShowOptimizedConvexes"), bChaosDebugDebugDrawShowOptimizedConvexes, TEXT(""));

		bool bChaosDebugDebugDrawIslands = true;

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

Scope (from outer to inner):

file
namespace    Chaos
namespace    DebugDraw
function     void DrawShapesImpl

Source code excerpt:

				const FConvex* Convex = Implicit->template GetObject<FConvex>();

				const FReal NetMargin = bChaosDebugDebugDrawCoreShapes ? Margin + Convex->GetMargin() : 0.0f;
				DrawShapesConvexImpl(Particle, ShapeTransform, Convex, NetMargin, ShapeColor, Duration, Settings);

				// Generate the exact marging-reduced convex for comparison with the runtime approximation
				// Warning: extremely expensive!
				if (bChaosDebugDebugDrawExactCoreShapes)
				{