p.ChaosCloth.DebugDrawSelfIntersection
p.ChaosCloth.DebugDrawSelfIntersection
#Overview
name: p.ChaosCloth.DebugDrawSelfIntersection
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to debug draw the Chaos Cloth self intersection information
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.ChaosCloth.DebugDrawSelfIntersection is to enable debug drawing of self-intersection information for Chaos Cloth simulations in Unreal Engine 5. This setting variable is primarily used for debugging and visualization purposes within the Chaos Cloth system.
-
The Chaos Cloth plugin and the Chaos Cloth Asset Engine module rely on this setting variable. It’s part of the cloth simulation system in Unreal Engine 5.
-
The value of this variable is set as a console variable (CVar) with default value false. It can be toggled on or off during runtime for debugging purposes.
-
This variable interacts with other debug drawing variables in the Chaos Cloth system, such as DebugDrawWindForces and DebugDrawSelfCollision. They are often used together to provide comprehensive visual debugging for cloth simulations.
-
Developers should be aware that this variable is intended for debugging and development purposes only. It should not be enabled in shipping builds as it may impact performance.
-
Best practices when using this variable include:
- Only enable it when actively debugging cloth self-intersection issues.
- Use it in conjunction with other debug drawing options for a complete picture of the cloth simulation.
- Disable it when not needed to avoid unnecessary performance overhead.
Regarding the associated variable DebugDrawSelfIntersection:
This is actually the same variable, just referenced in different contexts. It’s used both as a console variable and as a method name in the FClothingSimulation class. The purpose remains the same - to debug draw self-intersection information for Chaos Cloth.
- It’s used within the Chaos namespace, specifically in the FClothingSimulation class.
- The value is typically set through the console variable, but the corresponding method is called when the debug drawing is actually performed.
- It’s often used alongside other debug drawing methods like DebugDrawSelfCollision and DebugDrawLocalSpace.
- Developers should note that this functionality is only available in non-shipping builds (wrapped in #if !UE_BUILD_SHIPPING).
- Best practice is to use this method in conjunction with the console variable, enabling it when needed for visual debugging of cloth self-intersection issues.
#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:85
Scope (from outer to inner):
file
namespace ClothingSimulationCVar
Source code excerpt:
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:310
Scope (from outer to inner):
file
namespace UE::Chaos::ClothAsset
function void FClothSimulationProxy::Tick
Source code excerpt:
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(); }
if (DebugDrawAnimMeshWiredCVar && DebugDrawAnimMeshWiredCVar->GetValueOnAnyThread()) { Visualization->DrawAnimMeshWired(); }
#Associated Variable and Callsites
This variable is associated with another variable named DebugDrawSelfIntersection
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:85
Scope (from outer to inner):
file
namespace ClothingSimulationCVar
Source code excerpt:
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:594
Scope (from outer to inner):
file
function void FClothingSimulation::Simulate
Source code excerpt:
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,
USkeletalMeshComponent* InOwnerComponent,
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Public/ChaosCloth/ChaosClothingSimulation.h:112
Scope (from outer to inner):
file
namespace Chaos
class class FClothingSimulation : public FClothingSimulationCommon
function void DebugDrawSelfIntersection
Source code excerpt:
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:
void ResetStats();
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosClothEditor/Private/ChaosClothEditor/ChaosSimulationEditorExtender.cpp:82
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
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)
{