p.Chaos.NewtonEvolution.WriteCCDContacts
p.Chaos.NewtonEvolution.WriteCCDContacts
#Overview
name: p.Chaos.NewtonEvolution.WriteCCDContacts
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Write CCD collision contacts and normals potentially causing the CCD collision threads to lock, allowing for debugging of these contacts.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.NewtonEvolution.WriteCCDContacts is to enable debugging of Continuous Collision Detection (CCD) contacts in the Chaos physics system of Unreal Engine 5. It is specifically used for writing CCD collision contacts and normals, which can potentially cause CCD collision threads to lock.
This setting variable is primarily used in the Chaos physics subsystem, which is part of Unreal Engine’s experimental physics simulation module. It is referenced in the NewtonEvolution.cpp file, which suggests it’s part of the Newton solver for physics simulations.
The value of this variable is set as a console variable (CVar) with a default value of false. It can be changed at runtime through the console or configuration files.
The associated variable CVarChaosNewtonEvolutionWriteCCDContacts interacts directly with p.Chaos.NewtonEvolution.WriteCCDContacts. They share the same value and purpose.
Developers must be aware that enabling this variable may impact performance due to the additional writing of debug information and potential thread locking. It should only be used when debugging CCD collision issues.
Best practices for using this variable include:
- Only enable it when specifically debugging CCD collision problems.
- Be prepared for potential performance impacts when enabled.
- Disable it in production builds to avoid unnecessary overhead.
Regarding the associated variable CVarChaosNewtonEvolutionWriteCCDContacts:
This is the actual C++ variable that controls the behavior defined by p.Chaos.NewtonEvolution.WriteCCDContacts. It’s used in the AdvanceOneTimeStep function of the FNewtonEvolution class within the Chaos::Softs namespace.
The value of this variable is retrieved using the GetValueOnAnyThread() method, which suggests it can be accessed from multiple threads. Developers should be cautious about changing this value during runtime, as it could affect ongoing physics simulations.
When using this variable, developers should consider the context of the entire physics simulation step and understand that enabling it might introduce additional computational overhead in exchange for valuable debugging information.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/NewtonEvolution.cpp:37
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionUseSmoothTimeStep(TEXT("p.Chaos.NewtonEvolution.UseSmoothTimeStep"), true, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<int32> CVarChaosNewtonEvolutionMinParallelBatchSize(TEXT("p.Chaos.NewtonEvolution.MinParallelBatchSize"), 300, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionWriteCCDContacts(TEXT("p.Chaos.NewtonEvolution.WriteCCDContacts"), false, TEXT("Write CCD collision contacts and normals potentially causing the CCD collision threads to lock, allowing for debugging of these contacts."), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionParallelIntegrate(TEXT("p.Chaos.NewtonEvolution.ParalleIntegrate"), false, TEXT("Run the integration step in parallel for."), ECVF_Cheat);
//#if INTEL_ISPC && !UE_BUILD_SHIPPING
//bool bChaos_PostIterationUpdates_ISPC_Enabled = true;
//FAutoConsoleVariableRef CVarChaosPostIterationUpdatesISPCEnabled(TEXT("p.Chaos.PostIterationUpdates.ISPC"), bChaos_PostIterationUpdates_ISPC_Enabled, TEXT("Whether to use ISPC optimizations in Newton Post iteration updates"));
//
#Associated Variable and Callsites
This variable is associated with another variable named CVarChaosNewtonEvolutionWriteCCDContacts
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/NewtonEvolution.cpp:37
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionUseSmoothTimeStep(TEXT("p.Chaos.NewtonEvolution.UseSmoothTimeStep"), true, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<int32> CVarChaosNewtonEvolutionMinParallelBatchSize(TEXT("p.Chaos.NewtonEvolution.MinParallelBatchSize"), 300, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionWriteCCDContacts(TEXT("p.Chaos.NewtonEvolution.WriteCCDContacts"), false, TEXT("Write CCD collision contacts and normals potentially causing the CCD collision threads to lock, allowing for debugging of these contacts."), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionParallelIntegrate(TEXT("p.Chaos.NewtonEvolution.ParalleIntegrate"), false, TEXT("Run the integration step in parallel for."), ECVF_Cheat);
//#if INTEL_ISPC && !UE_BUILD_SHIPPING
//bool bChaos_PostIterationUpdates_ISPC_Enabled = true;
//FAutoConsoleVariableRef CVarChaosPostIterationUpdatesISPCEnabled(TEXT("p.Chaos.PostIterationUpdates.ISPC"), bChaos_PostIterationUpdates_ISPC_Enabled, TEXT("Whether to use ISPC optimizations in Newton Post iteration updates"));
//
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/NewtonEvolution.cpp:705
Scope (from outer to inner):
file
namespace Chaos::Softs
function void FNewtonEvolution::AdvanceOneTimeStep
Source code excerpt:
TNumericLimits<int32>::Max() : // Disable
CVarChaosNewtonEvolutionMinParallelBatchSize.GetValueOnAnyThread(); // TODO: 1000 is a guess, tune this!
const bool bWriteCCDContacts = CVarChaosNewtonEvolutionWriteCCDContacts.GetValueOnAnyThread();
{
TRACE_CPUPROFILER_EVENT_SCOPE(ChaosNewtonPreIterationUpdates);
MParticlesActiveView.RangeFor(
[this, Dt, MinParallelBatchSize](FSolverParticles& Particles, int32 Offset, int32 Range)