p.GeometryCollection.PropagateInternalClusterDisableFlagToChildren
p.GeometryCollection.PropagateInternalClusterDisableFlagToChildren
#Overview
name: p.GeometryCollection.PropagateInternalClusterDisableFlagToChildren
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If enabled, disabled internal clusters will propagate their disabled flag to their children when buffering instead of implicitly activating the children.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.GeometryCollection.PropagateInternalClusterDisableFlagToChildren is to control the behavior of disabled internal clusters within the Geometry Collection system in Unreal Engine 5. Specifically, it determines whether the disabled state of internal clusters should be propagated to their child clusters during buffering.
This setting variable is primarily used in the Chaos physics system, which is part of Unreal Engine’s experimental physics simulation module. It is particularly relevant to the Geometry Collection feature, which is used for creating destructible objects and simulating complex physical interactions.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands. By default, it is set to true.
The associated variable bPropagateInternalClusterDisableFlagToChildren directly interacts with this setting. They share the same value and purpose.
Developers must be aware that when this flag is enabled (set to true), disabled internal clusters will propagate their disabled state to their children during the buffering process. This means that if a parent cluster is disabled, all of its child clusters will also be disabled. If the flag is disabled (set to false), child clusters will not inherit the disabled state from their parent, potentially leading to implicit activation of the children.
Best practices when using this variable include:
-
Consider the performance implications: Propagating the disabled state can potentially reduce the number of active physics objects, which may improve performance.
-
Be mindful of gameplay implications: Disabling child clusters might affect gameplay mechanics that rely on specific parts of a Geometry Collection being active.
-
Use in conjunction with other Geometry Collection settings: This setting works in tandem with other Geometry Collection parameters, so consider its effects in the broader context of your physics simulation setup.
-
Test thoroughly: As this setting can significantly affect the behavior of destructible objects, it’s crucial to test its effects under various gameplay scenarios.
-
Consider exposing this setting in your game’s options menu if fine-tuning physics behavior is important for your game’s performance or gameplay.
The associated variable bPropagateInternalClusterDisableFlagToChildren is used directly in the FGeometryCollectionPhysicsProxy::BufferPhysicsResults_Internal function to determine whether to propagate the disabled state from parent clusters to their children. This variable should be treated with the same considerations as the console variable itself, 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:146
Scope: file
Source code excerpt:
bool bPropagateInternalClusterDisableFlagToChildren = true;
FAutoConsoleVariableRef CVarPropagateInternalClusterDisableFlagToChildren(
TEXT("p.GeometryCollection.PropagateInternalClusterDisableFlagToChildren"),
bPropagateInternalClusterDisableFlagToChildren,
TEXT("If enabled, disabled internal clusters will propagate their disabled flag to their children when buffering instead of implicitly activating the children."));
bool bGeometryCollectionScaleClusterGeometry = true;
FAutoConsoleVariableRef CVarGeometryCollectionScaleClusterGeometry(
TEXT("p.GeometryCollection.ScaleClusterGeometry"),
#Associated Variable and Callsites
This variable is associated with another variable named bPropagateInternalClusterDisableFlagToChildren
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:144
Scope: file
Source code excerpt:
TEXT("If enabled, check if the root transform is broken in the proxy and disable the GT particle if so. Should be enabled - cvar is a failsafe to revert behaviour"));
bool bPropagateInternalClusterDisableFlagToChildren = true;
FAutoConsoleVariableRef CVarPropagateInternalClusterDisableFlagToChildren(
TEXT("p.GeometryCollection.PropagateInternalClusterDisableFlagToChildren"),
bPropagateInternalClusterDisableFlagToChildren,
TEXT("If enabled, disabled internal clusters will propagate their disabled flag to their children when buffering instead of implicitly activating the children."));
bool bGeometryCollectionScaleClusterGeometry = true;
FAutoConsoleVariableRef CVarGeometryCollectionScaleClusterGeometry(
TEXT("p.GeometryCollection.ScaleClusterGeometry"),
bGeometryCollectionScaleClusterGeometry,
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:3881
Scope (from outer to inner):
file
function void FGeometryCollectionPhysicsProxy::BufferPhysicsResults_Internal
Source code excerpt:
// Indicate that this object needs to be updated and the proxy is active.
StateData.State.DisabledState = bPropagateInternalClusterDisableFlagToChildren ? ClusterParent->Disabled() : false;
StateData.State.HasInternalClusterParent = true;
StateData.State.DynamicInternalClusterParent = (ClusterParent->IsDynamic());
StateData.State.HasClusterUnionParent = ClusterParent->PhysicsProxy()->GetType() == EPhysicsProxyType::ClusterUnionProxy;
bHasChanged = true;