p.Chaos.NewtonEvolution.FastPositionBasedFriction
p.Chaos.NewtonEvolution.FastPositionBasedFriction
#Overview
name: p.Chaos.NewtonEvolution.FastPositionBasedFriction
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.NewtonEvolution.FastPositionBasedFriction is to control the behavior of position-based friction calculations in the Chaos physics engine’s Newton evolution solver.
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 Newton evolution solver within Chaos, which is responsible for simulating the motion and interaction of physical objects.
The value of this variable is set as a console variable (CVar) in the Unreal Engine. It’s initialized with a default value of true, indicating that fast position-based friction is enabled by default.
The associated variable CVarChaosNewtonEvolutionFastPositionBasedFriction directly corresponds to this setting. They share the same value and purpose.
While the code snippet shows that this variable is currently not being used in the cloth solver implementation, its presence suggests that it was intended to optimize friction calculations for performance. When enabled (set to true), it likely uses a faster, possibly approximated method for calculating friction based on object positions.
Developers should be aware that:
- This is part of the experimental Chaos physics system, so its behavior may change in future engine versions.
- Changing this setting could affect the accuracy vs. performance trade-off in physics simulations.
- It’s marked with ECVF_Cheat, indicating it’s primarily for testing and debugging purposes.
Best practices when using this variable include:
- Test thoroughly when changing its value, as it may affect physics behavior across your entire game.
- Use it in conjunction with other Chaos physics settings for optimal results.
- Be cautious about changing it in shipping builds, as it’s marked as a cheat variable.
Regarding the associated variable CVarChaosNewtonEvolutionFastPositionBasedFriction:
- It’s the actual console variable that controls this setting.
- It’s defined as a boolean, so it can only be true or false.
- It’s initialized with the same default value (true) as the setting variable.
- Developers can modify this at runtime through the console or in code to toggle the fast position-based friction feature.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/NewtonEvolution.cpp:34
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionUseNestedParallelFor(TEXT("p.Chaos.NewtonEvolution.UseNestedParallelFor"), true, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionFastPositionBasedFriction(TEXT("p.Chaos.NewtonEvolution.FastPositionBasedFriction"), true, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionUseSmoothTimeStep(TEXT("p.Chaos.NewtonEvolution.UseSmoothTimeStep"), true, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<int32> CVarChaosNewtonEvolutionMinParallelBatchSize(TEXT("p.Chaos.NewtonEvolution.MinParallelBatchSize"), 300, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionWriteCCDContacts(TEXT("p.Chaos.NewtonEvolution.WriteCCDContacts"), false, TEXT("Write CCD collision contacts and normals potentially causing the CCD collision threads to lock, allowing for debugging of these contacts."), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionParallelIntegrate(TEXT("p.Chaos.NewtonEvolution.ParalleIntegrate"), false, TEXT("Run the integration step in parallel for."), ECVF_Cheat);
//#if INTEL_ISPC && !UE_BUILD_SHIPPING
#Associated Variable and Callsites
This variable is associated with another variable named CVarChaosNewtonEvolutionFastPositionBasedFriction
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/NewtonEvolution.cpp:34
Scope: file
Source code excerpt:
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionUseNestedParallelFor(TEXT("p.Chaos.NewtonEvolution.UseNestedParallelFor"), true, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionFastPositionBasedFriction(TEXT("p.Chaos.NewtonEvolution.FastPositionBasedFriction"), true, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionUseSmoothTimeStep(TEXT("p.Chaos.NewtonEvolution.UseSmoothTimeStep"), true, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<int32> CVarChaosNewtonEvolutionMinParallelBatchSize(TEXT("p.Chaos.NewtonEvolution.MinParallelBatchSize"), 300, TEXT(""), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionWriteCCDContacts(TEXT("p.Chaos.NewtonEvolution.WriteCCDContacts"), false, TEXT("Write CCD collision contacts and normals potentially causing the CCD collision threads to lock, allowing for debugging of these contacts."), ECVF_Cheat);
TAutoConsoleVariable<bool> CVarChaosNewtonEvolutionParallelIntegrate(TEXT("p.Chaos.NewtonEvolution.ParalleIntegrate"), false, TEXT("Run the integration step in parallel for."), ECVF_Cheat);
//#if INTEL_ISPC && !UE_BUILD_SHIPPING
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/NewtonEvolution.cpp:835
Scope (from outer to inner):
file
namespace Chaos::Softs
function void FNewtonEvolution::AdvanceOneTimeStep
Source code excerpt:
// The following is not currently been used by the cloth solver implementation at the moment
//if (!CVarChaosNewtonEvolutionFastPositionBasedFriction.GetValueOnAnyThread() && MCoefficientOfFriction > 0)
//{
// SCOPE_CYCLE_COUNTER(STAT_ChaosNewtonCollisionRuleFriction);
// MParticlesActiveView.ParallelFor(
// [&CollisionRule, Dt](FSolverParticles& Particles, int32 Index)
// {
// TRACE_CPUPROFILER_EVENT_SCOPE(ChaosNewtonCollisionRuleFriction);