p.IgnoreAnalyticCollisionsOverride
p.IgnoreAnalyticCollisionsOverride
#Overview
name: p.IgnoreAnalyticCollisionsOverride
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Overrides the default for ignroing analytic collsions.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of p.IgnoreAnalyticCollisionsOverride is to provide a global override for ignoring analytic collisions in the physics simulation system of Unreal Engine 5.
This setting variable is primarily used in the physics engine subsystem of Unreal Engine 5, specifically in the collision detection and handling modules. Based on the callsites, it’s utilized in the Engine module and the Experimental Chaos physics system.
The value of this variable is set through a console variable (CVar) named CVarIgnoreAnalyticCollisionsOverride. It’s defined as a read-only console variable, which means its value can be set at startup or through configuration files, but not changed at runtime.
The associated variable CVarIgnoreAnalyticCollisionsOverride interacts directly with p.IgnoreAnalyticCollisionsOverride. They share the same value and purpose.
Developers must be aware that this variable overrides the default behavior for ignoring analytic collisions. When set to true (1), it forces the physics system to ignore analytic collisions globally, regardless of individual object settings.
Best practices when using this variable include:
- Use it cautiously, as it affects the entire physics simulation.
- Consider the performance implications of enabling or disabling analytic collisions globally.
- Test thoroughly after changing this setting, as it can significantly impact collision behavior across the entire game.
Regarding the associated variable CVarIgnoreAnalyticCollisionsOverride:
The purpose of CVarIgnoreAnalyticCollisionsOverride is to provide a console-accessible way to control the p.IgnoreAnalyticCollisionsOverride setting.
It’s used in the same subsystems as p.IgnoreAnalyticCollisionsOverride, primarily in the physics engine and collision handling systems.
The value is set when defining the console variable, with a default of 0 (false). It can be changed through console commands or configuration files.
This variable directly interacts with p.IgnoreAnalyticCollisionsOverride, essentially serving as its setter and getter.
Developers should be aware that this is a read-only console variable, meaning it can’t be changed at runtime through normal means.
Best practices include:
- Use this variable for debugging or testing purposes.
- Document any use of this variable in project settings or documentation, as it can have significant effects on physics behavior.
- Consider exposing this setting in a user-friendly way if it’s intended to be adjustable in final builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodyInstance.cpp:73
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarIgnoreAnalyticCollisionsOverride(
TEXT("p.IgnoreAnalyticCollisionsOverride"),
0,
TEXT("Overrides the default for ignroing analytic collsions."),
ECVF_ReadOnly
);
bool bPreventInvalidBodyInstanceTransforms = true;
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/Chaos/Private/PhysicsProxy/GeometryCollectionPhysicsProxy.cpp:990
Scope (from outer to inner):
file
function void FGeometryCollectionPhysicsProxy::InitializeDynamicCollection
Source code excerpt:
// CVar defined in BodyInstance but pertinent here as we will need to copy simplicials in the case that this is set.
// Original CVar is read-only so taking a static ptr here is fine as the value cannot be changed
static IConsoleVariable* AnalyticDisableCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("p.IgnoreAnalyticCollisionsOverride"));
static const bool bAnalyticsDisabled = (AnalyticDisableCVar && AnalyticDisableCVar->GetBool());
if (FGeometryCollection::AreCollisionParticlesEnabled()
&& RestCollection.HasAttribute(DynamicCollection.SimplicialsAttribute, FTransformCollection::TransformGroup)
&& Params.Shared.SizeSpecificData[0].CollisionShapesData.Num()
&& (Params.Shared.SizeSpecificData[0].CollisionShapesData[0].CollisionType == ECollisionTypeEnum::Chaos_Surface_Volumetric || bAnalyticsDisabled))
#Associated Variable and Callsites
This variable is associated with another variable named CVarIgnoreAnalyticCollisionsOverride
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodyInstance.cpp:72
Scope: file
Source code excerpt:
);
TAutoConsoleVariable<int32> CVarIgnoreAnalyticCollisionsOverride(
TEXT("p.IgnoreAnalyticCollisionsOverride"),
0,
TEXT("Overrides the default for ignroing analytic collsions."),
ECVF_ReadOnly
);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodyInstance.cpp:1250
Scope (from outer to inner):
file
function bool FInitBodiesHelperBase::CreateShapes_AssumesLocked
Source code excerpt:
BodySetup->AddShapesToRigidActor_AssumesLocked(Instance, Instance->Scale3D, SimplePhysMat, ComplexPhysMats, ComplexPhysMatMasks, BodyCollisionData, FTransform::Identity);
FPhysicsInterface::SetIgnoreAnalyticCollisions_AssumesLocked(Instance->ActorHandle, CVarIgnoreAnalyticCollisionsOverride.GetValueOnGameThread() ? true : Instance->bIgnoreAnalyticCollisions);
const int32 NumShapes = FPhysicsInterface::GetNumShapes(Instance->ActorHandle);
bInitFail |= NumShapes == 0;
return bInitFail;
}