p.GeometryCollection.EnabledNestedChildTransformUpdates

p.GeometryCollection.EnabledNestedChildTransformUpdates

#Overview

name: p.GeometryCollection.EnabledNestedChildTransformUpdates

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.GeometryCollection.EnabledNestedChildTransformUpdates is to control the updating of transforms for driven, disabled child bodies within Geometry Collections. This setting is primarily used for line trace results against geometry collections in Unreal Engine’s physics system.

This setting variable is part of the Chaos physics system, specifically within the Geometry Collection module. It is utilized in the Experimental/Chaos runtime module of Unreal Engine.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of true and can be modified at runtime through console commands.

The associated variable bGeometryCollectionEnabledNestedChildTransformUpdates directly interacts with this setting. They share the same value and are used interchangeably in the code.

Developers should be aware that this variable affects the performance and accuracy of line traces against geometry collections. Enabling this feature ensures that even disabled child bodies within a geometry collection have their transforms updated, which can be crucial for certain gameplay mechanics or visual feedback.

Best practices when using this variable include:

  1. Leaving it enabled (default) unless there’s a specific performance reason to disable it.
  2. If disabling, thoroughly test line traces and any gameplay systems that rely on accurate geometry collection transforms.
  3. Consider the impact on both runtime performance and gameplay behavior when modifying this setting.

Regarding the associated variable bGeometryCollectionEnabledNestedChildTransformUpdates:

#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:92

Scope: file

Source code excerpt:

bool bGeometryCollectionEnabledNestedChildTransformUpdates = true;
FAutoConsoleVariableRef CVarEnabledNestedChildTransformUpdates(
	TEXT("p.GeometryCollection.EnabledNestedChildTransformUpdates"),
	bGeometryCollectionEnabledNestedChildTransformUpdates,
	TEXT("Enable updates for driven, disabled, child bodies. Used for line trace results against geometry collections.[def: true]"));

bool bGeometryCollectionAlwaysGenerateGTCollisionForClusters = true;
FAutoConsoleVariableRef CVarGeometryCollectionAlwaysGenerateGTCollisionForClusters(
	TEXT("p.GeometryCollection.AlwaysGenerateGTCollisionForClusters"),

#Associated Variable and Callsites

This variable is associated with another variable named bGeometryCollectionEnabledNestedChildTransformUpdates. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:90

Scope: file

Source code excerpt:



bool bGeometryCollectionEnabledNestedChildTransformUpdates = true;
FAutoConsoleVariableRef CVarEnabledNestedChildTransformUpdates(
	TEXT("p.GeometryCollection.EnabledNestedChildTransformUpdates"),
	bGeometryCollectionEnabledNestedChildTransformUpdates,
	TEXT("Enable updates for driven, disabled, child bodies. Used for line trace results against geometry collections.[def: true]"));

bool bGeometryCollectionAlwaysGenerateGTCollisionForClusters = true;
FAutoConsoleVariableRef CVarGeometryCollectionAlwaysGenerateGTCollisionForClusters(
	TEXT("p.GeometryCollection.AlwaysGenerateGTCollisionForClusters"),
	bGeometryCollectionAlwaysGenerateGTCollisionForClusters,

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:3892

Scope (from outer to inner):

file
function     void FGeometryCollectionPhysicsProxy::BufferPhysicsResults_Internal

Source code excerpt:

			}

			if (bGeometryCollectionEnabledNestedChildTransformUpdates)
			{
				if (ClusterParent && !ClusterParent->Disabled())
				{
					const FRigidTransform3 ChildToWorld = Handle->ChildToParent() * FRigidTransform3(ClusterParent->GetX(), ClusterParent->GetR());
					UpdateParticleHandleTransformIfNeeded(*CurrentSolver, *Handle, ChildToWorld);
					// fields may have applied velocities, we need to make sure to clear that up, so that we don't accumulate