p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowLeaves
p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowLeaves
#Overview
name: p.Chaos.Solver.DebugDrawSpatialAccelerationStructure.ShowLeaves
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Show spatial acceleration structure leaves 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.ShowLeaves is to control the debug visualization of spatial acceleration structure leaves in the Chaos physics solver. This setting is part of the debugging and visualization system for the Chaos physics engine in Unreal Engine 5.
This variable is primarily used within the Chaos namespace, which is part of Unreal Engine’s experimental physics system. It is specifically related to the PBDRigidsSolver, which handles rigid body dynamics in the Chaos physics simulation.
The value of this variable is set through the Unreal Engine console variable system, as indicated by the FAutoConsoleVariableRef declaration. This allows developers to toggle this debug feature at runtime or through configuration files.
This variable interacts closely with other debug-related variables, particularly:
- ChaosSolverDebugDrawSpatialAccelerationStructure
- ChaosSolverDebugDrawSpatialAccelerationStructureShowNodes
Developers should be aware that this variable is part of a larger debug visualization system for the Chaos physics solver. It’s specifically designed to show the leaves of the spatial acceleration structure, which is likely a hierarchical structure used for efficient collision detection or spatial queries.
Best practices when using this variable include:
- Use it in conjunction with ChaosSolverDebugDrawSpatialAccelerationStructure for a complete visualization.
- Be aware that enabling debug visualizations may impact performance, so it should primarily be used during development and debugging phases.
- Combine it with ChaosSolverDebugDrawSpatialAccelerationStructureShowNodes to get a complete picture of the spatial acceleration structure.
Regarding the associated variable ChaosSolverDebugDrawSpatialAccelerationStructureShowLeaves:
This is an integer variable that directly corresponds to the console variable. It’s defined within the Chaos::CVars namespace and is used internally by the Chaos physics system to store the current state of the debug visualization setting.
The value of this variable is set by the console variable system when the corresponding console command is used. It’s likely used in conditional statements within the physics solver code to determine whether to render the debug visualization of the spatial acceleration structure leaves.
Developers should note that modifying this variable directly in code is not recommended. Instead, they should use the console variable system to change its value, ensuring consistency across the engine’s systems.
#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:162
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FAutoConsoleVariableRef CVarChaosSolverDrawCharacterGroundConstraints(TEXT("p.Chaos.Solver.DebugDrawCharacterGroundConstraints"), ChaosSolverDrawCharacterGroundConstraints, TEXT("Draw character ground constraints"));
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)."));
#Associated Variable and Callsites
This variable is associated with another variable named ChaosSolverDebugDrawSpatialAccelerationStructureShowLeaves
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:135
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
int32 ChaosSolverDrawCharacterGroundConstraints = 0;
int32 ChaosSolverDebugDrawSpatialAccelerationStructure = 0;
int32 ChaosSolverDebugDrawSpatialAccelerationStructureShowLeaves = 0;
int32 ChaosSolverDebugDrawSpatialAccelerationStructureShowNodes = 0;
int32 ChaosSolverDebugDrawSuspensionConstraints = 0;
int32 ChaosSolverDrawClusterConstraints = 0;
int32 ChaosSolverDebugDrawMeshContacts = 0;
int32 ChaosSolverDebugDrawMeshBVHOverlaps = 0;
int32 ChaosSolverDebugDrawColorShapeByClientServer = 0;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:162
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FAutoConsoleVariableRef CVarChaosSolverDrawCharacterGroundConstraints(TEXT("p.Chaos.Solver.DebugDrawCharacterGroundConstraints"), ChaosSolverDrawCharacterGroundConstraints, TEXT("Draw character ground constraints"));
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)."));