p.ChaosCloth.DebugDrawSelfCollision
p.ChaosCloth.DebugDrawSelfCollision
#Overview
name: p.ChaosCloth.DebugDrawSelfCollision
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to debug draw the Chaos Cloth self collision information
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.ChaosCloth.DebugDrawSelfCollision is to enable or disable the debug drawing of self-collision information for the Chaos Cloth system in Unreal Engine 5. This setting variable is specifically used for visualization and debugging purposes within the cloth simulation subsystem.
-
The Chaos Cloth plugin and the ChaosClothAsset module rely on this setting variable. It is part of the cloth simulation debugging toolkit.
-
The value of this variable is set as a console variable (CVar) with a default value of false. It can be toggled on or off during runtime or through console commands.
-
This variable interacts with other debug drawing variables for the Chaos Cloth system, such as DebugDrawLongRangeConstraint, DebugDrawWindForces, and DebugDrawSelfIntersection. They are often used together to provide comprehensive visual debugging for different aspects of cloth simulation.
-
Developers must be aware that this variable is intended for debugging and development purposes only. It should not be used in shipping builds, as indicated by the
ECVF_Cheat
flag and its presence in#if CHAOS_DEBUG_DRAW
blocks. -
Best practices when using this variable include:
- Only enable it when actively debugging cloth self-collision issues.
- Use it in conjunction with other debug drawing options for a complete picture of the cloth simulation.
- Remember to disable it when not needed, as debug drawing can impact performance.
The associated variable DebugDrawSelfCollision serves the same purpose as p.ChaosCloth.DebugDrawSelfCollision. It is used within the Chaos Cloth system to control the debug drawing of self-collision information. This variable is typically used in the internal implementation of the cloth simulation system to check whether the debug drawing should be performed. The same considerations and best practices apply to this associated variable as to the console variable.
#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:84
Scope (from outer to inner):
file
namespace ClothingSimulationCVar
Source code excerpt:
TAutoConsoleVariable<bool> DebugDrawLongRangeConstraint (TEXT("p.ChaosCloth.DebugDrawLongRangeConstraint" ), false, TEXT("Whether to debug draw the Chaos Cloth long range constraint (aka tether constraint)"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawWindForces (TEXT("p.ChaosCloth.DebugDrawWindForces" ), false, TEXT("Whether to debug draw the Chaos Cloth wind forces"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawSelfCollision (TEXT("p.ChaosCloth.DebugDrawSelfCollision" ), false, TEXT("Whether to debug draw the Chaos Cloth self collision information"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawSelfIntersection (TEXT("p.ChaosCloth.DebugDrawSelfIntersection" ), false, TEXT("Whether to debug draw the Chaos Cloth self intersection information"), ECVF_Cheat);
}
#endif // #if CHAOS_DEBUG_DRAW
#if !UE_BUILD_SHIPPING
namespace ClothingSimulationConsole
#Loc: <Workspace>/Engine/Plugins/ChaosClothAsset/Source/ChaosClothAssetEngine/Private/ChaosClothAsset/ClothSimulationProxy.cpp:309
Scope (from outer to inner):
file
namespace UE::Chaos::ClothAsset
function void FClothSimulationProxy::Tick
Source code excerpt:
static const TConsoleVariableData<bool>* const DebugDrawLongRangeConstraintCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawLongRangeConstraint"));
static const TConsoleVariableData<bool>* const DebugDrawWindForcesCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawWindForces"));
static const TConsoleVariableData<bool>* const DebugDrawSelfCollisionCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawSelfCollision"));
static const TConsoleVariableData<bool>* const DebugDrawSelfIntersectionCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawSelfIntersection"));
if (DebugDrawLocalSpaceCVar && DebugDrawLocalSpaceCVar->GetValueOnAnyThread()) { Visualization->DrawLocalSpace(); }
if (DebugDrawBoundsCVar && DebugDrawBoundsCVar->GetValueOnAnyThread()) { Visualization->DrawBounds(); }
if (DebugDrawGravityCVar && DebugDrawGravityCVar->GetValueOnAnyThread()) { Visualization->DrawGravity(); }
if (DebugDrawPhysMeshWiredCVar && DebugDrawPhysMeshWiredCVar->GetValueOnAnyThread()) { Visualization->DrawPhysMeshWired(); }
#Associated Variable and Callsites
This variable is associated with another variable named DebugDrawSelfCollision
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:84
Scope (from outer to inner):
file
namespace ClothingSimulationCVar
Source code excerpt:
TAutoConsoleVariable<bool> DebugDrawLongRangeConstraint (TEXT("p.ChaosCloth.DebugDrawLongRangeConstraint" ), false, TEXT("Whether to debug draw the Chaos Cloth long range constraint (aka tether constraint)"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawWindForces (TEXT("p.ChaosCloth.DebugDrawWindForces" ), false, TEXT("Whether to debug draw the Chaos Cloth wind forces"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawSelfCollision (TEXT("p.ChaosCloth.DebugDrawSelfCollision" ), false, TEXT("Whether to debug draw the Chaos Cloth self collision information"), ECVF_Cheat);
TAutoConsoleVariable<bool> DebugDrawSelfIntersection (TEXT("p.ChaosCloth.DebugDrawSelfIntersection" ), false, TEXT("Whether to debug draw the Chaos Cloth self intersection information"), ECVF_Cheat);
}
#endif // #if CHAOS_DEBUG_DRAW
#if !UE_BUILD_SHIPPING
namespace ClothingSimulationConsole
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:593
Scope (from outer to inner):
file
function void FClothingSimulation::Simulate
Source code excerpt:
if (ClothingSimulationCVar::DebugDrawLongRangeConstraint .GetValueOnAnyThread()) { DebugDrawLongRangeConstraint (); }
if (ClothingSimulationCVar::DebugDrawWindForces .GetValueOnAnyThread()) { DebugDrawWindAndPressureForces(); }
if (ClothingSimulationCVar::DebugDrawSelfCollision .GetValueOnAnyThread()) { DebugDrawSelfCollision (); }
if (ClothingSimulationCVar::DebugDrawSelfIntersection .GetValueOnAnyThread()) { DebugDrawSelfIntersection (); }
#endif // #if CHAOS_DEBUG_DRAW
}
void FClothingSimulation::GetSimulationData(
TMap<int32, FClothSimulData>& OutData,
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Public/ChaosCloth/ChaosClothingSimulation.h:111
Scope (from outer to inner):
file
namespace Chaos
class class FClothingSimulation : public FClothingSimulationCommon
function void DebugDrawSelfCollision
Source code excerpt:
void DebugDrawWindForces(FPrimitiveDrawInterface* PDI = nullptr) const { Visualization.DrawWindAndPressureForces(PDI); }
void DebugDrawLocalSpace(FPrimitiveDrawInterface* PDI = nullptr) const { Visualization.DrawLocalSpace(PDI); }
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:
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosClothEditor/Private/ChaosClothEditor/ChaosSimulationEditorExtender.cpp:81
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
FVisualizationOption(&Chaos::FClothingSimulation::DebugDrawWindAndPressureForces, TEXT("p.ChaosClothEditor.DebugDrawWindAndPressureForces"), LOCTEXT("ChaosVisName_WindAndPressureForces", "Wind Aerodynamic And Pressure Forces"), LOCTEXT("ChaosVisName_WindAndPressure_Tooltip", "Draws the Wind drag and lift and pressure forces")),
FVisualizationOption(&Chaos::FClothingSimulation::DebugDrawLocalSpace , TEXT("p.ChaosClothEditor.DebugDrawLocalSpace" ), LOCTEXT("ChaosVisName_LocalSpace" , "Local Space Reference Bone" ), LOCTEXT("ChaosVisName_LocalSpace_Tooltip" , "Draws the local space reference bone")),
FVisualizationOption(&Chaos::FClothingSimulation::DebugDrawSelfCollision , TEXT("p.ChaosClothEditor.DebugDrawSelfCollision" ), LOCTEXT("ChaosVisName_SelfCollision" , "Self Collision" ), LOCTEXT("ChaosVisName_SelfCollision_Tooltip" , "Draws the self collision thickness/debugging information")),
FVisualizationOption(&Chaos::FClothingSimulation::DebugDrawSelfIntersection , TEXT("p.ChaosClothEditor.DebugDrawSelfIntersection" ), LOCTEXT("ChaosVisName_SelfIntersection" , "Self Intersection" ), LOCTEXT("ChaosVisName_SelfIntersection_Tooltip" , "Draws the self intersection contour/region information")),
};
const uint32 FVisualizationOption::Count = sizeof(OptionData) / sizeof(FVisualizationOption);
FSimulationEditorExtender::FSimulationEditorExtender()
: Flags(false, FVisualizationOption::Count)