p.Chaos.Solver.Sleep.IsolatedParticle.LinearMultiplier

p.Chaos.Solver.Sleep.IsolatedParticle.LinearMultiplier

#Overview

name: p.Chaos.Solver.Sleep.IsolatedParticle.LinearMultiplier

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.Solver.Sleep.IsolatedParticle.LinearMultiplier is to adjust the sleep linear threshold for floating particles in the Chaos physics simulation system of Unreal Engine 5.

This setting variable is used in the Chaos physics subsystem, specifically in the Island Manager component. It’s part of the Experimental Chaos module, which is responsible for handling physics simulations in Unreal Engine 5.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1.0f and can be adjusted at runtime using console commands or through configuration files.

This variable interacts directly with the associated variable IsolatedParticleSleepLinearThresholdMultiplier. They share the same value and are used together to modify the sleep behavior of isolated (floating) particles in the physics simulation.

Developers must be aware that this variable affects the performance and behavior of physics simulations, particularly for objects that are not in contact with other objects (isolated or floating). Adjusting this value can change how quickly or easily these objects enter a sleep state, which can impact both performance and visual fidelity.

Best practices when using this variable include:

  1. Use it in conjunction with profiling tools to find the right balance between performance and simulation accuracy.
  2. Test thoroughly with different values in various scenarios to ensure desired behavior across all use cases.
  3. Consider the implications on gameplay and visual consistency when modifying this value.
  4. Document any non-default values used in the project for easier maintenance and debugging.

Regarding the associated variable IsolatedParticleSleepLinearThresholdMultiplier:

The purpose of this variable is the same as p.Chaos.Solver.Sleep.IsolatedParticle.LinearMultiplier - it’s used to adjust the sleep linear threshold for floating particles in the Chaos physics simulation.

This variable is used directly in the GetIsolatedParticleSleepThresholds function within the Chaos::Private namespace. It’s multiplied with the OutSleepLinearThreshold to adjust the sleep threshold for isolated particles.

The value is set through the CVar system and shares the same value as p.Chaos.Solver.Sleep.IsolatedParticle.LinearMultiplier.

Developers should be aware that this variable is used in the core logic that determines when isolated particles should enter a sleep state. Modifying it will directly affect the physics simulation’s behavior and performance.

Best practices for using this variable are similar to those for p.Chaos.Solver.Sleep.IsolatedParticle.LinearMultiplier, with an additional emphasis on understanding its role in the GetIsolatedParticleSleepThresholds function and how it interacts with other threshold calculations in the physics system.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Island/IslandManager.cpp:74

Scope (from outer to inner):

file
namespace    Chaos::CVars

Source code excerpt:

	/* Cvar to adjust the sleep linear threshold for floating particles */
	FRealSingle IsolatedParticleSleepLinearThresholdMultiplier = 1.0f;
	FAutoConsoleVariableRef CVarChaosSolverIsolatedParticleSleepLinearThresholdMultiplier(TEXT("p.Chaos.Solver.Sleep.IsolatedParticle.LinearMultiplier"), IsolatedParticleSleepLinearThresholdMultiplier, TEXT("A multiplier applied to SleepLinearThreshold for floating particles"));

	/* Cvar to adjust the sleep angular threshold for floating particles */
	FRealSingle IsolatedParticleSleepAngularThresholdMultiplier = 1.0f;
	FAutoConsoleVariableRef CVarChaosSolverIsolatedParticleSleepAngularThresholdMultiplier(TEXT("p.Chaos.Solver.Sleep.IsolatedParticle.AngularMultiplier"), IsolatedParticleSleepAngularThresholdMultiplier, TEXT("A multiplier applied to SleepAngularThreshold for floating particles"));
}

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Island/IslandManager.cpp:73

Scope (from outer to inner):

file
namespace    Chaos::CVars

Source code excerpt:


	/* Cvar to adjust the sleep linear threshold for floating particles */
	FRealSingle IsolatedParticleSleepLinearThresholdMultiplier = 1.0f;
	FAutoConsoleVariableRef CVarChaosSolverIsolatedParticleSleepLinearThresholdMultiplier(TEXT("p.Chaos.Solver.Sleep.IsolatedParticle.LinearMultiplier"), IsolatedParticleSleepLinearThresholdMultiplier, TEXT("A multiplier applied to SleepLinearThreshold for floating particles"));

	/* Cvar to adjust the sleep angular threshold for floating particles */
	FRealSingle IsolatedParticleSleepAngularThresholdMultiplier = 1.0f;
	FAutoConsoleVariableRef CVarChaosSolverIsolatedParticleSleepAngularThresholdMultiplier(TEXT("p.Chaos.Solver.Sleep.IsolatedParticle.AngularMultiplier"), IsolatedParticleSleepAngularThresholdMultiplier, TEXT("A multiplier applied to SleepAngularThreshold for floating particles"));
}

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Island/IslandManager.cpp:211

Scope (from outer to inner):

file
namespace    Chaos::Private
function     bool GetIsolatedParticleSleepThresholds

Source code excerpt:

			// upwards ballistic trajectory, or when a floating oscillating body reverses rotation, etc.
			OutSleepCounterThreshold *= FMath::Max(1, CVars::IsolatedParticleSleepCounterThresholdMultiplier);
			OutSleepLinearThreshold *= FMath::Max(0.0f, CVars::IsolatedParticleSleepLinearThresholdMultiplier);
			OutSleepAngularThreshold *= FMath::Max(0.0f, CVars::IsolatedParticleSleepAngularThresholdMultiplier);

			return true;
		}

		return false;