ClusterUnion.StressSolver.StrengthScalar
ClusterUnion.StressSolver.StrengthScalar
#Overview
name: ClusterUnion.StressSolver.StrengthScalar
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Materioal strength scalar ( <1: weaker, >1: stronger)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ClusterUnion.StressSolver.StrengthScalar is to adjust the material strength in the Chaos physics system’s cluster union stress solver. This variable acts as a scalar multiplier for material strength, allowing developers to fine-tune the strength of materials in simulations.
This setting variable is primarily used in the Experimental Chaos module of Unreal Engine 5, specifically within the cluster union stress solver subsystem. The Chaos physics system is an experimental physics engine that provides advanced simulation capabilities.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be adjusted at runtime through the console or configuration files. Its default value is 1.0f, representing the baseline material strength.
The associated variable ClusterUnionStressSolverStrengthScalar directly interacts with ClusterUnion.StressSolver.StrengthScalar. They share the same value and are used interchangeably in the code.
Developers must be aware that this variable affects the overall strength of materials in the simulation. Values less than 1 will make materials weaker, while values greater than 1 will make them stronger. This can significantly impact the behavior of simulated objects and their interactions.
Best practices when using this variable include:
- Start with the default value of 1.0 and make small adjustments.
- Test thoroughly after making changes, as it can affect the entire simulation.
- Consider using different values for different scenarios or material types if needed.
- Document any non-default values used in production to ensure consistency across the project.
Regarding the associated variable ClusterUnionStressSolverStrengthScalar: This is the actual float variable that stores the strength scalar value. It is used directly in calculations within the FClusterUnionStressSolver::EvaluateConnectionStress function to modify the compression, tensile, and shear strength of materials. The variable is multiplied with the respective material strengths to determine stress ratios, which are crucial for simulating material behavior under various forces.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ClusterUnionStressSolver.cpp:11
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
float ClusterUnionStressSolverStrengthScalar = 1.f;
FAutoConsoleVariableRef CVarClusterUnionStressSolverStrengthScalar(TEXT("ClusterUnion.StressSolver.StrengthScalar"), ClusterUnionStressSolverStrengthScalar, TEXT("Materioal strength scalar ( <1: weaker, >1: stronger)"));
float ComputeAreaFromBoundingBoxOverlap(const Chaos::FAABB3& BoxA, const Chaos::FAABB3& BoxB)
{
// if the two box don't overlap, we'll get an inside out box
// but we are still using it to compute the area as an approximation
const Chaos::FAABB3 OverlapBox = BoxA.GetIntersection(BoxB);
#Associated Variable and Callsites
This variable is associated with another variable named ClusterUnionStressSolverStrengthScalar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ClusterUnionStressSolver.cpp:10
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
FAutoConsoleVariableRef CVarClusterUnionStressSolverEnableDebugDraw(TEXT("ClusterUnion.StressSolver.EnableDebugDraw"), bClusterUnionStressSolverEnableDebugDraw, TEXT("When enabled, this will draw visual debug information for about the stress solver execution."));
float ClusterUnionStressSolverStrengthScalar = 1.f;
FAutoConsoleVariableRef CVarClusterUnionStressSolverStrengthScalar(TEXT("ClusterUnion.StressSolver.StrengthScalar"), ClusterUnionStressSolverStrengthScalar, TEXT("Materioal strength scalar ( <1: weaker, >1: stronger)"));
float ComputeAreaFromBoundingBoxOverlap(const Chaos::FAABB3& BoxA, const Chaos::FAABB3& BoxB)
{
// if the two box don't overlap, we'll get an inside out box
// but we are still using it to compute the area as an approximation
const Chaos::FAABB3 OverlapBox = BoxA.GetIntersection(BoxB);
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/ClusterUnionStressSolver.cpp:176
Scope (from outer to inner):
file
namespace Chaos
function FClusterUnionStressSolver::FConnectionEvalResult FClusterUnionStressSolver::EvaluateConnectionStress
Source code excerpt:
const double CompressionStress = -TensileStress;
Result.CompressionStressRatio = (float)CompressionStress / (Material.CompressionStrength * ClusterUnionStressSolverStrengthScalar);
Result.TensileStressRatio = (float)TensileStress / (Material.TensileStrength * ClusterUnionStressSolverStrengthScalar);
Result.ShearStressRatio = (float)TensileStress / (Material.ShearStrength * ClusterUnionStressSolverStrengthScalar);
// log and debug draw
#if CHAOS_DEBUG_DRAW
if (bClusterUnionStressSolverEnableDebugDraw)
{
constexpr uint8 DepthPriority = 10;