P.Chaos.Simulation.Enable

P.Chaos.Simulation.Enable

#Overview

name: P.Chaos.Simulation.Enable

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of P.Chaos.Simulation.Enable is to control the activation of the Chaos physics simulation in Unreal Engine 5. This setting variable is used to enable or disable the Chaos physics system, which is responsible for simulating physical interactions in the game world.

Regarding the associated variable CVar_ChaosSimulationEnable:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/PhysicsCore/Private/ChaosScene.cpp:48

Scope: file

Source code excerpt:

DECLARE_DWORD_ACCUMULATOR_STAT(TEXT("NumDirtyNonEmptyCellsInGrid"), STAT_ChaosCounter_NumDirtyNonEmptyCellsInGrid, STATGROUP_ChaosCounters);

TAutoConsoleVariable<int32> CVar_ChaosSimulationEnable(TEXT("P.Chaos.Simulation.Enable"),1,TEXT("Enable / disable chaos simulation. If disabled, physics will not tick."));
TAutoConsoleVariable<int32> CVar_ApplyProjectSettings(TEXT("p.Chaos.Simulation.ApplySolverProjectSettings"), 1, TEXT("Whether to apply the solver project settings on spawning a solver"));

FChaosScene::FChaosScene(
	UObject* OwnerPtr
	, Chaos::FReal InAsyncDt
#if CHAOS_DEBUG_NAME

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/PhysicsCore/Private/ChaosScene.cpp:48

Scope: file

Source code excerpt:

DECLARE_DWORD_ACCUMULATOR_STAT(TEXT("NumDirtyNonEmptyCellsInGrid"), STAT_ChaosCounter_NumDirtyNonEmptyCellsInGrid, STATGROUP_ChaosCounters);

TAutoConsoleVariable<int32> CVar_ChaosSimulationEnable(TEXT("P.Chaos.Simulation.Enable"),1,TEXT("Enable / disable chaos simulation. If disabled, physics will not tick."));
TAutoConsoleVariable<int32> CVar_ApplyProjectSettings(TEXT("p.Chaos.Simulation.ApplySolverProjectSettings"), 1, TEXT("Whether to apply the solver project settings on spawning a solver"));

FChaosScene::FChaosScene(
	UObject* OwnerPtr
	, Chaos::FReal InAsyncDt
#if CHAOS_DEBUG_NAME

#Loc: <Workspace>/Engine/Source/Runtime/PhysicsCore/Private/ChaosScene.cpp:370

Scope (from outer to inner):

file
function     void FChaosScene::StartFrame

Source code excerpt:

	SCOPE_CYCLE_COUNTER(STAT_Scene_StartFrame);

	if(CVar_ChaosSimulationEnable.GetValueOnGameThread() == 0)
	{
		return;
	}

	const float UseDeltaTime = OnStartFrame(MDeltaTime);;

#Loc: <Workspace>/Engine/Source/Runtime/PhysicsCore/Private/ChaosScene.cpp:493

Scope (from outer to inner):

file
function     void FChaosScene::EndFrame

Source code excerpt:

	SCOPE_CYCLE_COUNTER(STAT_Scene_EndFrame);

	if(CVar_ChaosSimulationEnable.GetValueOnGameThread() == 0 || GetSolver() == nullptr)
	{
		return;
	}

#if !UE_BUILD_SHIPPING
	{