p.Chaos.ImmPhys.InertiaConditioning.RotationRatio

p.Chaos.ImmPhys.InertiaConditioning.RotationRatio

#Overview

name: p.Chaos.ImmPhys.InertiaConditioning.RotationRatio

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.RotationRatio is to control the maximum ratio of joint correction from rotation versus translation in the inertia conditioning system of Unreal Engine’s Chaos physics engine.

This setting variable is primarily used in the Immediate Physics simulation system within the Chaos physics engine, which is a part of Unreal Engine’s physics subsystem. Based on the callsites, it’s specifically used in the ImmediatePhysicsChaos module.

The value of this variable is set through a console variable (CVar) system, allowing it to be adjusted at runtime. It’s initialized with a default value of 2.

The associated variable ChaosImmediate_InertiaConditioningRotationRatio directly interacts with this setting. They share the same value and are used interchangeably in the code.

Developers should be aware that this variable affects the balance between rotational and translational corrections in joint simulations. A higher value will allow more correction from rotation relative to translation.

Best practices when using this variable include:

  1. Adjusting it carefully to find the right balance for your specific simulation needs.
  2. Testing thoroughly after changes, as it can significantly impact the behavior of jointed physics objects.
  3. Considering its interaction with other inertia conditioning parameters like Distance and MaxInvInertiaComponentRatio.

Regarding the associated variable ChaosImmediate_InertiaConditioningRotationRatio:

#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:147

Scope: file

Source code excerpt:


Chaos::FRealSingle ChaosImmediate_InertiaConditioningRotationRatio = 2;
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;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

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)."));

Chaos::FRealSingle ChaosImmediate_InertiaConditioningRotationRatio = 2;
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;

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

Scope (from outer to inner):

file
namespace    ImmediatePhysics_Chaos
function     void FSimulation::UpdateInertiaConditioning

Source code excerpt:

		{
			// The maximum contribution to error correction from rotation
			const FRealSingle MaxRotationRatio = ChaosImmediate_InertiaConditioningRotationRatio;

			// The error distance that the constraint correction must be stable for
			// @todo(chaos): should probably be tied to constraint teleport threshold?
			const FRealSingle MaxDistance = ChaosImmediate_InertiaConditioningDistance;

			// A limit on the relative sizes of the inertia components (inverse)