p.ChaosCloth.DebugDrawGravity
p.ChaosCloth.DebugDrawGravity
#Overview
name: p.ChaosCloth.DebugDrawGravity
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to debug draw the Chaos Cloth gravity acceleration vector
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.ChaosCloth.DebugDrawGravity is to enable debug drawing of the Chaos Cloth gravity acceleration vector. This setting variable is part of the debugging and visualization system for the Chaos Cloth simulation in Unreal Engine 5.
-
The Chaos Cloth plugin and module rely on this setting variable. It’s specifically used in the Chaos Cloth simulation system, which is part of the physics and cloth simulation capabilities of Unreal Engine.
-
The value of this variable is set as a console variable (CVar) in the engine. It’s initialized as false by default, meaning the debug drawing is off unless explicitly enabled.
-
This variable interacts with other debug drawing variables for the Chaos Cloth system, such as DebugDrawLocalSpace, DebugDrawBounds, DebugDrawPhysMeshWired, etc. They are all part of a suite of debugging tools for the Chaos Cloth simulation.
-
Developers must be aware that this is a debugging feature and should only be enabled when needed for visualization or troubleshooting purposes. Enabling debug drawing can have performance implications, especially in a shipping build.
-
Best practices when using this variable include:
- Only enable it when actively debugging cloth simulation issues.
- Use it in conjunction with other debug drawing options to get a comprehensive view of the cloth simulation.
- Remember to disable it when not needed to avoid unnecessary performance overhead.
Regarding the associated variable DebugDrawGravity:
This is the actual TAutoConsoleVariable
-
Its purpose is the same as p.ChaosCloth.DebugDrawGravity - to control the debug drawing of the gravity acceleration vector in the Chaos Cloth simulation.
-
It’s used in the FClothingSimulation::Simulate function to determine whether to call the DebugDrawGravity() function.
-
The value is typically accessed using the GetValueOnAnyThread() method, which allows it to be checked from any thread safely.
-
Developers should be aware that this is an internal variable and should generally interact with it through the console variable system rather than directly.
-
Best practices include using the console commands to toggle this setting during runtime for debugging, rather than modifying the code directly.
#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:67
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);
TAutoConsoleVariable<bool> DebugDrawFaceNormals (TEXT("p.ChaosCloth.DebugDrawFaceNormals" ), false, TEXT("Whether to debug draw the Chaos Cloth face normals"), ECVF_Cheat);
#Loc: <Workspace>/Engine/Plugins/ChaosClothAsset/Source/ChaosClothAssetEngine/Private/ChaosClothAsset/ClothSimulationProxy.cpp:294
Scope (from outer to inner):
file
namespace UE::Chaos::ClothAsset
function void FClothSimulationProxy::Tick
Source code excerpt:
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"));
static const TConsoleVariableData<bool>* const DebugDrawCollisionCVar = IConsoleManager::Get().FindTConsoleVariableDataBool(TEXT("p.ChaosCloth.DebugDrawCollision"));
#Associated Variable and Callsites
This variable is associated with another variable named DebugDrawGravity
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:67
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);
TAutoConsoleVariable<bool> DebugDrawFaceNormals (TEXT("p.ChaosCloth.DebugDrawFaceNormals" ), false, TEXT("Whether to debug draw the Chaos Cloth face normals"), ECVF_Cheat);
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Private/ChaosCloth/ChaosClothingSimulation.cpp:578
Scope (from outer to inner):
file
function void FClothingSimulation::Simulate
Source code excerpt:
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 (); }
if (ClothingSimulationCVar::DebugDrawCollision .GetValueOnAnyThread()) { DebugDrawCollision (); }
#Loc: <Workspace>/Engine/Plugins/ChaosCloth/Source/ChaosCloth/Public/ChaosCloth/ChaosClothingSimulation.h:114
Scope (from outer to inner):
file
namespace Chaos
class class FClothingSimulation : public FClothingSimulationCommon
function void DebugDrawGravity
Source code excerpt:
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);