p.Chaos.GC.EnableCollisionParticles
p.Chaos.GC.EnableCollisionParticles
#Overview
name: p.Chaos.GC.EnableCollisionParticles
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable use of collision particles for collision [def:true]
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.Chaos.GC.EnableCollisionParticles is to control the use of collision particles for collision detection in the Chaos Geometry Collection system within Unreal Engine 5. This setting variable is part of the physics simulation system, specifically for the Chaos physics engine.
This setting variable is primarily used in the Experimental Chaos module of Unreal Engine 5, as evidenced by its location in the “Runtime/Experimental/Chaos” directory. It appears to be specifically related to the Geometry Collection feature of the Chaos physics system.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through the console or configuration files. By default, it is set to true.
The associated variable bChaosGeometryCollectionEnableCollisionParticles directly interacts with p.Chaos.GC.EnableCollisionParticles. They share the same value, and bChaosGeometryCollectionEnableCollisionParticles is used in the code to check whether collision particles are enabled.
Developers must be aware that this variable controls a potentially performance-impacting feature. Enabling collision particles may provide more accurate collision detection but could also increase computational overhead. They should also note that this feature is part of the experimental Chaos physics system, which may be subject to changes or improvements in future engine versions.
Best practices when using this variable include:
- Testing performance with both enabled and disabled states to determine the optimal setting for your specific use case.
- Considering the complexity of your geometry collections when deciding whether to enable this feature.
- Being cautious when modifying this setting in shipping builds, as it may affect gameplay consistency.
Regarding the associated variable bChaosGeometryCollectionEnableCollisionParticles:
- Its purpose is to provide a boolean flag that can be easily checked in C++ code to determine if collision particles are enabled.
- It is used in the AreCollisionParticlesEnabled() function, which likely serves as a central point for other parts of the engine to query this setting.
- The value is set through the console variable system, allowing for runtime modification.
- Developers should be aware that changes to p.Chaos.GC.EnableCollisionParticles will directly affect this variable.
- Best practices include using the AreCollisionParticlesEnabled() function to check the state rather than accessing the variable directly, as this provides a level of abstraction and potential for future expansion of the logic.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/GeometryCollection/GeometryCollection.cpp:23
Scope: file
Source code excerpt:
bool bChaosGeometryCollectionEnableCollisionParticles = true;
FAutoConsoleVariableRef CVarChaosGeometryCollectionEnableCollisionParticles(
TEXT("p.Chaos.GC.EnableCollisionParticles"),
bChaosGeometryCollectionEnableCollisionParticles,
TEXT("Enable use of collision particles for collision [def:true]"));
DEFINE_LOG_CATEGORY_STATIC(FGeometryCollectionLogging, Log, All);
// @todo: update names
#Associated Variable and Callsites
This variable is associated with another variable named bChaosGeometryCollectionEnableCollisionParticles
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/GeometryCollection/GeometryCollection.cpp:21
Scope: file
Source code excerpt:
#include "Voronoi/Voronoi.h"
bool bChaosGeometryCollectionEnableCollisionParticles = true;
FAutoConsoleVariableRef CVarChaosGeometryCollectionEnableCollisionParticles(
TEXT("p.Chaos.GC.EnableCollisionParticles"),
bChaosGeometryCollectionEnableCollisionParticles,
TEXT("Enable use of collision particles for collision [def:true]"));
DEFINE_LOG_CATEGORY_STATIC(FGeometryCollectionLogging, Log, All);
// @todo: update names
const FName FGeometryCollection::FacesGroup = "Faces";
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/GeometryCollection/GeometryCollection.cpp:45
Scope (from outer to inner):
file
function bool FGeometryCollection::AreCollisionParticlesEnabled
Source code excerpt:
bool FGeometryCollection::AreCollisionParticlesEnabled()
{
return bChaosGeometryCollectionEnableCollisionParticles;
}
FGeometryCollection::FGeometryCollection(FGeometryCollectionDefaults InDefaults)
: FTransformCollection()
, FGeometryCollectionConvexPropertiesInterface(this)