p.Chaos.Solver.Joint.MaxInertiaRatio
p.Chaos.Solver.Joint.MaxInertiaRatio
#Overview
name: p.Chaos.Solver.Joint.MaxInertiaRatio
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
6Dof joint MaxInertiaRatio (if > 0)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Solver.Joint.MaxInertiaRatio is to set the maximum inertia ratio for 6-degree-of-freedom (6DOF) joints in the Chaos physics solver, which is part of Unreal Engine’s physics simulation system.
This setting variable is primarily used by the Chaos physics solver, which is part of Unreal Engine’s Experimental Chaos module. It specifically relates to the joint system within the physics simulation.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 5.0f and can be modified at runtime using the console command system.
The associated variable ChaosSolverJointMaxInertiaRatio directly interacts with p.Chaos.Solver.Joint.MaxInertiaRatio. They share the same value, with ChaosSolverJointMaxInertiaRatio being the actual variable used in the code, while p.Chaos.Solver.Joint.MaxInertiaRatio is the console variable name for external access and modification.
Developers must be aware that this variable only takes effect if its value is greater than 0. It’s used to limit the inertia ratio in 6DOF joints, which can help prevent instability in physics simulations involving connected rigid bodies with significantly different masses or inertias.
Best practices when using this variable include:
- Only modify it if you’re experiencing issues with joint stability in your physics simulations.
- Start with small adjustments from the default value (5.0f) and test thoroughly.
- Be aware that changes to this value can affect the behavior of all 6DOF joints in your simulation.
- Use in conjunction with p.Chaos.Solver.Joint.MinParentMassRatio for fine-tuning joint behavior.
Regarding the associated variable ChaosSolverJointMaxInertiaRatio:
- Its purpose is identical to p.Chaos.Solver.Joint.MaxInertiaRatio, serving as the in-code representation of the maximum inertia ratio for 6DOF joints.
- It’s used directly in the Chaos physics solver, specifically in the FPBDRigidsSolver::PrepareAdvanceBy function to set up joint settings before advancing the physics simulation.
- Its value is set by the console variable system and can be modified at runtime.
- It interacts directly with the JointsSettings structure, influencing the behavior of the joint solver.
- Developers should be aware that modifying this variable will affect all 6DOF joints in the simulation.
- Best practices for using this variable are the same as those for p.Chaos.Solver.Joint.MaxInertiaRatio, as they are essentially the same setting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:329
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FAutoConsoleVariableRef CVarChaosSolverJointMinParentMassRatio(TEXT("p.Chaos.Solver.Joint.MinParentMassRatio"), ChaosSolverJointMinParentMassRatio, TEXT("6Dof joint MinParentMassRatio (if > 0)"));
FRealSingle ChaosSolverJointMaxInertiaRatio = 5.0f;
FAutoConsoleVariableRef CVarChaosSolverJointMaxInertiaRatio(TEXT("p.Chaos.Solver.Joint.MaxInertiaRatio"), ChaosSolverJointMaxInertiaRatio, TEXT("6Dof joint MaxInertiaRatio (if > 0)"));
// Collision detection cvars
// Utility to support runtime changes to some high-level collision configuration that requires we update all existing collisions (actually we just destroy them)
// This is only intended for testing and debugging and handling the change is not fast.
bool bChaosCollisionConfigChanged = false;
#Associated Variable and Callsites
This variable is associated with another variable named ChaosSolverJointMaxInertiaRatio
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:328
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FRealSingle ChaosSolverJointMinParentMassRatio = 0.2f;
FAutoConsoleVariableRef CVarChaosSolverJointMinParentMassRatio(TEXT("p.Chaos.Solver.Joint.MinParentMassRatio"), ChaosSolverJointMinParentMassRatio, TEXT("6Dof joint MinParentMassRatio (if > 0)"));
FRealSingle ChaosSolverJointMaxInertiaRatio = 5.0f;
FAutoConsoleVariableRef CVarChaosSolverJointMaxInertiaRatio(TEXT("p.Chaos.Solver.Joint.MaxInertiaRatio"), ChaosSolverJointMaxInertiaRatio, TEXT("6Dof joint MaxInertiaRatio (if > 0)"));
// Collision detection cvars
// Utility to support runtime changes to some high-level collision configuration that requires we update all existing collisions (actually we just destroy them)
// This is only intended for testing and debugging and handling the change is not fast.
bool bChaosCollisionConfigChanged = false;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:1298
Scope (from outer to inner):
file
namespace Chaos
function void FPBDRigidsSolver::PrepareAdvanceBy
Source code excerpt:
JointsSettings.AngleTolerance = ChaosSolverJointAngleTolerance;
JointsSettings.MinParentMassRatio = ChaosSolverJointMinParentMassRatio;
JointsSettings.MaxInertiaRatio = ChaosSolverJointMaxInertiaRatio;
JointsSettings.bSolvePositionLast = bChaosSolverJointSolvePositionLast;
JointsSettings.bUsePositionBasedDrives = bChaosSolverJointUsePositionBasedDrives;
JointsSettings.NumShockPropagationIterations = ChaosSolverJointNumShockProagationIterations;
JointsSettings.ShockPropagationOverride = ChaosSolverJointShockPropagation;
JointsSettings.bUseLinearSolver = bChaosSolverJointUseLinearSolver;
JointsSettings.bSortEnabled = false;