p.Chaos.ImmPhys.Joint.PositionTolerance
p.Chaos.ImmPhys.Joint.PositionTolerance
#Overview
name: p.Chaos.ImmPhys.Joint.PositionTolerance
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
PositionTolerance.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.ImmPhys.Joint.PositionTolerance is to set the position tolerance for joints in the Chaos Immediate Physics system within Unreal Engine 5. This setting is used to define the acceptable margin of error for joint positions during physics simulations.
This setting variable is primarily used by the Chaos physics engine, specifically within the Immediate Physics subsystem. It is part of the Engine module, as evidenced by its location in the Engine/Source/Runtime/Engine directory.
The value of this variable is set through the Unreal Engine console variable system. It is declared as an FAutoConsoleVariableRef, which allows it to be modified at runtime through console commands or configuration files.
The associated variable ChaosImmediate_Joint_PositionTolerance interacts directly with p.Chaos.ImmPhys.Joint.PositionTolerance. They share the same value, with ChaosImmediate_Joint_PositionTolerance being the actual variable used in the code, while p.Chaos.ImmPhys.Joint.PositionTolerance is the console variable name used to access and modify it.
Developers must 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, while a higher value might improve performance at the cost of less accurate joint positions.
Best practices when using this variable include:
- Carefully balancing between simulation accuracy and performance.
- Testing different values to find the optimal setting for your specific use case.
- Considering the scale of your physics objects when setting this value.
- Being consistent with its usage across related physics settings for predictable behavior.
Regarding the associated variable ChaosImmediate_Joint_PositionTolerance:
- Its purpose is the same as p.Chaos.ImmPhys.Joint.PositionTolerance, serving as the actual variable used in the code.
- It is used within the Chaos Immediate Physics system of Unreal Engine.
- Its value is set to 0.025f by default but can be modified through the console variable system.
- It directly interacts with p.Chaos.ImmPhys.Joint.PositionTolerance, sharing the same value.
- Developers should be aware that modifying this variable will affect joint positioning precision in physics simulations.
- Best practices include using the console variable (p.Chaos.ImmPhys.Joint.PositionTolerance) to modify its value rather than changing it directly in the code, allowing for easier runtime adjustments and configuration.
#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:113
Scope: file
Source code excerpt:
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)"));
FAutoConsoleVariableRef CVarChaosImmPhysJointEnableTwistLimits(TEXT("p.Chaos.ImmPhys.Joint.EnableTwistLimits"), ChaosImmediate_Joint_EnableTwistLimits, TEXT("EnableTwistLimits."));
FAutoConsoleVariableRef CVarChaosImmPhysJointEnableSwingLimits(TEXT("p.Chaos.ImmPhys.Joint.EnableSwingLimits"), ChaosImmediate_Joint_EnableSwingLimits, TEXT("EnableSwingLimits."));
#Associated Variable and Callsites
This variable is associated with another variable named ChaosImmediate_Joint_PositionTolerance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:89
Scope: file
Source code excerpt:
Chaos::FRealSingle ChaosImmediate_Joint_SwingTwistAngleTolerance = 1.0e-6f;
Chaos::FRealSingle ChaosImmediate_Joint_PositionTolerance = 0.025f;
Chaos::FRealSingle ChaosImmediate_Joint_AngleTolerance = 0.001f;
int32 ChaosImmediate_Joint_NumShockPropagationIterations = -1;
int32 ChaosImmediate_Joint_SolvePositionLast = 1;
int32 ChaosImmediate_Joint_UsePositionBasedDrives = 1;
int32 ChaosImmediate_Joint_EnableTwistLimits = 1;
int32 ChaosImmediate_Joint_EnableSwingLimits = 1;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:113
Scope: file
Source code excerpt:
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)"));
FAutoConsoleVariableRef CVarChaosImmPhysJointEnableTwistLimits(TEXT("p.Chaos.ImmPhys.Joint.EnableTwistLimits"), ChaosImmediate_Joint_EnableTwistLimits, TEXT("EnableTwistLimits."));
FAutoConsoleVariableRef CVarChaosImmPhysJointEnableSwingLimits(TEXT("p.Chaos.ImmPhys.Joint.EnableSwingLimits"), ChaosImmediate_Joint_EnableSwingLimits, TEXT("EnableSwingLimits."));
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/ImmediatePhysics/ImmediatePhysicsChaos/ImmediatePhysicsSimulation_Chaos.cpp:871
Scope (from outer to inner):
file
namespace ImmediatePhysics_Chaos
function void FSimulation::Simulate
Source code excerpt:
FPBDJointSolverSettings JointsSettings = Implementation->Joints.GetSettings();
JointsSettings.SwingTwistAngleTolerance = ChaosImmediate_Joint_SwingTwistAngleTolerance;
JointsSettings.PositionTolerance = ChaosImmediate_Joint_PositionTolerance;
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;