p.GeometryCollectionNavigationSizeThreshold
p.GeometryCollectionNavigationSizeThreshold
#Overview
name: p.GeometryCollectionNavigationSizeThreshold
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Size in CM used as a threshold for whether a geometry in the collection is collected and exported for navigation purposes. Measured as the diagonal of the leaf node bounds.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.GeometryCollectionNavigationSizeThreshold is to set a threshold size for determining whether a geometry in a collection should be exported for navigation purposes in the Unreal Engine’s Geometry Collection system.
This setting variable is primarily used in the Geometry Collection Engine module, which is part of Unreal Engine’s experimental features for handling complex, destructible geometry.
The value of this variable is set through a console variable system, using FAutoConsoleVariableRef. It’s initialized with a default value of 20.0f (centimeters) and can be modified at runtime through console commands or programmatically.
The p.GeometryCollectionNavigationSizeThreshold interacts directly with its associated variable GGeometryCollectionNavigationSizeThreshold. They share the same value, with the ‘p.’ prefixed version being the console-accessible name.
Developers should be aware that this threshold is measured as the diagonal of the leaf node bounds in the Geometry Collection hierarchy. It’s used in the UGeometryCollectionComponent::DoCustomNavigableGeometryExport function to determine which geometries should be included in the navigation export.
Best practices when using this variable include:
- Adjusting the value based on the scale and detail level of your game’s environments.
- Being cautious when modifying it at runtime, as it could impact performance if set too low (including too many small geometries) or navigation quality if set too high (excluding important geometries).
- Using it in conjunction with other Geometry Collection settings for optimal performance and behavior.
Regarding the associated variable GGeometryCollectionNavigationSizeThreshold:
- It’s a float variable that directly stores the threshold value.
- It’s used in the actual code logic, specifically in the DoCustomNavigableGeometryExport function of the UGeometryCollectionComponent class.
- When working with this variable in C++ code, developers should use GGeometryCollectionNavigationSizeThreshold rather than trying to access the console variable directly.
- Any changes to p.GeometryCollectionNavigationSizeThreshold will be reflected in GGeometryCollectionNavigationSizeThreshold, ensuring consistency between the console-accessible setting and the internal code logic.
#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:463
Scope: file
Source code excerpt:
// navigation purposes. Measured as the diagonal of the leaf node bounds.
float GGeometryCollectionNavigationSizeThreshold = 20.0f;
FAutoConsoleVariableRef CVarGeometryCollectionNavigationSizeThreshold(TEXT("p.GeometryCollectionNavigationSizeThreshold"), GGeometryCollectionNavigationSizeThreshold, TEXT("Size in CM used as a threshold for whether a geometry in the collection is collected and exported for navigation purposes. Measured as the diagonal of the leaf node bounds."));
// Single-Threaded Bounds
bool bGeometryCollectionSingleThreadedBoundsCalculation = false;
FAutoConsoleVariableRef CVarGeometryCollectionSingleThreadedBoundsCalculation(TEXT("p.GeometryCollectionSingleThreadedBoundsCalculation"), bGeometryCollectionSingleThreadedBoundsCalculation, TEXT("[Debug Only] Single threaded bounds calculation. [def:false]"));
FName UGeometryCollectionComponent::DefaultCollisionProfileName("InternalGCDefaultCollision");
#Associated Variable and Callsites
This variable is associated with another variable named GGeometryCollectionNavigationSizeThreshold
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:462
Scope: file
Source code excerpt:
// Size in CM used as a threshold for whether a geometry in the collection is collected and exported for
// navigation purposes. Measured as the diagonal of the leaf node bounds.
float GGeometryCollectionNavigationSizeThreshold = 20.0f;
FAutoConsoleVariableRef CVarGeometryCollectionNavigationSizeThreshold(TEXT("p.GeometryCollectionNavigationSizeThreshold"), GGeometryCollectionNavigationSizeThreshold, TEXT("Size in CM used as a threshold for whether a geometry in the collection is collected and exported for navigation purposes. Measured as the diagonal of the leaf node bounds."));
// Single-Threaded Bounds
bool bGeometryCollectionSingleThreadedBoundsCalculation = false;
FAutoConsoleVariableRef CVarGeometryCollectionSingleThreadedBoundsCalculation(TEXT("p.GeometryCollectionSingleThreadedBoundsCalculation"), bGeometryCollectionSingleThreadedBoundsCalculation, TEXT("[Debug Only] Single threaded bounds calculation. [def:false]"));
FName UGeometryCollectionComponent::DefaultCollisionProfileName("InternalGCDefaultCollision");
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Private/GeometryCollection/GeometryCollectionComponent.cpp:1466
Scope (from outer to inner):
file
function bool UGeometryCollectionComponent::DoCustomNavigableGeometryExport
Source code excerpt:
check(Collection);
const float SizeThreshold = GGeometryCollectionNavigationSizeThreshold * GGeometryCollectionNavigationSizeThreshold;
// for all geometry. inspect bounding box build int list of transform indices.
int32 VertexCount = 0;
int32 FaceCountEstimate = 0;
TArray<int32> GeometryIndexBuffer;
TArray<int32> TransformIndexBuffer;