p.CollisionDisableCulledContacts
p.CollisionDisableCulledContacts
#Overview
name: p.CollisionDisableCulledContacts
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allow the PBDRigidsEvolutionGBF collision constraints to throw out contacts mid solve if they are culled.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.CollisionDisableCulledContacts is to control whether the PBDRigidsEvolutionGBF collision constraints can discard contacts mid-solve if they are culled. This setting is part of the Chaos physics system in Unreal Engine 5, specifically related to collision handling.
This setting variable is primarily used in the Chaos experimental physics module, which is part of Unreal Engine’s physics simulation system. Based on the callsites, it’s utilized within the PBDRigidsEvolutionGBF (Position Based Dynamics Rigid Evolution Gauss-Seidel Boundary Friction) component of the Chaos system.
The value of this variable is set through a console variable (CVar) system. It’s initialized to 0 and can be modified at runtime using the console command “p.CollisionDisableCulledContacts”.
The associated variable CollisionDisableCulledContacts directly interacts with p.CollisionDisableCulledContacts. They share the same value, with CollisionDisableCulledContacts being the actual variable used in the code logic.
Developers must be aware that enabling this feature (setting it to a non-zero value) allows the physics system to discard certain collision contacts during the solve phase. This can potentially improve performance but may affect the accuracy of collision resolution in some scenarios.
Best practices when using this variable include:
- Testing thoroughly to ensure that enabling this feature doesn’t negatively impact your game’s physics behavior.
- Using it in conjunction with other physics settings to achieve the desired balance between performance and accuracy.
- Consider exposing this as a configurable option for end-users if physics fidelity is crucial to your game.
Regarding the associated variable CollisionDisableCulledContacts:
- Its purpose is the same as p.CollisionDisableCulledContacts, serving as the actual variable used in the code logic.
- It’s used directly in the Chaos physics system, specifically in the PBDRigidsEvolutionGBF class.
- Its value is set by the console variable system and is used to configure the collision constraints (CollisionConstraints.SetCanDisableContacts(!!CollisionDisableCulledContacts)).
- It interacts with the CollisionConstraints object of the PBDRigidsEvolutionGBF class.
- Developers should be aware that this variable’s value is cast to a boolean when used, so any non-zero value will enable the feature.
- Best practices include using this variable consistently with p.CollisionDisableCulledContacts and considering its impact on physics behavior and performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolutionGBF.cpp:54
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
int CollisionDisableCulledContacts = 0;
FAutoConsoleVariableRef CVarDisableCulledContacts(TEXT("p.CollisionDisableCulledContacts"), CollisionDisableCulledContacts, TEXT("Allow the PBDRigidsEvolutionGBF collision constraints to throw out contacts mid solve if they are culled."));
FRealSingle SmoothedPositionLerpRate = 0.3f;
FAutoConsoleVariableRef CVarSmoothedPositionLerpRate(TEXT("p.Chaos.SmoothedPositionLerpRate"), SmoothedPositionLerpRate, TEXT("The interpolation rate for the smoothed position calculation. Used for sleeping."));
int DisableParticleUpdateVelocityParallelFor = 0;
FAutoConsoleVariableRef CVarDisableParticleUpdateVelocityParallelFor(TEXT("p.DisableParticleUpdateVelocityParallelFor"), DisableParticleUpdateVelocityParallelFor, TEXT("Disable Particle Update Velocity ParallelFor and run the update on a single thread"));
#Associated Variable and Callsites
This variable is associated with another variable named CollisionDisableCulledContacts
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolutionGBF.cpp:53
Scope (from outer to inner):
file
namespace Chaos
namespace CVars
Source code excerpt:
FAutoConsoleVariableRef CVarDisableThreshold(TEXT("p.DisableThreshold2"), DisableThreshold, TEXT("Disable threshold frames to transition to sleeping"));
int CollisionDisableCulledContacts = 0;
FAutoConsoleVariableRef CVarDisableCulledContacts(TEXT("p.CollisionDisableCulledContacts"), CollisionDisableCulledContacts, TEXT("Allow the PBDRigidsEvolutionGBF collision constraints to throw out contacts mid solve if they are culled."));
FRealSingle SmoothedPositionLerpRate = 0.3f;
FAutoConsoleVariableRef CVarSmoothedPositionLerpRate(TEXT("p.Chaos.SmoothedPositionLerpRate"), SmoothedPositionLerpRate, TEXT("The interpolation rate for the smoothed position calculation. Used for sleeping."));
int DisableParticleUpdateVelocityParallelFor = 0;
FAutoConsoleVariableRef CVarDisableParticleUpdateVelocityParallelFor(TEXT("p.DisableParticleUpdateVelocityParallelFor"), DisableParticleUpdateVelocityParallelFor, TEXT("Disable Particle Update Velocity ParallelFor and run the update on a single thread"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolutionGBF.cpp:1083
Scope (from outer to inner):
file
namespace Chaos
function FPBDRigidsEvolutionGBF::FPBDRigidsEvolutionGBF
Source code excerpt:
SetNumProjectionIterations(DefaultNumProjectionIterations);
CollisionConstraints.SetCanDisableContacts(!!CollisionDisableCulledContacts);
CollisionConstraints.SetCullDistance(DefaultCollisionCullDistance);
GetIslandManager().SetMaterialContainers(&PhysicsMaterials, &PerParticlePhysicsMaterials, &SolverPhysicsMaterials);
GetIslandManager().SetGravityForces(&GravityForces);
GetIslandManager().SetDisableCounterThreshold(DisableThreshold);