p.Chaos.ImmPhys.InertiaConditioning.LinearEnabled
p.Chaos.ImmPhys.InertiaConditioning.LinearEnabled
#Overview
name: p.Chaos.ImmPhys.InertiaConditioning.LinearEnabled
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable/Disable constraint stabilization through inertia conditioning when using the linear joint solver
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.ImmPhys.InertiaConditioning.LinearEnabled is to control the enabling or disabling of constraint stabilization through inertia conditioning when using the linear joint solver in Unreal Engine’s Chaos physics system.
This setting variable is primarily used in the Immediate Physics simulation module of the Chaos physics system, which is part of Unreal Engine’s physics engine. Based on the callsites, it’s specifically used in the ImmediatePhysicsSimulation_Chaos.cpp file, indicating its relevance to the immediate physics simulation in Chaos.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands. By default, it is set to true, enabling the inertia conditioning for the linear joint solver.
This variable interacts closely with bChaosImmediate_NonLinearInertiaConditioningEnabled, which serves a similar purpose but for the non-linear joint solver. Together, they control the inertia conditioning behavior for different types of joint solvers.
Developers must be aware that this variable specifically affects the linear joint solver. Changing this setting will impact the stability and behavior of physics simulations using the linear joint solver in the Chaos system.
Best practices when using this variable include:
- Understanding the implications of enabling or disabling inertia conditioning on your specific physics simulations.
- Testing the physics behavior with both enabled and disabled states to determine the optimal setting for your game’s requirements.
- Considering performance implications, as enabling inertia conditioning may have a performance cost.
Regarding the associated variable bChaosImmediate_LinearInertiaConditioningEnabled:
The purpose of bChaosImmediate_LinearInertiaConditioningEnabled is to store the actual boolean value that determines whether linear inertia conditioning is enabled or disabled.
This variable is used directly in the physics simulation code, specifically in the UpdateInertiaConditioning function of the FSimulation class. It’s checked to determine whether to apply inertia conditioning when using the linear joint solver.
The value of this variable is set by the console variable p.Chaos.ImmPhys.InertiaConditioning.LinearEnabled, allowing it to be changed at runtime.
It interacts with bChaosImmediate_NonLinearInertiaConditioningEnabled to determine which inertia conditioning to use based on the joint solver type.
Developers should be aware that this variable directly affects the physics simulation behavior and should be modified with caution.
Best practices include:
- Using this variable in conjunction with profiling tools to understand its impact on physics simulation performance and stability.
- Documenting any changes made to this variable, as it can significantly affect the behavior of physics objects in the game.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:138
Scope: file
Source code excerpt:
bool bChaosImmediate_LinearInertiaConditioningEnabled = true;
FAutoConsoleVariableRef CVarChaosImmPhysParticleLinearInertiaConditioningEnabled(TEXT("p.Chaos.ImmPhys.InertiaConditioning.LinearEnabled"), bChaosImmediate_LinearInertiaConditioningEnabled, TEXT("Enable/Disable constraint stabilization through inertia conditioning when using the linear joint solver"));
bool bChaosImmediate_NonLinearInertiaConditioningEnabled = false;
FAutoConsoleVariableRef CVarChaosImmPhysParticleNonLinearInertiaConditioningEnabled(TEXT("p.Chaos.ImmPhys.InertiaConditioning.NonlinearEnabled"), bChaosImmediate_NonLinearInertiaConditioningEnabled, TEXT("Enable/Disable constraint stabilization through inertia conditioning when using the non-linear joint solver"));
Chaos::FRealSingle ChaosImmediate_InertiaConditioningDistance = 10;
FAutoConsoleVariableRef CVarChaosImmPhysParticleInertiaConditioningDistance(TEXT("p.Chaos.ImmPhys.InertiaConditioning.Distance"), ChaosImmediate_InertiaConditioningDistance, TEXT("An input to inertia conditioning system. The joint distance error which needs to be stable (generate a low rotation)."));
#Associated Variable and Callsites
This variable is associated with another variable named bChaosImmediate_LinearInertiaConditioningEnabled
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:137
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarChaosImmPhysJointMaxInertiaRatio(TEXT("p.Chaos.ImmPhys.Joint.MaxInertiaRatio"), ChaosImmediate_Joint_MaxInertiaRatio, TEXT("6Dof joint MaxInertiaRatio (if > 0)"));
bool bChaosImmediate_LinearInertiaConditioningEnabled = true;
FAutoConsoleVariableRef CVarChaosImmPhysParticleLinearInertiaConditioningEnabled(TEXT("p.Chaos.ImmPhys.InertiaConditioning.LinearEnabled"), bChaosImmediate_LinearInertiaConditioningEnabled, TEXT("Enable/Disable constraint stabilization through inertia conditioning when using the linear joint solver"));
bool bChaosImmediate_NonLinearInertiaConditioningEnabled = false;
FAutoConsoleVariableRef CVarChaosImmPhysParticleNonLinearInertiaConditioningEnabled(TEXT("p.Chaos.ImmPhys.InertiaConditioning.NonlinearEnabled"), bChaosImmediate_NonLinearInertiaConditioningEnabled, TEXT("Enable/Disable constraint stabilization through inertia conditioning when using the non-linear joint solver"));
Chaos::FRealSingle ChaosImmediate_InertiaConditioningDistance = 10;
FAutoConsoleVariableRef CVarChaosImmPhysParticleInertiaConditioningDistance(TEXT("p.Chaos.ImmPhys.InertiaConditioning.Distance"), ChaosImmediate_InertiaConditioningDistance, TEXT("An input to inertia conditioning system. The joint distance error which needs to be stable (generate a low rotation)."));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:985
Scope (from outer to inner):
file
namespace ImmediatePhysics_Chaos
function void FSimulation::UpdateInertiaConditioning
Source code excerpt:
// Linear and Non-linear joint solvers have a separate cvar to enable inertia conditioning
const bool bUseInertiaConditioning = Implementation->Joints.GetSettings().bUseLinearSolver ? bChaosImmediate_LinearInertiaConditioningEnabled : bChaosImmediate_NonLinearInertiaConditioningEnabled;
if (bUseInertiaConditioning)
{
// The maximum contribution to error correction from rotation
const FRealSingle MaxRotationRatio = ChaosImmediate_InertiaConditioningRotationRatio;