p.ChaosNumContactIterationsOverride

p.ChaosNumContactIterationsOverride

#Overview

name: p.ChaosNumContactIterationsOverride

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of p.ChaosNumContactIterationsOverride is to control the number of contact iterations in the Chaos physics system within Unreal Engine 5. This setting variable is specifically related to the physics simulation, particularly the contact resolution process.

This setting variable is primarily used in the Chaos physics module, which is an experimental physics system in Unreal Engine 5. Based on the callsites, it’s evident that this variable is used in the PBDRigidsEvolution component of the Chaos system, which likely handles rigid body dynamics and collision resolution.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of -1 and can be overridden at runtime using the console command “p.ChaosNumContactIterationsOverride”.

The associated variable ChaosNumContactIterationsOverride directly interacts with p.ChaosNumContactIterationsOverride. They share the same value, with the CVar p.ChaosNumContactIterationsOverride serving as the interface for adjusting the value at runtime.

Developers should be aware that:

  1. The default value of -1 likely indicates that the system should use a predefined or calculated number of iterations.
  2. Setting a value >= 0 will override the default behavior and force the system to use the specified number of contact iterations.

Best practices when using this variable include:

  1. Only override the default value if there’s a specific need to adjust the physics simulation behavior.
  2. Be cautious when increasing the number of iterations, as it may impact performance.
  3. Test thoroughly after changing this value to ensure it doesn’t negatively affect the physics simulation or overall game performance.

Regarding the associated variable ChaosNumContactIterationsOverride:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolution.cpp:20

Scope: file

Source code excerpt:


int32 ChaosNumContactIterationsOverride = -1;
FAutoConsoleVariableRef CVarChaosNumContactIterationsOverride(TEXT("p.ChaosNumContactIterationsOverride"), ChaosNumContactIterationsOverride, TEXT("Override for num contact iterations if >= 0. [def:-1]"));

namespace Chaos
{
	namespace CVars
	{
		extern bool bChaos_Solver_TestMode_Enabled;

#Associated Variable and Callsites

This variable is associated with another variable named ChaosNumContactIterationsOverride. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolution.cpp:19

Scope: file

Source code excerpt:

FAutoConsoleVariableRef CVarChaosNumPushOutIterationsOverride(TEXT("p.ChaosNumPushOutIterationsOverride"), ChaosNumPushOutIterationsOverride, TEXT("Override for num push out iterations if >= 0 [def:-1]"));

int32 ChaosNumContactIterationsOverride = -1;
FAutoConsoleVariableRef CVarChaosNumContactIterationsOverride(TEXT("p.ChaosNumContactIterationsOverride"), ChaosNumContactIterationsOverride, TEXT("Override for num contact iterations if >= 0. [def:-1]"));

namespace Chaos
{
	namespace CVars
	{
		extern bool bChaos_Solver_TestMode_Enabled;

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/PBDRigidsEvolution.h:27

Scope: file

Source code excerpt:

extern int32 ChaosRigidsEvolutionApplyPushoutAllowEarlyOutCVar;
extern int32 ChaosNumPushOutIterationsOverride;
extern int32 ChaosNumContactIterationsOverride;

namespace Chaos
{
extern CHAOS_API int32 ForceNoCollisionIntoSQ;

struct FBroadPhaseConfig