p.Chaos.DebugDraw.Deformable.KinematicParticle
p.Chaos.DebugDraw.Deformable.KinematicParticle
#Overview
name: p.Chaos.DebugDraw.Deformable.KinematicParticle
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Debug draw the deformables kinematic particles. [def: false]
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.DebugDraw.Deformable.KinematicParticle is to enable debug drawing of kinematic particles in the Unreal Engine 5’s Chaos physics system, specifically for deformable objects.
This setting variable is primarily used by the Chaos physics system, which is part of Unreal Engine’s experimental physics simulation module. It is specifically utilized in the deformable solver component of the Chaos system.
The value of this variable is set through the Unreal Engine console variable system, as evidenced by the FAutoConsoleVariableRef declaration in the source code. It can be toggled on or off, with the default value being false.
This variable interacts with other debug drawing variables, such as p.Chaos.DebugDraw.Enabled. The debug drawing will only occur if both p.Chaos.DebugDraw.Enabled and p.Chaos.DebugDraw.Deformable.KinematicParticle are set to true.
Developers must be aware that this is a debug feature and should only be used during development and debugging processes. Enabling this feature may have performance implications, especially in complex scenes with many deformable objects.
Best practices when using this variable include:
- Only enable it when actively debugging deformable physics behavior.
- Disable it in release builds or when performance is a concern.
- Use it in conjunction with other debug drawing options to get a comprehensive view of the physics simulation.
- Be cautious when using it in multiplayer or networked environments, as it may affect performance or cause desyncs if not handled properly.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Deformable/ChaosDeformableSolver.cpp:72
Scope (from outer to inner):
file
namespace Chaos::Softs
Source code excerpt:
FAutoConsoleVariableRef CVarDeformableDebugParamsDrawTetrahedralParticles(TEXT("p.Chaos.DebugDraw.Deformable.TetrahedralParticle"), GDeformableDebugParams.bDoDrawTetrahedralParticles, TEXT("Debug draw the deformable solvers tetrahedron. [def: false]"));
FAutoConsoleVariableRef CVarDeformableDebugParamsDrawKinematicParticles(TEXT("p.Chaos.DebugDraw.Deformable.KinematicParticle"), GDeformableDebugParams.bDoDrawKinematicParticles, TEXT("Debug draw the deformables kinematic particles. [def: false]"));
FAutoConsoleVariableRef CVarDeformableDebugParamsDrawTransientKinematicParticles(TEXT("p.Chaos.DebugDraw.Deformable.TransientKinematicParticle"), GDeformableDebugParams.bDoDrawTransientKinematicParticles, TEXT("Debug draw the deformables transient kinematic particles. [def: false]"));
FAutoConsoleVariableRef CVarDeformableDebugParamsDrawRigidCollisionGeometry(TEXT("p.Chaos.DebugDraw.Deformable.RigidCollisionGeometry"), GDeformableDebugParams.bDoDrawRigidCollisionGeometry, TEXT("Debug draw the deformable solvers rigid collision geometry. [def: false]"));
FDeformableXPBDCorotatedParams GDeformableXPBDCorotatedParams;
FAutoConsoleVariableRef CVarDeformableXPBDCorotatedBatchSize(TEXT("p.Chaos.Deformable.XPBDBatchSize"), GDeformableXPBDCorotatedParams.XPBDCorotatedBatchSize, TEXT("Batch size for physics parallel for. [def: 5]"));
FAutoConsoleVariableRef CVarDeformableXPBDCorotatedBatchThreshold(TEXT("p.Chaos.Deformable.XPBDBatchThreshold"), GDeformableXPBDCorotatedParams.XPBDCorotatedBatchThreshold, TEXT("Batch threshold for physics parallel for. [def: 5]"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Deformable/ChaosDeformableSolver.cpp:1074
Scope (from outer to inner):
file
lambda-function
Source code excerpt:
//debug draw
//p.Chaos.DebugDraw.Enabled 1
//p.Chaos.DebugDraw.Deformable.KinematicParticle 1
if (GDeformableDebugParams.IsDebugDrawingEnabled() && GDeformableDebugParams.bDoDrawKinematicParticles)
{
auto DoubleVert = [](FVector3f V) { return FVector3d(V.X, V.Y, V.Z); };
Chaos::FDebugDrawQueue::GetInstance().DrawDebugPoint(DoubleVert(MParticles.GetX(Index)), FColor::Red, false, -1.0f, 0, 5);
}
#endif
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Deformable/ChaosDeformableSolver.cpp:1094
Scope (from outer to inner):
file
namespace Chaos::Softs
function void FDeformableSolver::InitializeKinematicConstraint
lambda-function
Source code excerpt:
//debug draw
//p.Chaos.DebugDraw.Enabled 1
//p.Chaos.DebugDraw.Deformable.KinematicParticle 1
if (GDeformableDebugParams.IsDebugDrawingEnabled() && GDeformableDebugParams.bDoDrawKinematicParticles)
{
auto DoubleVert = [](FVector3f V) { return FVector3d(V.X, V.Y, V.Z); };
Chaos::FDebugDrawQueue::GetInstance().DrawDebugPoint(DoubleVert(MParticles.GetX(Index)), FColor::Red, false, -1.0f, 0, 5);
}
#endif