p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowNodes
p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowNodes
#Overview
name: p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowNodes
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Show spatial acceleration structure nodes when its debug draw is enabled
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowNodes is to enable or disable the debug drawing of spatial acceleration structure nodes in the Chaos physics solver. This setting is part of the debugging and visualization system for the Chaos physics engine in Unreal Engine 5.
The Chaos physics solver, which is part of the Experimental Chaos module in Unreal Engine 5, relies on this setting variable. It is specifically used for debug visualization purposes within the physics simulation.
The value of this variable is set through the Unreal Engine console variable system. It is declared as an integer variable named ChaosSolverDebugDrawSpatialAccelerationStructureShowNodes and is associated with the console command “p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowNodes”.
This variable interacts closely with two other related variables:
- p.Chaos.Solver.DebugDrawSpatialAccelerationStructure
- p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowLeaves
These three variables work together to control different aspects of the debug visualization for the spatial acceleration structure used in the Chaos solver.
Developers should be aware that this is a debugging feature and should only be enabled when necessary for visualization or troubleshooting purposes. Enabling debug drawing can have performance implications, especially in complex scenes or when running on less powerful hardware.
Best practices for using this variable include:
- Only enable it when actively debugging spatial acceleration structure issues.
- Use it in conjunction with the other related debug draw variables for a comprehensive view of the acceleration structure.
- Remember to disable it in production builds or when performance is a concern.
Regarding the associated variable ChaosSolverDebugDrawSpatialAccelerationStructureShowNodes: This is the actual integer variable that stores the state of the debug drawing option. It is initialized to 0 (disabled) by default. The console variable system uses this variable to toggle the debug drawing feature on and off. When developers interact with the p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowNodes console command, they are essentially modifying the value of this associated variable.
The same best practices and considerations apply to this associated variable as they do to the console command itself. Developers should be mindful of its performance impact and use it judiciously during development and debugging sessions.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:163
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FAutoConsoleVariableRef CVarChaosSolverDebugDrawSpatialAccelerationStructure(TEXT("p.Chaos.Solver.DebugDrawSpatialAccelerationStructure"), ChaosSolverDebugDrawSpatialAccelerationStructure, TEXT("Draw spatial acceleration structure"));
FAutoConsoleVariableRef CVarChaosSolverDebugDrawSpatialAccelerationStructureShowLeaves(TEXT("p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowLeaves"), ChaosSolverDebugDrawSpatialAccelerationStructureShowLeaves, TEXT("Show spatial acceleration structure leaves when its debug draw is enabled"));
FAutoConsoleVariableRef CVarChaosSolverDebugDrawSpatialAccelerationStructureShowNodes(TEXT("p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowNodes"), ChaosSolverDebugDrawSpatialAccelerationStructureShowNodes, TEXT("Show spatial acceleration structure nodes when its debug draw is enabled"));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesCoMConnector(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.CoMConnector"), ChaosSolverDrawJointFeatures.bCoMConnector, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesActorConnector(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.ActorConnector"), ChaosSolverDrawJointFeatures.bActorConnector, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesStretch(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.Stretch"), ChaosSolverDrawJointFeatures.bStretch, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesAxes(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.Axes"), ChaosSolverDrawJointFeatures.bAxes, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesLevel(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.Level"), ChaosSolverDrawJointFeatures.bLevel, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesIndex(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.Index"), ChaosSolverDrawJointFeatures.bIndex, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
#Associated Variable and Callsites
This variable is associated with another variable named ChaosSolverDebugDrawSpatialAccelerationStructureShowNodes
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:136
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
int32 ChaosSolverDebugDrawSpatialAccelerationStructure = 0;
int32 ChaosSolverDebugDrawSpatialAccelerationStructureShowLeaves = 0;
int32 ChaosSolverDebugDrawSpatialAccelerationStructureShowNodes = 0;
int32 ChaosSolverDebugDrawSuspensionConstraints = 0;
int32 ChaosSolverDrawClusterConstraints = 0;
int32 ChaosSolverDebugDrawMeshContacts = 0;
int32 ChaosSolverDebugDrawMeshBVHOverlaps = 0;
int32 ChaosSolverDebugDrawColorShapeByClientServer = 0;
int32 ChaosSolverDebugDrawShowServer = 1;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:163
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FAutoConsoleVariableRef CVarChaosSolverDebugDrawSpatialAccelerationStructure(TEXT("p.Chaos.Solver.DebugDrawSpatialAccelerationStructure"), ChaosSolverDebugDrawSpatialAccelerationStructure, TEXT("Draw spatial acceleration structure"));
FAutoConsoleVariableRef CVarChaosSolverDebugDrawSpatialAccelerationStructureShowLeaves(TEXT("p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowLeaves"), ChaosSolverDebugDrawSpatialAccelerationStructureShowLeaves, TEXT("Show spatial acceleration structure leaves when its debug draw is enabled"));
FAutoConsoleVariableRef CVarChaosSolverDebugDrawSpatialAccelerationStructureShowNodes(TEXT("p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowNodes"), ChaosSolverDebugDrawSpatialAccelerationStructureShowNodes, TEXT("Show spatial acceleration structure nodes when its debug draw is enabled"));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesCoMConnector(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.CoMConnector"), ChaosSolverDrawJointFeatures.bCoMConnector, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesActorConnector(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.ActorConnector"), ChaosSolverDrawJointFeatures.bActorConnector, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesStretch(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.Stretch"), ChaosSolverDrawJointFeatures.bStretch, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesAxes(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.Axes"), ChaosSolverDrawJointFeatures.bAxes, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesLevel(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.Level"), ChaosSolverDrawJointFeatures.bLevel, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));
FAutoConsoleVariableRef CVarChaosSolverDrawJointFeaturesIndex(TEXT("p.Chaos.Solver.DebugDraw.JointFeatures.Index"), ChaosSolverDrawJointFeatures.bIndex, TEXT("Joint features mask (see FDebugDrawJointFeatures)."));