p.Chaos.ArrayCollection.MinSlack

p.Chaos.ArrayCollection.MinSlack

#Overview

name: p.Chaos.ArrayCollection.MinSlack

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.Chaos.ArrayCollection.MinSlack is to control the minimum number of slack elements in particle arrays within the Chaos physics system of Unreal Engine 5. This setting is part of the memory management strategy for the Chaos solver, which is responsible for physics simulations.

Regarding the associated variable ChaosArrayCollectionMinSlack:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:295

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:

		FAutoConsoleVariableRef CVarChaosSolverShrinkArrays(TEXT("p.Chaos.Solver.ShrinkArrays"), bChaosSolverShrinkArrays, TEXT("Enable/Disable particle array shrinking in the main scene"));
		FAutoConsoleVariableRef CVarChaosSolverArrayCollectionMaxSlackFraction(TEXT("p.Chaos.ArrayCollection.MaxSlackFraction"), ChaosArrayCollectionMaxSlackFraction, TEXT("Shrink particle arrays if the number of slack elements exceeds the number of elements by this fraction"));
		FAutoConsoleVariableRef CVarChaosSolverArrayCollectionMinSlack(TEXT("p.Chaos.ArrayCollection.MinSlack"), ChaosArrayCollectionMinSlack, TEXT("Do not reduce the size of particle arrays if it would leave less slack than this"));

		// Iteration count cvars
		// These override the engine config if >= 0

		int32 ChaosSolverCollisionPositionFrictionIterations = -1;
		int32 ChaosSolverCollisionVelocityFrictionIterations = -1;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:292

Scope (from outer to inner):

file
namespace    Chaos
namespace    CVars

Source code excerpt:

		bool bChaosSolverShrinkArrays = false;
		float ChaosArrayCollectionMaxSlackFraction = 0.5f;
		int32 ChaosArrayCollectionMinSlack = 100;
		FAutoConsoleVariableRef CVarChaosSolverShrinkArrays(TEXT("p.Chaos.Solver.ShrinkArrays"), bChaosSolverShrinkArrays, TEXT("Enable/Disable particle array shrinking in the main scene"));
		FAutoConsoleVariableRef CVarChaosSolverArrayCollectionMaxSlackFraction(TEXT("p.Chaos.ArrayCollection.MaxSlackFraction"), ChaosArrayCollectionMaxSlackFraction, TEXT("Shrink particle arrays if the number of slack elements exceeds the number of elements by this fraction"));
		FAutoConsoleVariableRef CVarChaosSolverArrayCollectionMinSlack(TEXT("p.Chaos.ArrayCollection.MinSlack"), ChaosArrayCollectionMinSlack, TEXT("Do not reduce the size of particle arrays if it would leave less slack than this"));

		// Iteration count cvars
		// These override the engine config if >= 0

		int32 ChaosSolverCollisionPositionFrictionIterations = -1;
		int32 ChaosSolverCollisionVelocityFrictionIterations = -1;

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:610

Scope (from outer to inner):

file
namespace    Chaos
class        class AdvanceOneTimeStepTask : public FNonAbandonableTask
function     void DoWork

Source code excerpt:

			{
				QUICK_SCOPE_CYCLE_COUNTER(ShrinkParticleArrays);
				MSolver->GetParticles().ShrinkArrays(CVars::ChaosArrayCollectionMaxSlackFraction, CVars::ChaosArrayCollectionMinSlack);
			}

			if (FRewindData* RewindData = MSolver->GetRewindData())
			{
				SCOPE_CYCLE_COUNTER(STAT_RewindFinishFrame);
				RewindData->FinishFrame();