p.Chaos.GC.EnableRootProxyComponents

p.Chaos.GC.EnableRootProxyComponents

#Overview

name: p.Chaos.GC.EnableRootProxyComponents

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.GC.EnableRootProxyComponents is to control the creation of root proxy components in the Geometry Collection system of Unreal Engine’s Chaos physics engine.

This setting variable is primarily used in the Geometry Collection Engine module, which is part of Unreal Engine’s experimental features for advanced physics simulations. Specifically, it affects the behavior of the GeometryCollectionComponent class.

The value of this variable is set through a console variable system, initialized with a default value of true. It’s associated with the GeometryCollectionEnableRootProxyComponents boolean variable, which directly controls the behavior in the code.

This variable interacts with other conditions in the ShouldCreateRootProxyComponents function of the GeometryCollectionComponent class. It’s used in conjunction with other checks such as the presence of root proxy meshes, the absence of a custom renderer, and another boolean flag (bEnableRootProxyStaticMeshComponents).

Developers must be aware that this variable affects the creation of root proxy components, which are likely used for optimization or specific rendering purposes in the Geometry Collection system. Changing this value could impact performance or visual results of Geometry Collection objects.

Best practices when using this variable include:

  1. Understanding the implications of enabling or disabling root proxy components on performance and visual fidelity.
  2. Testing thoroughly when changing this value, as it may affect existing Geometry Collection setups in a project.
  3. Considering the interaction with other related settings, such as custom renderers and the bEnableRootProxyStaticMeshComponents flag.

Regarding the associated variable GeometryCollectionEnableRootProxyComponents:

The purpose of GeometryCollectionEnableRootProxyComponents is to directly control the creation of root proxy components within the Geometry Collection system’s C++ code.

This variable is used within the GeometryCollectionComponent class of the Geometry Collection Engine module. It’s set by the console variable system and shares its value with p.Chaos.GC.EnableRootProxyComponents.

The value of this variable is initialized to true by default but can be changed at runtime through the console variable system.

This variable directly interacts with the logic in the ShouldCreateRootProxyComponents function, determining whether root proxy components should be created for a Geometry Collection.

Developers should be aware that this variable directly affects the internal workings of the Geometry Collection component and changing it could have immediate effects on existing Geometry Collections in a scene.

Best practices for using this variable include:

  1. Modifying it through the console variable system rather than changing the code directly.
  2. Understanding the performance implications of enabling or disabling root proxy components.
  3. Testing thoroughly after changing this value, as it may affect the behavior and performance of Geometry Collections throughout the project.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:132

Scope: file

Source code excerpt:


bool GeometryCollectionEnableRootProxyComponents = true;
FAutoConsoleVariableRef CVarGeometryCollectionRootProxyComponents(TEXT("p.Chaos.GC.EnableRootProxyComponents"), GeometryCollectionEnableRootProxyComponents, TEXT("when on ( by default ) , create root proxy components"));

bool GeometryCollectionUseReplicationV2 = true;
FAutoConsoleVariableRef CVarGeometryCollectionUseReplicationV2(TEXT("p.Chaos.GC.UseReplicationV2"), GeometryCollectionUseReplicationV2, TEXT("When true use new replication data model"));

int32 GeometryCollectionNetAwakeningMode = 1;
FAutoConsoleVariableRef CVarGeometryCollectionNetAwakeningMode(TEXT("p.Chaos.GC.NetAwakeningMode"), GeometryCollectionNetAwakeningMode, TEXT("Changes how GC components ensure that their owner is awake for replication. 0 = ForceDormancyAwake, 1 = Use Flush Net Dormancy"));

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:131

Scope: file

Source code excerpt:

FAutoConsoleVariableRef CVarGeometryCollectionCreatePhysicsStateInEditor(TEXT("p.Chaos.GC.CreatePhysicsStateInEditor"), GeometryCollectionCreatePhysicsStateInEditor, TEXT("when on , physics state for a GC will be create in editor ( non PIE )"));

bool GeometryCollectionEnableRootProxyComponents = true;
FAutoConsoleVariableRef CVarGeometryCollectionRootProxyComponents(TEXT("p.Chaos.GC.EnableRootProxyComponents"), GeometryCollectionEnableRootProxyComponents, TEXT("when on ( by default ) , create root proxy components"));

bool GeometryCollectionUseReplicationV2 = true;
FAutoConsoleVariableRef CVarGeometryCollectionUseReplicationV2(TEXT("p.Chaos.GC.UseReplicationV2"), GeometryCollectionUseReplicationV2, TEXT("When true use new replication data model"));

int32 GeometryCollectionNetAwakeningMode = 1;
FAutoConsoleVariableRef CVarGeometryCollectionNetAwakeningMode(TEXT("p.Chaos.GC.NetAwakeningMode"), GeometryCollectionNetAwakeningMode, TEXT("Changes how GC components ensure that their owner is awake for replication. 0 = ForceDormancyAwake, 1 = Use Flush Net Dormancy"));

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:3588

Scope (from outer to inner):

file
function     bool UGeometryCollectionComponent::ShouldCreateRootProxyComponents

Source code excerpt:

	const bool bHasRootProxyMeshes = RestCollection && RestCollection->RootProxyData.ProxyMeshes.Num() > 0;
	const bool bHasCustomRenderer = CanUseCustomRenderer();
	return bHasRootProxyMeshes && !bHasCustomRenderer && bEnableRootProxyStaticMeshComponents && GeometryCollectionEnableRootProxyComponents;
}

void UGeometryCollectionComponent::CreateRootProxyComponentsIfNeeded()
{
	ClearRootProxyComponents();