p.Chaos.PBDCollisionSolver.JacobiStiffness
p.Chaos.PBDCollisionSolver.JacobiStiffness
#Overview
name: p.Chaos.PBDCollisionSolver.JacobiStiffness
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.PBDCollisionSolver.JacobiStiffness is to control the stiffness of the Jacobi solver in the Chaos physics engine’s Position-Based Dynamics (PBD) collision solver. This setting variable is primarily used for the physics simulation system, specifically for collision resolution.
This setting variable is primarily used by the Chaos physics engine, which is part of Unreal Engine’s experimental physics system. It is referenced in the PBDCollisionContainerSolver and PBDCollisionSolverJacobi modules.
The value of this variable is set to a default of 0.5f in the C++ code, but it can be modified at runtime through the console variable system. The associated variable Chaos_PBDCollisionSolver_JacobiStiffness is used to store the actual value.
This variable interacts with other physics-related variables, such as State.Stiffness, which is multiplied by the Jacobi stiffness to get the final stiffness value used in collision solving.
Developers must be aware that this variable directly affects the behavior of collision resolution in the Chaos physics engine. Changing this value will impact how rigid the collision responses are, with higher values resulting in stiffer (less elastic) collisions.
Best practices when using this variable include:
- Carefully tuning the value to achieve the desired collision behavior for your specific game or simulation needs.
- Testing thoroughly after making changes, as it can significantly impact the overall feel of physics interactions.
- Considering performance implications, as higher stiffness values might require more iterations to resolve collisions accurately.
Regarding the associated variable Chaos_PBDCollisionSolver_JacobiStiffness:
- It serves as the actual storage for the Jacobi stiffness value.
- It is defined in the Chaos namespace, specifically within the CVars (Console Variables) sub-namespace.
- This variable is used directly in the collision solving functions, such as SolvePositionNoFriction, SolvePositionWithFriction, and SolveVelocity.
- It allows for easy access and modification of the Jacobi stiffness value throughout the Chaos physics code.
- Developers should use this variable when they need to read or modify the Jacobi stiffness value programmatically within the engine code.
#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:38
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// @todo(chaos): to be tuned
FRealSingle Chaos_PBDCollisionSolver_JacobiStiffness = 0.5f;
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverJacobiStiffness(TEXT("p.Chaos.PBDCollisionSolver.JacobiStiffness"), Chaos_PBDCollisionSolver_JacobiStiffness, TEXT(""));
// 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(""));
#Associated Variable and Callsites
This variable is associated with another variable named Chaos_PBDCollisionSolver_JacobiStiffness
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolver.cpp:37
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// Jacobi solver stiffness
// @todo(chaos): to be tuned
FRealSingle Chaos_PBDCollisionSolver_JacobiStiffness = 0.5f;
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverJacobiStiffness(TEXT("p.Chaos.PBDCollisionSolver.JacobiStiffness"), Chaos_PBDCollisionSolver_JacobiStiffness, TEXT(""));
// 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(""));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolverJacobi.cpp:28
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
extern FRealSingle Chaos_PBDCollisionSolver_AutoStiffness_MassRatio2;
extern FRealSingle Chaos_PBDCollisionSolver_JacobiStiffness;
}
namespace Private
{
//////////////////////////////////////////////////////////////////////////////////////////////////
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Collision/PBDCollisionSolverJacobi.h:21
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
extern bool bChaos_PBDCollisionSolver_Velocity_FrictionEnabled;
extern float Chaos_PBDCollisionSolver_Position_StaticFrictionStiffness;
extern float Chaos_PBDCollisionSolver_JacobiStiffness;
extern float Chaos_PBDCollisionSolver_JacobiPositionTolerance;
extern float Chaos_PBDCollisionSolver_JacobiRotationTolerance;
}
namespace Private
{
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Collision/PBDCollisionSolverJacobi.h:848
Scope (from outer to inner):
file
namespace Chaos
namespace Private
class class FPBDCollisionSolverJacobi
function bool SolvePositionNoFriction
Source code excerpt:
FConstraintSolverBody& Body1 = SolverBody1();
const FSolverReal Stiffness = CVars::Chaos_PBDCollisionSolver_JacobiStiffness * State.Stiffness;
State.ManifoldPoints.SolvePositionNoFriction(
Stiffness,
MaxPushOut,
Body0,
Body1);
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Collision/PBDCollisionSolverJacobi.h:865
Scope (from outer to inner):
file
namespace Chaos
namespace Private
class class FPBDCollisionSolverJacobi
function bool SolvePositionWithFriction
Source code excerpt:
FConstraintSolverBody& Body1 = SolverBody1();
const FSolverReal Stiffness = CVars::Chaos_PBDCollisionSolver_JacobiStiffness * State.Stiffness;
State.ManifoldPoints.SolvePositionWithFriction(
Stiffness,
Dt,
State.StaticFriction,
State.DynamicFriction,
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Collision/PBDCollisionSolverJacobi.h:889
Scope (from outer to inner):
file
namespace Chaos
namespace Private
class class FPBDCollisionSolverJacobi
function bool SolveVelocity
Source code excerpt:
FConstraintSolverBody& Body1 = SolverBody1();
const FSolverReal Stiffness = CVars::Chaos_PBDCollisionSolver_JacobiStiffness * State.Stiffness;
State.ManifoldPoints.SolveVelocity(
Stiffness,
Dt,
bApplyDynamicFriction,
Body0,