p.FixBadAccelerationStructureRemoval
p.FixBadAccelerationStructureRemoval
#Overview
name: p.FixBadAccelerationStructureRemoval
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.FixBadAccelerationStructureRemoval is to address issues related to the removal of objects from the acceleration structure in the Chaos physics system of Unreal Engine 5. This setting variable is primarily used in the physics simulation subsystem, specifically within the Chaos framework.
The Unreal Engine subsystem that relies on this setting variable is the Chaos physics module, which is part of the experimental features in Unreal Engine 5. This can be seen from the file path “Runtime/Experimental/Chaos” in the provided code locations.
The value of this variable is set to 1 by default, as shown in the source code:
CHAOS_API int32 FixBadAccelerationStructureRemoval = 1;
It is then associated with a console variable through FAutoConsoleVariableRef, allowing it to be modified at runtime:
FAutoConsoleVariableRef CVarFixBadAccelerationStructureRemoval(TEXT("p.FixBadAccelerationStructureRemoval"), FixBadAccelerationStructureRemoval, TEXT(""));
There are no other variables directly interacting with FixBadAccelerationStructureRemoval in the provided code snippet. However, it’s worth noting that it’s defined alongside other acceleration structure-related variables, such as AccelerationStructureIsolateQueryOnlyObjects and AccelerationStructureSplitStaticAndDynamic.
Developers should be aware that this variable is likely used to enable or disable a fix for issues related to removing objects from the acceleration structure. When set to 1 (default), it presumably enables the fix. Changing this value might affect the performance or behavior of the physics simulation, particularly in scenarios involving dynamic object removal.
Best practices when using this variable include:
- Leave it at the default value (1) unless specific issues are encountered.
- If physics simulation problems occur, particularly related to object removal, experimenting with this variable might help.
- Document any changes made to this variable in project settings or documentation.
- Test thoroughly after modifying this value, as it may have wide-ranging effects on physics simulation.
Regarding the associated variable FixBadAccelerationStructureRemoval, it is the actual int32 variable that stores the value. The p.FixBadAccelerationStructureRemoval is the console command used to modify this variable at runtime. They are essentially two representations of the same setting - one for code use and one for console access. The same considerations and best practices apply to both.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolution.cpp:31
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
CHAOS_API int32 FixBadAccelerationStructureRemoval = 1;
FAutoConsoleVariableRef CVarFixBadAccelerationStructureRemoval(TEXT("p.FixBadAccelerationStructureRemoval"), FixBadAccelerationStructureRemoval, TEXT(""));
CHAOS_API int32 AccelerationStructureIsolateQueryOnlyObjects = 0;
FAutoConsoleVariableRef CVarAccelerationStructureIsolateQueryOnlyObjects(TEXT("p.Chaos.AccelerationStructureIsolateQueryOnlyObjects"), AccelerationStructureIsolateQueryOnlyObjects, TEXT("Set to 1: QueryOnly Objects will not be moved to acceleration structures on the Physics Thread"));
CHAOS_API int32 AccelerationStructureSplitStaticAndDynamic = 1;
FAutoConsoleVariableRef CVarAccelerationStructureSplitStaticAndDynamic(TEXT("p.Chaos.AccelerationStructureSplitStaticDynamic"), AccelerationStructureSplitStaticAndDynamic, TEXT("Set to 1: Sort Dynamic and Static bodies into seperate acceleration structures, any other value will disable the feature"));
#Associated Variable and Callsites
This variable is associated with another variable named FixBadAccelerationStructureRemoval
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDRigidsEvolution.cpp:30
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
}
CHAOS_API int32 FixBadAccelerationStructureRemoval = 1;
FAutoConsoleVariableRef CVarFixBadAccelerationStructureRemoval(TEXT("p.FixBadAccelerationStructureRemoval"), FixBadAccelerationStructureRemoval, TEXT(""));
CHAOS_API int32 AccelerationStructureIsolateQueryOnlyObjects = 0;
FAutoConsoleVariableRef CVarAccelerationStructureIsolateQueryOnlyObjects(TEXT("p.Chaos.AccelerationStructureIsolateQueryOnlyObjects"), AccelerationStructureIsolateQueryOnlyObjects, TEXT("Set to 1: QueryOnly Objects will not be moved to acceleration structures on the Physics Thread"));
CHAOS_API int32 AccelerationStructureSplitStaticAndDynamic = 1;
FAutoConsoleVariableRef CVarAccelerationStructureSplitStaticAndDynamic(TEXT("p.Chaos.AccelerationStructureSplitStaticDynamic"), AccelerationStructureSplitStaticAndDynamic, TEXT("Set to 1: Sort Dynamic and Static bodies into seperate acceleration structures, any other value will disable the feature"));
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/PBDRigidsEvolution.h:69
Scope (from outer to inner):
file
namespace Chaos
Source code excerpt:
extern CHAOS_API FBroadPhaseConfig BroadPhaseConfig;
extern CHAOS_API int32 FixBadAccelerationStructureRemoval;
class FChaosArchive;
template <typename TPayload, typename T, int d>
class ISpatialAccelerationCollection;