p.Chaos.Joint.DisableSoftLimits
p.Chaos.Joint.DisableSoftLimits
#Overview
name: p.Chaos.Joint.DisableSoftLimits
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Disable soft limits (for debugging only)
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Joint.DisableSoftLimits is to disable soft limits in the Chaos physics engine’s joint system. This setting is primarily used for debugging purposes.
This setting variable is utilized by the Chaos physics engine, which is part of Unreal Engine’s experimental physics system. Specifically, it affects the joint constraints module within Chaos.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as a boolean variable with a default value of false, meaning soft limits are enabled by default.
The associated variable bChaos_Joint_DisableSoftLimits directly interacts with p.Chaos.Joint.DisableSoftLimits. They share the same value and purpose.
Developers must be aware that this variable is intended for debugging only. Disabling soft limits can significantly alter the behavior of joints in the physics simulation, potentially leading to unexpected results.
Best practices when using this variable include:
- Only use it for debugging purposes.
- Be cautious when disabling soft limits, as it may affect the stability and realism of the physics simulation.
- Remember to re-enable soft limits after debugging.
Regarding the associated variable bChaos_Joint_DisableSoftLimits:
The purpose of bChaos_Joint_DisableSoftLimits is identical to p.Chaos.Joint.DisableSoftLimits - it’s used to disable soft limits in the Chaos physics engine’s joint system for debugging.
This variable is used in the Chaos physics engine, specifically in the joint constraints module. It’s referenced in the PBDJointConstraintUtilities to determine whether soft limits should be applied for linear, twist, and swing constraints.
The value of bChaos_Joint_DisableSoftLimits is set through the console variable system, mirroring p.Chaos.Joint.DisableSoftLimits.
This variable directly interacts with p.Chaos.Joint.DisableSoftLimits, as they share the same value and purpose.
Developers should be aware that this variable affects multiple types of joint constraints (linear, twist, and swing). When set to true, it will disable soft limits for all these constraint types.
Best practices for using this variable are the same as for p.Chaos.Joint.DisableSoftLimits. It should only be used for debugging, and developers should be cautious about the effects on physics simulation when it’s enabled.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Joint/JointConstraintsCVars.cpp:14
Scope: file
Source code excerpt:
bool bChaos_Joint_DisableSoftLimits = false;
FAutoConsoleVariableRef CVarChaosJointDisableSoftLimits(TEXT("p.Chaos.Joint.DisableSoftLimits"), bChaos_Joint_DisableSoftLimits, TEXT("Disable soft limits (for debugging only)"));
bool bChaos_Joint_Plasticity_ClampToLimits = true;
FAutoConsoleVariableRef CVarChaosJointPlasticityClampToLimits(TEXT("p.Chaos.Joint.Plasticity.ClampToLimits"), bChaos_Joint_Plasticity_ClampToLimits, TEXT("Clamp drive position targets to defined limits after plasticity computation"));
float Chaos_Joint_LinearVelocityThresholdToApplyRestitution = 1e-2f;
FAutoConsoleVariableRef CVarChaosJointLinearVelocityThresholdToApplyRestitution(TEXT("p.Chaos.Joint.LinearVelocityThresholdToApplyRestitution"), Chaos_Joint_LinearVelocityThresholdToApplyRestitution, TEXT("Apply restitution only if initial velocity is higher than this threshold (used in Quasipbd)"));
#Associated Variable and Callsites
This variable is associated with another variable named bChaos_Joint_DisableSoftLimits
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Joint/JointConstraintsCVars.cpp:13
Scope: file
Source code excerpt:
FAutoConsoleVariableRef CVarChaosJointVelProjectionScale(TEXT("p.Chaos.Joint.VelProjectionAlpha"), Chaos_Joint_VelProjectionAlpha, TEXT("How much of the velocity correction to apply during projection. Equivalent to (1-damping) for projection velocity delta"));
bool bChaos_Joint_DisableSoftLimits = false;
FAutoConsoleVariableRef CVarChaosJointDisableSoftLimits(TEXT("p.Chaos.Joint.DisableSoftLimits"), bChaos_Joint_DisableSoftLimits, TEXT("Disable soft limits (for debugging only)"));
bool bChaos_Joint_Plasticity_ClampToLimits = true;
FAutoConsoleVariableRef CVarChaosJointPlasticityClampToLimits(TEXT("p.Chaos.Joint.Plasticity.ClampToLimits"), bChaos_Joint_Plasticity_ClampToLimits, TEXT("Clamp drive position targets to defined limits after plasticity computation"));
float Chaos_Joint_LinearVelocityThresholdToApplyRestitution = 1e-2f;
FAutoConsoleVariableRef CVarChaosJointLinearVelocityThresholdToApplyRestitution(TEXT("p.Chaos.Joint.LinearVelocityThresholdToApplyRestitution"), Chaos_Joint_LinearVelocityThresholdToApplyRestitution, TEXT("Apply restitution only if initial velocity is higher than this threshold (used in Quasipbd)"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Joint/JointConstraintsCVars.h:20
Scope: file
Source code excerpt:
extern float Chaos_Joint_VelProjectionAlpha;
extern bool bChaos_Joint_DisableSoftLimits;
extern bool bChaos_Joint_Plasticity_ClampToLimits;
extern float Chaos_Joint_LinearVelocityThresholdToApplyRestitution;
extern float Chaos_Joint_AngularVelocityThresholdToApplyRestitution;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDJointConstraintUtilities.cpp:396
Scope (from outer to inner):
file
namespace Chaos
function bool FPBDJointUtilities::GetSoftLinearLimitEnabled
Source code excerpt:
const FPBDJointSettings& JointSettings)
{
return JointSettings.bSoftLinearLimitsEnabled && !bChaos_Joint_DisableSoftLimits;
}
bool FPBDJointUtilities::GetSoftTwistLimitEnabled(
const FPBDJointSolverSettings& SolverSettings,
const FPBDJointSettings& JointSettings)
{
return JointSettings.bSoftTwistLimitsEnabled && !bChaos_Joint_DisableSoftLimits;
}
bool FPBDJointUtilities::GetSoftSwingLimitEnabled(
const FPBDJointSolverSettings& SolverSettings,
const FPBDJointSettings& JointSettings)
{
return JointSettings.bSoftSwingLimitsEnabled && !bChaos_Joint_DisableSoftLimits;
}
FReal FPBDJointUtilities::GetLinearStiffness(
const FPBDJointSolverSettings& SolverSettings,
const FPBDJointSettings& JointSettings)
{