p.Chaos.Solver.Sleep.IsolatedParticle.AngularMultiplier
p.Chaos.Solver.Sleep.IsolatedParticle.AngularMultiplier
#Overview
name: p.Chaos.Solver.Sleep.IsolatedParticle.AngularMultiplier
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
A multiplier applied to SleepAngularThreshold for floating particles
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Solver.Sleep.IsolatedParticle.AngularMultiplier is to adjust the sleep angular threshold for floating particles in the Chaos physics system of Unreal Engine 5.
This setting variable is primarily used within the Chaos physics subsystem, specifically in the Island management component of the solver. It’s part of the experimental Chaos namespace, indicating it’s a feature of the new Chaos physics engine 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.
The variable interacts directly with an associated variable named IsolatedParticleSleepAngularThresholdMultiplier. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable specifically affects isolated or floating particles in the physics simulation. It’s a multiplier applied to the SleepAngularThreshold for these particles, which determines when they enter a sleep state to save computational resources.
Best practices when using this variable include:
- Adjusting it carefully, as it can impact performance and simulation accuracy.
- Testing thoroughly after changes, especially in scenarios with many floating objects.
- Considering the balance between performance optimization and simulation fidelity.
Regarding the associated variable IsolatedParticleSleepAngularThresholdMultiplier:
This variable serves the same purpose as p.Chaos.Solver.Sleep.IsolatedParticle.AngularMultiplier. It’s used internally within the Chaos physics system to store and apply the multiplier value.
It’s defined in the Chaos::CVars namespace and is used in the GetIsolatedParticleSleepThresholds function to calculate the final sleep angular threshold for isolated particles.
The value is set through the CVar system and can be adjusted in the same ways as p.Chaos.Solver.Sleep.IsolatedParticle.AngularMultiplier.
Developers should treat this variable with the same considerations as the CVar it’s associated with, understanding that changes to either will affect the sleep behavior of isolated particles in the Chaos physics simulation.
#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:78
Scope (from outer to inner):
file
namespace Chaos::CVars
Source code excerpt:
/* 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"));
}
namespace Chaos::Private
{
//////////////////////////////////////////////////////////////////////////////////////////////////
#Associated Variable and Callsites
This variable is associated with another variable named IsolatedParticleSleepAngularThresholdMultiplier
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Island/IslandManager.cpp:77
Scope (from outer to inner):
file
namespace Chaos::CVars
Source code excerpt:
/* 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"));
}
namespace Chaos::Private
{
//////////////////////////////////////////////////////////////////////////////////////////////////
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Island/IslandManager.cpp:212
Scope (from outer to inner):
file
namespace Chaos::Private
function bool GetIsolatedParticleSleepThresholds
Source code excerpt:
OutSleepCounterThreshold *= FMath::Max(1, CVars::IsolatedParticleSleepCounterThresholdMultiplier);
OutSleepLinearThreshold *= FMath::Max(0.0f, CVars::IsolatedParticleSleepLinearThresholdMultiplier);
OutSleepAngularThreshold *= FMath::Max(0.0f, CVars::IsolatedParticleSleepAngularThresholdMultiplier);
return true;
}
return false;
}