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).
- type:
Var
- help:
An input to inertia conditioning system. The maximum ratio of joint correction from rotation versus translation
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:
- Adjusting it carefully to find the right balance for your specific simulation needs.
- Testing thoroughly after changes, as it can significantly impact the behavior of jointed physics objects.
- Considering its interaction with other inertia conditioning parameters like Distance and MaxInvInertiaComponentRatio.
Regarding the associated variable ChaosImmediate_InertiaConditioningRotationRatio:
- Its purpose is identical to p.Chaos.ImmPhys.InertiaConditioning.RotationRatio.
- It’s used directly in the UpdateInertiaConditioning function of the ImmediatePhysics_Chaos namespace.
- Its value is set by the console variable system and can be modified at runtime.
- It interacts closely with other inertia conditioning variables like ChaosImmediate_InertiaConditioningDistance.
- Developers should treat it as the internal representation of the console variable.
- Best practices include using this variable for runtime calculations and the console variable for external adjustments and debugging.
#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)