p.Chaos.ImmPhys.InertiaConditioning.MaxInvInertiaComponentRatio

p.Chaos.ImmPhys.InertiaConditioning.MaxInvInertiaComponentRatio

#Overview

name: p.Chaos.ImmPhys.InertiaConditioning.MaxInvInertiaComponentRatio

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.ImmPhys.InertiaConditioning.MaxInvInertiaComponentRatio is to serve as an input parameter for the inertia conditioning system in Unreal Engine’s Chaos physics simulation, specifically for the Immediate Physics module.

This setting variable is primarily used by the Chaos physics subsystem within Unreal Engine’s physics engine. It is part of the Immediate Physics implementation, which is likely a specialized version of the physics simulation for certain use cases.

The value of this variable is set through the Unreal Engine console variable system, as evidenced by the FAutoConsoleVariableRef declaration. This allows for runtime modification of the value, which can be useful for debugging and fine-tuning physics behavior.

The associated variable ChaosImmediate_MaxInvInertiaComponentRatio directly interacts with p.Chaos.ImmPhys.InertiaConditioning.MaxInvInertiaComponentRatio. They share the same value, with the console variable acting as an interface to set the C++ variable.

Developers must be aware that this variable affects the inertia conditioning system, which is crucial for maintaining stable and realistic physics simulations. The variable specifically controls the maximum ratio between the largest and smallest inertia components of physics objects.

Best practices when using this variable include:

  1. Understanding the impact on physics stability and performance before modifying.
  2. Using it in conjunction with other inertia conditioning parameters for optimal results.
  3. Testing thoroughly after changes, as it can affect the behavior of all physics objects in the simulation.

Regarding the associated variable ChaosImmediate_MaxInvInertiaComponentRatio:

The purpose of ChaosImmediate_MaxInvInertiaComponentRatio is to store the actual value used in the physics calculations for the maximum inverse inertia component ratio.

This variable is used directly in the Chaos physics subsystem, specifically in the ImmediatePhysics_Chaos namespace within the FSimulation::UpdateInertiaConditioning function.

Its value is set by the console variable system through p.Chaos.ImmPhys.InertiaConditioning.MaxInvInertiaComponentRatio.

It interacts with the physics simulation by providing a limit on the relative sizes of the inertia components for physics objects.

Developers should be aware that this variable is used in the core physics update loop and can have a significant impact on simulation behavior and performance.

Best practices include monitoring this value during physics debugging and considering its effects when troubleshooting physics-related issues 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:150

Scope: file

Source code excerpt:


Chaos::FRealSingle ChaosImmediate_MaxInvInertiaComponentRatio = 0;
FAutoConsoleVariableRef  CVarChaosImmPhysInertiaConditioningMaxInvInertiaComponentRatio(TEXT("p.Chaos.ImmPhys.InertiaConditioning.MaxInvInertiaComponentRatio"), ChaosImmediate_MaxInvInertiaComponentRatio, TEXT("An input to inertia conditioning system. The largest inertia component must be at least least multiple of the smallest component"));

// Whether to use the linear joint solver which is significantly faster than the non-linear one but less accurate. Only applies to the QuasiPBD Solver
int32 ChaosImmediate_Joint_UseLinearSolver = -1;
FAutoConsoleVariableRef CVarChaosImmPhysJointUseCachedSolver(TEXT("p.Chaos.ImmPhys.Joint.UseLinearSolver"), ChaosImmediate_Joint_UseLinearSolver, TEXT("Force use of linear or non-linear joint solver. (-1 to use PhysicsAsset setting)"));

//

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:149

Scope: file

Source code excerpt:

FAutoConsoleVariableRef  CVarChaosImmPhysParticleInertiaConditioningRotationRatio(TEXT("p.Chaos.ImmPhys.InertiaConditioning.RotationRatio"), ChaosImmediate_InertiaConditioningRotationRatio, TEXT("An input to inertia conditioning system. The maximum ratio of joint correction from rotation versus translation"));

Chaos::FRealSingle ChaosImmediate_MaxInvInertiaComponentRatio = 0;
FAutoConsoleVariableRef  CVarChaosImmPhysInertiaConditioningMaxInvInertiaComponentRatio(TEXT("p.Chaos.ImmPhys.InertiaConditioning.MaxInvInertiaComponentRatio"), ChaosImmediate_MaxInvInertiaComponentRatio, TEXT("An input to inertia conditioning system. The largest inertia component must be at least least multiple of the smallest component"));

// Whether to use the linear joint solver which is significantly faster than the non-linear one but less accurate. Only applies to the QuasiPBD Solver
int32 ChaosImmediate_Joint_UseLinearSolver = -1;
FAutoConsoleVariableRef CVarChaosImmPhysJointUseCachedSolver(TEXT("p.Chaos.ImmPhys.Joint.UseLinearSolver"), ChaosImmediate_Joint_UseLinearSolver, TEXT("Force use of linear or non-linear joint solver. (-1 to use PhysicsAsset setting)"));

//

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:997

Scope (from outer to inner):

file
namespace    ImmediatePhysics_Chaos
function     void FSimulation::UpdateInertiaConditioning

Source code excerpt:


			// A limit on the relative sizes of the inertia components (inverse)
			const FRealSingle MaxInvInertiaComponentRatio = ChaosImmediate_MaxInvInertiaComponentRatio;

			// @todo(chaos): keep track of changes to the flags so we don't need to loop every tick (maybe check it in Integrate)
			for (FActorHandle* Actor : Implementation->ActorHandles)
			{
				FGenericParticleHandle Particle = Actor->GetParticle();
				if (Particle->InertiaConditioningDirty())