p.Chaos.Joint.Plasticity.ClampToLimits

p.Chaos.Joint.Plasticity.ClampToLimits

#Overview

name: p.Chaos.Joint.Plasticity.ClampToLimits

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of p.Chaos.Joint.Plasticity.ClampToLimits is to control whether drive position targets are clamped to defined limits after plasticity computation in the Chaos physics engine’s joint system.

This setting variable is primarily used by the Chaos physics engine, which is an experimental physics simulation system in Unreal Engine 5. Specifically, it’s part of the joint constraint system within Chaos.

The value of this variable is set using an FAutoConsoleVariableRef, which means it can be changed at runtime through the console or configuration files. It’s initialized to true by default.

The associated variable bChaos_Joint_Plasticity_ClampToLimits directly interacts with this console variable. They share the same value and purpose.

Developers must be aware that this variable affects the behavior of joints in the Chaos physics system, particularly when dealing with plasticity computations. When enabled (set to true), it ensures that the drive position targets stay within the defined limits after plasticity is computed.

Best practices when using this variable include:

  1. Understanding the implications of clamping on joint behavior in your specific use case.
  2. Testing your physics simulations with both true and false values to ensure desired behavior.
  3. Considering performance implications, as clamping may introduce additional computations.

Regarding the associated variable bChaos_Joint_Plasticity_ClampToLimits:

The purpose of bChaos_Joint_Plasticity_ClampToLimits is identical to p.Chaos.Joint.Plasticity.ClampToLimits. It’s the C++ variable that directly controls the behavior within the code.

This variable is used within the Chaos physics engine’s joint system, specifically in plasticity computations for joints.

The value of this variable is set by the console variable p.Chaos.Joint.Plasticity.ClampToLimits through the FAutoConsoleVariableRef mechanism.

No other variables directly interact with bChaos_Joint_Plasticity_ClampToLimits based on the provided information.

Developers should be aware that this is the actual variable used in the code to control the clamping behavior. Changes to the console variable will affect this variable’s value.

Best practices for using this variable include:

  1. Avoiding direct modification of this variable in code, instead use the console variable for runtime changes.
  2. Ensuring that any code relying on this variable’s behavior is properly tested with both true and false values.

#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:17

Scope: file

Source code excerpt:


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)"));

float Chaos_Joint_AngularVelocityThresholdToApplyRestitution = 1e-2f;
FAutoConsoleVariableRef CVarChaosJointAngularVelocityThresholdToApplyRestitution(TEXT("p.Chaos.Joint.AngularVelocityThresholdToApplyRestitution"), Chaos_Joint_AngularVelocityThresholdToApplyRestitution, 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_Plasticity_ClampToLimits. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/Joint/JointConstraintsCVars.cpp:16

Scope: file

Source code excerpt:

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)"));

float Chaos_Joint_AngularVelocityThresholdToApplyRestitution = 1e-2f;
FAutoConsoleVariableRef CVarChaosJointAngularVelocityThresholdToApplyRestitution(TEXT("p.Chaos.Joint.AngularVelocityThresholdToApplyRestitution"), Chaos_Joint_AngularVelocityThresholdToApplyRestitution, 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:22

Scope: file

Source code excerpt:

extern bool bChaos_Joint_DisableSoftLimits;

extern bool bChaos_Joint_Plasticity_ClampToLimits;

extern float Chaos_Joint_LinearVelocityThresholdToApplyRestitution;

extern float Chaos_Joint_AngularVelocityThresholdToApplyRestitution;

extern bool bChaos_Joint_UseCachedSolver;