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).

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:

  1. Leave it enabled (default) for most scenarios to benefit from performance improvements.
  2. Consider disabling it (set to 0) if you notice any issues with collision accuracy, especially for simulations involving very precise or small object movements.
  3. 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:

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