p.Chaos.Solver.InertiaConditioning.Enabled
p.Chaos.Solver.InertiaConditioning.Enabled
#Overview
name: p.Chaos.Solver.InertiaConditioning.Enabled
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable/Disable constraint stabilization through inertia conditioning
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Solver.InertiaConditioning.Enabled is to control the activation of inertia conditioning for joint and collision stabilization in the Chaos physics solver, particularly for small and thin objects.
This setting variable is used in the Chaos physics system, which is part of Unreal Engine’s experimental physics module. It’s specifically utilized in the PBDRigidsEvolutionGBF (Position Based Dynamics Rigid Evolution) component of the Chaos solver.
The value of this variable is set using an FAutoConsoleVariableRef, which allows it to be modified at runtime through console commands. It’s initialized to true by default.
The associated variable bChaosSolverInertiaConditioningEnabled directly interacts with p.Chaos.Solver.InertiaConditioning.Enabled. They share the same value and are used interchangeably in the code.
Developers should be aware that this variable affects the stability of physics simulations, particularly for small or thin objects that may be prone to jittering or unstable behavior. Enabling this feature can help improve the overall stability of the physics simulation.
Best practices when using this variable include:
- Testing the physics behavior with this feature both enabled and disabled to determine the optimal setting for your specific use case.
- Monitoring performance impacts, as enabling this feature may introduce additional computational overhead.
- Using in conjunction with other Chaos solver settings like p.Chaos.Solver.InertiaConditioning.Distance for fine-tuning physics behavior.
Regarding the associated variable bChaosSolverInertiaConditioningEnabled:
The purpose of bChaosSolverInertiaConditioningEnabled is to provide a C++ accessible boolean flag for the inertia conditioning feature within the Chaos solver code.
This variable is used directly in the UpdateInertiaConditioning function of the FPBDRigidsEvolutionGBF class, which is part of the core Chaos physics simulation logic.
The value of this variable is set in tandem with p.Chaos.Solver.InertiaConditioning.Enabled through the FAutoConsoleVariableRef mechanism.
It interacts closely with other physics-related variables and functions, such as Rigid.InertiaConditioningEnabled() and CalculateParticleInertiaConditioning().
Developers should be aware that this variable directly influences the physics simulation loop and can affect the behavior of dynamic rigid bodies in the scene.
Best practices for using this variable include:
- Ensuring consistency between this variable and its console variable counterpart.
- Using it in conjunction with other inertia conditioning parameters for fine-grained control over physics behavior.
- Profiling the performance impact of enabling/disabling this feature in your specific use case.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolutionGBF.cpp:102
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// Enable inertia conditioning for joint and collisions stabilization for small and thin objects
bool bChaosSolverInertiaConditioningEnabled = true;
FAutoConsoleVariableRef CVarChaosSolverInertiaConditioningEnabled(TEXT("p.Chaos.Solver.InertiaConditioning.Enabled"), bChaosSolverInertiaConditioningEnabled, TEXT("Enable/Disable constraint stabilization through inertia conditioning"));
// The largest joint error we expect to resolve in a moderately stable way
FRealSingle ChaosSolverInertiaConditioningDistance = 20;
FAutoConsoleVariableRef CVarChaosSolverInertiaConditioningDistance(TEXT("p.Chaos.Solver.InertiaConditioning.Distance"), ChaosSolverInertiaConditioningDistance, TEXT("An input to inertia conditioning system. The joint distance error which needs to be stable (generate a low rotation)."));
// The ratio of joint error correction that comes from particle rotation versus translation
#Associated Variable and Callsites
This variable is associated with another variable named bChaosSolverInertiaConditioningEnabled
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolutionGBF.cpp:101
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// Enable inertia conditioning for joint and collisions stabilization for small and thin objects
bool bChaosSolverInertiaConditioningEnabled = true;
FAutoConsoleVariableRef CVarChaosSolverInertiaConditioningEnabled(TEXT("p.Chaos.Solver.InertiaConditioning.Enabled"), bChaosSolverInertiaConditioningEnabled, TEXT("Enable/Disable constraint stabilization through inertia conditioning"));
// The largest joint error we expect to resolve in a moderately stable way
FRealSingle ChaosSolverInertiaConditioningDistance = 20;
FAutoConsoleVariableRef CVarChaosSolverInertiaConditioningDistance(TEXT("p.Chaos.Solver.InertiaConditioning.Distance"), ChaosSolverInertiaConditioningDistance, TEXT("An input to inertia conditioning system. The joint distance error which needs to be stable (generate a low rotation)."));
// The ratio of joint error correction that comes from particle rotation versus translation
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolutionGBF.cpp:1655
Scope (from outer to inner):
file
namespace Chaos
function void FPBDRigidsEvolutionGBF::UpdateInertiaConditioning
Source code excerpt:
if (Rigid.InertiaConditioningDirty())
{
const bool bWantInertiaConditioning = Rigid.IsDynamic() && Rigid.InertiaConditioningEnabled() && bChaosSolverInertiaConditioningEnabled;
if (bWantInertiaConditioning)
{
const FVec3f InvInertiaScale = CalculateParticleInertiaConditioning(Rigid.Handle(), MaxDistance, MaxRotationRatio, MaxInvInertiaComponentRatio);
Rigid.SetInvIConditioning(InvInertiaScale);
}
else