p.Chaos.Solver.DebugDrawIslands
p.Chaos.Solver.DebugDrawIslands
#Overview
name: p.Chaos.Solver.DebugDrawIslands
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Draw solver islands (0 = never; 1 = end of frame).
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Solver.DebugDrawIslands is to enable debug drawing of solver islands in the Chaos physics system of Unreal Engine 5. This setting is primarily used for visualization and debugging purposes within the physics simulation.
This setting variable is used in the Chaos physics subsystem, which is part of the Experimental namespace in Unreal Engine 5. It’s specifically used in the PBDRigidsSolver (Position Based Dynamics Rigids Solver) module.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which allows it to be changed at runtime through console commands or configuration files.
The associated variable ChaosSolverDrawIslands interacts directly with p.Chaos.Solver.DebugDrawIslands. They share the same value and are used interchangeably in the code.
Developers should be aware that this is a debug visualization tool and should only be enabled when needed for debugging purposes. It’s not intended for use in production builds as it may impact performance.
Best practices for using this variable include:
- Only enable it when actively debugging physics issues related to solver islands.
- Be aware that enabling this visualization may impact performance, especially in complex scenes.
- Use it in conjunction with other debug drawing tools (like DebugDrawBounds, DebugDrawTransforms) for a more comprehensive view of the physics state.
- Remember to disable it when not needed to avoid unnecessary performance overhead.
Regarding the associated variable ChaosSolverDrawIslands:
- It’s an integer variable initialized to 0, meaning the debug drawing is disabled by default.
- It’s used directly in the PostTickDebugDraw function of the FPBDRigidsSolver class to conditionally trigger the drawing of the constraint graph when set to 1.
- Like p.Chaos.Solver.DebugDrawIslands, it should be used judiciously and only when necessary for debugging purposes.
- It’s part of a larger set of debug drawing options for the Chaos solver, allowing developers to visualize different aspects of the physics simulation as needed.
#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:152
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FAutoConsoleVariableRef CVarChaosSolverDrawBounds(TEXT("p.Chaos.Solver.DebugDrawBounds"), ChaosSolverDebugDrawBounds, TEXT("Draw bounding volumes inside the broadphase (0 = never; 1 = end of frame)."));
FAutoConsoleVariableRef CVarChaosSolverDrawTransforms(TEXT("p.Chaos.Solver.DebugDrawTransforms"), ChaosSolverDrawTransforms, TEXT("Draw particle transforms (0 = never; 1 = end of frame)."));
FAutoConsoleVariableRef CVarChaosSolverDrawIslands(TEXT("p.Chaos.Solver.DebugDrawIslands"), ChaosSolverDrawIslands, TEXT("Draw solver islands (0 = never; 1 = end of frame)."));
FAutoConsoleVariableRef CVarChaosSolverDrawIslandSleepState(TEXT("p.Chaos.Solver.DebugDrawSleepState"), ChaosSolverDebugDrawIslandSleepState, TEXT("Draw island sleep state."));
FAutoConsoleVariableRef CVarChaosSolverDrawCCD(TEXT("p.Chaos.Solver.DebugDrawCCDInteractions"), ChaosSolverDrawCCDInteractions, TEXT("Draw CCD interactions."));
FAutoConsoleVariableRef CVarChaosSolverDrawCCDThresholds(TEXT("p.Chaos.Solver.DebugDrawCCDThresholds"), ChaosSolverDrawCCDThresholds, TEXT("Draw CCD swept thresholds."));
FAutoConsoleVariableRef CVarChaosSolverDrawShapesShapesStatic(TEXT("p.Chaos.Solver.DebugDraw.ShowStatics"), ChaosSolverDrawShapesShowStatic, TEXT("If DebugDrawShapes is enabled, whether to show static objects"));
FAutoConsoleVariableRef CVarChaosSolverDrawShapesShapesKinematic(TEXT("p.Chaos.Solver.DebugDraw.ShowKinematics"), ChaosSolverDrawShapesShowKinematic, TEXT("If DebugDrawShapes is enabled, whether to show kinematic objects"));
FAutoConsoleVariableRef CVarChaosSolverDrawShapesShapesDynamic(TEXT("p.Chaos.Solver.DebugDraw.ShowDynamics"), ChaosSolverDrawShapesShowDynamic, TEXT("If DebugDrawShapes is enabled, whether to show dynamic objects"));
#Associated Variable and Callsites
This variable is associated with another variable named ChaosSolverDrawIslands
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:125
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
int32 ChaosSolverDebugDrawBounds = 0;
int32 ChaosSolverDrawTransforms = 0;
int32 ChaosSolverDrawIslands = 0;
int32 ChaosSolverDebugDrawIslandSleepState = 0;
int32 ChaosSolverDrawCCDInteractions = 0;
int32 ChaosSolverDrawCCDThresholds = 0;
int32 ChaosSolverDrawShapesShowStatic = 1;
int32 ChaosSolverDrawShapesShowKinematic = 1;
int32 ChaosSolverDrawShapesShowDynamic = 1;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:152
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FAutoConsoleVariableRef CVarChaosSolverDrawBounds(TEXT("p.Chaos.Solver.DebugDrawBounds"), ChaosSolverDebugDrawBounds, TEXT("Draw bounding volumes inside the broadphase (0 = never; 1 = end of frame)."));
FAutoConsoleVariableRef CVarChaosSolverDrawTransforms(TEXT("p.Chaos.Solver.DebugDrawTransforms"), ChaosSolverDrawTransforms, TEXT("Draw particle transforms (0 = never; 1 = end of frame)."));
FAutoConsoleVariableRef CVarChaosSolverDrawIslands(TEXT("p.Chaos.Solver.DebugDrawIslands"), ChaosSolverDrawIslands, TEXT("Draw solver islands (0 = never; 1 = end of frame)."));
FAutoConsoleVariableRef CVarChaosSolverDrawIslandSleepState(TEXT("p.Chaos.Solver.DebugDrawSleepState"), ChaosSolverDebugDrawIslandSleepState, TEXT("Draw island sleep state."));
FAutoConsoleVariableRef CVarChaosSolverDrawCCD(TEXT("p.Chaos.Solver.DebugDrawCCDInteractions"), ChaosSolverDrawCCDInteractions, TEXT("Draw CCD interactions."));
FAutoConsoleVariableRef CVarChaosSolverDrawCCDThresholds(TEXT("p.Chaos.Solver.DebugDrawCCDThresholds"), ChaosSolverDrawCCDThresholds, TEXT("Draw CCD swept thresholds."));
FAutoConsoleVariableRef CVarChaosSolverDrawShapesShapesStatic(TEXT("p.Chaos.Solver.DebugDraw.ShowStatics"), ChaosSolverDrawShapesShowStatic, TEXT("If DebugDrawShapes is enabled, whether to show static objects"));
FAutoConsoleVariableRef CVarChaosSolverDrawShapesShapesKinematic(TEXT("p.Chaos.Solver.DebugDraw.ShowKinematics"), ChaosSolverDrawShapesShowKinematic, TEXT("If DebugDrawShapes is enabled, whether to show kinematic objects"));
FAutoConsoleVariableRef CVarChaosSolverDrawShapesShapesDynamic(TEXT("p.Chaos.Solver.DebugDraw.ShowDynamics"), ChaosSolverDrawShapesShowDynamic, TEXT("If DebugDrawShapes is enabled, whether to show dynamic objects"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:2579
Scope (from outer to inner):
file
namespace Chaos
function void FPBDRigidsSolver::PostTickDebugDraw
Source code excerpt:
DebugDraw::DrawParticleTransforms(FRigidTransform3(), Particles.GetAllParticlesView(), &ChaosSolverDebugDebugDrawSettings);
}
if (ChaosSolverDrawIslands == 1)
{
DebugDraw::DrawConstraintGraph(FRigidTransform3(), GetEvolution()->GetIslandManager(), &ChaosSolverDebugDebugDrawSettings);
}
if (ChaosSolverDebugDrawIslandSleepState == 1)
{
GetEvolution()->GetIslandManager().DebugDrawSleepState(&ChaosSolverDebugDebugDrawSettings);