p.Chaos.Solver.Joint.MinParentMassRatio
p.Chaos.Solver.Joint.MinParentMassRatio
#Overview
name: p.Chaos.Solver.Joint.MinParentMassRatio
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
6Dof joint MinParentMassRatio (if > 0)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Solver.Joint.MinParentMassRatio is to set the minimum mass ratio between a parent and child body in a 6 degrees of freedom (6DoF) joint within the Chaos physics solver in Unreal Engine 5.
This setting variable is primarily used by the Chaos physics system, which is part of the Experimental module in Unreal Engine 5. It specifically affects the behavior of joints in the physics simulation.
The value of this variable is set in the C++ code within the Chaos namespace and CVars namespace. It is initialized with a default value of 0.2f and can be modified at runtime through the console variable system.
The associated variable ChaosSolverJointMinParentMassRatio directly interacts with p.Chaos.Solver.Joint.MinParentMassRatio. They share the same value, and ChaosSolverJointMinParentMassRatio is used to apply the setting within the physics solver.
Developers must be aware that this variable only takes effect if its value is greater than 0. It influences the mass ratio calculations for 6DoF joints, which can affect the stability and behavior of jointed physics objects.
Best practices when using this variable include:
- Only modify it if you understand the implications on joint behavior in your physics simulation.
- Test thoroughly after changes, as it can affect the overall stability of jointed objects.
- Consider the relationship between this variable and other joint-related settings for optimal physics behavior.
Regarding the associated variable ChaosSolverJointMinParentMassRatio:
The purpose of ChaosSolverJointMinParentMassRatio is to store and apply the minimum parent mass ratio setting within the Chaos physics solver.
This variable is used directly in the FPBDRigidsSolver::PrepareAdvanceBy function to set the MinParentMassRatio in the JointsSettings structure. This indicates that it’s applied each time the physics solver prepares to advance the simulation.
The value of ChaosSolverJointMinParentMassRatio is set by the console variable system through p.Chaos.Solver.Joint.MinParentMassRatio.
It interacts closely with other joint-related variables in the solver, such as ChaosSolverJointAngleTolerance and ChaosSolverJointMaxInertiaRatio.
Developers should be aware that changes to this variable will directly affect the behavior of the physics solver for jointed objects.
Best practices include monitoring this variable alongside other joint settings when troubleshooting physics behavior, and considering its impact when fine-tuning the physics simulation for specific scenarios involving jointed objects.
#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:327
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FAutoConsoleVariableRef CVarChaosSolverJointAngleTolerance(TEXT("p.Chaos.Solver.Joint.AngleTolerance"), ChaosSolverJointAngleTolerance, TEXT("AngleTolerance."));
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)
#Associated Variable and Callsites
This variable is associated with another variable named ChaosSolverJointMinParentMassRatio
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:326
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FRealSingle ChaosSolverJointAngleTolerance = 0.001f;
FAutoConsoleVariableRef CVarChaosSolverJointAngleTolerance(TEXT("p.Chaos.Solver.Joint.AngleTolerance"), ChaosSolverJointAngleTolerance, TEXT("AngleTolerance."));
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)
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:1297
Scope (from outer to inner):
file
namespace Chaos
function void FPBDRigidsSolver::PrepareAdvanceBy
Source code excerpt:
JointsSettings.PositionTolerance = ChaosSolverJointPositionTolerance;
JointsSettings.AngleTolerance = ChaosSolverJointAngleTolerance;
JointsSettings.MinParentMassRatio = ChaosSolverJointMinParentMassRatio;
JointsSettings.MaxInertiaRatio = ChaosSolverJointMaxInertiaRatio;
JointsSettings.bSolvePositionLast = bChaosSolverJointSolvePositionLast;
JointsSettings.bUsePositionBasedDrives = bChaosSolverJointUsePositionBasedDrives;
JointsSettings.NumShockPropagationIterations = ChaosSolverJointNumShockProagationIterations;
JointsSettings.ShockPropagationOverride = ChaosSolverJointShockPropagation;
JointsSettings.bUseLinearSolver = bChaosSolverJointUseLinearSolver;