p.Chaos.Solver.Collision.AllowManifoldUpdate
p.Chaos.Solver.Collision.AllowManifoldUpdate
#Overview
name: p.Chaos.Solver.Collision.AllowManifoldUpdate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable/Disable reuse of manifolds between ticks (for small movement).
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.Solver.Collision.AllowManifoldUpdate is to control the reuse of collision manifolds between simulation ticks in the Chaos physics engine. This setting is part of the collision detection system within Unreal Engine’s Chaos physics solver.
This setting variable is primarily used in the Chaos physics subsystem, specifically within the PBDRigidsSolver module. It’s part of the collision detection and handling mechanism in the physics simulation.
The value of this variable is set through a console variable (CVar) system. It’s initialized to 1 (enabled) by default, but can be changed at runtime using the console command system.
The associated variable ChaosSolverCollisionAllowManifoldUpdate directly interacts with p.Chaos.Solver.Collision.AllowManifoldUpdate. They share the same value, with the CVar system linking them together.
Developers must be aware that this variable affects performance and accuracy of collision detection. Enabling manifold reuse (the default setting) can improve performance by reducing unnecessary recalculations, but may slightly reduce accuracy for objects with very small movements.
Best practices when using this variable include:
- Leave it enabled (default) for most scenarios to benefit from performance improvements.
- Consider disabling it (set to 0) if you notice any issues with collision accuracy, especially for simulations involving very precise or small object movements.
- Test your specific use case with both settings to determine the best balance of performance and accuracy for your project.
Regarding the associated variable ChaosSolverCollisionAllowManifoldUpdate:
- It’s an int32 variable that directly corresponds to the CVar setting.
- It’s used in the PrepareAdvanceBy function of the FPBDRigidsSolver class to configure the collision detector settings.
- When non-zero, it enables manifold reuse in the collision detection system.
- Developers should be aware that changing this variable directly won’t affect the simulation unless it’s done through the CVar system, as the CVar is what’s checked in the code.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:370
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// Allow manifolds to be reused between ticks
int32 ChaosSolverCollisionAllowManifoldUpdate = 1;
FAutoConsoleVariableRef CVarChaosSolverCollisionAllowManifoldUpdate(TEXT("p.Chaos.Solver.Collision.AllowManifoldUpdate"), ChaosSolverCollisionAllowManifoldUpdate, TEXT("Enable/Disable reuse of manifolds between ticks (for small movement)."));
// Enable/Disable CCD. Set to false to disable the system, regardless of particle settings
bool bChaosUseCCD = true;
FAutoConsoleVariableRef CVarChaosUseCCD(TEXT("p.Chaos.Solver.UseCCD"), bChaosUseCCD, TEXT("Global flag to turn CCD on or off. Default is true (on)"), OnCollisionConfigCVarChanged);
// Enable/Disable MACD (Motion-Aware Collision Detection). Set to false to disable the system, regardless of particle settings
#Associated Variable and Callsites
This variable is associated with another variable named ChaosSolverCollisionAllowManifoldUpdate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:369
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
// Allow manifolds to be reused between ticks
int32 ChaosSolverCollisionAllowManifoldUpdate = 1;
FAutoConsoleVariableRef CVarChaosSolverCollisionAllowManifoldUpdate(TEXT("p.Chaos.Solver.Collision.AllowManifoldUpdate"), ChaosSolverCollisionAllowManifoldUpdate, TEXT("Enable/Disable reuse of manifolds between ticks (for small movement)."));
// Enable/Disable CCD. Set to false to disable the system, regardless of particle settings
bool bChaosUseCCD = true;
FAutoConsoleVariableRef CVarChaosUseCCD(TEXT("p.Chaos.Solver.UseCCD"), bChaosUseCCD, TEXT("Global flag to turn CCD on or off. Default is true (on)"), OnCollisionConfigCVarChanged);
// Enable/Disable MACD (Motion-Aware Collision Detection). Set to false to disable the system, regardless of particle settings
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PBDRigidsSolver.cpp:1284
Scope (from outer to inner):
file
namespace Chaos
function void FPBDRigidsSolver::PrepareAdvanceBy
Source code excerpt:
FCollisionDetectorSettings CollisionDetectorSettings = MEvolution->GetCollisionConstraints().GetDetectorSettings();
CollisionDetectorSettings.bAllowManifoldReuse = (ChaosSolverCollisionAllowManifoldUpdate != 0);
CollisionDetectorSettings.bDeferNarrowPhase = (ChaosSolverCollisionDeferNarrowPhase != 0);
CollisionDetectorSettings.bAllowManifolds = (ChaosSolverCollisionUseManifolds != 0);
CollisionDetectorSettings.bAllowCCD = bChaosUseCCD;
CollisionDetectorSettings.bAllowMACD = bChaosUseMACD;
MEvolution->GetCollisionConstraints().SetDetectorSettings(CollisionDetectorSettings);