p.ChaosCloth.DebugDrawWindForces
p.ChaosCloth.DebugDrawWindForces
#Overview
name: p.ChaosCloth.DebugDrawWindForces
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to debug draw the Chaos Cloth wind forces
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.ChaosCloth.DebugDrawWindForces is to enable debug drawing of wind forces acting on the Chaos Cloth simulation in Unreal Engine 5. This setting variable is primarily used for the Chaos Cloth system, which is part of the physics simulation in Unreal Engine.
This setting variable is relied upon by the ChaosCloth plugin and the ChaosClothAsset module. These are responsible for simulating and rendering cloth physics in Unreal Engine 5.
The value of this variable is set as a console variable, which means it can be changed at runtime through the game console or through code. It is initialized as false by default, as seen in the ChaosClothingSimulation.cpp file.
The associated variable DebugDrawWindForces interacts directly with p.ChaosCloth.DebugDrawWindForces. They share the same value and purpose. In the code, DebugDrawWindForces is used to actually perform the debug drawing when the console variable is set to true.
Developers must be aware that this is a debug feature and should only be used during development and testing. It’s not intended for use in shipping builds, as evidenced by the #if !UE_BUILD_SHIPPING preprocessor directive.
Best practices when using this variable include:
- Only enable it when necessary for debugging wind force issues in cloth simulation.
- Disable it in shipping builds to avoid performance overhead.
- Use it in conjunction with other debug drawing options for a comprehensive view of the cloth simulation.
Regarding the associated variable DebugDrawWindForces:
- It’s a function that actually performs the debug drawing when called.
- It has been deprecated in version 5.1 and renamed to DebugDrawWindAndPressureForces, suggesting that it now includes visualization of pressure forces as well.
- When using this function, developers should be aware of the deprecation and use the new DebugDrawWindAndPressureForces function instead.
- The function can take an optional FPrimitiveDrawInterface parameter, allowing for custom rendering contexts if needed.
#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:83
Scope (from outer to inner):
file
namespace ClothingSimulationCVar
Source code excerpt:
TAutoConsoleVariable<bool> DebugDrawBendingConstraint (TEXT("p.ChaosCloth.DebugDrawBendingConstraint" ), false, TEXT("Whether to debug draw the Chaos Cloth bending constraint"), ECVF_Cheat);
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
#Loc: <Workspace>/Engine/Plugins/ChaosClothAsset/Source/ChaosClothAssetEngine/Private/ChaosClothAsset/ClothSimulationProxy.cpp:308
Scope (from outer to inner):
file
namespace UE::Chaos::ClothAsset
function void FClothSimulationProxy::Tick
Source code excerpt:
static const TConsoleVariableData<bool>* const DebugDrawBendingConstraintCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawBendingConstraint"));
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(); }
#Associated Variable and Callsites
This variable is associated with another variable named DebugDrawWindForces
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:83
Scope (from outer to inner):
file
namespace ClothingSimulationCVar
Source code excerpt:
TAutoConsoleVariable<bool> DebugDrawBendingConstraint (TEXT("p.ChaosCloth.DebugDrawBendingConstraint" ), false, TEXT("Whether to debug draw the Chaos Cloth bending constraint"), ECVF_Cheat);
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
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:592
Scope (from outer to inner):
file
function void FClothingSimulation::Simulate
Source code excerpt:
if (ClothingSimulationCVar::DebugDrawBendingConstraint .GetValueOnAnyThread()) { DebugDrawBendingConstraint (); }
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(
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Public/ChaosCloth/ChaosClothingSimulation.h:109
Scope (from outer to inner):
file
namespace Chaos
class class FClothingSimulation : public FClothingSimulationCommon
function void DebugDrawWindForces
Source code excerpt:
void DebugDrawWindAndPressureForces(FPrimitiveDrawInterface* PDI = nullptr) const { Visualization.DrawWindAndPressureForces(PDI); }
UE_DEPRECATED(5.1, "DebugDrawWindForces has been renamed DebugDrawWindAndPressureForces.")
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