p.Chaos.DebugDraw.ShowInactiveContacts
p.Chaos.DebugDraw.ShowInactiveContacts
#Overview
name: p.Chaos.DebugDraw.ShowInactiveContacts
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to show inactive contacts (ones that contributed no impulses or pushout)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.ShowInactiveContacts is to control the debug visualization of inactive contacts in the Chaos physics system of Unreal Engine 5. Specifically, it determines whether to show contacts that have not contributed any impulses or pushout during physics simulation.
This setting variable is primarily used in the Chaos physics subsystem, which is part of the experimental physics engine in Unreal Engine 5. 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 changed at runtime through console commands or configuration files.
The associated variable bChaosDebugDebugDrawInactiveContacts directly interacts with p.Chaos.DebugDraw.ShowInactiveContacts. They share the same value, with bChaosDebugDebugDrawInactiveContacts being the actual boolean variable used in the code logic.
Developers must be aware that this variable affects debug visualization only and does not impact the actual physics simulation. It’s primarily a tool for debugging and understanding the behavior of the physics system.
Best practices when using this variable include:
- Use it in conjunction with other debug drawing options for a comprehensive view of the physics state.
- Be aware that showing inactive contacts might increase visual clutter, so use it selectively when needed.
- Remember to disable it in release builds to avoid any potential performance impact from debug drawing.
Regarding the associated variable bChaosDebugDebugDrawInactiveContacts:
- Its purpose is to serve as the actual boolean flag used in the code to determine whether inactive contacts should be drawn.
- It’s used directly in the DrawCollisionImpl function to decide whether to continue drawing a contact point based on its activity status.
- The value is set by the console variable system and can be changed at runtime.
- Developers should treat this variable as read-only within their code, allowing the console variable system to manage its value.
#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:49
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
bool bChaosDebugDebugDrawInactiveContacts = true;
FAutoConsoleVariableRef CVarChaosDebugDrawInactiveContacts(TEXT("p.Chaos.DebugDraw.ShowInactiveContacts"), bChaosDebugDebugDrawInactiveContacts, TEXT("Whether to show inactive contacts (ones that contributed no impulses or pushout)"));
bool bChaosDebugDebugDrawContactIterations = false;
FAutoConsoleVariableRef CVarChaosDebugDrawContactIterations(TEXT("p.Chaos.DebugDraw.ShowContactIterations"), bChaosDebugDebugDrawContactIterations, TEXT("Whether to show an indicator of how many iterations a contact was active for"));
bool bChaosDebugDebugDrawColorShapesByShapeType = false;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawColorShapesByShapeType(TEXT("p.Chaos.DebugDraw.ColorShapesByShapeType"), bChaosDebugDebugDrawColorShapesByShapeType, TEXT("Whether to use shape type to define the color of the shapes instead of using the particle state "));
#Associated Variable and Callsites
This variable is associated with another variable named bChaosDebugDebugDrawInactiveContacts
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:48
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
Source code excerpt:
FAutoConsoleVariableRef CVarChaosDebugDrawShapeParticles(TEXT("p.Chaos.DebugDraw.ShowCollisionParticles"), bChaosDebugDebugDrawCollisionParticles, TEXT("Whether to show the collision particles if present"));
bool bChaosDebugDebugDrawInactiveContacts = true;
FAutoConsoleVariableRef CVarChaosDebugDrawInactiveContacts(TEXT("p.Chaos.DebugDraw.ShowInactiveContacts"), bChaosDebugDebugDrawInactiveContacts, TEXT("Whether to show inactive contacts (ones that contributed no impulses or pushout)"));
bool bChaosDebugDebugDrawContactIterations = false;
FAutoConsoleVariableRef CVarChaosDebugDrawContactIterations(TEXT("p.Chaos.DebugDraw.ShowContactIterations"), bChaosDebugDebugDrawContactIterations, TEXT("Whether to show an indicator of how many iterations a contact was active for"));
bool bChaosDebugDebugDrawColorShapesByShapeType = false;
FAutoConsoleVariableRef CVarChaosDebugDebugDrawColorShapesByShapeType(TEXT("p.Chaos.DebugDraw.ColorShapesByShapeType"), bChaosDebugDebugDrawColorShapesByShapeType, TEXT("Whether to use shape type to define the color of the shapes instead of using the particle state "));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ChaosDebugDraw.cpp:1237
Scope (from outer to inner):
file
namespace Chaos
namespace DebugDraw
function void DrawCollisionImpl
Source code excerpt:
const bool bIsActive = ManifoldPointResult.bIsValid && (!ManifoldPointResult.NetPushOut.IsNearlyZero() || !ManifoldPointResult.NetImpulse.IsNearlyZero() || (!Contact.GetUseManifold() && !Contact.AccumulatedImpulse.IsNearlyZero()));
const bool bPruned = ManifoldPoint.Flags.bDisabled;
if ((bPruned || !bIsActive) && !bChaosDebugDebugDrawInactiveContacts)
{
continue;
}
const int32 ContactPlaneOwner = 1;
const int32 ContactPointOwner = 1 - ContactPlaneOwner;