p.GeometryCollectionAlwaysRecreateSimulationData
p.GeometryCollectionAlwaysRecreateSimulationData
#Overview
name: p.GeometryCollectionAlwaysRecreateSimulationData
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
always recreate the simulation data even if the simulation data is not marked as dirty - this has runtime cost in editor - only use as a last resort if default has issues [def:false]
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.GeometryCollectionAlwaysRecreateSimulationData
is to control the recreation of simulation data for Geometry Collections in Unreal Engine’s experimental GeometryCollectionEngine module. This setting is primarily used for debugging and troubleshooting purposes within the editor.
This setting variable is used in the GeometryCollectionEngine module, which is part of Unreal Engine’s experimental features for handling complex geometry simulations, such as destruction and fracturing.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be adjusted at runtime through the console. By default, it is set to false.
The associated variable bGeometryCollectionAlwaysRecreateSimulationData
directly interacts with this console variable. They share the same value and are used interchangeably in the code.
Developers must be aware that enabling this variable can have performance implications in the editor. As the comment suggests, it should only be used as a last resort if the default behavior is causing issues. When enabled, it forces the recreation of simulation data even if it’s not marked as dirty, which can be computationally expensive.
Best practices for using this variable include:
- Keeping it disabled by default for optimal performance.
- Only enabling it temporarily for debugging purposes when issues with Geometry Collection simulation data arise.
- Disabling it immediately after resolving the issue to avoid unnecessary performance overhead.
Regarding the associated variable bGeometryCollectionAlwaysRecreateSimulationData
:
- Its purpose is the same as
p.GeometryCollectionAlwaysRecreateSimulationData
, serving as the actual boolean flag used in the code. - It is used in the
UGeometryCollection::CreateSimulationDataIfNeeded()
function to determine whether to recreate simulation data. - The value is set by the console variable
p.GeometryCollectionAlwaysRecreateSimulationData
. - It directly affects the behavior of the
CreateSimulationDataIfNeeded()
function, potentially causing more frequent recreation of simulation data. - Developers should be aware that changing this variable’s value will impact the frequency of simulation data recreation, which can affect performance and behavior of Geometry Collections.
- Best practices for this variable are the same as for the console variable: use it sparingly and only for debugging purposes when necessary.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionObject.cpp:64
Scope: file
Source code excerpt:
bool bGeometryCollectionAlwaysRecreateSimulationData = false;
FAutoConsoleVariableRef CVarGeometryCollectionAlwaysRecreateSimulationData(
TEXT("p.GeometryCollectionAlwaysRecreateSimulationData"),
bGeometryCollectionAlwaysRecreateSimulationData,
TEXT("always recreate the simulation data even if the simulation data is not marked as dirty - this has runtime cost in editor - only use as a last resort if default has issues [def:false]"));
namespace Chaos
{
namespace CVars
#Associated Variable and Callsites
This variable is associated with another variable named bGeometryCollectionAlwaysRecreateSimulationData
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionObject.cpp:62
Scope: file
Source code excerpt:
TEXT("Enable generation of convex geometry on older destruction files.[def:true]"));
bool bGeometryCollectionAlwaysRecreateSimulationData = false;
FAutoConsoleVariableRef CVarGeometryCollectionAlwaysRecreateSimulationData(
TEXT("p.GeometryCollectionAlwaysRecreateSimulationData"),
bGeometryCollectionAlwaysRecreateSimulationData,
TEXT("always recreate the simulation data even if the simulation data is not marked as dirty - this has runtime cost in editor - only use as a last resort if default has issues [def:false]"));
namespace Chaos
{
namespace CVars
{
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionObject.cpp:1361
Scope (from outer to inner):
file
function void UGeometryCollection::CreateSimulationDataIfNeeded
Source code excerpt:
void UGeometryCollection::CreateSimulationDataIfNeeded()
{
if (IsSimulationDataDirty() || bGeometryCollectionAlwaysRecreateSimulationData)
{
CreateSimulationData();
}
}