p.ChaosCloth.DebugDrawBounds
p.ChaosCloth.DebugDrawBounds
#Overview
name: p.ChaosCloth.DebugDrawBounds
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to debug draw the Chaos Cloth bounds
It is referenced in 8
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.ChaosCloth.DebugDrawBounds is to enable debug drawing of the Chaos Cloth bounds in Unreal Engine 5. This setting variable is primarily used for debugging and visualization purposes within the Chaos Cloth simulation system.
The Chaos Cloth simulation system, which is part of the ChaosCloth plugin, relies on this setting variable. It is used in both the ChaosCloth and ChaosClothAsset modules.
The value of this variable is set as a console variable, initialized to false by default. It can be toggled on or off during runtime for debugging purposes.
This variable interacts with several other debug drawing variables for the Chaos Cloth system, such as DebugDrawLocalSpace, DebugDrawGravity, DebugDrawPhysMeshWired, and others. They are all part of a set of debug visualization tools for the Chaos Cloth system.
Developers should be aware that this variable is intended for debugging and visualization purposes only. It should not be relied upon for gameplay logic or shipping builds. Enabling debug drawing can have performance implications, so it should be used judiciously.
Best practices when using this variable include:
- Only enable it when actively debugging cloth simulation issues.
- Disable it in shipping builds to avoid performance overhead.
- Use it in conjunction with other debug drawing options to get a comprehensive view of the cloth simulation.
The associated variable DebugDrawBounds is essentially the same as p.ChaosCloth.DebugDrawBounds. It’s used within the Chaos Cloth simulation code to actually perform the debug drawing when the console variable is set to true. The purpose and usage considerations are the same as for p.ChaosCloth.DebugDrawBounds.
When DebugDrawBounds is enabled, it calls the DebugDrawBounds() function of the FClothingSimulation class, which in turn uses the Visualization system to draw the bounds of the cloth simulation.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:66
Scope (from outer to inner):
file
namespace ClothingSimulationCVar
Source code excerpt:
{
TAutoConsoleVariable<bool> DebugDrawLocalSpace (TEXT("p.ChaosCloth.DebugDrawLocalSpace" ), false, TEXT("Whether to debug draw the Chaos Cloth local space"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawBounds (TEXT("p.ChaosCloth.DebugDrawBounds" ), false, TEXT("Whether to debug draw the Chaos Cloth bounds"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawGravity (TEXT("p.ChaosCloth.DebugDrawGravity" ), false, TEXT("Whether to debug draw the Chaos Cloth gravity acceleration vector"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawPhysMeshWired (TEXT("p.ChaosCloth.DebugDrawPhysMeshWired" ), false, TEXT("Whether to debug draw the Chaos Cloth wireframe meshes"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawAnimMeshWired (TEXT("p.ChaosCloth.DebugDrawAnimMeshWired" ), false, TEXT("Whether to debug draw the animated/kinematic Cloth wireframe meshes"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawAnimNormals (TEXT("p.ChaosCloth.DebugDrawAmimNormals" ), false, TEXT("Whether to debug draw the animated/kinematic Cloth normals"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawPointNormals (TEXT("p.ChaosCloth.DebugDrawPointNormals" ), false, TEXT("Whether to debug draw the Chaos Cloth point normals"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawPointVelocities (TEXT("p.ChaosCloth.DebugDrawPointVelocities" ), false, TEXT("Whether to debug draw the Chaos Cloth point velocities"), ECVF_Cheat);
#Loc: <Workspace>/Engine/Plugins/ChaosClothAsset/Source/ChaosClothAssetEngine/Private/ChaosClothAsset/ClothSimulationProxy.cpp:293
Scope (from outer to inner):
file
namespace UE::Chaos::ClothAsset
function void FClothSimulationProxy::Tick
Source code excerpt:
#if CHAOS_DEBUG_DRAW
static const TConsoleVariableData<bool>* const DebugDrawLocalSpaceCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawLocalSpace"));
static const TConsoleVariableData<bool>* const DebugDrawBoundsCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawBounds"));
static const TConsoleVariableData<bool>* const DebugDrawGravityCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawGravity"));
static const TConsoleVariableData<bool>* const DebugDrawPhysMeshWiredCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawPhysMeshWired"));
static const TConsoleVariableData<bool>* const DebugDrawAnimMeshWiredCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawAnimMeshWired"));
static const TConsoleVariableData<bool>* const DebugDrawPointVelocitiesCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawPointVelocities"));
static const TConsoleVariableData<bool>* const DebugDrawAnimNormalsCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawAnimNormals"));
static const TConsoleVariableData<bool>* const DebugDrawPointNormalsCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawPointNormals"));
#Associated Variable and Callsites
This variable is associated with another variable named DebugDrawBounds
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:66
Scope (from outer to inner):
file
namespace ClothingSimulationCVar
Source code excerpt:
{
TAutoConsoleVariable<bool> DebugDrawLocalSpace (TEXT("p.ChaosCloth.DebugDrawLocalSpace" ), false, TEXT("Whether to debug draw the Chaos Cloth local space"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawBounds (TEXT("p.ChaosCloth.DebugDrawBounds" ), false, TEXT("Whether to debug draw the Chaos Cloth bounds"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawGravity (TEXT("p.ChaosCloth.DebugDrawGravity" ), false, TEXT("Whether to debug draw the Chaos Cloth gravity acceleration vector"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawPhysMeshWired (TEXT("p.ChaosCloth.DebugDrawPhysMeshWired" ), false, TEXT("Whether to debug draw the Chaos Cloth wireframe meshes"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawAnimMeshWired (TEXT("p.ChaosCloth.DebugDrawAnimMeshWired" ), false, TEXT("Whether to debug draw the animated/kinematic Cloth wireframe meshes"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawAnimNormals (TEXT("p.ChaosCloth.DebugDrawAmimNormals" ), false, TEXT("Whether to debug draw the animated/kinematic Cloth normals"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawPointNormals (TEXT("p.ChaosCloth.DebugDrawPointNormals" ), false, TEXT("Whether to debug draw the Chaos Cloth point normals"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawPointVelocities (TEXT("p.ChaosCloth.DebugDrawPointVelocities" ), false, TEXT("Whether to debug draw the Chaos Cloth point velocities"), ECVF_Cheat);
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:577
Scope (from outer to inner):
file
function void FClothingSimulation::Simulate
Source code excerpt:
#if CHAOS_DEBUG_DRAW
if (ClothingSimulationCVar::DebugDrawLocalSpace .GetValueOnAnyThread()) { DebugDrawLocalSpace (); }
if (ClothingSimulationCVar::DebugDrawBounds .GetValueOnAnyThread()) { DebugDrawBounds (); }
if (ClothingSimulationCVar::DebugDrawGravity .GetValueOnAnyThread()) { DebugDrawGravity (); }
if (ClothingSimulationCVar::DebugDrawPhysMeshWired .GetValueOnAnyThread()) { DebugDrawPhysMeshWired (); }
if (ClothingSimulationCVar::DebugDrawAnimMeshWired .GetValueOnAnyThread()) { DebugDrawAnimMeshWired (); }
if (ClothingSimulationCVar::DebugDrawPointVelocities .GetValueOnAnyThread()) { DebugDrawPointVelocities (); }
if (ClothingSimulationCVar::DebugDrawAnimNormals .GetValueOnAnyThread()) { DebugDrawAnimNormals (); }
if (ClothingSimulationCVar::DebugDrawPointNormals .GetValueOnAnyThread()) { DebugDrawPointNormals (); }
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Public/ChaosCloth/ChaosClothingSimulation.h:113
Scope (from outer to inner):
file
namespace Chaos
class class FClothingSimulation : public FClothingSimulationCommon
function void DebugDrawBounds
Source code excerpt:
void DebugDrawSelfCollision(FPrimitiveDrawInterface* PDI = nullptr) const { Visualization.DrawSelfCollision(PDI); }
void DebugDrawSelfIntersection(FPrimitiveDrawInterface* PDI = nullptr) const { Visualization.DrawSelfIntersection(PDI); }
void DebugDrawBounds(FPrimitiveDrawInterface* PDI = nullptr) const { Visualization.DrawBounds(PDI); }
void DebugDrawGravity(FPrimitiveDrawInterface* PDI = nullptr) const { Visualization.DrawGravity(PDI); }
#endif // #if CHAOS_DEBUG_DRAW
private:
void ResetStats();
void UpdateStats(const FClothingSimulationCloth* Cloth);
#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraDataChannel_Islands.cpp:171
Scope (from outer to inner):
file
function void UNiagaraDataChannelHandler_Islands::Tick
Source code excerpt:
if(IslandChannel->GetDebugDrawSettings().ShowBounds())
{
Island.DebugDrawBounds();
}
//Free up islands that are not being used.
//We do this immediately as we leave it up to the handler systems to delay their cleanup as long as they want to.
if (Island.IsBeingUsed() == false)
{
#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraDataChannel_Islands.cpp:509
Scope (from outer to inner):
file
function void FNDCIsland::DebugDrawBounds
Source code excerpt:
}
void FNDCIsland::DebugDrawBounds()
{
DrawDebugBox(Owner->GetWorld(), Bounds.Origin, Bounds.BoxExtent, FQuat::Identity, FColor::Red);
}
#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Public/NiagaraDataChannel_Islands.h:60
Scope: file
Source code excerpt:
FNiagaraDataChannelDataPtr GetData()const { return Data; }
void DebugDrawBounds();
private:
/** The owning handler for this island. */
UPROPERTY()
TObjectPtr<UNiagaraDataChannelHandler_Islands> Owner = nullptr;