p.Chaos.PBDCollisionSolver.AutoStiffness.MassRatio2
p.Chaos.PBDCollisionSolver.AutoStiffness.MassRatio2
#Overview
name: p.Chaos.PBDCollisionSolver.AutoStiffness.MassRatio2
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.AutoStiffness.MassRatio2 is to control the auto-stiffness behavior in the Position Based Dynamics (PBD) collision solver within the Chaos physics system of Unreal Engine 5. Specifically, it defines the mass ratio at which the solver stiffness will be equal to 0.
-
This setting variable is primarily used by the Chaos physics system, which is an experimental physics engine in Unreal Engine 5. It’s part of the collision solving mechanism, particularly for the PBD (Position Based Dynamics) collision solver.
-
Based on the callsites, this variable is used within the Chaos namespace, specifically in the collision solver module. It’s defined in the PBDCollisionContainerSolver.cpp file and referenced in PBDCollisionContainerSolverJacobi.cpp.
-
The value of this variable is set through the Unreal Engine console variable system. It’s initialized to 0 in the code, but can be modified at runtime using the console command system.
-
This variable interacts closely with Chaos_PBDCollisionSolver_AutoStiffness_MassRatio1. Together, these two variables likely define a range for the mass ratio that affects the auto-stiffness calculation.
-
Developers should be aware that this variable is part of an experimental physics system. Its behavior might change in future engine versions, and it should be used with caution in production environments.
-
Best practices when using this variable include:
- Testing thoroughly to understand its impact on collision behavior.
- Using it in conjunction with Chaos_PBDCollisionSolver_AutoStiffness_MassRatio1 to define an appropriate range for auto-stiffness calculation.
- Monitoring performance impacts when modifying this value, as it could affect physics simulation performance.
Regarding the associated variable Chaos_PBDCollisionSolver_AutoStiffness_MassRatio2:
- This is the internal C++ variable that directly corresponds to the console variable p.Chaos.PBDCollisionSolver.AutoStiffness.MassRatio2.
- It’s used within the Chaos physics system to store the value set by the console variable.
- The variable is defined in the CVars namespace within the Chaos namespace, indicating it’s a console variable specific to the Chaos system.
- It’s initialized to 0, but its value can be changed at runtime through the console variable system.
- This variable is likely used in the actual collision solving algorithms to determine how stiffness should be adjusted based on the mass ratio of colliding objects.
- Developers working directly with the Chaos physics code should use this variable when implementing or modifying collision solving algorithms that depend on auto-stiffness calculations.
#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:33
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FRealSingle Chaos_PBDCollisionSolver_AutoStiffness_MassRatio2 = 0;
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverAutoStiffnessMassRatio1(TEXT("p.Chaos.PBDCollisionSolver.AutoStiffness.MassRatio1"), Chaos_PBDCollisionSolver_AutoStiffness_MassRatio1, TEXT(""));
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverAutoStiffnessMassRatio2(TEXT("p.Chaos.PBDCollisionSolver.AutoStiffness.MassRatio2"), Chaos_PBDCollisionSolver_AutoStiffness_MassRatio2, TEXT(""));
// 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(""));
#Associated Variable and Callsites
This variable is associated with another variable named Chaos_PBDCollisionSolver_AutoStiffness_MassRatio2
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolver.cpp:31
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// Solver stiffness will be equal to 0 when the mass ratio is MassRatio2.
FRealSingle Chaos_PBDCollisionSolver_AutoStiffness_MassRatio1 = 0;
FRealSingle Chaos_PBDCollisionSolver_AutoStiffness_MassRatio2 = 0;
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverAutoStiffnessMassRatio1(TEXT("p.Chaos.PBDCollisionSolver.AutoStiffness.MassRatio1"), Chaos_PBDCollisionSolver_AutoStiffness_MassRatio1, TEXT(""));
FAutoConsoleVariableRef CVarChaosPBDCollisionSolverAutoStiffnessMassRatio2(TEXT("p.Chaos.PBDCollisionSolver.AutoStiffness.MassRatio2"), Chaos_PBDCollisionSolver_AutoStiffness_MassRatio2, TEXT(""));
// 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(""));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolverJacobi.cpp:26
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
extern FRealSingle Chaos_PBDCollisionSolver_AutoStiffness_MassRatio1;
extern FRealSingle Chaos_PBDCollisionSolver_AutoStiffness_MassRatio2;
extern FRealSingle Chaos_PBDCollisionSolver_JacobiStiffness;
}
namespace Private
{