p.GeometryCollectionCollideAll
p.GeometryCollectionCollideAll
#Overview
name: p.GeometryCollectionCollideAll
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Bypass the collision matrix and make geometry collections collide against everything
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.GeometryCollectionCollideAll is to control the collision behavior of geometry collections in Unreal Engine’s physics system. Specifically, it allows bypassing the collision matrix and making geometry collections collide against everything.
This setting variable is primarily used in the Chaos physics system, which is part of Unreal Engine’s experimental physics module. It is referenced in the GeometryCollectionPhysicsProxy.cpp file, indicating its relevance to the Geometry Collection feature of the physics system.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands. It is initialized to false by default.
The associated variable GeometryCollectionCollideAll directly interacts with p.GeometryCollectionCollideAll. They share the same value and purpose.
Developers must be aware that enabling this variable will override the collision matrix settings for geometry collections. This can have significant performance implications, as it will cause geometry collections to collide with all other objects, potentially increasing the computational load of physics simulations.
Best practices when using this variable include:
- Use it sparingly and only when necessary, as it can impact performance.
- Consider enabling it temporarily for debugging purposes to isolate collision issues.
- Be mindful of the potential impact on gameplay and ensure it doesn’t create unintended behavior in your game.
- If enabled, thoroughly test the physics interactions to ensure they behave as expected across all scenarios.
Regarding the associated variable GeometryCollectionCollideAll: This is the actual boolean variable that stores the state controlled by p.GeometryCollectionCollideAll. It is used in the implementation to determine whether to override collision filters for geometry collections. When true, it causes the physics system to set collision filters that make the geometry collection collide with everything. Developers should treat this variable with the same considerations as p.GeometryCollectionCollideAll, as they are directly linked.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:85
Scope: file
Source code excerpt:
bool GeometryCollectionCollideAll = false;
FAutoConsoleVariableRef CVarGeometryCollectionCollideAll(
TEXT("p.GeometryCollectionCollideAll"),
GeometryCollectionCollideAll,
TEXT("Bypass the collision matrix and make geometry collections collide against everything"));
bool bGeometryCollectionEnabledNestedChildTransformUpdates = true;
FAutoConsoleVariableRef CVarEnabledNestedChildTransformUpdates(
#Associated Variable and Callsites
This variable is associated with another variable named GeometryCollectionCollideAll
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:83
Scope: file
Source code excerpt:
TEXT("Disable gravity for geometry collections"));
bool GeometryCollectionCollideAll = false;
FAutoConsoleVariableRef CVarGeometryCollectionCollideAll(
TEXT("p.GeometryCollectionCollideAll"),
GeometryCollectionCollideAll,
TEXT("Bypass the collision matrix and make geometry collections collide against everything"));
bool bGeometryCollectionEnabledNestedChildTransformUpdates = true;
FAutoConsoleVariableRef CVarEnabledNestedChildTransformUpdates(
TEXT("p.GeometryCollection.EnabledNestedChildTransformUpdates"),
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:379
Scope (from outer to inner):
file
function void SetImplicitToPTParticles
Source code excerpt:
}
if (GeometryCollectionCollideAll) // cvar
{
// Override collision filters and make this body collide with everything.
int32 CurrShape = 0;
FCollisionFilterData FilterData;
FilterData.Word1 = 0xFFFF; // this body channel
FilterData.Word3 = 0xFFFF; // collision candidate channels