p.Chaos.PBDCollisionSolver.JacobiPositionTolerance
p.Chaos.PBDCollisionSolver.JacobiPositionTolerance
#Overview
name: p.Chaos.PBDCollisionSolver.JacobiPositionTolerance
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.PBDCollisionSolver.JacobiPositionTolerance is to set a tolerance threshold for position corrections in the Position-Based Dynamics (PBD) collision solver within the Chaos physics system of Unreal Engine 5. This variable is used to determine when position corrections are considered small enough to be ignored or zeroed out during the collision solving process.
This setting variable is primarily used by the Chaos physics system, which is an experimental physics engine in Unreal Engine 5. Specifically, it is utilized within the PBD collision solver module.
The value of this variable is set in the C++ source code file “PBDCollisionContainerSolver.cpp” within the Chaos namespace and CVars namespace. It is initialized with a default value of 1.e-6f (0.000001).
The variable interacts closely with its associated variable Chaos_PBDCollisionSolver_JacobiPositionTolerance. They share the same value and are used interchangeably in the codebase. Additionally, it’s worth noting that there’s a similar variable for rotation tolerance called Chaos_PBDCollisionSolver_JacobiRotationTolerance, which serves a similar purpose but for rotation corrections.
Developers must be aware that this variable directly affects the precision of collision resolution in the Chaos physics system. A lower value will result in more precise collision handling but may increase computational cost, while a higher value might improve performance at the cost of less accurate collisions.
Best practices when using this variable include:
- Adjusting it carefully based on the specific needs of your project, considering the trade-off between precision and performance.
- Testing thoroughly after making changes to ensure that collision behavior remains acceptable.
- Considering the scale of your game world, as the appropriate tolerance may vary depending on the size of objects and the overall scale of the environment.
Regarding the associated variable Chaos_PBDCollisionSolver_JacobiPositionTolerance:
- Its purpose is identical to p.Chaos.PBDCollisionSolver.JacobiPositionTolerance, serving as the internal representation within the C++ code.
- It is used directly in the Chaos physics system’s collision solving algorithms.
- The value is set in the same location as p.Chaos.PBDCollisionSolver.JacobiPositionTolerance and they always have the same value.
- It interacts with the console variable system of Unreal Engine, allowing runtime modification of the tolerance value.
- Developers should be aware that modifying this variable directly in code will affect the behavior of the collision solver.
- Best practices include using the console variable (p.Chaos.PBDCollisionSolver.JacobiPositionTolerance) for adjustments rather than modifying the C++ variable directly, as this allows for easier testing and tuning during development.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolver.cpp:43
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// @todo(chaos): to be tuned
FRealSingle Chaos_PBDCollisionSolver_JacobiPositionTolerance = 1.e-6f;
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverJacobiPositionTolerance(TEXT("p.Chaos.PBDCollisionSolver.JacobiPositionTolerance"), Chaos_PBDCollisionSolver_JacobiPositionTolerance, TEXT(""));
// Jacobi rotation tolerance. Rotation corrections below this are zeroed.
// @todo(chaos): to be tuned
FRealSingle Chaos_PBDCollisionSolver_JacobiRotationTolerance = 1.e-8f;
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverJacobiRotationTolerance(TEXT("p.Chaos.PBDCollisionSolver.JacobiRotationTolerance"), Chaos_PBDCollisionSolver_JacobiRotationTolerance, TEXT(""));
#Associated Variable and Callsites
This variable is associated with another variable named Chaos_PBDCollisionSolver_JacobiPositionTolerance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolver.cpp:42
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// Jacobi position tolerance. Position corrections below this are zeroed.
// @todo(chaos): to be tuned
FRealSingle Chaos_PBDCollisionSolver_JacobiPositionTolerance = 1.e-6f;
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverJacobiPositionTolerance(TEXT("p.Chaos.PBDCollisionSolver.JacobiPositionTolerance"), Chaos_PBDCollisionSolver_JacobiPositionTolerance, TEXT(""));
// Jacobi rotation tolerance. Rotation corrections below this are zeroed.
// @todo(chaos): to be tuned
FRealSingle Chaos_PBDCollisionSolver_JacobiRotationTolerance = 1.e-8f;
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverJacobiRotationTolerance(TEXT("p.Chaos.PBDCollisionSolver.JacobiRotationTolerance"), Chaos_PBDCollisionSolver_JacobiRotationTolerance, TEXT(""));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Collision/PBDCollisionSolverJacobi.h:22
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
extern float Chaos_PBDCollisionSolver_Position_StaticFrictionStiffness;
extern float Chaos_PBDCollisionSolver_JacobiStiffness;
extern float Chaos_PBDCollisionSolver_JacobiPositionTolerance;
extern float Chaos_PBDCollisionSolver_JacobiRotationTolerance;
}
namespace Private
{
class FSolverVec3SOA