p.Chaos.ImmPhys.Joint.MaxInertiaRatio
p.Chaos.ImmPhys.Joint.MaxInertiaRatio
#Overview
name: p.Chaos.ImmPhys.Joint.MaxInertiaRatio
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
6Dof joint MaxInertiaRatio (if > 0)
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.ImmPhys.Joint.MaxInertiaRatio is to set the maximum inertia ratio for 6 degrees of freedom (6DoF) joints in the Chaos Immediate Physics system of Unreal Engine 5. This setting is part of the physics simulation system, specifically for joint constraints.
This setting variable is primarily used in the Chaos Immediate Physics subsystem, which is part of the Unreal Engine’s physics engine. It’s referenced in the ImmediatePhysicsChaos module, which handles real-time physics simulations.
The value of this variable is set through the Unreal Engine’s console variable system (CVars). It’s initialized with a default value of 5.0f and can be modified at runtime using the console command system.
The associated variable ChaosImmediate_Joint_MaxInertiaRatio interacts directly with p.Chaos.ImmPhys.Joint.MaxInertiaRatio. They share the same value, with ChaosImmediate_Joint_MaxInertiaRatio being the actual variable used in the physics calculations.
Developers should be aware that this variable affects the behavior of 6DoF joints in the physics simulation. A higher value allows for a greater difference in inertia between connected bodies, which can impact the stability and realism of the joint behavior.
Best practices when using this variable include:
- Only modify it if you understand the implications on joint behavior and overall physics simulation.
- Test thoroughly after changing the value to ensure it doesn’t negatively impact the stability of your physics simulations.
- Consider using it in conjunction with other joint-related settings for fine-tuning physics behavior.
Regarding the associated variable ChaosImmediate_Joint_MaxInertiaRatio:
- Its purpose is the same as p.Chaos.ImmPhys.Joint.MaxInertiaRatio, serving as the actual variable used in physics calculations.
- It’s used within the Chaos Immediate Physics subsystem, specifically in the FSimulation::Simulate function.
- Its value is set by the console variable system, mirroring p.Chaos.ImmPhys.Joint.MaxInertiaRatio.
- It interacts with other joint-related variables in the JointsSettings struct.
- Developers should be aware that modifying this variable directly in code won’t have an effect unless the corresponding console variable is also updated.
- Best practice is to modify this variable through the console variable system rather than changing it directly in the code.
#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:135
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarChaosImmPhysJointAngularDriveDamping(TEXT("p.Chaos.ImmPhys.Joint.AngularDriveDamping"), ChaosImmediate_Joint_AngularDriveDamping, TEXT("6Dof joint drive damping override (if > 0)."));
FAutoConsoleVariableRef CVarChaosImmPhysJointMinParentMassRatio(TEXT("p.Chaos.ImmPhys.Joint.MinParentMassRatio"), ChaosImmediate_Joint_MinParentMassRatio, TEXT("6Dof joint MinParentMassRatio (if > 0)"));
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"));
#Associated Variable and Callsites
This variable is associated with another variable named ChaosImmediate_Joint_MaxInertiaRatio
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:111
Scope: file
Source code excerpt:
Chaos::FRealSingle ChaosImmediate_Joint_AngularDriveDamping = -1.0f;
Chaos::FRealSingle ChaosImmediate_Joint_MinParentMassRatio = 0.2f;
Chaos::FRealSingle ChaosImmediate_Joint_MaxInertiaRatio = 5.0f;
FAutoConsoleVariableRef CVarChaosImmPhysJointSwingTwistAngleTolerance(TEXT("p.Chaos.ImmPhys.Joint.SwingTwistAngleTolerance"), ChaosImmediate_Joint_SwingTwistAngleTolerance, TEXT("SwingTwistAngleTolerance."));
FAutoConsoleVariableRef CVarChaosImmPhysJointPositionTolerance(TEXT("p.Chaos.ImmPhys.Joint.PositionTolerance"), ChaosImmediate_Joint_PositionTolerance, TEXT("PositionTolerance."));
FAutoConsoleVariableRef CVarChaosImmPhysJointAngleTolerance(TEXT("p.Chaos.ImmPhys.Joint.AngleTolerance"), ChaosImmediate_Joint_AngleTolerance, TEXT("AngleTolerance."));
FAutoConsoleVariableRef CVarChaosImmPhysJointNumShockPropagationIterations(TEXT("p.Chaos.ImmPhys.Joint.NumShockPropagationIterations"), ChaosImmediate_Joint_NumShockPropagationIterations, TEXT("How many iterations to run shock propagation for"));
FAutoConsoleVariableRef CVarChaosImmPhysJointSolvePositionLast(TEXT("p.Chaos.ImmPhys.Joint.SolvePositionLast"), ChaosImmediate_Joint_SolvePositionLast, TEXT("Should we solve joints in position-then-rotation order (false) rotation-then-position order (true, default)"));
FAutoConsoleVariableRef CVarChaosImmPhysJointUsePBDVelocityDrives(TEXT("p.Chaos.ImmPhys.Joint.UsePBDDrives"), ChaosImmediate_Joint_UsePositionBasedDrives, TEXT("Whether to solve drives in the position or velocity phase of the solver (default true)"));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:135
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarChaosImmPhysJointAngularDriveDamping(TEXT("p.Chaos.ImmPhys.Joint.AngularDriveDamping"), ChaosImmediate_Joint_AngularDriveDamping, TEXT("6Dof joint drive damping override (if > 0)."));
FAutoConsoleVariableRef CVarChaosImmPhysJointMinParentMassRatio(TEXT("p.Chaos.ImmPhys.Joint.MinParentMassRatio"), ChaosImmediate_Joint_MinParentMassRatio, TEXT("6Dof joint MinParentMassRatio (if > 0)"));
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"));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:874
Scope (from outer to inner):
file
namespace ImmediatePhysics_Chaos
function void FSimulation::Simulate
Source code excerpt:
JointsSettings.AngleTolerance = ChaosImmediate_Joint_AngleTolerance;
JointsSettings.MinParentMassRatio = ChaosImmediate_Joint_MinParentMassRatio;
JointsSettings.MaxInertiaRatio = ChaosImmediate_Joint_MaxInertiaRatio;
JointsSettings.bSolvePositionLast = ChaosImmediate_Joint_SolvePositionLast != 0;
JointsSettings.bUsePositionBasedDrives = ChaosImmediate_Joint_UsePositionBasedDrives != 0;
JointsSettings.bEnableTwistLimits = ChaosImmediate_Joint_EnableTwistLimits != 0;
JointsSettings.bEnableSwingLimits = ChaosImmediate_Joint_EnableSwingLimits != 0;
JointsSettings.bEnableDrives = ChaosImmediate_Joint_EnableDrives != 0;
JointsSettings.LinearStiffnessOverride = ChaosImmediate_Joint_Stiffness;