p.Chaos.PBDCollisionSolver.Velocity.SolveEnabled
p.Chaos.PBDCollisionSolver.Velocity.SolveEnabled
#Overview
name: p.Chaos.PBDCollisionSolver.Velocity.SolveEnabled
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 8
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.PBDCollisionSolver.Velocity.SolveEnabled is to control whether velocity-based collision solving is enabled in the Chaos physics engine’s Position Based Dynamics (PBD) collision solver. This setting is specifically for the velocity component of the collision resolution process.
This setting variable is primarily used in the Chaos physics engine, which is part of Unreal Engine’s experimental physics system. It’s utilized in the collision solving subsystem, particularly in the PBD (Position Based Dynamics) collision solver module.
The value of this variable is set through the Unreal Engine’s console variable system. It’s defined and initialized in the Chaos namespace, specifically in the CVars (Console Variables) sub-namespace.
This variable interacts closely with other collision solver settings, such as position solving (bChaos_PBDCollisionSolver_Position_SolveEnabled) and friction-related variables (bChaos_PBDCollisionSolver_Velocity_FrictionEnabled).
Developers must be aware that this setting can significantly impact the behavior and performance of the physics simulation. Disabling velocity solving might lead to less accurate or stable simulations, especially in scenarios involving fast-moving objects or complex interactions.
Best practices when using this variable include:
- Only disable it if you’re certain that velocity-based solving is not necessary for your specific use case.
- Test thoroughly after changing this setting, as it can have wide-ranging effects on physics behavior.
- Consider the interaction with other physics settings, especially those related to position solving and friction.
The associated variable bChaos_PBDCollisionSolver_Velocity_SolveEnabled is the actual boolean variable that controls this functionality within the C++ code. It’s used in various parts of the collision solver implementation to conditionally execute velocity-solving code. This variable is set to true by default, indicating that velocity solving is enabled by default in the Chaos physics engine.
When using this associated variable, developers should:
- Be cautious about directly modifying it in code, as it’s primarily intended to be controlled via the console variable system.
- Use it for conditional checks in physics-related code if custom behavior based on velocity solving is needed.
- Be aware that changes to this variable will affect all instances of the PBD collision solver in the running application.
#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/PBDCollisionSolver.cpp:48
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
bool bChaos_PBDCollisionSolver_Velocity_AveragePointEnabled = false;
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_SolveEnabled(TEXT("p.Chaos.PBDCollisionSolver.Velocity.SolveEnabled"), bChaos_PBDCollisionSolver_Velocity_SolveEnabled, TEXT(""));
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_MinInvMassScale(TEXT("p.Chaos.PBDCollisionSolver.Velocity.MinInvMassScale"), Chaos_PBDCollisionSolver_Velocity_MinInvMassScale, TEXT(""));
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_FrictionEnabled(TEXT("p.Chaos.PBDCollisionSolver.Velocity.FrictionEnabled"), bChaos_PBDCollisionSolver_Velocity_FrictionEnabled, TEXT(""));
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_StaticFrictionStiffness(TEXT("p.Chaos.PBDCollisionSolver.Velocity.StaticFriction.Stiffness"), Chaos_PBDCollisionSolver_Velocity_StaticFrictionStiffness, TEXT(""));
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_AveragePointEnabled(TEXT("p.Chaos.PBDCollisionSolver.Velocity.AveragePointEnabled"), bChaos_PBDCollisionSolver_Velocity_AveragePointEnabled, TEXT(""));
}
using namespace CVars;
#Associated Variable and Callsites
This variable is associated with another variable named bChaos_PBDCollisionSolver_Velocity_SolveEnabled
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolver.cpp:23
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
{
extern bool bChaos_PBDCollisionSolver_Position_SolveEnabled;
extern bool bChaos_PBDCollisionSolver_Velocity_SolveEnabled;
extern float Chaos_PBDCollisionSolver_Position_MinInvMassScale;
extern float Chaos_PBDCollisionSolver_Velocity_MinInvMassScale;
// If one body is more than MassRatio1 times the mass of the other, adjust the solver stiffness when the lighter body is underneath.
// Solver stiffness will be equal to 1 when the mass ratio is MassRatio1.
// Solver stiffness will be equal to 0 when the mass ratio is MassRatio2.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolver.cpp:758
Scope (from outer to inner):
file
namespace Chaos
function void FPBDCollisionContainerSolver::SolveVelocityImpl
Source code excerpt:
{
SCOPE_CYCLE_COUNTER(STAT_Collisions_ApplyPushOut);
if (!CVars::bChaos_PBDCollisionSolver_Velocity_SolveEnabled)
{
return;
}
if (EndIndex <= BeginIndex)
{
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolverJacobi.cpp:23
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
{
extern bool bChaos_PBDCollisionSolver_Position_SolveEnabled;
extern bool bChaos_PBDCollisionSolver_Velocity_SolveEnabled;
extern FRealSingle Chaos_PBDCollisionSolver_AutoStiffness_MassRatio1;
extern FRealSingle Chaos_PBDCollisionSolver_AutoStiffness_MassRatio2;
extern FRealSingle Chaos_PBDCollisionSolver_JacobiStiffness;
}
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolverJacobi.cpp:513
Scope (from outer to inner):
file
namespace Chaos
namespace Private
function bool FPBDCollisionContainerSolverJacobi::SolveVelocityImpl
Source code excerpt:
{
SCOPE_CYCLE_COUNTER(STAT_Collisions_ApplyPushOut);
if (!CVars::bChaos_PBDCollisionSolver_Velocity_SolveEnabled)
{
return false;
}
if (EndIndex <= BeginIndex)
{
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolverSimd.cpp:24
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
{
extern bool bChaos_PBDCollisionSolver_Position_SolveEnabled;
extern bool bChaos_PBDCollisionSolver_Velocity_SolveEnabled;
}
namespace Private
{
//////////////////////////////////////////////////////////////////////////////////////////////////
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionContainerSolverSimd.cpp:592
Scope (from outer to inner):
file
namespace Chaos
namespace Private
function void FPBDCollisionContainerSolverSimd::ApplyVelocityConstraints
Source code excerpt:
{
SCOPE_CYCLE_COUNTER(STAT_Collisions_ApplyPushOut);
if (!CVars::bChaos_PBDCollisionSolver_Velocity_SolveEnabled)
{
return;
}
const FPBDCollisionSolverSettings& SolverSettings = ConstraintContainer.GetSolverSettings();
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Collision/PBDCollisionSolver.cpp:41
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
//
bool bChaos_PBDCollisionSolver_Velocity_SolveEnabled = true;
// If Chaos_PBDCollisionSolver_Velocity_MinInvMassScale is the same as Chaos_PBDCollisionSolver_Position_MinInvMassScale and all velocity iterations have shockpropagation, we avoid recalculating constraint-space mass
float Chaos_PBDCollisionSolver_Velocity_MinInvMassScale = Chaos_PBDCollisionSolver_Position_MinInvMassScale;
bool bChaos_PBDCollisionSolver_Velocity_FrictionEnabled = true;
float Chaos_PBDCollisionSolver_Velocity_StaticFrictionStiffness = 1.0f;
bool bChaos_PBDCollisionSolver_Velocity_AveragePointEnabled = false;
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_SolveEnabled(TEXT("p.Chaos.PBDCollisionSolver.Velocity.SolveEnabled"), bChaos_PBDCollisionSolver_Velocity_SolveEnabled, TEXT(""));
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_MinInvMassScale(TEXT("p.Chaos.PBDCollisionSolver.Velocity.MinInvMassScale"), Chaos_PBDCollisionSolver_Velocity_MinInvMassScale, TEXT(""));
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_FrictionEnabled(TEXT("p.Chaos.PBDCollisionSolver.Velocity.FrictionEnabled"), bChaos_PBDCollisionSolver_Velocity_FrictionEnabled, TEXT(""));
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_StaticFrictionStiffness(TEXT("p.Chaos.PBDCollisionSolver.Velocity.StaticFriction.Stiffness"), Chaos_PBDCollisionSolver_Velocity_StaticFrictionStiffness, TEXT(""));
FAutoConsoleVariableRef CVarChaos_PBDCollisionSolver_Velocity_AveragePointEnabled(TEXT("p.Chaos.PBDCollisionSolver.Velocity.AveragePointEnabled"), bChaos_PBDCollisionSolver_Velocity_AveragePointEnabled, TEXT(""));
}
using namespace CVars;