p.Chaos.Solver.Joint.PositionTolerance
p.Chaos.Solver.Joint.PositionTolerance
#Overview
name: p.Chaos.Solver.Joint.PositionTolerance
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
PositionTolerance.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Solver.Joint.PositionTolerance is to set the position tolerance for 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’s specifically related to the joint simulation within the physics system.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be adjusted at runtime through the console or configuration files. The default value is set to 0.025f.
The associated variable ChaosSolverJointPositionTolerance directly interacts with p.Chaos.Solver.Joint.PositionTolerance. They share the same value, with ChaosSolverJointPositionTolerance being the actual variable used in the code.
Developers should be aware that this variable affects the precision of joint positioning in physics simulations. A lower value will result in more precise joint positioning but may increase computational cost.
Best practices when using this variable include:
- Adjusting it carefully based on the specific needs of your project.
- Testing different values to find the right balance between precision and performance.
- Considering the scale of your physics objects when setting this value.
Regarding the associated variable ChaosSolverJointPositionTolerance:
- It’s used directly in the FPBDRigidsSolver::PrepareAdvanceBy function to set the PositionTolerance of JointsSettings.
- This variable allows the joint position tolerance to be used within the actual solver code.
- Developers should be aware that changing p.Chaos.Solver.Joint.PositionTolerance will directly affect this variable and, consequently, the behavior of the physics solver.
- Best practice is to use the console variable (p.Chaos.Solver.Joint.PositionTolerance) for adjustments rather than modifying ChaosSolverJointPositionTolerance directly in the code, as this allows for easier tuning and debugging.
#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:323
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// Copied from RBAN
FRealSingle ChaosSolverJointPositionTolerance = 0.025f;
FAutoConsoleVariableRef CVarChaosSolverJointPositionTolerance(TEXT("p.Chaos.Solver.Joint.PositionTolerance"), ChaosSolverJointPositionTolerance, TEXT("PositionTolerance."));
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)"));
#Associated Variable and Callsites
This variable is associated with another variable named ChaosSolverJointPositionTolerance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:322
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// Copied from RBAN
FRealSingle ChaosSolverJointPositionTolerance = 0.025f;
FAutoConsoleVariableRef CVarChaosSolverJointPositionTolerance(TEXT("p.Chaos.Solver.Joint.PositionTolerance"), ChaosSolverJointPositionTolerance, TEXT("PositionTolerance."));
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)"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:1295
Scope (from outer to inner):
file
namespace Chaos
function void FPBDRigidsSolver::PrepareAdvanceBy
Source code excerpt:
JointsSettings.MaxSolverStiffness = ChaosSolverJointMaxSolverStiffness;
JointsSettings.NumIterationsAtMaxSolverStiffness = ChaosSolverJointNumIterationsAtMaxSolverStiffness;
JointsSettings.PositionTolerance = ChaosSolverJointPositionTolerance;
JointsSettings.AngleTolerance = ChaosSolverJointAngleTolerance;
JointsSettings.MinParentMassRatio = ChaosSolverJointMinParentMassRatio;
JointsSettings.MaxInertiaRatio = ChaosSolverJointMaxInertiaRatio;
JointsSettings.bSolvePositionLast = bChaosSolverJointSolvePositionLast;
JointsSettings.bUsePositionBasedDrives = bChaosSolverJointUsePositionBasedDrives;
JointsSettings.NumShockPropagationIterations = ChaosSolverJointNumShockProagationIterations;